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

Telegram topics do not work in a stable container (v1.26.0) #2055

Open HaserWolf opened 1 year ago

HaserWolf commented 1 year ago

Describe the bug I'm using https://hub.docker.com/r/42wim/matterbridge to distribute notifications from internal telegram channel to public telegram groups and IRC channels. One of these groups switched to topics mode. If I run the stable container (version 1.26.0 6dafebc) the message does not arrive in the group with topics and in logs I have an error called 'SendMessage failed: strconv.ParseInt: parsing "-100xxxxxxxxxx/xx": invalid syntax'. If I run the latest container (version 1.26.1-dev 89b0d36) with the same config file identical message arrives correctly.

To Reproduce Use 42wim/matterbridge:stable with configuration file bridged telegram channel (gateway.in) to telegram group (gateway.out) with topics mode enabled and tried to send message to specific topic ("-100xxxxxxxxxx/xx" format in channel setting).

Expected behavior Support for telegram topics should work as well as when using 42wim/matterbridge:latest.

Debug logs

• time="2023-06-11T00:02:55Z" level=info msg="telegram.notice: joining -100xxxxxxxxxx (ID: -100xxxxxxxxxxtelegram.notice)" func=joinChannels file="bridge/bridge.go:77" prefix=telegram
• time="2023-06-11T00:02:55Z" level=info msg="telegram.notice: joining -100xxxxxxxxxx/xx (ID: -100xxxxxxxxxx/xxtelegram.notice)" func=joinChannels file="bridge/bridge.go:77" prefix=telegram
• time="2023-06-11T00:02:55Z" level=info msg="Gateway(s) started succesfully. Now relaying messages" func=main file="matterbridge.go:68" prefix=main
• time="2023-06-11T00:03:27Z" level=debug msg="== Receiving event: (*tgbotapi.Message)(nil)" func=handleRecv file="bridge/telegram/handlers.go:175" prefix=telegram                                                     
• time="2023-06-11T00:03:27Z" level=debug msg="<= Sending message from unknown on telegram.notice to gateway" func=handleRecv file="bridge/telegram/handlers.go:237" prefix=telegram                                    
• time="2023-06-11T00:03:27Z" level=debug msg="<= Message is config.Message{Text:"Bot testing notification", Channel:"-100xxxxxxxxxx", Username:"unknown", UserID:"-100xxxxxxxxxx", Avatar:"", Account:"telegram.notice", Event:"", Protocol:"", Gateway:"", ParentID:"", Timestamp:time.Date(1, time.January, 1, 0, 0, 0, 0, time.UTC), ID:"57", Extra:map[string][]interface {}{}}" func=handleRecv file="bridge/telegram/handlers.go:238" prefix=telegram            
• time="2023-06-11T00:03:27Z" level=debug msg="=> Sending config.Message{Text:"Bot testing notification", Channel:"-100xxxxxxxxxx", Username:"unknown", UserID:"-100xxxxxxxxxx", Avatar:"", Account:"telegram.notice", Event:"", Protocol:"telegram", Gateway:"groups", ParentID:"", Timestamp:time.Date(2023, time.June, 11, 0, 3, 27, 90974130, time.Local), ID:"57", Extra:map[string][]interface {}{}} from telegram.notice (-100xxxxxxxxxx) to telegram.notice (-100xxxxxxxxxx/xx)" func=SendMessage file="gateway/gateway.go:499" prefix=gateway                                           
• time="2023-06-11T00:03:27Z" level=debug msg="=> Receiving config.Message{Text:"Bot testing notification", Channel:"-100xxxxxxxxxx/xx", Username:"", UserID:"-100xxxxxxxxxx", Avatar:"", Account:"telegram.notice", Event:"", Protocol:"telegram", Gateway:"groups", ParentID:"", Timestamp:time.Date(2023, time.June, 11, 0, 3, 27, 90974130, time.Local), ID:"", Extra:map[string][]interface {}{}}" func=Send file="bridge/telegram/telegram.go:90" prefix=telegram  
• time="2023-06-11T00:03:27Z" level=debug msg="=> Send from telegram.notice (-100xxxxxxxxxx) to telegram.notice (-100xxxxxxxxxx/xx) took 16.535µs" func=func1 file="gateway/gateway.go:508" prefix=gateway               
• time="2023-06-11T00:03:27Z" level=error msg="SendMessage failed: strconv.ParseInt: parsing "-100xxxxxxxxxx/xx": invalid syntax" func=handleMessage file="gateway/handlers.go:228" prefix=gateway

Environment

glasgowm148 commented 11 months ago

It shouldn't, you need to install the latest dev build. It's included in the next stable release.