telegram_bots/feeds/modules/echo.py

15 lines
330 B
Python

from django.db import models
from telebot import TeleBot
from feeds.models import FeedModuleConfig
class EchoFeedModuleConfig(FeedModuleConfig):
message = models.TextField()
MODULE_NAME = 'Echo'
def execute(self, bot: TeleBot, chat_id, last_id):
bot.send_message(chat_id, self.message)
yield None