@bot.message_handler(commands=['help'])# /help -> sending all functions
defsend_welcome(message):
bot.reply_to(message,"/id or /auth for authentication. /update to get updates on your shares. /users to see all users. For further details see aktienbot.flokaiser.com")
@bot.message_handler(commands=['users'])
defsend_all_users(message):
print('Debug: users command')
user_id=int(message.from_user.id)
answer='Current number of users: '+str(len(user_list))
@bot.message_handler(commands=['id','auth'])# /auth or /id -> Authentication with user_id over web tool
defsend_id(message):
answer='Your ID/Authentication Code is: ['+str(message.from_user.id)+']. Enter this code in the settings on aktienbot.flokaiser.com to get updates on your shares.'
bot.reply_to(message,answer)
@bot.message_handler(commands=['update'])# /update -> send static update via user_id to this user, later fetch from database
defsend_update(message):
user_id=int(message.from_user.id)
#Get Information for user with this id
bot.send_message(chat_id=user_id,text='This is your update')
@bot.message_handler(func=lambdamessage:True)# Returning that command is unkown for any other statement
defecho_all(message):
answer='Do not know this command or text: '+message.text
bot.reply_to(message,answer)
telebot.logger.setLevel(logging.DEBUG)
@bot.inline_handler(lambdaquery:query.query=='text')# inline prints for debugging