Skip to content
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.

zsrkmyn/telegram2irc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

This is a bot who can connect IRC channels with Telegram chat groups.

Dependencies ========== + python-irc + tg

Notice

Another version of this software is available at bigeagle branch. That version is written by @bigeagle, which include a picture-uploading function that this branch have not implemented yet.

But I may not merge it into master branch, for it is mainly written by @bigeagle. I do not want to take credit for the work that @bigeagle does. XD

You can choose to use either the two versions of the softeware.

Thanks @bigeagle again for his hard working.

Usage

  1. If you have not used telegram-cli before, run it first, and set the correct phone number to log in.
  2. Create chat groups using create_group_chat command in telegram-cli, and use dialog_list to check wheather the groups are created successfully. Then exit the client.
  3. Rename the config.py.example to config.py and edit it.
    1. Set bindings to bind IRC channels with Telegram chats. Elements in binddings tuple are tuples with three element, whose first element is IRC channel and the second one is Telegram chat (both chat ID and chat name are acceptable) and the third element is either 0 or 1, if 1 is set, the channel will not be listed in .list command (See .help).
    2. blacklist in irc is a list which contains some nicks in IRC. The messages of these nicks won't be forwarded to Telegram.
  4. Start the telegram-cli using telegram-cli --json -d -P <port>, where <port> is the telegram client port you filled in config.py file, and -I is mandatory, -d is optional.
  5. Start the bot using python3 teleirc.py, then it will join the channels automatically and forwards the messages between Telegram and IRC.
  6. Add the bot as a contact on other Telegram accounts, and send .help to it, you can get the information about how to join a chat group, how to change the nick and etc.

TODO

  1. Add restarting function.
  2. Write comment for the code.
  3. Use logger instead of print.

License

This software is released with MIT License. See LICENSE file for more details.

About

A bot connect IRC and Telegram. Multiple bindings are supported.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages