Config file - A7F/mtg-telegram-assistant GitHub Wiki
Because this progect is still in a work in progress stage, nothing is definitive and everything can be subject to changes. However, here is a quick description of what each field in config.json file does:
| Field | Description | Working? |
|---|---|---|
| token | bot token, an alpha numeric string which uniquely identifies your bot | Yes |
| master | integer array, stores all the user IDs allowed as bot administrators | Yes |
| group_id | group id towards where to send RSS feeds | Yes |
| channel_id | channel id towards where to send RSS feeds | Yes |
| welcome | flag to enable welcome message. set the message in the strings.py file | Yes |
| social | add all the social link your LGS has here. Leave a social link blank to disable it | Yes |
| locale | bot language | No |
| path | database filepath | Yes |
| rss | a set of destination links to read rss feeds from | Yes |
| days_until_delete | auto clear the database from very old rss feeds | Yes |
| poll_time | set here how many seconds the bot should wait before checking again the feeds | Yes |
| limit | how many new posts should send each time scans the RSS feed | Yes |
Follows further explanations on those fields.
-
token: as I said, it's a unique identifier for your bot so this field is required in order to properly start the bot; ask BotFather to get one!
-
master: in order to make things easier, this field is auto filled by the bot itself depending on which user you set as group administrator, so there's no need to edit it manually. Each time somebody uses command
/startin a group, the bot proceeds indexing the group admins and put their ids in that array. Easy peasy. -
locale: set on "EN" (=English) by default, allows you to translate the bot strings into selected language. I still have not implemented it because it's one of those things supposed to be done when the project is over.
-
path: filepath to this bot's database. You can leave it as-is, or you can specify another path. Mind that if you change it once the database is already created, if the bot doesn't find the database in the new path, it will proceed to create a new one.
-
rss: this is a set of links that you may want to get rss news from. It has a
poll_timefield which defines how many seconds it should wait before checking the rss feeds again, and also alimitfield which tells the bot how many fresh news you want - this is useful especially if you have multiple rss sources and you don't want to flood the group. Feel free to change it, but I strongly suggest you to keep it as low as possible. An example: suppose site A usually writes 2 new articles per 1 hour, but you have the poll timer set to 3 hours instead. From the last check, you will have 6 pending new posts to read but the limit that you set to 2 makes the bot send only the 2 newest posts site A made, instead. The fieldpost_tocan either begroup,channelor empty. I suggest to set it to "channel" and connect your group to that channel: it turns out really nice, trust me! Of youre you're gonna need to set the channel name properly. -
days_until_delete: I recently added this field to help keeping the database "light" enough. The bot will delete all the entries in the
rss feeddatabase table which are older than the number of days specified. Be conscious of the fact that if you set a very short threshold, let's say 1 day, the bot might delete all the rss feed table: in this case it will send the last N feeds on every reboot where N is thelimitparameter described in the table above.