1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-30 15:04:18 +00:00

Added bot started message.

This commit is contained in:
Steffo 2017-03-10 15:52:26 +01:00
parent e6120ea84a
commit 60876e92b2

View file

@ -14,7 +14,7 @@ b = telegram.Bot(royalbotconfig.telegram_token)
def currently_logged_in(update): def currently_logged_in(update):
"""Find the database user which sent the update.""" """Trova l'utente connesso all'account di Telegram che ha mandato l'update."""
session = database.Session() session = database.Session()
user = session.query(database.User).filter_by(telegram_id=update.message.sent_from.user_id).first() user = session.query(database.User).filter_by(telegram_id=update.message.sent_from.user_id).first()
return user return user
@ -168,4 +168,5 @@ if __name__ == "__main__":
b.commands["sync"] = sync b.commands["sync"] = sync
b.commands["changepassword"] = changepassword b.commands["changepassword"] = changepassword
b.commands["help"] = help b.commands["help"] = help
print("Bot started!")
b.run() b.run()