Update assistant.py

This commit is contained in:
SmartManoj 2019-07-15 17:03:19 +05:30 committed by GitHub
parent dec7ebdac0
commit 70a683c06e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -271,7 +271,6 @@ async def handler(event):
@bot.on(events.NewMessage(pattern='(?i)[/#](list|help)', forwards=False))
async def handler(event):
if event.chat_id:
text = 'Available commands:\n'
for callback, handler in bot.list_event_handlers():
if isinstance(handler, events.NewMessage) and callback.__doc__:
@ -281,7 +280,9 @@ async def handler(event):
text.replace('#','/')
text += '\nCommand prefixes supports both hastag and forward slash'
message = await event.respond(text, link_preview=False)
if event.chat_id < 0 :
await asyncio.sleep(1 * text.count(' ')) # Sleep ~1 second per word
await message.delete()
if aiohttp:
@bot.on(events.NewMessage(pattern='(?i)[/#][hp]aste(bin)?', forwards=False))