Spoilers, major command system improvements #4
@ -182,9 +182,9 @@ async def commands_register():
|
|||||||
logWrite(f"Registered user commands for locale {lc}")
|
logWrite(f"Registered user commands for locale {lc}")
|
||||||
|
|
||||||
# Registering admin/owner commands
|
# Registering admin/owner commands
|
||||||
for admin in configGet("admins")+[configGet("owner")]:
|
for admin in configGet("admins").extend([configGet("owner")]):
|
||||||
try:
|
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"):
|
if admin == configGet("owner"):
|
||||||
logWrite(f"Registered admin commands for owner {configGet('owner')}")
|
logWrite(f"Registered admin commands for owner {configGet('owner')}")
|
||||||
else:
|
else:
|
||||||
@ -208,4 +208,5 @@ async def commands_register():
|
|||||||
|
|
||||||
|
|
||||||
if configGet("debug") is True:
|
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)}")
|
logWrite(f"Complete commands registration:\n{dumps(commands_raw, indent=4, ensure_ascii=False, encode_html_chars=False)}")
|
Reference in New Issue
Block a user