diff --git a/bot/README.md b/bot/README.md index 6ea82b7..a314739 100644 --- a/bot/README.md +++ b/bot/README.md @@ -15,7 +15,7 @@ This is the bot that actually scrapes the menus from Telegram and puts them in a | `TG_API_ID` | YES | Your telegram API Id | | `TG_API_HASH` | YES | Your telegram API Hash | | `TG_SESSION_NAME` | NO | The telethon session name/path _(Default: "default")_ | -| `TG_CHANNEL_NAME` | NO | The channel where the menu info is stored _(Default: "CafeteriaFIC")_ | +| `TG_CHANNEL_ID` | NO | The channel where the menu info is stored _(Default: -1001385379004 (id of https://t.me/CafeteriaFIC))_ | | `MENU_HISTORY_FILE_PATH` | NO | The place where the JSON file with the menu history will be stored. _(Default: "/tmp/menu_history.json")_ | _**Tip💡:**_ Look at [Telethon documentation](https://docs.telethon.dev/en/stable/basic/signing-in.html#signing-in) for info about the telegram authentication process diff --git a/bot/bot_listen.py b/bot/bot_listen.py index a890e4c..d6f3327 100644 --- a/bot/bot_listen.py +++ b/bot/bot_listen.py @@ -6,7 +6,7 @@ from utils import parse_menu_message, InvalidMenuMessageError client = TelegramClient(config.session_name, config.api_id, config.api_hash) -@client.on(events.NewMessage(chats=config.channel_name)) +@client.on(events.NewMessage(chats=[config.channel_id])) async def handler(event): msg = event.message if not msg.message is None: diff --git a/bot/config.py b/bot/config.py index 6540ed7..4cff1e9 100644 --- a/bot/config.py +++ b/bot/config.py @@ -3,7 +3,7 @@ from os import getenv api_id = getenv("TG_API_ID") api_hash = getenv("TG_API_HASH") session_name = getenv("TG_SESSION_NAME", "default") -channel_name = getenv("TG_CHANNEL_NAME", "CafeteriaFIC") +channel_id = int(getenv("TG_CHANNEL_ID", -1001385379004)) menu_history_file_path = getenv( "MENU_HISTORY_FILE_PATH", "/tmp/menu_history.json")