Fixed the 'setup announcement_role' command and added the 'twitchnotifs.js' file

This commit is contained in:
ION606
2022-09-13 10:57:53 -04:00
parent 27fecfffcb
commit d3f2085813
2 changed files with 78 additions and 67 deletions
+7
View File
@@ -27,6 +27,7 @@ async function execute(bot, message, args, command, Discord, mongouri, items, xp
bot.mongoconnection.then(async (client) => { bot.mongoconnection.then(async (client) => {
// if (err) { return console.log(err); } // if (err) { return console.log(err); }
try {
//Initialize //Initialize
CreateNewCollection(message, client, server, owner.user.id); CreateNewCollection(message, client, server, owner.user.id);
@@ -79,6 +80,9 @@ async function execute(bot, message, args, command, Discord, mongouri, items, xp
dbo.updateOne({_id: 'LOG'}, {$set: {severity: tier}}) dbo.updateOne({_id: 'LOG'}, {$set: {severity: tier}})
} else if (command == 'announcement_role') { } else if (command == 'announcement_role') {
if (message.mentions.roles.first() == undefined) {
return message.reply("Please mention a role (_!setup announcement\\_role **@role**_)\n_Note: Selmer Bot does NOT ping the @everyone role_");
}
const role = message.mentions.roles.first().id; const role = message.mentions.roles.first().id;
dbo.updateOne({_id: 'announcement'}, { $set: { 'role': role } }); dbo.updateOne({_id: 'announcement'}, { $set: { 'role': role } });
} else if (command == "announcement_channel") { } else if (command == "announcement_channel") {
@@ -101,6 +105,9 @@ async function execute(bot, message, args, command, Discord, mongouri, items, xp
message.reply(temp); message.reply(temp);
} }
} catch (err) {
console.error(err);
}
}); });
} }
+4
View File
@@ -0,0 +1,4 @@
/* TODO
1) Save by streamer id, with the users to ping inside
2) Check the streamers every 5 min or so
*/