Is it possible to check if touser is a mentioned user?

I’d like to create a custom command that only work when touser is a mentioned user. For example, if I type !hug @somebody, the bot will response something. But if I type !hug Frank or !hug 123, the bot will do nothing. Since Frank is not mentioned and 123 is not even a user name. Is it possible to do this?

@skkri

!addcom -cd=5 !hug -a=!hugp2 $(eval a=decodeURIComponent(`$(touser)`);b=a.charAt(0)==`@`?a.replace(`@`,``):``;b.length>0?b+` foo^_^BAR`:` `)
!addcom -cd=5 !hugp2 $(eval `$(2)`==`foo^_^BAR`&&`$(twitch $(touser))`!=`Unknown Twitch Channel`?`$(user) gives $(touser) a hug! <3`:` `)

The command response if the input matches the criteria (first character is @ and the input is an existing Twitch username) is located in !hugp2:

$(user) gives $(touser) a hug! <3

Thanks! I will try it later.

1 Like

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