mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
fix: build and lots of obsolete warnings
This commit is contained in:
@@ -58,6 +58,6 @@ public class Common : BotEventHandler
|
||||
.Br();
|
||||
}
|
||||
|
||||
await Bot.SendTextMessageAsync(Chat.Id, msg.ToString(), parseMode: ParseMode.Html);
|
||||
await Bot.SendMessage(Chat.Id, msg.ToString(), parseMode: ParseMode.Html);
|
||||
}
|
||||
}
|
||||
@@ -54,7 +54,7 @@ public abstract class AbstractAnimationReply : BotEventHandler
|
||||
animationFileOption.SetValue(animation.FileId);
|
||||
_db.AddOrUpdate(animationFileOption);
|
||||
|
||||
await Bot.SendTextMessageAsync(Chat.Id, "Animation has been set.", replyToMessageId: Message!.ReplyToMessage!.MessageId);
|
||||
await Bot.SendMessage(Chat.Id, "Animation has been set.", replyParameters: Message!.ReplyToMessage!.MessageId);
|
||||
}
|
||||
|
||||
protected virtual async Task<bool> HandleAnimation()
|
||||
@@ -84,8 +84,8 @@ public abstract class AbstractAnimationReply : BotEventHandler
|
||||
return false;
|
||||
}
|
||||
|
||||
await Bot.SendAnimationAsync(Chat.Id, new InputFileId(animationFileId),
|
||||
replyToMessageId: GetMessageIdToReply() ?? Message?.MessageId);
|
||||
await Bot.SendAnimation(Chat.Id, new InputFileId(animationFileId),
|
||||
replyParameters: GetMessageIdToReply() ?? Message?.MessageId);
|
||||
|
||||
nextUseOption.SetValue(DateTime.Now + Cooldown);
|
||||
_db.AddOrUpdate(nextUseOption);
|
||||
|
||||
@@ -35,7 +35,7 @@ public class Bayan : AbstractAnimationReply
|
||||
{
|
||||
if (await HandleAnimation())
|
||||
{
|
||||
await Bot.DeleteMessageAsync(Chat.Id, Message!.MessageId);
|
||||
await Bot.DeleteMessage(Chat.Id, Message!.MessageId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ public class Guess : CommonHandler
|
||||
var doesExist = guessDict.Any(pair => pair.Value.UserId == From.Id);
|
||||
if (doesExist)
|
||||
{
|
||||
await Bot.SendTextMessageAsync(Chat, "Вы уже запустили игру.");
|
||||
await Bot.SendMessage(Chat, "Вы уже запустили игру.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -81,8 +81,8 @@ public class Guess : CommonHandler
|
||||
new("3") { CallbackData = $"guess|{From.Id}|answer|3" }
|
||||
});
|
||||
|
||||
var message = await Bot.SendTextMessageAsync(Chat.Id, "Выберите число от 1 до 3.",
|
||||
replyToMessageId: messageId,
|
||||
var message = await Bot.SendMessage(Chat.Id, "Выберите число от 1 до 3.",
|
||||
replyParameters: messageId,
|
||||
replyMarkup: keyBoard
|
||||
);
|
||||
|
||||
@@ -127,7 +127,7 @@ public class Guess : CommonHandler
|
||||
return;
|
||||
}
|
||||
|
||||
await Bot.AnswerCallbackQueryAsync(CallbackQuery.Id);
|
||||
await Bot.AnswerCallbackQuery(CallbackQuery.Id);
|
||||
|
||||
guessDict.TryRemove((int) messageId, out _);
|
||||
_guessCache.SetValue(Chat.Id, guessDict, -1);
|
||||
@@ -152,7 +152,7 @@ public class Guess : CommonHandler
|
||||
|
||||
_db.AddOrUpdate(cooldownOption);
|
||||
|
||||
await Bot.EditMessageTextAsync(Chat, (int) messageId, message + postFix, parseMode: ParseMode.Html);
|
||||
await Bot.EditMessageText(Chat, (int) messageId, message + postFix, parseMode: ParseMode.Html);
|
||||
|
||||
// Drop bot message.
|
||||
_requests.Add(new DeleteRequest
|
||||
@@ -166,8 +166,8 @@ public class Guess : CommonHandler
|
||||
protected override async Task<Message> Reply(string text)
|
||||
{
|
||||
// TODO: move feature with autocleaning to Core CommonHandler.
|
||||
var message = await Bot.SendTextMessageAsync(Chat.Id, text,
|
||||
replyToMessageId: Message?.MessageId, parseMode: ParseMode.Html);
|
||||
var message = await Bot.SendMessage(Chat.Id, text,
|
||||
replyParameters: Message?.MessageId, parseMode: ParseMode.Html);
|
||||
|
||||
_requests.Add(new DeleteRequest
|
||||
{
|
||||
|
||||
@@ -132,14 +132,14 @@ public class Roll : CommonHandler
|
||||
}
|
||||
}
|
||||
|
||||
await Bot.SendTextMessageAsync(Chat, $"{string.Join(", ", numbers)}\n\nPositive: {positive}.\nNegative: {negative}");
|
||||
await Bot.SendMessage(Chat, $"{string.Join(", ", numbers)}\n\nPositive: {positive}.\nNegative: {negative}");
|
||||
}
|
||||
|
||||
protected override async Task<Message> Reply(string text)
|
||||
{
|
||||
// TODO: move feature with autocleaning to Core CommonHandler.
|
||||
var message = await Bot.SendTextMessageAsync(Chat.Id, text,
|
||||
replyToMessageId: Message?.MessageId, parseMode: ParseMode.Html);
|
||||
var message = await Bot.SendMessage(Chat.Id, text,
|
||||
replyParameters: Message?.MessageId, parseMode: ParseMode.Html);
|
||||
|
||||
_requests.Add(new DeleteRequest
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user