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

Can't ping the bot if it has a nickname #855

Closed
Willard21 opened this issue Oct 28, 2019 · 5 comments
Closed

Can't ping the bot if it has a nickname #855

Willard21 opened this issue Oct 28, 2019 · 5 comments
Labels
C-Bug Category: This issue is a confirmed bug

Comments

@Willard21
Copy link
Member

Describe the bug
Giving the bot a nickname will stop pings from working since the ping format becomes <@!170915625722576896> instead of the normal <@170915625722576896>. I think Fallen tried to tell me that before the update but I didn't understand what he was saying lol.

To Reproduce
Steps to reproduce the behavior:

  1. @SpookordRPG ping
  2. Get no response
@Willard21 Willard21 added the C-Bug Category: This issue is a confirmed bug label Oct 28, 2019
@sudojunior
Copy link
Member

sudojunior commented Oct 28, 2019

/<@!?(\d+)>/ -> [fullMatch, ...captures] where captures includes mentioned user target (conditional requirement to check who was mentioned - bot or exchange target i.e. donate, idonate, battle, etc.)

EDIT (1): fix typo

@Willard21
Copy link
Member Author

I already fixed it. Anyway, I was removing it from an array, so I couldn't use regex. I just used max(indexof(string1), indexof(string2)). Seemed easier than manually looping over the array to use regex.

@sudojunior
Copy link
Member

And that concludes to be more functional - as in literal functions being utilized in this new revision?

@Sven65
Copy link
Contributor

Sven65 commented Oct 28, 2019

Uh, we can just use the d.js function for it?

https://discord.js.org/#/docs/main/stable/class/Message?scrollTo=isMemberMentioned

@Willard21
Copy link
Member Author

We do use that, but that's only a boolean. It doesn't say whether the message is @DiscordRPG ping or ping @DiscordRPG, it just returns true for both. So I need the index of it to know where to remove it from the args array.

@Sven65 Sven65 closed this as completed Oct 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Bug Category: This issue is a confirmed bug
Projects
None yet
Development

No branches or pull requests

3 participants