Fix unknown command handling and delete-portal confirmation
This commit is contained in:
@@ -103,7 +103,7 @@ class CommandHandler:
|
|||||||
evt.command = ""
|
evt.command = ""
|
||||||
command = sender.command_status["next"]
|
command = sender.command_status["next"]
|
||||||
else:
|
else:
|
||||||
command = command_handlers["unknown_command"]
|
command = command_handlers["unknown-command"]
|
||||||
try:
|
try:
|
||||||
await command(evt)
|
await command(evt)
|
||||||
except FloodWaitError as e:
|
except FloodWaitError as e:
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ async def delete_portal(evt):
|
|||||||
that_this = "This" if room_id == evt.room_id else "That"
|
that_this = "This" if room_id == evt.room_id else "That"
|
||||||
return await evt.reply(f"{that_this} is not a portal room.")
|
return await evt.reply(f"{that_this} is not a portal room.")
|
||||||
|
|
||||||
async def post_confirm(_, confirm):
|
async def post_confirm(confirm):
|
||||||
evt.sender.command_status = None
|
evt.sender.command_status = None
|
||||||
if len(confirm.args) > 0 and confirm.args[0] == "confirm-delete":
|
if len(confirm.args) > 0 and confirm.args[0] == "confirm-delete":
|
||||||
await portal.cleanup_and_delete()
|
await portal.cleanup_and_delete()
|
||||||
|
|||||||
Reference in New Issue
Block a user