diff options
author | Dmitrii Morozov <snoopdesigns@gmail.com> | 2024-03-21 20:55:30 +0100 |
---|---|---|
committer | Dmitrii Morozov <snoopdesigns@gmail.com> | 2024-03-21 20:55:30 +0100 |
commit | 9e1211c1b2d6005e529c16376d86203fa7932ed1 (patch) | |
tree | 00ca3283ba937e9eca2b71b3e384e7a120746dcc /tgbot.py | |
parent | 02ea6960948abb874d926663ab4339cd654aec46 (diff) |
Implementation
Diffstat (limited to 'tgbot.py')
-rwxr-xr-x | tgbot.py | 19 |
1 files changed, 13 insertions, 6 deletions
@@ -1,15 +1,22 @@ #!/usr/bin/python3 -import telebot -from pythonFortniteStatus.fortnite-status import * +from telebot import TeleBot +from telebot import formatting +from fortniteStatusWrapper import formatFortniteStatus +from pythonFortniteStatus.FortniteStatus import * -bot = telebot.TeleBot('6860285100:AAFkBS_ncl38XN4_Em_nzSt93Jlwc5BJ9mU') +bot = TeleBot('6860285100:AAFkBS_ncl38XN4_Em_nzSt93Jlwc5BJ9mU') +fortniteStatus = FortniteStatus() @bot.message_handler(commands = ['start']) def url(message): bot.reply_to(message, "This bot is doing nothing so far..") -@bot.message_handler(func=lambda message: True) -def echo_message(message): - bot.reply_to(message, message.text) +@bot.message_handler(commands = ['status']) +def fortniteStatusCommand(message): + bot.send_message( + message.chat.id, + formatFortniteStatus(fortniteStatus.getStatus()), + parse_mode='MarkdownV2' + ) bot.polling(none_stop=True, interval=0)
\ No newline at end of file |