6.1 PRE-0.2
This commit is contained in:
1 parent
b6ccf30ae4
commit
f6d4383ff6
31 files changed
+145
-42
No files matched your search
@@ -0,0 +1,49 @@
|
||||
// SupportBot 6.0, Created by Emerald Services
|
||||
// Message Reaction Event
|
||||
|
||||
const Discord = require("discord.js");
|
||||
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 reacted = [];
|
||||
|
||||
module.exports = async (bot, message) => {
|
||||
|
||||
// Ticket Creation Panel
|
||||
// This is an embed message where users are able to react and a ticket is created in return.
|
||||
|
||||
bot.on('messageReactionAdd', async (reaction, user) => {
|
||||
|
||||
|
||||
if (supportbot.ReactionTickets === "true") {
|
||||
|
||||
|
||||
|
||||
if (reaction.message.id === tickets.ReactionMessage_ID) {
|
||||
|
||||
let user = await reaction.message.guild.members.fetch(user);
|
||||
|
||||
switch (reaction.emoji.id) {
|
||||
case supportbot.ReactionEmoji: {
|
||||
reaction.message.guild.members.fetch(user).then(r => {
|
||||
reaction.users.remove(r.id)
|
||||
});
|
||||
|
||||
|
||||
const cmd = bot.commands.get(supportbot.NewTicket);
|
||||
if(!cmd) return;
|
||||
console.log("1")
|
||||
cmd.execute(bot, message, args);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
};
|
||||
Reference in new issue
Block a user