Detecting or intercepting twitch commands, such as /me

Hi all!

I’ve been doing a lot of research into trying to solve the issue a lot of people are trying to solve- which is essentially blocking usage of the /me command, or having nightbot respond if someone uses it.

From what I can tell, Twitch omits the /me part of the message before Nightbot is able to see it. Would it be possible to workaround this with a custom API? Forgive me if this is a stupid question, I don’t FULLY understand how APIs work with Nightbot, but I was wondering if an API would either be able to figure out if a message was a /me or not.

Thanks in advance!

1 Like

Hey @HedgeWizardly!

While you can’t block or disable the /me command, or have a custom /me command, I think you can add it to blacklisted words to purge those messages, not 100% sure it’ll work though.

Hey @Emily!

Unfortunately I tried a lot of variants of that, both within Twitch’s own blacklisted words box, and within Nightbot’s. I even tried a few variations of the regex version of the /me command, and nothing has worked so far :frowning:

Honestly your best bet for something like this would be to reach out to twitch and try to get them to change it on their end as far as I know there would be no way of detecting /me unless twitch allowed it.


Then it’s not possible, sorry.

1 Like

Aw that’s a shame. Thank you for your responses anyways!

I am also curious on how i could implement a nightbot response from viewers using a “/me” message on a second trigger word

anyone been able to find a way for nightbot to respond to those annoying /me messages?

I’ve got multiple word commands working fine (see below example) but I’m curious on how i could improve it (and learn more about nightbot and integrate more into my commands)

!addcom FIRST_WORD $(eval decodeURIComponent(`$(querystring)`).toLowerCase()==`REST_OF_THE_PHRASE`.toLowerCase()?`COMMAND_RESPONSE`:` `)

following my command syntax IF the “/me” would be picked up by nightbot then my command would be
!addcom /me $(eval decodeURIComponent(`$(querystring)`).toLowerCase()==`donated`.toLowerCase()?`Pfft.... kid!!?!! relfnLUL Who are you trying to fool relfnIQ`:` `)

ie - if someone writes
/me donated $50
it would trigger
but if someone wrote
/me hugs TestUser
it would NOT trigger

but yeah I cant get nightbot to read the /me and differentiate between someone saying “/me WORD” and “WORD”

I hope we can brainstorm and get out big brain farm to come up with a solution xOx
(and yes I’ve thought about just having a command for “donated” to trigger for all those annoying fake donos but I have some command ideas for different /me triggers that would need to be filtered out from people saying the same thing but without the /me)

The furthest I’ve gotten so far is what I’ve found is in this thread. Basically, commands don’t get put into chat directly, they’re processed differently, so I was hoping to see if there was a regex code for /me that would be picked up, but no luck…

Hey @ThisisDrLove!

If I understand correctly, you want Nightbot to send a message when people try to trick a donation message.
This is easily doable, Nightbot doesn’t see the /me given that it’s a Twitch chat command, the first thing it sees is the word following it, so with that in mind, create a command called donated:

!addcom donated Pfft.... kid!!?!! relfnLUL Who are you trying to fool relfnIQ
1 Like

Hey Emily! Thanks again for this! That’s actually what I’ve ended up doing for now. It’s not the most foolproof method, as if someone just says the word donated at the beginning of their sentence, like “donated some clothes to charity today” then it triggers it.

It would be really great if we can convince the Twitch devs to provide a working regex code for APIs to pick up usage of the /me, though.

I guess we could add a check for a number:

!addcom donated $(eval `$(query)`.match(/\d+/)?`Pfft.... kid!!?!! relfnLUL Who are you trying to fool relfnIQ`:` `)

It’ll still trigger the command if people say they “donated $50 to [insert charity name here],” but at least it won’t for the case you specified.

1 Like

That’s a really good idea, thanks Emily!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.