diff --git a/HSMensaW_botA.py b/HSMensaW_botA.py index 76703b7..61807f5 100644 --- a/HSMensaW_botA.py +++ b/HSMensaW_botA.py @@ -180,6 +180,15 @@ class HSMensaW(telepot.aio.helper.ChatHandler): lang = query_data[:query_data.index("::")] chat_id = int(query_data[query_data.index("::") + 2:]) + chat_member = await bot.getChatMember(chat_id=chat_id, user_id=from_id) + member_status = chat_member["status"] + + if msg["message"]["chat"]["type"] != "private" and member_status != "creator" and \ + member_status != "administrator": + await bot.answerCallbackQuery(callback_query_id=query_id, text="Keine Berechtigung. Bitten Sie einen " + "Admin, die Sprache zu ändern.") + return + name = "" user_id = msg["from"]["id"] if "first_name" in msg["from"].keys():