123456789101112131415161718192021 |
- using System.Threading.Tasks;
- using MafiaTelegramBot.DataBase.EntityDao;
- 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.GetPlayerById(UserId);
- if (user.GetRoomName() != "")
- return await Bot.SendWithMarkdown2(ChatId, strings.user_already_in_game);
- return await Bot.SendWithMarkdown2(ChatId, strings.choose_type_room,
- Keyboard.RoomTypeKeyboard(UserId, Callback.MakePrivateRoom, Callback.MakePublicRoom));
- }
- }
- }
|