Send test message with telegram.

This commit is contained in:
Ceda EI 2019-05-17 20:43:03 +05:30
parent 6cebd436b8
commit 8d62ff9e71
1 changed files with 7 additions and 0 deletions

View File

@ -56,6 +56,13 @@ if tg_enable:
config["telegram"]["bot_token"] = input("> ") config["telegram"]["bot_token"] = input("> ")
print("\nEnter userid\n") print("\nEnter userid\n")
config["telegram"]["user_id"] = get_number("> ") config["telegram"]["user_id"] = get_number("> ")
print("\nAttempting to send a test message")
from backends import telegram
telegram.send(config["telegram"], "Test Message from The Long Night")
print("""
Message sent, if you did not recieve a message, check the bot_token and
user_id. Also, ensure that you have started the bot.
""")
print("\nStoring config.") print("\nStoring config.")
with open('config.json', 'w') as f: with open('config.json', 'w') as f: