forked from Helias/Telegram-DMI-Bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
executable file
·64 lines (53 loc) · 2.25 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# -*- coding: utf-8 -*-
from functions import *
reload(sys)
sys.setdefaultencoding('utf8')
bot= telegram.Bot(TOKEN)
def record_everything(bot, update):
message = str(update.message)
log_tmp = open("logs/logs.txt","a+")
log_tmp.write("\n"+message)
def main():
updater = Updater(TOKEN)
dp = updater.dispatcher
dp.add_handler(MessageHandler(Filters.all, record_everything),1)
dp.add_handler(RegexHandler('/help',help))
dp.add_handler(RegexHandler('/rappresentanti',rappresentanti))
dp.add_handler(RegexHandler('/rappresentanti_dmi',rappresentanti_dmi))
dp.add_handler(RegexHandler('/rappresentanti_informatica',rappresentanti_info))
dp.add_handler(RegexHandler('/rappresentanti_matematica',rappresentanti_mate))
dp.add_handler(RegexHandler('/sdidattica',sdidattica))
dp.add_handler(RegexHandler('/sstudenti',sstudenti))
dp.add_handler(RegexHandler('/cea',cea))
dp.add_handler(RegexHandler('/ersu',ersu))
dp.add_handler(RegexHandler('/ufficioersu',ufficioersu))
dp.add_handler(RegexHandler('/urp',urp))
dp.add_handler(RegexHandler('/prof',prof))
dp.add_handler(RegexHandler('/esami',esami))
dp.add_handler(RegexHandler('/mesami',mesami))
dp.add_handler(RegexHandler('/aulario',aulario))
dp.add_handler(RegexHandler('/mensa',mensa))
dp.add_handler(RegexHandler('/biblioteca',biblioteca))
dp.add_handler(RegexHandler('/cus',cus))
dp.add_handler(RegexHandler('/smonta_portoni',smonta_portoni))
dp.add_handler(RegexHandler('/santino',santino))
dp.add_handler(RegexHandler('/liste',liste))
dp.add_handler(RegexHandler('/contributors',contributors))
dp.add_handler(RegexHandler('/forum',forum_bot))
if (disable_drive == 0):
dp.add_handler(RegexHandler('/drive',drive))
dp.add_handler(RegexHandler('/adddb',adddb))
dp.add_handler(RegexHandler('/request',request))
if (disable_db == 0):
dp.add_handler(RegexHandler('/stats',stats))
dp.add_handler(RegexHandler('/statsT',statsTot))
if (disable_chatid_logs == 0):
dp.add_handler(RegexHandler('/news',news_))
dp.add_handler(RegexHandler('/spamnews',spamnews))
dp.add_handler(RegexHandler('/disablenews',disablenews))
dp.add_handler(RegexHandler('/enablenews',enablenews))
dp.add_handler(CallbackQueryHandler(callback))
updater.start_polling()
updater.idle()
if __name__ == '__main__':
main()