SB-6.1-PRE

This commit is contained in:
ItzEmerald committed 2021-02-02 13:50:53 +00:00
1 parent 690169a409
commit 358a25f522
3760 files changed
+300059 -36

No files matched your search

+27 -1
View File
@@ -7,7 +7,7 @@ const fs = require("fs");
const yaml = require('js-yaml');
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
const tickets = yaml.load(fs.readFileSync('./storage/ticketreaction.yml', 'utf8'));
const verif = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
module.exports = async (bot) => {
bot.user.setActivity(supportbot.BotActivity, {
@@ -47,4 +47,30 @@ module.exports = async (bot) => {
})
}
if (supportbot.Verification === "true") {
let chan2 = bot.channels.cache.find(channel => channel.name === supportbot.Verification_Channel)
if (!chan2) {
console.log('\u001b[33m', "[WARN] Verification Reaction panel is not setup, You can do so via the configuration file!")
return false;
}
chan2.messages.fetch(verif.verification_msg).catch(r => {
let embed = new Discord.MessageEmbed()
.setTitle(supportbot.VerificationMessage.replace(/%VerificationEmoji%/g, supportbot.VerificationEmoji))
.setColor(supportbot.EmbedColour)
.setFooter(supportbot.EmbedFooter);
bot.channels.cache.find(channel => channel.name === supportbot.Verification_Channel).send({embed: embed}).then(r => {
let data = {
"verification_msg": `${r.id}`
}
let yamlStr = yaml.dump(data);
fs.writeFileSync('./storage/verification.yml', yamlStr, 'utf8');
r.react(supportbot.VerificationEmoji)
}).catch(e => {
console.log(e)
})
})
}
};