added settings
This commit is contained in:
@@ -21,7 +21,7 @@ module.exports = {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (self) { return }
|
||||
if (knownBots.has(userstate.username)) { return }
|
||||
|
||||
@@ -54,7 +54,13 @@ module.exports = {
|
||||
dClient.emit('Command/positivity', channel, userstate, message, self)
|
||||
break;
|
||||
case "commands":
|
||||
dClient.emit('Command/commands', channel, userstate, message, self, args[1], args[2])
|
||||
dClient.emit('Command/commands', channel, userstate, message, self, args[1], args[2])
|
||||
break;
|
||||
case "settings":
|
||||
dClient.emit('Command/settings', channel, userstate, message, self, args[1], args[2])
|
||||
break;
|
||||
case "so":
|
||||
dClient.emit('Command/so', channel, userstate, message, self, args[1])
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { tClient } = require("../..");
|
||||
const { tClient, mClient } = require("../..");
|
||||
const { getChannelInformation } = require("../../functions");
|
||||
|
||||
// Event triggered by Custom Shoutout emitted in Messages.js
|
||||
@@ -9,7 +9,21 @@ module.exports = {
|
||||
name: 'Twitch/Shoutout',
|
||||
once: false,
|
||||
async execute(reason, channel, username) {
|
||||
|
||||
// Check if shoutout is enabled
|
||||
const db = mClient.db('settings')
|
||||
const coll = db.collection(channel)
|
||||
const setting = await coll.findOne({ name: 'shoutout' })
|
||||
|
||||
// create in disabled state if not exists
|
||||
if (!setting) {
|
||||
await coll.insertOne({
|
||||
name: 'shoutout',
|
||||
enabled: false // default
|
||||
})
|
||||
}
|
||||
|
||||
if (!setting?.enabled && reason != 'command' ){ return }
|
||||
|
||||
// Function to perform shoutout (Nightbot or custom)
|
||||
async function doShoutouts(channel, user) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user