tg_rss_bot/telegram/command_processor.py

30 lines
863 B
Python
Raw Normal View History

2022-05-01 23:43:04 +00:00
import telebot
from telebot.types import Message
class CommandProcessor:
2022-05-02 14:53:53 +00:00
"""
Processes user input and dispatches the data to other services.
"""
2022-05-01 23:43:04 +00:00
bot: telebot.TeleBot
def __init__(self, token: str):
self.bot = telebot.TeleBot(token)
def run(self):
self.bot.register_message_handler(commands=['help', 'start'], callback=self.__command_help)
self.bot.infinity_polling()
def __command_help(self, message: Message):
self.bot.reply_to(message, 'Commands: "/add", "/list", "/del", "/help".')
def __add_feed(self, message: Message):
self.bot.reply_to(message, 'Feed added (stub)')
def __list_feeds(self, message: Message):
self.bot.reply_to(message, 'Your feeds: (stub)')
def __delete_feed(self, message: Message):
self.bot.reply_to(message, 'Feed deleted: (stub)')