Sending messages using my bot name

Hello. While logged into my channel as the broadcaster in my JS file, is there a way I can send a chat message(s) using my bot name instead of my broadcaster name? I need to take broadcaster action based on a detected chat command and then send out a chat message (from my bot username) with the response.

Thanks

You’d have to login as the bot instead of as you.

If you make the bot a mod, then the bot can do the deleting

Thanks. I figured :frowning: Actually, I need to VIP a user, which the mod bot cannot do (as far as I know). That’s why I needed to log in as the broadcaster. If you can think of a workaround, I’d be happy to hear.
Regards

Then your bot would need to login as both accounts at the same time. WHich is possible just two threads with it’s own credentials

Oh, never thought of that. Sounds interesting. However, in order for the broadcaster to issue the VIP command the code must read “client.say(channel, /vip ${userName});”. When this occurs, the that VIP command shows up in chat with the broadcaster’s name.

Yup that is how I do it

But I run two different bot processes.
And use redis to talk between the two if I need to.

I am not sure how to use redis to make that connection.

Here’s an idea. Is there a way for the bot to monitor the output to a terminal/logs? If so, I can monitor that with the second bot since for the following.

[20:00] info: [#myChannel] Executing command: /vip testUser
[20:00] info: [#myChannel] You have added testUser as a vip of this channel.

Thanks

Redis PubSub is a method to send messages between processes.

Sure, thats possible in programming

The bot could also respond to the “x got VIP” message that Chat sends to moderators

Unfortunately, it doesn’t seem that twitch send the same messages to chat when the command is issued from a program. As a mod, I don’t see the “x got VIP” in chat, nor does the user get a message that (s)he has been added as a VIP. However, the user does get VIPed and he/she gets the badge.

If you could point me a command or a topic on how to monitor the messages that go to the logs or terminal, I think my problem is solved.

Thanks again for your time and guidance.

I think your suggestion to use redis is the answer. I had never heard of it before, but I spent a bit of time researching since your message. Thanks for your help. Noops like me would have no idea what we are dong sometimes and help for people like you are a blessing.

Ah I was thinking of moderator pubsub the Moderation Events PubSub Topic instead.

Much nicer than running a relay socket server or something else, which would be abother way.

Theres a load of options to relay tasks between different operations.

I checked my code, and turns out my VIP bot runs two bots in the same script, so they don’t have to redis between the two I just hurl a message inside the program and the program makes to Twitch Chat connections with different key sets.

Thanks for you help. My solution is to connect to the channel from within the same script with both accounts, like you. There were some timing issues with the bot’s connection but by adding setTimeout and closing the connection after each connect, I seem to have solved the problems. Regards

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