A way to notify people

#1

I want the bot to notify people as soon as they type in chat
Something like:
USER1: !notify USER2 MESSAGE
USER2: Hey
Bot: Hey, USER2, USER1 left you a message: MESSAGE
something like that
i think theres a bot that can do this already but idk where to find it so i would really appreciate if someone did this

#2

maybe !notify with the message Hey, @(1), (sender) left you a message: (echo)

NOTE keep in mind this can be abused so i would not advise on it :slight_smile: better way would to make a custom script

Example of why it could be abused

#3

I am not entirely sure I understand the use case. Is this any different than in chat @mentioning someone directly? What benefit does the bot doing it provide?

EDIT: I read this again, so, when someone fires a message in chat remind them that someone is looking for them. I wouldn’t leave a message, like Dakoda pointed out. Should also be rate limited and probably in a script, it could be abused.

#4

Sorry I took a while to respond, but yeah, that’s what I want it to do, remind U2 that there was someone looking for them.

It’s fine if people can abuse it I barely get 3 viewers anyways lol.

#5

I can probably slap together a custom module in the next few days.

Do you want it to keep the reminder if the bot is shutdown and restarted?

#6

Yeah I guess

#7

Place the attached file in /scripts/custom/. Be sure to enable the module if it does not automatically enable.

notifySystem.js (3.5 KB)

notifytoggle
[03-23-2019 @ 14:31:32.215 MDT] @IllusionaryBot, Notifications are now enabled
notify illusionaryone hello there
[03-23-2019 @ 14:28:40.094 MDT] [CHAT] @IllusionaryBot, Leaving message [hello there] for illusionaryone
[03-23-2019 @ 14:28:50.754 MDT] illusionaryone: greetings
[03-23-2019 @ 14:28:50.760 MDT] [CHAT] @IllusionaryOne, illusionarybot left you a message: hello there

it will also check to make sure the user exists on Twitch:

notify asdhfkahfwkefh message
[03-23-2019 @ 14:33:57.373 MDT] [MUTED] @IllusionaryBot, asdhfkahfwkefh was not found on Twitch.

If someone, or some people, do start to troll the system, you can disable it and clear the notifications:

notifytoggle
[03-23-2019 @ 14:40:37.649 MDT] [MUTED] @IllusionaryBot, Notifications are now disabled
notifyclear
[03-23-2019 @ 14:40:39.176 MDT] [MUTED] @IllusionaryBot, Deleted all notifications
1 Like
#8

This is exactly what I wanted thank you soooo much!!

1 Like
#9

Welcome! I did first upload without a !notifyclear command and thought that a bad idea. While I trust most people, there can always be that one troll that can ruin things. At least this way a moderator or above can turn it off for a few minutes and clear the queue.

Cheers

#10

One thing I noticed is that if multiple people notify the same person, only the last message will be said
User1: !notify User3 Hello
User2: !notify User3 Hey
User3: Hey
Bot:@User3, User2 left you a message: Hey
yea

EDIT: just realized a clear notifications command will be very useful lol

#11

That is correct. The database has a single key - the user to be pinged. I can see about appending the messages together - Twitch has a rate limit on chat. If multiple people leave a message for a person and the bot has to deliver multiple messages at once, it fills up the rate limit.

The !notifyclear command is in the script above already.

#12

Updated script.

notifySystem.js (3.8 KB)

[03-25-2019 @ 11:44:43.903 MDT] [MUTED] @IllusionaryBot, Leaving message [second message] for illusionaryone
[03-25-2019 @ 11:44:55.543 MDT] illusionaryone: hello
[03-25-2019 @ 11:44:55.550 MDT] [MUTED] @IllusionaryOne, You have message(s): illusionarybot: first message | illusionarybot: second message
1 Like
#13

Thank you sooo much again!
In the first script you sent, the clear command wasnt working at all

but its fully working in the second one
Working

And the multiple messages is really great too!

Thank you!

#14

You may have grabbed the first script between the time I uploaded an original and overwrote it.

Glad it is working.

Cheers!