We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c0f2aa2 commit 527e232Copy full SHA for 527e232
blackjackbot/commands/game/commands.py
@@ -81,8 +81,16 @@ def stop_cmd(update, context):
81
82
game = GameStore().get_game(chat.id)
83
84
+ user_id = user.id
85
try:
- game.stop(user.id)
86
+ if chat.type == "group" or chat.type == "supergroup":
87
+ # If yes, get the chat admins
88
+ admins = context.bot.get_chat_administrators(chat_id=chat.id)
89
+ # if user.id in chat admin IDs, let them end the game with admin powers
90
+ if user.id in [x.user.id for x in admins]:
91
+ user_id = -1
92
+
93
+ game.stop(user_id)
94
update.effective_message.reply_text(translator("game_ended"))
95
except errors.InsufficientPermissionsException:
96
update.effective_message.reply_text(translator("mp_only_creator_can_end"))
0 commit comments