Skip to content

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

irc:
  address: irc.stevesoltys.com
  port: 6697
  password: irc_server_password
  ssl: true

  operator_nick: TelegramIRC
  operator_password: operator_password

The options are fairly straightforward:

For the IRC server:

  • The address entry is the hostname for the IRC server.
  • The port entry is the port number for the IRC server. This is optional and defaults to 6667.
  • The password entry is the password for the IRC server. This is optional and defaults to null.
  • The ssl entry is a flag indicating whether or not bots should connect to the IRC server using SSL. This is optional and defaults to false.
Notes
  • 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_nick entry 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 to TelegramIRC.
  • The operator_password entry is the password that will be used for authenticating the telegram-irc operator bot as an IRC operator. This is optional and defaults to null.
Notes
  • 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_nick and operator_password to be the credentials of that entry.

Telegram

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: mixtape

For a bot entry:

  • The nick entry is the IRC nick that will be mapped to this Telegram bot.
  • The username entry is the username of the Telegram bot.
  • The token entry 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 /whois the 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 -1001071879676 and the value could be my_chat_channel. After restarting telegram-irc with the new configuration entry, the group chat should be mapped to #my_chat_channel on IRC.

For decoders:

  • The media decoders can currently be one of two options: default or mixtape.
  • The default selection will just relay a message with some metadata when someone sends a file on Telegram, while mixtape will automatically upload all files to https://mixtape.moe.

Clone this wiki locally