-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
33 lines (20 loc) · 931 Bytes
/
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
import os
from telegram.ext import ApplicationBuilder, CommandHandler, CallbackQueryHandler
from handlers.start import start
from handlers.help import list_currencies
from handlers.convert import convert
from handlers.presets import create_preset, retrieve_presets, delete_preset
from handlers.button_handlers import button_handler
from handlers.stats import info
TOKEN = os.environ.get('TOKEN')
app = ApplicationBuilder().token(TOKEN).build()
app.add_handler(CommandHandler("start", start))
app.add_handler(CommandHandler("currencies", list_currencies))
app.add_handler(CommandHandler("convert", convert))
# preset handlers
app.add_handler(CommandHandler("create", create_preset))
app.add_handler(CommandHandler("delete", delete_preset))
app.add_handler(CommandHandler("presets", retrieve_presets))
app.add_handler(CallbackQueryHandler(button_handler))
app.add_handler(CommandHandler("info", info))
app.run_polling()