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.7k stars 623 forks source link

Messages only travel one way - telegram / Gitter #274

Closed bashfulrobot closed 7 years ago

bashfulrobot commented 7 years ago

If you have a configuration problem, please first try to create a basic configuration following the instructions on the wiki before filing an issue.

Please answer the following questions.

Which version of matterbridge are you using?

run matterbridge -version version: 1.2.0

Please describe the expected behavior.

Messages moving back and forth between gitter and telegram

Please describe the actual behavior.

Use logs from running matterbridge -debug if possible.

Messages go from telegram to gitter, but not the other way. The telegram messages show in the debug, but the gitter ones do not.

/opt/matterbridge/matterbridge -debug -conf /etc/matterbridge/matterbridge.toml
INFO[2017-10-10T23:27:02Z] Enabling debug                               
INFO[2017-10-10T23:27:02Z] Running version 1.2.0                        
INFO[2017-10-10T23:27:02Z] Starting bridge: telegram.ubc                
INFO[2017-10-10T23:27:02Z] Connecting                                    module=telegram
INFO[2017-10-10T23:27:02Z] Connection succeeded                          module=telegram
INFO[2017-10-10T23:27:02Z] telegram.ubc: joining -xxxxxxxxx (-xxxxxxxxtelegram.ubc) 
INFO[2017-10-10T23:27:02Z] Starting bridge: gitter.ubc                  
INFO[2017-10-10T23:27:02Z] Connecting                                    module=gitter
INFO[2017-10-10T23:27:03Z] Connection succeeded                          module=gitter
INFO[2017-10-10T23:27:03Z] gitter.ubc: joining ubuntubudgie/community (ubuntubudgie/communitygitter.ubc) 
INFO[2017-10-10T23:27:03Z] Gateway(s) started succesfully. Now relaying messages

telgram to gitter:

DEBU[2017-10-10T23:27:58Z] Receiving from telegram: &tgbotapi.Message{MessageID:1660, From:(*tgbotapi.User)(0xc42040d040), Date:1507678078, Chat:(*tgbotapi.Chat)(0xc42077f320), ForwardFrom:(*tgbotapi.User)(nil), ForwardFromChat:(*tgbotapi.Chat)(nil), ForwardFromMessageID:0, ForwardDate:0, ReplyToMessage:(*tgbotapi.Message)(nil), EditDate:0, Text:"test", Entities:(*[]tgbotapi.MessageEntity)(nil), Audio:(*tgbotapi.Audio)(nil), Document:(*tgbotapi.Document)(nil), Game:(*tgbotapi.Game)(nil), Photo:(*[]tgbotapi.PhotoSize)(nil), Sticker:(*tgbotapi.Sticker)(nil), Video:(*tgbotapi.Video)(nil), VideoNote:(*tgbotapi.VideoNote)(nil), Voice:(*tgbotapi.Voice)(nil), Caption:"", Contact:(*tgbotapi.Contact)(nil), Location:(*tgbotapi.Location)(nil), Venue:(*tgbotapi.Venue)(nil), NewChatMembers:(*[]tgbotapi.User)(nil), LeftChatMember:(*tgbotapi.User)(nil), NewChatTitle:"", NewChatPhoto:(*[]tgbotapi.PhotoSize)(nil), DeleteChatPhoto:false, GroupChatCreated:false, SuperGroupChatCreated:false, ChannelChatCreated:false, MigrateToChatID:0, MigrateFromChatID:0, PinnedMessage:(*tgbotapi.Message)(nil), Invoice:(*tgbotapi.Invoice)(nil), SuccessfulPayment:(*tgbotapi.SuccessfulPayment)(nil)}  module=telegram
DEBU[2017-10-10T23:27:58Z] Sending message from xxxxxxx on telegram.ubc to gateway  module=telegram
DEBU[2017-10-10T23:27:58Z] Sending config.Message{Text:"test", Channel:"-xxxxxxx", Username:"xxxxx", UserID:"xxxxxx", Avatar:"", Account:"telegram.ubc", Event:"", Protocol:"", Gateway:"tgubc", Timestamp:time.Time{wall:0xbe6f73bf9069cd2a, ext:55773643229, loc:(*time.Location)(0x13de000)}, ID:"1660"} from telegram.ubc (-xxxxxxx) to gitter.ubc (ubuntubudgie/community) 
DEBU[2017-10-10T23:27:58Z] Receiving config.Message{Text:"test", Channel:"ubuntubudgie/community", Username:"", UserID:"xxxxxxxx", Avatar:"", Account:"telegram.ubc", Event:"", Protocol:"", Gateway:"tgubc", Timestamp:time.Time{wall:0xbe6f73bf9069cd2a, ext:55773643229, loc:(*time.Location)(0x13de000)}, ID:""}  module=gitter

gitter to telegram

no output in debug

Any steps to reproduce the behavior?

Load the config, and attempt to message.

Please add your configuration file

(be sure to exclude or anonymize private data (tokens/passwords))

#This is configuration for matterbridge.

###################################################################
#Gitter section
#Best to make a dedicated gitter account for the bot.
###################################################################

[gitter]
        [gitter.ubc]
        Token="xxxxxxxx"
        ShowJoinPart=false

###################################################################
#telegram section
###################################################################
[telegram]
        [telegram.ubc]
        Token="xxxxxx:xxxxxx"
        RemoteNickFormat="<{NICK}>: "

###################################################################
#General configuration
###################################################################
#Settings here override specific settings for each protocol
[general]
        #RemoteNickFormat="{NICK}: "

###################################################################
#Gateway configuration
###################################################################
[[gateway]]
        #REQUIRED and UNIQUE
        name="tgubc"
        enable=true

        ## Get the channel in TG
        ## add the bot: @get_id to channel
        ## The run the command: /my_id
        [[gateway.inout]]
        account="telegram.ubc"
        channel="-xxxxxxxx"

        [[gateway.inout]]
        account="gitter.ubc"
        channel="ubuntubudgie/community"
42wim commented 7 years ago

You're using a dedicated account for gitter ? If you try to type messages on gitter with the same account that's connected via matterbridge, it will not work.

bashfulrobot commented 7 years ago

Hmmm, I thought I had this working before. Assuming my config looks good, I'll try with a "automation" account.

42wim commented 7 years ago

The config looks good. You can also try it with your own account, but you have to have other users on gitter say something. Those messages should show up if you run with -debug (and hopefully also relay)

bashfulrobot commented 7 years ago

ohhhhhh - I see what you are saying.

I'll go test. Thanks for the info.

bashfulrobot commented 7 years ago

Closing off. Bridge works as expected. It is because I was testing with my own account. Moved to a service account for the bridge.