|
@@ -3,11 +3,19 @@ from telegram.ext import (Updater, CommandHandler, MessageHandler, Filters,
|
|
|
CallbackQueryHandler)
|
|
|
import handlers as hnd
|
|
|
from tale_handler import TaleHandler
|
|
|
+import os
|
|
|
|
|
|
+path_to_token = '/usr/local/etc/lcmbot/token'
|
|
|
|
|
|
def main():
|
|
|
# create LCMbot
|
|
|
- updater = Updater('TOKEN')
|
|
|
+ if os.path.isfile(path_to_token):
|
|
|
+ with open(path_to_token) as f:
|
|
|
+ TOKEN = f.readline().rstrip('\n')
|
|
|
+ else:
|
|
|
+ raise Exception('File "' + path_to_token + '" is missing')
|
|
|
+
|
|
|
+ updater = Updater(TOKEN)
|
|
|
dp = updater.dispatcher
|
|
|
|
|
|
# register handlers
|