mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-02 19:20:09 +03:00
Update assistant.py
This commit is contained in:
parent
dec7ebdac0
commit
70a683c06e
|
@ -271,17 +271,18 @@ async def handler(event):
|
||||||
|
|
||||||
@bot.on(events.NewMessage(pattern='(?i)[/#](list|help)', forwards=False))
|
@bot.on(events.NewMessage(pattern='(?i)[/#](list|help)', forwards=False))
|
||||||
async def handler(event):
|
async def handler(event):
|
||||||
if event.chat_id:
|
text = 'Available commands:\n'
|
||||||
text = 'Available commands:\n'
|
for callback, handler in bot.list_event_handlers():
|
||||||
for callback, handler in bot.list_event_handlers():
|
if isinstance(handler, events.NewMessage) and callback.__doc__:
|
||||||
if isinstance(handler, events.NewMessage) and callback.__doc__:
|
text += f'\n{callback.__doc__.strip()}'
|
||||||
text += f'\n{callback.__doc__.strip()}'
|
text += '\n\nYou can suggest new commands [here](https://docs.google.com/'\
|
||||||
text += '\n\nYou can suggest new commands [here](https://docs.google.com/'\
|
'spreadsheets/d/12yWwixUu_vB426_toLBAiajXxYKvR2J1DD6yZtQz9l4/edit).'
|
||||||
'spreadsheets/d/12yWwixUu_vB426_toLBAiajXxYKvR2J1DD6yZtQz9l4/edit).'
|
text.replace('#','/')
|
||||||
text.replace('#','/')
|
text += '\nCommand prefixes supports both hastag and forward slash'
|
||||||
text += '\nCommand prefixes supports both hastag and forward slash'
|
message = await event.respond(text, link_preview=False)
|
||||||
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:
|
if aiohttp:
|
||||||
@bot.on(events.NewMessage(pattern='(?i)[/#][hp]aste(bin)?', forwards=False))
|
@bot.on(events.NewMessage(pattern='(?i)[/#][hp]aste(bin)?', forwards=False))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user