-
-
Notifications
You must be signed in to change notification settings - Fork 813
How to configure tgcf ?
The application tgcf
is configured using a simple YAML
file. If you are new to the YAML
syntax, don't worry, it's easy, and you will learn it.
Tutorials on YAML syntax:
You may write your configuration in the tgcf.config.yml
file. (when running on your own computer)
When you are deploying on a cloud platform where you can't edit files, you may configure tgcf using environment variables. The contents of tgcf.config.yml
can be put inside the environment variable called TGCF_CONFIG
. Read the wiki for platform-specific guides on how to set environment variables in different platforms.
- For the
source
anddest
fields use the username of the channel/bot/person/group. (omit the@
symbol at the start). - If the private entity does not have a username, you may use the link of the private channel/group.
Below is an example configuration. Don't copy-paste this. Understand what each part does.
admins: [yourUserName,AnotherPerson]
# when tgcf is run in live mode, the admins can run commands to change the configuration
forwards:
- source: channelName
dest: [anotherChannel,https://t.me/channelLink]
# use username or link of the entity
show_forwarded_from: false
plugins:
filter:
text:
blacklist: ["nope"]
replace:
text:
god: devil
tokyo: delhi
Here is the complete schema for the configuration file.
-
admins
(the list of usernames or ids of the admins) -
forwards
(a list of forward objects)- forward ( contains a
source
(string), adest
(list of strings) and anoffset
(optional integer) )
- forward ( contains a
-
show_forwarded_from
(boolean: true/false) -
live
-
delete_sync
: bool (true or false)
-
-
past
-
delay
: int (between 1 to 100 )(seconds) (time to wait after every message is sent)
-
-
plugins
contain the name of the plugin and the data to be passed to that plugin.- What data to pass to plugins? is defined in the documentation for that plugin. Here is the list of all plugins.
Have a question? Ask in the discussion forum. But make sure to read the wiki first.