fix: build and lots of obsolete warnings

This commit is contained in:
Andriy
2025-02-09 17:40:03 +02:00
parent 8917a8ba5f
commit c3a553f68d
29 changed files with 103 additions and 108 deletions
+7 -7
View File
@@ -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
{