Data export, warnings' improvements, bug fixes #35
@ -27,11 +27,24 @@ async def cmd_resetcommands(app: Client, msg: Message):
|
|||||||
logWrite(f'Resetting commands in groups {configGet("admin", "groups")} and {configGet("users", "groups")}', debug=True)
|
logWrite(f'Resetting commands in groups {configGet("admin", "groups")} and {configGet("users", "groups")}', debug=True)
|
||||||
await app.delete_bot_commands(scope=BotCommandScopeChat(chat_id=configGet("admin", "groups")))
|
await app.delete_bot_commands(scope=BotCommandScopeChat(chat_id=configGet("admin", "groups")))
|
||||||
await app.delete_bot_commands(scope=BotCommandScopeChat(chat_id=configGet("users", "groups")))
|
await app.delete_bot_commands(scope=BotCommandScopeChat(chat_id=configGet("users", "groups")))
|
||||||
|
for lc in valid_locales:
|
||||||
|
try:
|
||||||
|
logWrite(f'Resetting commands in groups {configGet("admin", "groups")} and {configGet("users", "groups")} [{lc}]', debug=True)
|
||||||
|
await app.delete_bot_commands(scope=BotCommandScopeChat(chat_id=configGet("admin", "groups")), language_code=lc)
|
||||||
|
await app.delete_bot_commands(scope=BotCommandScopeChat(chat_id=configGet("users", "groups")), language_code=lc)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
for admin in configGet("admins"):
|
for admin in configGet("admins"):
|
||||||
try:
|
try:
|
||||||
logWrite(f'Resetting commands for admin {admin}', debug=True)
|
logWrite(f'Resetting commands for admin {admin}', debug=True)
|
||||||
await app.delete_bot_commands(scope=BotCommandScopeChat(chat_id=admin))
|
await app.delete_bot_commands(scope=BotCommandScopeChat(chat_id=admin))
|
||||||
|
for lc in valid_locales:
|
||||||
|
try:
|
||||||
|
logWrite(f'Resetting commands for admin {admin} [{lc}]', debug=True)
|
||||||
|
await app.delete_bot_commands(scope=BotCommandScopeChat(chat_id=admin), language_code=lc)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
except bad_request_400.PeerIdInvalid:
|
except bad_request_400.PeerIdInvalid:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user