From c1963bcc007270bd8ba3c9f41b3b4527de87cddf Mon Sep 17 00:00:00 2001 From: Nick80835 Date: Fri, 1 May 2020 10:27:07 -0400 Subject: [PATCH] add delete command --- ubot/modules/system.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ubot/modules/system.py b/ubot/modules/system.py index 2912655..6111afb 100644 --- a/ubot/modules/system.py +++ b/ubot/modules/system.py @@ -25,6 +25,13 @@ async def reload_modules(event): pass +@ldr.add(pattern="del") +async def delete_message(event): + message_to_delete = await event.get_reply_message() + if message_to_delete.from_id == (await event.client.get_me()).id: + await message_to_delete.delete() + + @ldr.add(pattern="alive", sudo=True) async def alive(event): alive_format = "`μBot is running under {0}.\n\n" \