move modules out

This commit is contained in:
2019-01-19 05:50:16 +03:00
parent e7d9324df8
commit b0d651ee92
6 changed files with 38 additions and 15 deletions

View File

@@ -0,0 +1,3 @@
from .echo import EchoFeedModuleConfig
FEED_MODULES = [EchoFeedModuleConfig]

13
feeds/modules/echo.py Normal file
View File

@@ -0,0 +1,13 @@
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)