Giter Site home page Giter Site logo

ircgrampp's Introduction

IRCGram++ is a complexly simple Telegram <-> IRC Gateway, based on IRCGram

IRCGram++

Diferences with IRCGram

  • Ready for use You don't need to deploy and compile
  • Cli tool To manage it
  • Available in npm repos Easy install
  • Use configuration files Saved in your home and in YAML format
  • One irc connection per each user is now optional To avoid max connections problems
  • Extendible configuration Your bridges configurations extends the global
  • Can use the telegram channel title or the chatId, it's easier to config
  • Better connections management

General Features

  • Supports multiple IRC channel ↔ Telegram group, with multiple users.
  • Telegram user -> irc user mapping (one connection per user joined to the group)

Install

With npm, as root:

# npm install -g ircgrampp

This add a command ircgrampp.

Config

Manualy

The configuration files are in the directory .ircgrampp in your home directory, you can edit it manually in ~/.ircgrampp/config.yml.

The bridges configuration are one per file in ~/.ircgrampp/bridges, (directory), you can create it's files manually.

Autogenerated

You can use the assist with:

$ ircgrampp config

This agent, makes from created the config files/directories, to generate the configuration with a simple dummies steps.

Develop

You can do pull requests, code revisions, fixes, etc. (all of it is welcomed).

Clone repo

$ git clone https://github.com/exos/ircgrampp.git

Install dependencies

$ npm install
or
$ yarn install

Check and update dependencies

$ npm ncu
or
$ yarn ncu

ncu is a third party tool.

build

$ npm run build

TODO

See the milestones.

  • Internationalization
  • Do it multi-core
  • Do it extensile with plugins
  • Better output

More information

ircgrampp's People

Contributors

exos avatar zephrax avatar dependabot[bot] avatar carpe-diem avatar

Stargazers

 avatar Julian Xhokaxhiu avatar  avatar Alexander Salas Bastidas avatar Alexander J. Rodriguez D. avatar

Watchers

Carlos Augusto Jaacks avatar  avatar James Cloos avatar  avatar  avatar

ircgrampp's Issues

Message are repeated if BridgeUser change irc nick

The case:

A new ircgrampp instance was a prefix congure as tele_, whe telegram user fulanito interactue in the channel, a new irc connecion is open for fulanito, but tele_fulanito already exists, and the UserBridge is registerd as tele_fulanito1, but the bridge don't know tele_fulanito1 (specting tele_fulanito) and transcribe the message to telegram again (how it was from irc).

Logs:

bridge telegram in message { id: 666, first_name: 'Fulano', username: 'fulanito' }
irc Search server by identifier [email protected]:6697+
irc Start irc connection irc.kernelpanic.com.ar
bridge Find for UserBridge 666@@[email protected]:6697+
bridge Not foud, creating
bridge Search irc connection for [email protected]
irc Search server by identifier [email protected]:6697+
irc Add channel to IRCConnection #arduino
irc Creating IRCChannel for #arduino for undefined
channels-info Find info for -137408370
telegram-connection @@Raspiers & Arduiners (#-137408370): 666 -> ups
bridge telegram in message { id: 666, first_name: 'Fulano', username: 'fulanito' }
session Bridge arduino success with Telegram
irc tele_fulanito1 registered
irc arduircbot registered
irc Send irc join
irc Send irc join
session Bridge arduino registered with IRC
....
irc tele_fulanito1 => #arduino: :D
bridge Check if have user tele_fulanito1
bridge irc in message tele_fulanito1

Add format to text messages

Telegram admits markdown format to messages, see parse_mode and this.

The goal is the irc -> telegram messages have an style to visually separate the user to the message:

for example:

[IRC/zephrax] tenés código sin pushear?

Can be

<zephrax> tenés código sin pushear?

or

*irc <zephrax> tenés código sin pushear?

Max listeners exceeded warning

Logs:

abr 02 04:39:27 hexodica ircgrampp[7927]: (node:7927) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 whois listeners added. Use emitter.setMaxListeners() to increase limit

Add bidirectional @mention replace

When a user mention another in the irc: "prefix_user", the telegram side should replace the text with the @user mention.

When a user mention another in telegram: "@user", the irc side should replace the text with the "prefix_nick" user.

When an chatId is used instead title, IRC messages are not transcribed

Logs:

session only option for javascriptes +0ms
config Preparing config for bridge javascriptes +3ms
session Starting bridges +2ms
session Starting javascriptes #javascript-es <->  -1001107646526 +1ms
bridge Create bridge javascriptes +1ms
irc Search server by identifier [email protected]:6697+ +1ms
irc Start irc connection irc.kernelpanic.com.ar +0ms
irc Add channel to IRCConnection #javascript-es +14ms
irc Creating IRCChannel for #javascript-es for undefined +0ms
telegram Token ***************************
telegram Start channel +12ms
channels-info Check for data directory in /home/exos/.ircgrampp +0ms
channels-info Load channels stored information +1ms
channels-info Find info for -1001107646526 +1ms
telegram Heve info about channel, setting +0ms
session Bridge javascriptes success with Telegram +1s
irc jsbot1 registered +1s
irc Send irc join +8ms
session Bridge javascriptes registered with IRC +1ms
session Bridge javascriptes stablished +1ms
irc jsbot1 join in #javascript-es +373ms
bridge Check if have user jsbot1 +2ms
channels-info Find info for -1001107646526 +6s
telegram @@JavaScript Es (#-1001107646526): 15463144 -> ,,, +0ms
irc exos => #javascript-es: hola +13s
bridge Check if have user exos +1ms
bridge irc in message exos +1ms                                                                                                                                        │  channels-info Find info for -1001107646526 +5s
telegram @@JavaScript Es (#-1001107646526): 15463144 -> :D ahora see +1ms
channels-info Find info for -1001107646526 +7s
telegram @@JavaScript Es (#-1001107646526): 15463144 -> no :( +0ms 

Error in "Edit bridge config" if there are not bridges

When open the config wizard:

ircgrampp config

And select "Edit bridge config" and there are not bridges to edit, this crash with:

readline.js:982
            throw err;
            ^

TypeError: Cannot read property 'value' of undefined
    at Prompt.getCurrentValue (/home/exos/alpha/botmasters/ircgrampp/node_modules/inquirer/lib/prompts/list.js:129:51)
    at tryCatcher (/home/exos/alpha/botmasters/ircgrampp/node_modules/rx/dist/rx.js:63:31)
    at InnerObserver.next (/home/exos/alpha/botmasters/ircgrampp/node_modules/rx/dist/rx.js:5407:43)
    at InnerObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/home/exos/alpha/botmasters/ircgrampp/node_modules/rx/dist/rx.js:1762:31)
    at InnerObserver.tryCatcher (/home/exos/alpha/botmasters/ircgrampp/node_modules/rx/dist/rx.js:63:31)
    at AutoDetachObserverPrototype.next (/home/exos/alpha/botmasters/ircgrampp/node_modules/rx/dist/rx.js:5883:51)
    at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/home/exos/alpha/botmasters/ircgrampp/node_modules/rx/dist/rx.js:1762:31)
    at TakeObserver.next (/home/exos/alpha/botmasters/ircgrampp/node_modules/rx/dist/rx.js:5646:17)
    at TakeObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/home/exos/alpha/botmasters/ircgrampp/node_modules/rx/dist/rx.js:1762:31)
    at TakeObserver.tryCatcher (/home/exos/alpha/botmasters/ircgrampp/node_modules/rx/dist/rx.js:63:31)
    at AutoDetachObserverPrototype.next (/home/exos/alpha/botmasters/ircgrampp/node_modules/rx/dist/rx.js:5883:51)
    at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/home/exos/alpha/botmasters/ircgrampp/node_modules/rx/dist/rx.js:1762:31)
    at Subject.onNext (/home/exos/alpha/botmasters/ircgrampp/node_modules/rx/dist/rx.js:5998:19)
    at Subject.tryCatcher (/home/exos/alpha/botmasters/ircgrampp/node_modules/rx/dist/rx.js:63:31)
    at AutoDetachObserverPrototype.next (/home/exos/alpha/botmasters/ircgrampp/node_modules/rx/dist/rx.js:5883:51)
    at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/home/exos/alpha/botmasters/ircgrampp/node_modules/rx/dist/rx.js:1762:31)
    at AutoDetachObserver.tryCatcher (/home/exos/alpha/botmasters/ircgrampp/node_modules/rx/dist/rx.js:63:31)
    at AutoDetachObserverPrototype.next (/home/exos/alpha/botmasters/ircgrampp/node_modules/rx/dist/rx.js:5883:51)
    at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/home/exos/alpha/botmasters/ircgrampp/node_modules/rx/dist/rx.js:1762:31)
    at Interface.handler (/home/exos/alpha/botmasters/ircgrampp/node_modules/rx/dist/rx.async.js:482:11)
    at emitOne (events.js:96:13)
    at Interface.emit (events.js:188:7)

Node versions:

  • v6.10.0
  • v7.10.0

Error when the bot is named in the IRC

If i write in the IRC the bot name, that message not arrive to telegram group

IRC:
11:57:20 < carpediem> prueba quilmeslug_bot

bot CLI

Unhandled rejection Error: ETELEGRAM: 400 Bad Request: can't parse entities in message text: Can't find end of the entity starting at byte offset 31
    at BaseError (/home/quilmeslug/ircgrampp/node_modules/node-telegram-bot-api/src/errors.js:10:5)
    at TelegramError (/home/quilmeslug/ircgrampp/node_modules/node-telegram-bot-api/src/errors.js:56:5)
    at request.then.err (/home/quilmeslug/ircgrampp/node_modules/node-telegram-bot-api/src/telegram.js:181:15)
    at tryCatcher (/home/quilmeslug/ircgrampp/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/home/quilmeslug/ircgrampp/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/home/quilmeslug/ircgrampp/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/home/quilmeslug/ircgrampp/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/home/quilmeslug/ircgrampp/node_modules/bluebird/js/release/promise.js:693:18)
    at Async._drainQueue (/home/quilmeslug/ircgrampp/node_modules/bluebird/js/release/async.js:133:16)
    at Async._drainQueues (/home/quilmeslug/ircgrampp/node_modules/bluebird/js/release/async.js:143:10)
    at Immediate.Async.drainQueues (/home/quilmeslug/ircgrampp/node_modules/bluebird/js/release/async.js:17:14)
    at runCallback (timers.js:672:20)
    at tryOnImmediate (timers.js:645:5)
    at processImmediate [as _immediateCallback] (timers.js:617:5)

This error happend in freenode.

Config files:

config.yml

channelsdb:          "/home/quilmeslug/.ircgrampp/channels.dat"
telegram: 
  token: "XXXXX"

irc: 
  server: irc.freenode.net
  port:   6697
  nick:   quilmeslug_bot
  secure: true
oneConnectionByUser: false
prefix:              telegram_
showJoinLeft:        false

bridges/Quilmeslug.yml

enable:              true
prefix:              telegram_
oneConnectionByUser: false
showJoinLeft:        false
ircScapeCharacter:   "!"
name:                Quilmeslug
telegram: 
  token:   "XXXX"
  channel: QuilmesLug
irc: 
  server:  irc.freenode.net
  port:    6697
  nick:    quilmeslug_bot
  secure:  true
  channel: "#quilmeslug"

Add support for nickserv identifying

It would be good to implement this functionality.

  1. Configure nickserv identification
  2. Configure modes for channel?
  3. Configure modes for users created by the bot?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.