I I am brewing a lot of help with creating a Twitch bot

( I don’t speak English very well. I’m from Germany )

I am doing a Twitch bot but I have no idea how to do a counter, cooldown and a mods only command.
Can anybody help me further. But all in a JavaScript file PS: How can the new followers and new sub or resubs be displayed in the chat? PSS:
And How i can make a 8 Ball Command ?
I see a lot of what I don’t understand but I don’t think so either :frowning:

//The script for the Mod Only Command

client.on(‘message’, (channel, userstate, message, self) => {
if(self) return;
if(message.toLowerCase() === ‘!MODONLY’) {
client.say(channel, " lol Mod only xD")
}
});

//The cooldown script

client.on(‘message’, (channel, userstate, message, self) => {
if(self) return;
if(message.toLowerCase() === ‘!fail’) {
client.say(channel,‘FailFish FailFish Domivie - Seal of Quality Fails! FailFish FailFish’)
}
});

//The script for counters

client.on(‘message’, (channel, userstate, message, self) => {
if(self) return;
if(message.toLowerCase() === ‘!death’) {
client.say(channel, Nidoo is ... died)
}
});

!death [+1]
!deathreset [0]
!deathset […]

//Who can help me or send the finished script?

//And another question

client.on(‘message’, (channel, userstate, message, self) => {
if(self) return;
if(message.toLowerCase() === ‘!followage’) {
client.say(channel, “Gibt es hier noch nicht :(”)
}
});

//And how can you do a followerage command?

//many many thanks in advance

Then the first thing to do in this case is to learn the basics of JavaScript, then you’ll learn the building blocks you need to create the features you desire.

Is a good resource to load some JavaScript basics.

Learn the basics first then you can do something complicated like a bot.

Resubs you can pull from chat via a USERNOTICE message
Followers will involve polling the API or using Webhooks


Depends one your source of Responses, personally I’d create an array of responses and shuffle the array picking one at random from the array.

I wouldn’t bother it’s chat spam and a user can get their own follow date from clicking on their own name. No need to clutter the chat, however

with a from_id and to_id will give the desired data

First you need to decide where you want to store the counters so when you bot restarts, crashes, disconnects, you can reload the counters. From there you build the code to match.

1 Like

How is commenting on a specific suggestion to the OP off-topic?

I’d create an array of responses and shuffle the array picking one at random from the array.

I feel like a parrot:

Randomizing a list does not increase the randomness of a random selection from that list.

Randomize a list when you want several non-repeating items in random order. Pick a random item if you want a random item.

Do what ever you want to do, to determine randomness.

Twice you have stated this, by chiming in with a statement regarding randomness but you are not helping the original poster with their issue(s). You are only complaining at me.

I only make a suggestion as to what you could do to achieve randomness, do whatever you want to do to achieve randomness based on your own criteria

Please take time to add something useful to threads and not to complain about randomness determination

Developers are free to determine how they want to randomize something, I just make a suggestion based on what I like to do to attempt to increase entropy

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