Browse Source

add query, message edit

Tigran 4 years ago
parent
commit
8ad0f514fd

+ 1 - 0
MafiaTelegramBot/Models/Bot.cs

@@ -79,6 +79,7 @@ namespace MafiaTelegramBot.Models
                 new ChangeRolesQuery(),
                 new PlayersCountSettingsQuery(),
                 new ApplyRolesChangeQuery(),
+                new StartGameQuery(),
             };
         }
         

+ 4 - 4
MafiaTelegramBot/Models/Inlines/ChangeRolesQuery.cs

@@ -17,12 +17,12 @@ namespace MafiaTelegramBot.Models.Inlines
             var roomKey = RoomEncrypter.GetCode(user.GetRoomName());
             var room = (ExtendedGameRoom) RoomController.GetRoom(roomKey);
             if(room.CustomRoomSettings.Count == 0) await room.InitSettings();
-            var message = $"{strings.current_enabled_roles}\n| ";
+            var message = $"{strings.current_enabled_roles}";
             foreach (var (role, count) in room.CustomRoomSettings)
             {
-                if (role is Roles.Mafia) message += $"{roles.Mafia} \\({count}\\) | ";
-                if (role is Roles.Villager) message += $"{roles.Villager} \\({count}\\) | ";
-                else message += $"{roles.ResourceManager.GetString(role.ToString())} \\({count}\\) | ";
+                if (role is Roles.Mafia) message += $"\n| {roles.Mafia} \\({count}\\) |";
+                if (role is Roles.Villager) message += $"\n| {roles.Villager} \\({count}\\) |";
+                else message += $"\n| {roles.ResourceManager.GetString(role.ToString())} \\({count}\\) |";
             }
             return await Bot.SendWithMarkdown2(ChatId, message, Keyboard.ChangeRolesKeyboard(UserId, roomKey, room));
         }