Spoilers, major command system improvements #4

Merged
profitroll merged 27 commits from dev into master 2023-01-05 13:45:15 +02:00
Showing only changes of commit bdb2338ab9 - Show all commits

View File

@ -182,9 +182,9 @@ async def commands_register():
logWrite(f"Registered user commands for locale {lc}")
# Registering admin/owner commands
for admin in configGet("admins")+[configGet("owner")]:
for admin in configGet("admins").extend([configGet("owner")]):
try:
await app.set_bot_commands(commands["admins"]+commands["users"], scope=BotCommandScopeChat(chat_id=admin))
await app.set_bot_commands(commands["admins"].extend(commands["users"]), scope=BotCommandScopeChat(chat_id=admin))
if admin == configGet("owner"):
logWrite(f"Registered admin commands for owner {configGet('owner')}")
else:
@ -208,4 +208,5 @@ async def commands_register():
if configGet("debug") is True:
print(commands, flush=True)
logWrite(f"Complete commands registration:\n{dumps(commands_raw, indent=4, ensure_ascii=False, encode_html_chars=False)}")