-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.py
32 lines (25 loc) · 1.02 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import re
import os
import importlib
from pyrogram import Client
from pyrogram.client import Client
from pyrogram.types.messages_and_media.message import Message
from pyrogram import filters
client = Client('user', config_file='config.ini', parse_mode='md')
VERSION = 2.1
@client.on_message(filters.regex('^version$', re.I) & filters.me)
async def version(client: Client, message: Message):
await message.edit("SafaSelf\n[Source](https://github.com/SafaSafari/SafaSelf)\nVersion {}".format(VERSION))
@client.on_message(filters.regex('^help$', re.I) & filters.me)
async def help(client: Client, message: Message):
help = """
version: Return current version of SafaSelf
help: Return this help message
"""
for file in os.listdir('plugins'):
if file[-3:] != '.py':
continue
help += "\n" + \
importlib.import_module('plugins.' + file[:-3]).help + "\n"
await message.edit("SafaSelf\n{}\n[Source](https://github.com/SafaSafari/SafaSelf)\nVersion {}".format(help, VERSION))
client.run()