forked from l0rem/TacoBot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcore.py
More file actions
40 lines (28 loc) · 1.24 KB
/
core.py
File metadata and controls
40 lines (28 loc) · 1.24 KB
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
33
34
35
36
37
38
from pyrogram import Client
import logging
from decouple import config
from handlers.basic import help_handler, start_handler, store_names_handler
from handlers.leaderboards import taco_top_handler, my_tacos_handler
from handlers.setup import self_kick_handler, new_chat_handler
from handlers.tacotransfers import chat_reply_handler, taco_mention_handler
bot_token = config('BOT_TOKEN', default='token')
api_id = config('API_ID', default='api_id')
api_hash = config('API_HASH', default='api_hash')
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
level=logging.getLevelName(config('LOG_LEVEL', default='INFO')))
bot = Client(session_name='TacoBot',
api_id=api_id,
api_hash=api_hash,
bot_token=bot_token)
if __name__ == '__main__':
bot.add_handler(new_chat_handler, group=-1)
bot.add_handler(store_names_handler, group=-1)
bot.add_handler(start_handler)
bot.add_handler(help_handler)
bot.add_handler(self_kick_handler)
bot.add_handler(chat_reply_handler)
bot.add_handler(my_tacos_handler)
bot.add_handler(taco_top_handler)
bot.add_handler(taco_mention_handler)
bot.run()
logging.info("Ready and listening for updates...")