42wim / matterbridge

bridge between mattermost, IRC, gitter, xmpp, slack, discord, telegram, rocketchat, twitch, ssh-chat, zulip, whatsapp, keybase, matrix, microsoft teams, nextcloud, mumble, vk and more with REST API (mattermost not required!)
Apache License 2.0
6.59k stars 613 forks source link

[Telegram <-> IRC] messages from Telegram are not generating debug entries #936

Closed jfernandz closed 4 years ago

jfernandz commented 4 years ago

Describe the bug Sent messages from telegram are not generating log entries. Besides sent messages from IRC are ending up in my telegram group (with their corresponding debug messages in matterbridge debug output), so I presume all data in config file is right.

My bot privacy is disabled so this cannot be causing the issue. Also I had to use @RawDataBot in Telegram to retrieve my group ID, because traffic in there was not causing any debug entry in matterbridge (contrary to what is said in here)

To Reproduce I've configured matterbridge to connect my Telegram private group with my IRC channel following your docu to create two inout gateways but messages are just sent in only one way (IRC to Telegram)

Expected behavior Messages are sent in both ways, IRC to Telegram and Telegram to IRC.

Screenshots/debug logs

wyre@xshellz-free:~/matterbridge$ ./matterbridge-1.16.1-linux-64bit -debug -conf tg_irc.toml 
[0000]  INFO main:         Enabling debug logging.
[0000]  INFO main:         Running version 1.16.1 bad1990
[0000]  INFO router:       Parsing gateway mygateway
[0000]  INFO router:       Starting bridge: irc.freenode 
[0000]  INFO irc:          Connecting irc.freenode.net:6697
[0000] DEBUG irc:          "CLIENT_INIT irc.freenode.net:6697"
[0000] DEBUG irc:          ":niven.freenode.net NOTICE * :*** Looking up your hostname..."
[0000] DEBUG irc:          ":niven.freenode.net NOTICE * :*** Checking Ident"
[0000] DEBUG irc:          ":niven.freenode.net NOTICE * :*** Found your hostname"
[0000] DEBUG irc:          ":niven.freenode.net NOTICE * :*** Got Ident response"
[0000] DEBUG irc:          ":niven.freenode.net CAP * LS :account-notify away-notify cap-notify chghost extended-join identify-msg multi-prefix sasl tls"
[0000] DEBUG irc:          ":niven.freenode.net CAP mozo ACK :cap-notify extended-join multi-prefix account-notify away-notify chghost sasl "
[0000] DEBUG irc:          "AUTHENTICATE +"
[0000] DEBUG irc:          ":niven.freenode.net 900 mozo mozo!wyre@shell.xshellz.com mozo :You are now logged in as mozo."
[0000] DEBUG irc:          ":niven.freenode.net 903 mozo :SASL authentication successful"
[0001] DEBUG irc:          ":niven.freenode.net NOTICE mozo :*** Spoofing your IP"
[0001] DEBUG irc:          ":niven.freenode.net 001 mozo :Welcome to the freenode Internet Relay Chat Network mozo"
[0001] DEBUG irc:          Registering callbacks
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0001] DEBUG irc:          "CLIENT_GENERAL_UPDATED"
[0003] DEBUG irc:          "CLIENT_CONNECTED irc.freenode.net:6697"
[0006]  INFO irc:          Connection succeeded
[0006]  INFO irc:          irc.freenode: joining #birras (ID: #birrasirc.freenode)
[0006] DEBUG irc:          ":mozo MODE mozo +Zi"
[0006]  INFO router:       Starting bridge: telegram.birras 
[0006]  INFO telegram:     Connecting
[0006] DEBUG irc:          handle girc.Event{Source:(*girc.Source)(0xc000407500), Tags:girc.Tags(nil), Timestamp:time.Time{wall:0xbf674b30c737d4ef, ext:6857864909, loc:(*time.Location)(0x1e1c5a0)}, Command:"JOIN", Params:[]string{"#birras", "mozo", "mozo"}, Sensitive:false, Echo:false}
[0006] DEBUG irc:          333: Topic set by likevinyl [2018-06-21 15:20:58 +0200 CEST]
[0007]  INFO telegram:     Connection succeeded
[0007]  INFO telegram:     telegram.birras: joining -1001188985016 (ID: -1001188985016telegram.birras)
[0007]  INFO main:         Gateway(s) started succesfully. Now relaying messages
[0059] DEBUG irc:          == Receiving PRIVMSG: wyre probando  girc.Event{Source:(*girc.Source)(0xc000568d80), Tags:girc.Tags(nil), Timestamp:time.Time{wall:0xbf674b3e0437494a, ext:59807497519, loc:(*time.Location)(0x1e1c5a0)}, Command:"PRIVMSG", Params:[]string{"#birras", "probando "}, Sensitive:false, Echo:false}
[0059] DEBUG irc:          detected ISO-8859-1 confidence 66
[0059] DEBUG irc:          <= Sending message from #birras on irc.freenode to gateway
[0059] DEBUG gateway:      => Sending config.Message{Text:"probando ", Channel:"#birras", Username:"wyre", UserID:"wyre@gateway/shell/xshellz/x-wqzabgbftrlgwnbd", Avatar:"", Account:"irc.freenode", Event:"", Protocol:"", Gateway:"mygateway", ParentID:"", Timestamp:time.Time{wall:0xbf674b3e0445a120, ext:59808437405, loc:(*time.Location)(0x1e1c5a0)}, ID:"", Extra:map[string][]interface {}(nil)} from irc.freenode (#birras) to telegram.birras (-1001188985016)
[0059] DEBUG telegram:     => Receiving config.Message{Text:"probando ", Channel:"-1001188985016", Username:"[irc] <wyre> ", UserID:"wyre@gateway/shell/xshellz/x-wqzabgbftrlgwnbd", Avatar:"", Account:"irc.freenode", Event:"", Protocol:"", Gateway:"mygateway", ParentID:"", Timestamp:time.Time{wall:0xbf674b3e0445a120, ext:59808437405, loc:(*time.Location)(0x1e1c5a0)}, ID:"", Extra:map[string][]interface {}(nil)}
[0060] DEBUG gateway:      mID telegram.birras: 14127

Environment (please complete the following information):

Additional context

[irc]
    [irc.freenode]
    Nick="mozo" # <== change this
    NickServNick="mozo" # <== change this if necessary (your nick registered with nickserv)
    NickServPassword="myIRCpassword" # <== change this (your pass with nickserv)
    Server="irc.freenode.net:6697"
    UseTLS=true
    UseSASL=true
    SkipTLSVerify=false
    RemoteNickFormat="[{PROTOCOL}] <{NICK}> "

[telegram]
    [telegram.birras]
    #See https://core.telegram.org/bots#6-botfather 
    #and https://www.linkedin.com/pulse/telegram-bots-beginners-marco-frau
    Token="myTelegramAPIkey"
    RemoteNickFormat="[{PROTOCOL}] <{NICK}> "

[[gateway]]
name="mygateway"
enable=true
    [[gateway.inout]]
    account="irc.freenode"
    channel="#birras"

    [[gateway.inout]]
    account="telegram.birras"
    channel="channelID"
jfernandz commented 4 years ago

It was caused by order in which you set the privacy and invite the bot to your Telegram group, I should check in here

I'd suggest you to add that important appointment to here

Thank you to @42wim in IRC #matterbridgechat :+1: