#Can I make the bot respond to being pinged?

1 messages · Page 1 of 1 (latest)

fallow burrow
#

I want to make a command which isn't prefix or interaction where the bot get's pinged and something specific is typed after the ping and it responds. Is this possible and how?
Thanks in advance.

plucky scroll
#

That's ust a mention prefix

#

Check for it the same way you'd check for a string prefix

fallow burrow
#

yeah but I have interaction and prefix commands for my bot

#

I would like to keep both of them and have mentions

plucky scroll
#

Nothing stops you from doing that

#

Just add a mention check similar to your prefix check

#

You could then execute whatever you want

#

There is a HasMentionPrefix extension method that'd do the check for you

fallow burrow
#
                message.HasMentionPrefix(_client.CurrentUser, ref argPos)) ||
                message.Author.IsBot)
                return;```
#

I have it setup like this

#

idk what to use to for itself

#

not the curent user

plucky scroll
#

currentUser is fine

fallow burrow
#

thank you so much it works

#

I just ping it and use any prefix command that I already have