Boto/node/boto.js

130 lines
4.7 KiB
JavaScript
Raw Normal View History

2022-02-09 06:55:26 +00:00
const tmi = require('tmi.js');
require('dotenv').config();
console.log(process.env.API_HOST);
const client = new tmi.Client({
options: { debug: true },
connection: {
secure: true,
reconnect: true
},
identity: {
username: process.env.TTV_BOT_USERNAME,
password: process.env.TTV_BOT_OAUTH
},
channels: [ process.env.TTV_CHANNELS ]
});
client.connect();
client.on('message', (channel, tags, message, self) => {
if(self) return;
const badges = tags.badges || {};
const isBroadcaster = badges.broadcaster;
const isMod = badges.moderator;
const isModUp = isBroadcaster || isMod;
});
2022-02-10 01:38:27 +00:00
2022-02-10 01:24:35 +00:00
// TODO:
// + Add Cooldowns
// + Add Mod vs Streamer vs Viewer vs Sub control
// + Turn BOTO into join userchannel_db & make botoff to rm_userchannel_db
2022-02-10 01:38:27 +00:00
// + Timed
// + B-Day Calc
// +
// +
2022-02-09 06:55:26 +00:00
client.on('message', (channel, tags, message, self) => {
if(self || !message.startsWith('!')) return;
const args = message.slice(1).split(' ');
const command = args.shift().toLowerCase();
const botUserState = client.userstate[channel];
const amMod = botUserState !== undefined && botUserState.mod === true;
2022-02-10 01:38:27 +00:00
2022-02-10 00:33:41 +00:00
// B E T A
// ==================================
2022-02-09 06:55:26 +00:00
// The Boto
2022-02-10 01:24:35 +00:00
// ----------------------------------
2022-02-09 06:55:26 +00:00
if(command === 'boto' || command === 'sariboto' || command === 'sari-boto') {
2022-02-10 01:38:27 +00:00
client.say(channel, `/me Bleep! Bloop! Twitch IRC connected... LETS PARTY!!!`);
2022-02-09 06:55:26 +00:00
client.say(channel, `!kappagen imGlitch EarthDay imGlitch EarthDay imGlitch`);
}
2022-02-10 00:33:41 +00:00
// The Echo
2022-02-10 01:24:35 +00:00
// ----------------------------------
2022-02-10 00:33:41 +00:00
else if(command === 'echo') {
2022-02-10 00:07:38 +00:00
client.say(channel, `/me Off in the distance @${tags.username} screams...`);
client.say(channel, `" ${args.join(' ')} ${args.join(' ')} ${args.join(' ')} ${args.join(' ')} ${args.join(' ')} " can be heard to all those around!`);
}
2022-02-10 00:33:41 +00:00
// T H E S H O W
// ==================================
// Being Raided
2022-02-10 01:24:35 +00:00
// ----------------------------------
2022-02-10 01:38:27 +00:00
else if(command === 'raid' || command === 'raided') {
2022-02-10 00:33:41 +00:00
client.say(channel, `!kappagen sarimoRAID sarimoFREEDOM sarimoRAID sarimoFREEDOM sarimoRAID sarimoFREEDOM`);
2022-02-10 01:12:49 +00:00
client.say(channel, `/me Did @${tags.username} say RAID!?! I believe ${args.join(' ')}, was mentioned as well!`);
2022-02-10 00:33:41 +00:00
}
// Raiding Someone
2022-02-10 01:24:35 +00:00
// ----------------------------------
2022-02-10 01:38:27 +00:00
else if(command === 'raidcall' || command === 'spam' || command === 'spamwars') {
2022-02-10 01:12:49 +00:00
client.say(channel, `!kappagen sarimoRAID sarimoFREEDOM sarimoRAID sarimoFREEDOM sarimoRAID sarimoFREEDOM`);
client.say(channel, `/me Thanks everyone for watching!!! PREPARE TO SPAM!`);
client.say(channel, `/me Copy'n'Paste the following:`);
client.say(channel, `sarimoRAID sarimoFREEDOM You may take us viewers, but you'll NEVER take our FREEDOM!`);
2022-02-10 00:33:41 +00:00
}
// K A P P A
// ==================================
2022-02-10 00:07:38 +00:00
// FX | Hi
2022-02-10 01:24:35 +00:00
// ----------------------------------
2022-02-10 01:38:27 +00:00
else if(command === 'hi' || command === 'hello' || command === 'welcome' || command === 'greeting' || command === 'greetings') {
2022-02-10 00:07:38 +00:00
client.say(channel, `!kappagen HeyGuys bleedPurple HeyGuys bleedPurple HeyGuys`);
2022-02-10 01:12:49 +00:00
client.say(channel, `/me Hi Hello Howdy Hola こんにちは Oi 你好 여보세요 Здравствуйте Bonjour Hej Hiya Heyo Yo`);
}
// FX | Hi
2022-02-10 01:24:35 +00:00
// ----------------------------------
2022-02-10 01:38:27 +00:00
else if(command === 'sup' || command === 'whatsup' || command === 'sups' || command === 'wazzup' || command === 'soup' || command === 'soups') {
2022-02-10 01:12:49 +00:00
client.say(channel, `!kappagen sarimoTRIP sarimoSOUP sarimoTRIP sarimoSOUP sarimoTRIP sarimoSOUP `);
client.say(channel, `/me Yo @${tags.username}, how goes it?`);
2022-02-10 00:07:38 +00:00
}
2022-02-10 00:33:41 +00:00
// FX | Salt
2022-02-10 01:24:35 +00:00
// ----------------------------------
2022-02-10 01:38:27 +00:00
else if(command === 'salt' || command === 'yoho' || command === 'rage' || command === 'rip' || command === 'sassy' || command === 'salty' || command === 'bitter') {
2022-02-10 00:33:41 +00:00
client.say(channel, `!kappagen PJSalt PanicVis PJSalt WutFace PJSalt PunOko PJSalt BabyRage PJSalt`);
}
// G E N E R A L
// ==================================
// Uptime
2022-02-10 01:24:35 +00:00
// ----------------------------------
// if(commandName === 'uptime') {
// let timestamp = new Date(body.stream.created_at).getTime();
// uptime = countdown(timestamp, Date.now(), 158);
// reply(uptime);
//}
2022-02-10 00:33:41 +00:00
// The 2Pac Timezone
2022-02-10 01:24:35 +00:00
// ----------------------------------
2022-02-10 00:33:41 +00:00
else if(command === '2pac' || command === 'pst' || command === 'timezone') {
2022-02-09 06:55:26 +00:00
client.say(channel, `/me Off in the distance @${tags.username} screams...`);
client.say(channel, `" ${args.join(' ')} ${args.join(' ')} ${args.join(' ')} ${args.join(' ')} ${args.join(' ')} " can be heard to all those around!`);
}
2022-02-10 00:33:41 +00:00
2022-02-09 06:55:26 +00:00
2022-02-10 00:33:41 +00:00
// E R R O R S
// ==================================
2022-02-09 06:55:26 +00:00
// NOT FOUND FUNCTION
else {
2022-02-10 01:38:27 +00:00
client.say(channel, `/me Bleep! Bloop! Error! Sorry, @${tags.username} hopefully SE/SL/Nitebot has ya covered...);
2022-02-09 06:55:26 +00:00
}
});