This command will only produce a response if the user’s message mentions the channel name.
!addcom hi $(eval d=decodeURIComponent;RegExp(`(\\b|@)${d("$(querystring $(channel))").replace(/[\\^$.*+?()[\]{}|]/g,"\\$&")}\\b`,"i").test(d("$(querystring)"))?`Hey ${d("$(querystring $(user))")} hope you're having a good time!`:" ")
Thank you, for the great effort. Is it possible to include when user type “hi” and “hello” in chat along with same logic as previous and ignores any viewer handle other than the streamer.
For an example, When you type hi or hello, it greets the same as previous and ignores any other viewer handles like hi @viewer. Can this be included alongside with “hi @streamer” and also “hi” alone in the chat.
This command will only produce a response if the user’s message is “hi” or if it starts with “hi” and also mentions the channel name.
!addcom hi $(eval d=decodeURIComponent;RegExp(`(\\b|@)${d("$(querystring $(channel))").replace(/[\\^$.*+?()[\]{}|]/g,"\\$&")}\\b|^\\s*$`,"i").test(d("$(querystring)"))?`Hey ${d("$(querystring $(user))")} hope you're having a good time!`:" ")