-
Notifications
You must be signed in to change notification settings - Fork 1
Configuration
Steve Soltys edited this page Apr 19, 2018
·
21 revisions
For configuration, telegram-irc uses Spring Boot Externalized Configuration.
It can be configured to a location of your choice by supplying the path as a command-line argument:
java -jar telegram-irc.jar --spring.config.location=/path/to/config.yml
An example configuration file can be found here. The purpose of this guide will be to go through this example and explain each section.
irc:
address: irc.stevesoltys.com
port: 6697
password: irc_server_password
ssl: true
operator_nick: TelegramIRC
operator_password: operator_passwordThe options are fairly straightforward:
For the IRC server:
- The
addressentry is the hostname for the IRC server. - The
portentry is the port number for the IRC server. This is optional and defaults to6667. - The
passwordentry is the password for the IRC server. This is optional and defaults tonull. - The
sslentry is a flag indicating whether or not bots should connect to the IRC server using SSL. This is optional and defaults tofalse.
- Be sure that the IRCd you are connecting to is configured to allow a large number of connections from a single address.
For the operator bot:
- The
operator_nickentry is the nick of the telegram-irc operator bot. It is also the username that will be used for authenticating the telegram-irc operator bot as an IRC operator. This is optional and defaults toTelegramIRC. - The
operator_passwordentry is the password that will be used for authenticating the telegram-irc operator bot as an IRC operator. This is optional and defaults tonull.
- The operator bot is utilized to ensure messages are only relayed once in group chats, and therefore will need to be in every relay channel.
- If you want the operator bot to be capable of features like kicking removed users or pinning messages in the topic, you will need to configure an IRC operator entry in your IRCd configuration. Then you can set
operator_nickandoperator_passwordto be the credentials of that entry.
telegram:
bots:
-
nick: stevesoltys
username: stevesoltys_bot
token: 123456789:AAGPk_OTCzuI-_MOD2NvcXKAo1KA1MeMzKc
channels:
"-1001071879676": irc_channel_name
image-decoder: mixtape
sticker-decoder: mixtape
document-decoder: mixtapeFor a bot entry:
- The
nickentry is the IRC nick that will be mapped to this Telegram bot. - The
usernameentry is the username of the Telegram bot. - The
tokenentry is the API key for the Telegram bot, which can be obtained from BotFather.
For a channel entry:
- The key of a channel entry should be the Telegram chat ID of the group chat that you are trying to relay. By default you will need to send a message in the Telegram group after starting telegram-irc, then
/whoisthe operator bot to see what channel was joined. You can take that channel ID and place it in an entry here. - The value of a channel entry should be the custom channel name that you would like to map the Telegram group to on IRC.
- For example, if the operator bot is in
#-1001071879676, the key for your entry would be-1001071879676and the value could bemy_chat_channel. After restarting telegram-irc with the new configuration entry, the group chat should be mapped to#my_chat_channelon IRC.
For decoders:
- The media decoders can currently be one of two options:
defaultormixtape. - The
defaultselection will just relay a message with some metadata when someone sends a file on Telegram, whilemixtapewill automatically upload all files to https://mixtape.moe.