123456789101112131415161718192021222324 |
- using System.Threading.Tasks;
- using MafiaTelegramBot.Controllers;
- using MafiaTelegramBot.DataBase.EntityDao;
- using MafiaTelegramBot.Game;
- using MafiaTelegramBot.Resources;
- using Telegram.Bot.Types;
- namespace MafiaTelegramBot.Models.Commands
- {
- public class RoomSettingsCommand : Command
- {
- protected override string Name => keyboard.room_settings;
- protected override async Task<Message> Execute(Update update)
- {
- var user = await UserDao.GetPlayerById(UserId);
- var roomKey = RoomEncrypter.GetCode(user.GetRoomName());
- var room = RoomController.GetRoom(roomKey);
- var status = room.TimerEnabled ? strings.enabled : strings.disabled;
- return await Bot.SendWithMarkdown2(ChatId, strings.what_settings,
- Keyboard.SettingsRoomKeyboard(UserId, $"{strings.timer}: {status}"));
- }
- }
- }
|