SB-6.1-PRE
Ticket Reaction Create
This commit is contained in:
1 parent
358a25f522
commit
70405a1cd0
9 files changed
+27
-96
No files matched your search
@@ -1,2 +0,0 @@
|
||||
|
||||
supportbot-config.yml
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
FROM node:alpine
|
||||
|
||||
MAINTAINER Thien Tran, <contact@thientran.io>
|
||||
|
||||
RUN apk update \
|
||||
&& apk upgrade
|
||||
|
||||
RUN apk add --no-cache git && \
|
||||
adduser -D -h /home/container container
|
||||
|
||||
# Ensure UTF-8
|
||||
ENV LANG en_US.UTF-8
|
||||
ENV LC_ALL en_US.UTF-8
|
||||
|
||||
WORKDIR /home/container
|
||||
|
||||
COPY ./entrypoint.sh /entrypoint.sh
|
||||
CMD ["/bin/ash", "/entrypoint.sh"]
|
||||
@@ -1,7 +0,0 @@
|
||||

|
||||
|
||||
SupportBot the #1 self-hosted discord ticket system with any customizations and features to help make your support system look clean, tidy and professional. It's self-hosted! No need to use someone's public discord bot thats used in a handful of servers. Create, Configure & Use your own discord bot installed with SupportBot.
|
||||
|
||||
### SupportBot Compatibility
|
||||
|
||||
SupportBot is a free & open projected create by Emerald Services, Anything older than version 6.0 we will not SupportBot. Following off that if you have recieved SupportBot from a third-party user we will not provide support no matter what version you are using. It is against of terms of service to sell our product.
|
||||
@@ -7,7 +7,6 @@ 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 (client, reaction, user) => {
|
||||
|
||||
@@ -20,34 +19,17 @@ module.exports = async (client, reaction, user) => {
|
||||
|
||||
if (supportbot.ReactionTickets === "true") {
|
||||
if (reaction.message.id === tickets.ReactionMessage_ID) {
|
||||
switch (reaction.emoji.id) {
|
||||
case supportbot.ReactionEmoji: {
|
||||
await reaction.users.remove(user.id)
|
||||
if (reaction.emoji.name == supportbot.ReactionEmoji || reaction.emoji.id == supportbot.ReactionEmoji) {
|
||||
await reaction.users.remove(user.id)
|
||||
|
||||
try {
|
||||
const cmd = client.commands.get("ticket");
|
||||
if(!cmd) return;
|
||||
|
||||
cmd.execute(message, "undefined");
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (supportbot.Verification === "true") {
|
||||
if (reaction.message.id === verif.verification_msg) {
|
||||
switch (reaction.emoji.id) {
|
||||
case supportbot.VerificationEmoji: {
|
||||
await reaction.users.remove(user.id)
|
||||
|
||||
let r = reaction.message.channel.guild.roles.cache.find(r => r.name === "verified")
|
||||
|
||||
await reaction.message.channel.guild.members.cache.get(user.id).roles.add(r)
|
||||
|
||||
}
|
||||
try {
|
||||
const cmd = client.commands.get("ticket");
|
||||
if(!cmd) return;
|
||||
|
||||
cmd.execute(message, "undefined");
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Executable → Regular
+5
-28
@@ -7,13 +7,14 @@ 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, {
|
||||
type: supportbot.ActvityType
|
||||
|
||||
});
|
||||
|
||||
|
||||
console.log(`\u001b[32m`, `―――――――――――――――――― SupportBot ――――――――――――――――――`)
|
||||
console.log(`\u001b[37m`, `${supportbot.Bot_Name} has successfully connected to discord`)
|
||||
console.log(`\u001b[32m`, `―――――――――――――――――― SupportBot ――――――――――――――――――`)
|
||||
@@ -40,37 +41,13 @@ module.exports = async (bot) => {
|
||||
}
|
||||
let yamlStr = yaml.dump(data);
|
||||
fs.writeFileSync('./storage/ticketreaction.yml', yamlStr, 'utf8');
|
||||
r.react(supportbot.ReactionEmoji)
|
||||
|
||||
r.react(supportbot.ReactionEmoji);
|
||||
}).catch(e => {
|
||||
console.log(e)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
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)
|
||||
})
|
||||
})
|
||||
}
|
||||
};
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"ticket": "ticket-0064",
|
||||
"id":207937608779694080
|
||||
"ticket": "ticket-0005",
|
||||
"id":419821884431925260
|
||||
}
|
||||
@@ -1,5 +1,8 @@
|
||||
{
|
||||
"716992597377286145": {
|
||||
"id": 65
|
||||
},
|
||||
"805909541979029524": {
|
||||
"id": 6
|
||||
}
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
ReactionMessage_ID: '806157017025609728'
|
||||
ReactionMessage_ID: '806191841896169473'
|
||||
+6
-10
@@ -11,11 +11,12 @@
|
||||
|
||||
# General Bot Configuration
|
||||
|
||||
Token: "NjUyNjUzMDU3OTQyODgwMjU2.Xerkhg.dhNMOR_rFyQKvoQJYkGRqZ7fq4E"
|
||||
Token: "BOT_TOKEN"
|
||||
Prefix: "-"
|
||||
Bot_Name: "SupportBot"
|
||||
|
||||
BotActivity: "-help ~ SupportBot 6.0"
|
||||
BotActivity: "-help | SupportBot"
|
||||
|
||||
ActivityType: "PLAYING"
|
||||
# Activity status can either be PLAYING, WATCHING or LISTENING.
|
||||
|
||||
@@ -38,7 +39,7 @@ AutoRole_Role: "Member"
|
||||
LockdownRole: "@everyone"
|
||||
|
||||
Staff: "Staff"
|
||||
Admin: "Administration Team"
|
||||
Admin: "Admin"
|
||||
|
||||
# Ticket Configuration
|
||||
|
||||
@@ -51,14 +52,9 @@ TicketSubject: "description"
|
||||
|
||||
ReactionTickets: "true"
|
||||
ReactionMessage: "React with %reaction_emoji% to create a Support Ticket!"
|
||||
ReactionChannel: "open-a-ticket"
|
||||
ReactionChannel: "create-ticket"
|
||||
ReactionEmoji: "📩"
|
||||
|
||||
Verification: "false"
|
||||
Verification_Channel: "verification"
|
||||
|
||||
VerificationMessage: "React with %VerificationEmoji% to get access to this server!"
|
||||
VerificationEmoji: "✅"
|
||||
# Custom Emojis: <:test:EMOJI_ID>
|
||||
|
||||
Ticket_Thumbnail: "https://images.emojiterra.com/google/android-pie/512px/1f39f.png"
|
||||
Ticket_Title: "Server Support | %ticketusername%"
|
||||
|
||||
Reference in new issue
Block a user