This repository has been archived on 2023-01-19. You can view files and clone it, but cannot push or open issues or pull requests.
MirrorTea/mirrortea/abstract_source_platform/telegram.py

25 lines
660 B
Python
Raw Normal View History

2023-01-10 00:48:55 +00:00
import sys
import aiogram as telegram
2023-01-10 12:33:52 +00:00
from abstract_source_platform.abstact_source_platform import (
2023-01-10 00:48:55 +00:00
AbstractSourcePlatform,
)
2023-01-10 12:33:52 +00:00
from models.user import User
2023-01-10 00:48:55 +00:00
class Telegram(AbstractSourcePlatform):
def __init__(self, app):
self.app = app
self.bot = telegram.Bot(token=app.config.telegram_bot_token)
self.dispatcher = telegram.Dispatcher(bot=self.bot)
self.dispatcher.register_message_handler(self.on_message)
async def run(self):
await self.dispatcher.start_polling()
async def on_message(self, msg):
print(msg, file=sys.stderr)
2023-01-10 00:48:55 +00:00
async def get_user_information(self) -> User:
pass