qaisjp / go-discord-irc

The Discord and IRC bridge with puppets! An IRC user is created for each Discord user, messages from IRC seamlessly appear on Discord, and Discord mentions are automagically converted to and from IRC.
MIT License
114 stars 33 forks source link

Ignoring message sent from an unhandled IRC channel. #31

Open ZeroIchiro opened 5 years ago

ZeroIchiro commented 5 years ago

Hey everyone,

tried to install that pearl on a test machine, and I encounter this problem mentioned above.

Here is my config, truncated at critical parts like passwords:

discord_token: abc.def.ghij
irc_server: irc.kibo.fm:6667
guild_id: 249927106937618432
#nickserv_identify:
channel_mappings:
  "#Kibo.FM": 249927106937618432
suffix: "D"
irc_listener_name: "Oscar"
webirc_pass: abcdef
insecure: true
debug: true
webhook_prefix: "Kibo" # this probably requires restart
webhook_limit: 90
simple: false # this requires restart

When I run the script with the parameter --simple, a listener joins the channel as requested, however writing in this channel created the warn message "Ignoring message sent from an unhandled IRC channel.", and that's it. The other direction (Discord -> IRC) works flawlessly. We still have to figure out why IRC drops an EOF or read error, but the listener would be step one and is already a great solution. But we can't figure out why it drops the messages. Why is the IRC channel #Kibo.FM "unhandled"? What did I do wrong in the configuration?

Thanks in advance.

qaisjp commented 5 years ago

The configuration looks fine to me.

Could it be the capitalisation? Try #kibo.fm".

ZeroIchiro commented 5 years ago

We created a chanbnel called #kibotest (all lower case), and still we received the message, so the handler is not case sensitive.

BCC-BGChatCommunity commented 3 years ago

Same here! :) It is case sensitive !

llmII commented 3 years ago

If it's case sensitive... bridge.go might be where to start looking. It should probably lowercase the channel there and whatever creates mappings should also lowercase from reading from the config.

Also looking around I see that a channel/discord-channel (skimming, forgive my lack of preciseness) is looked up by iterating over mappings. Wonder if it'd be a good idea to store mappings as a forwards and backwards map of discord<->irc channels as index and the mapping as the value stored (one hash lookup vs the other). This likely won't make a hill of beans though unless someone has ~20 channels and each one gets more than 100 messages a second? That said it would make it easier to read (a single lookup vs a few lines of iterations related code). I'll stop thinking out loud now.

BCC-BGChatCommunity commented 3 years ago

I still can't figure out how to not change the name of irc channel with capital first char like #Test to work in discord.