Update 'node/boto.js'

This commit is contained in:
Sarimoko 2022-02-12 04:58:58 +00:00
parent 7321cc9f76
commit fbc5125a8d
1 changed files with 26 additions and 19 deletions

View File

@ -2,8 +2,6 @@
// ================================== // ==================================
// TTV IRC BOT: Sariboto // TTV IRC BOT: Sariboto
// ================================== // ==================================
// !COMMANDS
// ==================================
// TODO: // TODO:
// ================================== // ==================================
// + Add Cooldowns // + Add Cooldowns
@ -32,7 +30,7 @@ const client = new tmi.Client({
client.connect(); client.connect();
// SCAN MSG | START
client.on('message', (channel, tags, message, self) => { client.on('message', (channel, tags, message, self) => {
if(self) return; if(self) return;
const badges = tags.badges || {}; // Scan Badges const badges = tags.badges || {}; // Scan Badges
@ -43,14 +41,11 @@ client.on('message', (channel, tags, message, self) => {
const botUserState = client.userstate[channel]; // MOD Status Check const botUserState = client.userstate[channel]; // MOD Status Check
const amMod = botUserState !== undefined && botUserState.mod === true; // Define Mod Status const amMod = botUserState !== undefined && botUserState.mod === true; // Define Mod Status
// Command Parser if(self || !message.startsWith('!')) return; // Command Parser
if(self || !message.startsWith('!')) return;
// !COMMAND => command
const args = message.slice(1).split(' '); const args = message.slice(1).split(' ');
const command = args.shift().toLowerCase(); const command = args.shift().toLowerCase(); // !COMMAND => command
// !MODS if(isModUp) { // !MODS | START
if(isModUp) {
console.log('Captians Log: MOD used a command...'); // Log for ALL commands Mods use Mod/Sub/General console.log('Captians Log: MOD used a command...'); // Log for ALL commands Mods use Mod/Sub/General
if(command === 'so' || if(command === 'so' ||
command === 'shoutout') { command === 'shoutout') {
@ -64,20 +59,32 @@ client.on('message', (channel, tags, message, self) => {
client.say(channel, `/me Mods cast a 33sec Timeout Curse on @${args.join(' ')}, resistence to Bans is decreased!`); client.say(channel, `/me Mods cast a 33sec Timeout Curse on @${args.join(' ')}, resistence to Bans is decreased!`);
client.say(channel, `!kappagen sarimoRAGE sarimoNERD`); client.say(channel, `!kappagen sarimoRAGE sarimoNERD`);
} }
} } // !MODS | END
// !SUBS if(isSub) { // !SUBS | START
else if(isSub) {
console.log('Captians Log: SUB used a command...'); // Log console.log('Captians Log: SUB used a command...'); // Log
console.log(tags.username, 'is a subscriber'); console.log(tags.username, 'is a subscriber');
} } // !SUBS | END
// General Commands if { // !ALL | START
else {
console.log('LOG: Non-Mod command used!'); console.log('LOG: Non-Mod command used!');
if(command === 'cord' ||
command === 'discord') {
client.say(channel, `/me The Cord by Sarimoko is joinable & sharable at: https://cord.sarimoko.com/`);
} }
else if(command === 'dice' ||
command === 'yahtzee') {
const rollsix = Math.floor(Math.random() * 6) + 1;
client.say(channel, `@${tags.username}, You rolled a ${rollsix}.`);
}
else if(command === 'roll' ||
command === 'rolldie') {
const rolldice = Math.floor(Math.random() * ${args.join(' ')}) + 1;
client.say(channel, `@${tags.username}, You rolled a ${args.join(' ')} sided dice and got a ${rolldice}.`);
}
} // !ALL | END
}); }); // SCAN MSG | END
// TTV Re-Active // TTV Re-Active
// ================================== // ==================================
@ -115,11 +122,11 @@ client.on("raided", (channel, username, viewers) => {
client.say(channel, `!kappagen sarimoRAID sarimoFREEDOM sarimoRAID sarimoFREEDOM sarimoRAID sarimoFREEDOM`); client.say(channel, `!kappagen sarimoRAID sarimoFREEDOM sarimoRAID sarimoFREEDOM sarimoRAID sarimoFREEDOM`);
}); });
client.on("subgift", (channel, username, streakMonths, recipient, methods, userstate) => { client.on("subgift", (channel, username, streakMonths, recipient, methods, userstate) => {
let senderCount = ~~userstate["msg-param-sender-count"]; let senderCount = ~~userstate["msg-param-sender-count"]; // IDK
client.say(channel, `/me Thank you for supporting The Sarimoko Show with Gift-Subs!`); client.say(channel, `/me Thank you for supporting The Sarimoko Show with Gift-Subs!`);
}); });
client.on("submysterygift", (channel, username, numbOfSubs, methods, userstate) => { client.on("submysterygift", (channel, username, numbOfSubs, methods, userstate) => {
let senderCount = ~~userstate["msg-param-sender-count"]; let senderCount = ~~userstate["msg-param-sender-count"]; // IDK
client.say(channel, `/me BLEEP! BLOOP! Am I getting hacked? Anon just Gift-Subbed! If I get erased... I love you all!`); client.say(channel, `/me BLEEP! BLOOP! Am I getting hacked? Anon just Gift-Subbed! If I get erased... I love you all!`);
}); });
client.on("resub", function (channel, username, months, message, userstate, methods) { client.on("resub", function (channel, username, months, message, userstate, methods) {