summaryrefslogtreecommitdiff
path: root/tgbot.py
diff options
context:
space:
mode:
authorDmitrii Morozov <snoopdesigns@gmail.com>2024-03-21 20:55:30 +0100
committerDmitrii Morozov <snoopdesigns@gmail.com>2024-03-21 20:55:30 +0100
commit9e1211c1b2d6005e529c16376d86203fa7932ed1 (patch)
tree00ca3283ba937e9eca2b71b3e384e7a120746dcc /tgbot.py
parent02ea6960948abb874d926663ab4339cd654aec46 (diff)
Implementation
Diffstat (limited to 'tgbot.py')
-rwxr-xr-xtgbot.py19
1 files changed, 13 insertions, 6 deletions
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