From 9e1211c1b2d6005e529c16376d86203fa7932ed1 Mon Sep 17 00:00:00 2001 From: Dmitrii Morozov Date: Thu, 21 Mar 2024 20:55:30 +0100 Subject: Implementation --- tgbot.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'tgbot.py') diff --git a/tgbot.py b/tgbot.py index 3cd6dc0..5443d43 100755 --- a/tgbot.py +++ b/tgbot.py @@ -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 -- cgit v1.2.3