12345678910111213141516171819202122 |
- using System.Threading.Tasks;
- using MafiaTelegramBot.DataBase;
- using MafiaTelegramBot.Resources;
- using Telegram.Bot.Types;
- namespace MafiaTelegramBot.Models.Commands
- {
- public class CreateGameCommand : Command
- {
- protected override string Name => keyboard.create_game;
- protected override async Task<Message> Execute(Update update)
- {
- var user = await UserDao.GetUserById(UserId);
- await Bot.SendStickerWithoutPackAsync(ChatId, "https://github.com/TelegramBots/book/raw/master/src/docs/sticker-fred.webp");
- if (user.GetRoomKey() != "")
- return await Bot.SendWithMarkdown2(ChatId, strings.user_already_in_game);
- return await Bot.SendWithMarkdown2(ChatId, strings.choose_type_room,
- Keyboards.RoomTypeKeyboard(UserId, Callback.MakePrivateRoom, Callback.MakePublicRoom));
- }
- }
- }
|