Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specifying Discord channel ID requires all Discord channels to be IDs #953

Closed
qaisjp opened this issue Nov 30, 2019 · 1 comment
Closed
Labels

Comments

@qaisjp
Copy link
Collaborator

qaisjp commented Nov 30, 2019

Describe the bug
Specifying a channel ID for one Discord gateway will "break" other gateways that use Discord channel names.

"break" = messages sent FROM Discord channels (ones that use channel names) don't get sent to the other channels. messages are sent to those discord channels fine. and messages between other platforms on the same gateway work fine.

To Reproduce

  1. Create multiple gateways using Discord channel names
  2. Observe everything working properly
  3. Change one gateway to use a Discord channel ID
  4. Observe other gateways breaking

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots/debug logs
If applicable, add screenshots to help explain your problem.
Use logs from running matterbridge -debug if possible.

Sending `k` as a test message on Discord yields this output
[0014] DEBUG discord:      == Receiving event &discordgo.Message{ID:"650313820018966559", ChannelID:"590172620440469505", GuildID:"278474088903606273", Content:"k", Timestamp:"2019-11-30T12:34:56.939000+00:00", EditedTimestamp:"", MentionRole
s:[]string{}, Tts:false, MentionEveryone:false, Author:(*discordgo.User)(0xc000862000), Attachments:[]*discordgo.MessageAttachment{}, Embeds:[]*discordgo.MessageEmbed{}, Mentions:[]*discordgo.User{}, Reactions:[]*discordgo.MessageReactions(ni
l), Pinned:false, Type:0, WebhookID:"", Member:(*discordgo.Member)(0xc000678a80), MentionChannels:[]*discordgo.Channel(nil), Activity:(*discordgo.MessageActivity)(nil), Application:(*discordgo.MessageApplication)(nil), MessageReference:(*disc
ordgo.MessageReference)(nil), Flags:0}
[0014] DEBUG discord:      <= Sending message from qaisjp on discord.mta to gateway
[0014] DEBUG discord:      <= Message is config.Message{Text:"k", Channel:"ID:590172620440469505", Username:"qaisjp", UserID:"83386293446246400", Avatar:"https://cdn.discordapp.com/avatars/83386293446246400/6c4342d5d3556d4d6993232272eb9699.jp
g", Account:"discord.mta", Event:"", Protocol:"", Gateway:"", ParentID:"", Timestamp:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}, ID:"650313820018966559", Extra:map[string][]interface {}(nil)}
It should look like this instead
[0018] DEBUG discord:      == Receiving event &discordgo.Message{ID:"650314136475140096", ChannelID:"590172620440469505", GuildID:"278474088903606273", Content:"k", Timestamp:"2019-11-30T12:36:12.388000+00:00", EditedTimestamp:"", MentionRole
s:[]string{}, Tts:false, MentionEveryone:false, Author:(*discordgo.User)(0xc0008a4d80), Attachments:[]*discordgo.MessageAttachment{}, Embeds:[]*discordgo.MessageEmbed{}, Mentions:[]*discordgo.User{}, Reactions:[]*discordgo.MessageReactions(ni
l), Pinned:false, Type:0, WebhookID:"", Member:(*discordgo.Member)(0xc000a3c7e0), MentionChannels:[]*discordgo.Channel(nil), Activity:(*discordgo.MessageActivity)(nil), Application:(*discordgo.MessageApplication)(nil), MessageReference:(*disc
ordgo.MessageReference)(nil), Flags:0}
[0018] DEBUG discord:      <= Sending message from qaisjp on discord.mta to gateway
[0018] DEBUG discord:      <= Message is config.Message{Text:"k", Channel:"test", Username:"qaisjp", UserID:"83386293446246400", Avatar:"https://cdn.discordapp.com/avatars/83386293446246400/6c4342d5d3556d4d6993232272eb9699.jpg", Account:"disc
ord.mta", Event:"", Protocol:"", Gateway:"", ParentID:"", Timestamp:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}, ID:"650314136475140096", Extra:map[string][]interface {}(nil)}
[0018] DEBUG gateway:      => Sending config.Message{Text:"k", Channel:"test", Username:"qaisjp", UserID:"83386293446246400", Avatar:"https://cdn.discordapp.com/avatars/83386293446246400/6c4342d5d3556d4d6993232272eb9699.jpg", Account:"discord
.mta", Event:"", Protocol:"", Gateway:"mta.test", ParentID:"", Timestamp:time.Time{wall:0xbf70b66f1ab5f1f4, ext:18908113554, loc:(*time.Location)(0x1ce2500)}, ID:"650314136475140096", Extra:map[string][]interface {}(nil)} from discord.mta (te
st) to slack.mta (test)
[0018] DEBUG slack:        => Receiving config.Message{Text:"k", Channel:"test", Username:"qaisjp", UserID:"83386293446246400", Avatar:"https://cdn.discordapp.com/avatars/83386293446246400/6c4342d5d3556d4d6993232272eb9699.jpg", Account:"disco
rd.mta", Event:"", Protocol:"", Gateway:"mta.test", ParentID:"", Timestamp:time.Time{wall:0xbf70b66f1ab5f1f4, ext:18908113554, loc:(*time.Location)(0x1ce2500)}, ID:"", Extra:map[string][]interface {}(nil)}

Environment (please complete the following information):

  • OS: [e.g. linux]
  • Matterbridge version: output of matterbridge -version
  • If self compiled: output of git rev-parse HEAD

173a38a

Additional context
Please add your configuration file (be sure to exclude or anonymize private data (tokens/passwords))

(cut down)

[[gateway]]
name="mta.dev"
enable=true

[[gateway.inout]]
account="slack.mta"
channel="general-dev"

[[gateway.inout]]
account="discord.mta"
channel="development"

[[gateway.inout]]
account="irc.gtanet"
channel="#mta.dev"

[[gateway]]
name="mta.allstaff"
enable=true

[[gateway.inout]]
account="slack.mta"
channel="general"

[[gateway.inout]]
account="discord.mta"
channel="ID:640602003638190102"

This caused the mta.allstaff gateway (i.e. the gateway that specifies ID) to work perfectly fine. Other gateways however weren't bridging messages sent from Discord. Everything else for the gateway (for example, messages from IRC or Slack) worked fine.

ID: syntax is specified here: https://github.com/42wim/matterbridge/wiki/Gateway-config-(channel-rules)

From the log, it seems that just because one gateway used channel IDs to identify channels, other gateways will start to do that too.

[0014] DEBUG discord:      <= Message is config.Message{Text:"k", Channel:"ID:590172620440469505" [..]

Note that whilst the ID is correct, the config for this gateway expects Channel:"test", not a channel ID.

@42wim
Copy link
Owner

42wim commented Jan 9, 2020

Thanks for the detailed bug report, should be fixed in master now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants