[core] add support of new bot api

This commit is contained in:
Andriy
2023-01-02 19:01:03 +02:00
parent 19a14bb1ea
commit eca77267d7
23 changed files with 40 additions and 42 deletions
+2 -2
View File
@@ -43,7 +43,7 @@ public class Store : BotEventHandler
var user = From;
var reputation = await _reputation.GetUserReputationAsync(Chat, user);
await Bot.SendTextMessageAsync(Chat.Id, $"<b>{user.ToHtml()} ({reputation})</b>, чего пожелаете?", ParseMode.Html,
await Bot.SendTextMessageAsync(Chat.Id, $"<b>{user.ToHtml()} ({reputation})</b>, чего пожелаете?", parseMode: ParseMode.Html,
replyMarkup: new InlineKeyboardMarkup(
_provider.GetServices<IRandomMediaService>()
.ToAsyncEnumerable()
@@ -116,7 +116,7 @@ public class Store : BotEventHandler
switch (randomMedia.Type)
{
case InputMediaType.Photo:
await Bot.SendPhotoAsync(Chat.Id, file, randomMedia.Caption, replyToMessageId: messageId, parseMode: ParseMode.Html);
await Bot.SendPhotoAsync(Chat.Id, file, 0, randomMedia.Caption, replyToMessageId: messageId, parseMode: ParseMode.Html);
break;
case InputMediaType.Video:
await Bot.SendVideoAsync(Chat.Id, file, caption: randomMedia.Caption, replyToMessageId: messageId, parseMode: ParseMode.Html);