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
Labels
Bug

Comments

@Willard21
Copy link

@Willard21 Willard21 commented Oct 28, 2019

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 Bug label Oct 28, 2019
@PlayTheFallen

This comment has been minimized.

Copy link
Member

@PlayTheFallen PlayTheFallen 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

This comment has been minimized.

Copy link
Author

@Willard21 Willard21 commented Oct 28, 2019

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.

@PlayTheFallen

This comment has been minimized.

Copy link
Member

@PlayTheFallen PlayTheFallen commented Oct 28, 2019

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

@Sven65

This comment has been minimized.

Copy link
Contributor

@Sven65 Sven65 commented Oct 28, 2019

@Willard21

This comment has been minimized.

Copy link
Author

@Willard21 Willard21 commented Oct 28, 2019

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 Oct 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.