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

Allow pinging between Discord and IRC #11

Open
DanielOaks opened this issue Mar 23, 2016 · 1 comment
Open

Allow pinging between Discord and IRC #11

DanielOaks opened this issue Mar 23, 2016 · 1 comment

Comments

@DanielOaks
Copy link
Contributor

If someone on IRC says: @Somecooldude yo what up

And there is someone on Discord who has that name, it should ping them in the message.

Discord -> IRC is not required as client highlighting is based on nick matching already, rather than the explicit name mentioning that Discord uses.

@r3c0d3x
Copy link
Member

r3c0d3x commented Oct 8, 2016

NOTE: I created an issue for this a minute or two ago without checking the issue list. Sorry for the spam!

I have a solution in mind. When parsing a message from a bridged IRC channel, follow these steps (in addition to parsing it as normal):

  1. If it doesn't has a @ character in it, just parse it as normal and ignore the following steps.
  2. For each @ character in the message, parse the characters following it until we reach a whitespace character (there is an issue here, which I'll mention soon). Search through the list of members of the server and pick the user whose name exactly matches that string (should we be case-sensitive?). If there are multiple users with that screen name, we pick the one who most recently typed. (up for debate)
  3. Replace each @-string from the IRC message with a mention (following the example above) according the the details of that user (i.e. matching the screen name and discriminator). I'm not extremely familiar with the Discord chat API so I'm not sure if we will have to do anything else besides this to "mention" that user when Itabashi is sending the bridged message to the Discord channel, but Discord's UI uses the above format to do mentions internally.

We do have some potential issues though:

  • What if a Discord user's screen name has whitespace characters in it? Should we add a delimiter for it?
    • The # prefixing the discriminator effectively functions as one in the Discord universe.
  • Should we be case sensitive when trying to match up an IRC -> Discord mention to the correct Discord user?
    • We should probably find out if Discord is. I'd imagine that it is, but I'm not sure.
  • If multiple Discord users have the same screen name, how do we decide which to mention?

EDIT: Basically, this would allow IRC users to mention Discord users by doing @user, where user is the Discord user's screen name.

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

No branches or pull requests

2 participants