diff --git a/node/autoban.js b/node/autoban.js index 0c6a644..ca0eff2 100644 --- a/node/autoban.js +++ b/node/autoban.js @@ -3,11 +3,13 @@ const tmi = require('tmi.js'); const colors = require('colors'); const config = require("./db/lurk_bots"); -// Define DB pull -const {banlist} = lurk_bots +console.log(`ANTI / Lurk Bots`.black.bgBrightRed); +console.log(`v 0.1 | BETA`.black.bgBrightRed); -console.log(process.env.API_HOST); +console.log(`Loading... | Lurk Bot DB`.black.bgGreen); +const {botlist} = lurk_bots +console.log(`Loading... | Setting from .env file`.black.bgGreen); const client = new tmi.Client({ options: { debug: true }, connection: { @@ -21,7 +23,23 @@ const client = new tmi.Client({ channels: [ process.env.TTV_STREAMER_CHANNEL ] }); +console.log(`Loading... | TTV IRC Login`.black.bgGreen); client.connect(); +console.log(`Loading... | Chatbot`.black.bgGreen); +client.on('message', (channel, tags, message, self) => { + if(botlist) return; + const badges = tags.badges || {}; // Scan Badges + const isBroadcaster = badges.broadcaster; // Define Streamer + const isMod = badges.moderator; // Define Mod + const isModUp = isBroadcaster || isMod; // Permission Merge = Mod+Streamer + const isSub = badges.subscriber || badges.founder; // Define Subs + const botUserState = client.userstate[channel]; // MOD Status Check + const amMod = botUserState !== undefined && botUserState.mod === true; // Define Mod Status + if(self || !message.startsWith('!')) return; // Command Parser + const args = message.slice(1).split(' '); + const command = args.shift().toLowerCase(); // !COMMAND => command -// Ban function \ No newline at end of file +// Ban function + +console.log(process.env.API_HOST); \ No newline at end of file