v8.0 - Dev-1
This commit is contained in:
1 parent
6d363abb54
commit
209ec0b435
25 files changed
+598
-501
No files matched your search
@@ -12,7 +12,7 @@ module.exports = new Event("guildMemberAdd", async (client, member, interaction,
|
||||
if (supportbot.Welcome) {
|
||||
const WelcomeChannel = member.guild.channels.cache.find(channel => channel.name === supportbot.WelcomeChannel)
|
||||
|
||||
const WelcomeEmbed = new Discord.MessageEmbed()
|
||||
const WelcomeEmbed = new Discord.EmbedBuilder()
|
||||
.setColor(supportbot.WelcomeColour)
|
||||
.setTitle(supportbot.WelcomeTitle)
|
||||
.setDescription(supportbot.WelcomeMessage.replace(/%joined_user%/g, member.user))
|
||||
|
||||
@@ -12,7 +12,7 @@ module.exports = new Event("guildMemberRemove", async (client, member, interacti
|
||||
if (supportbot.Leave) {
|
||||
const LeaveChannel = member.guild.channels.cache.find(channel => channel.name === supportbot.LeaveChannel)
|
||||
|
||||
const LeaveEmbed = new Discord.MessageEmbed()
|
||||
const LeaveEmbed = new Discord.EmbedBuilder()
|
||||
.setColor(supportbot.LeaveColour)
|
||||
.setTitle(supportbot.LeaveTitle)
|
||||
.setDescription(supportbot.LeaveMessage.replace(/%joined_user%/g, member.user))
|
||||
|
||||
@@ -13,14 +13,14 @@ const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
|
||||
const Event = require("../Structures/Event.js");
|
||||
|
||||
module.exports = new Event("interactionCreate", async (client, interaction) => {
|
||||
if (interaction.isCommand()) {
|
||||
if (interaction.type == Discord.InteractionType.ApplicationCommand) {
|
||||
const command = client.commands.find(
|
||||
(cmd) => cmd.name.toLowerCase() === interaction.commandName
|
||||
);
|
||||
|
||||
if (interaction.user.bot || !interaction.guild) return;
|
||||
|
||||
const NotValid = new Discord.MessageEmbed()
|
||||
const NotValid = new Discord.EmbedBuilder()
|
||||
.setDescription(`:x: \`Invalid Command\` `)
|
||||
.setColor(supportbot.ErrorColour);
|
||||
|
||||
@@ -31,9 +31,9 @@ module.exports = new Event("interactionCreate", async (client, interaction) => {
|
||||
|
||||
const permission = interaction.member.permissions.has(command.permissions);
|
||||
|
||||
const ValidPerms = new Discord.MessageEmbed()
|
||||
const ValidPerms = new Discord.EmbedBuilder()
|
||||
.setDescription(
|
||||
":x: `Invalid Permissions` Do you have the correct permissions to execute this command?"
|
||||
"> :x: `Invalid Permissions` Do you have the correct permissions to execute this command?"
|
||||
)
|
||||
.setColor(supportbot.ErrorColour);
|
||||
|
||||
@@ -109,16 +109,16 @@ module.exports = new Event("interactionCreate", async (client, interaction) => {
|
||||
}
|
||||
);
|
||||
|
||||
const ticketDeleteButton = new Discord.MessageButton()
|
||||
const ticketDeleteButton = new Discord.ButtonBuilder()
|
||||
.setCustomId("ticketclose")
|
||||
.setLabel("Close")
|
||||
.setStyle(supportbot.TicketDeleteColour)
|
||||
.setEmoji(supportbot.TicketDeleteEmoji);
|
||||
|
||||
const row = new Discord.MessageActionRow().addComponents(
|
||||
const row = new Discord.ActionRowBuilder().addComponents(
|
||||
ticketDeleteButton
|
||||
);
|
||||
const ArchiveEmbed = new Discord.MessageEmbed()
|
||||
const ArchiveEmbed = new Discord.EmbedBuilder()
|
||||
.setTitle("Archived")
|
||||
.setDescription(`Archived ${interaction.channel.name}`)
|
||||
.setColor(supportbot.SuccessColour);
|
||||
|
||||
+73
-57
@@ -16,68 +16,76 @@ const Event = require("../Structures/Event.js");
|
||||
|
||||
module.exports = new Event("ready", async (client, interaction) => {
|
||||
const { getRole, getChannel, getCategory } = client;
|
||||
client.user.setActivity(supportbot.BotActivity, {
|
||||
type: supportbot.ActivityType,
|
||||
client.user.setActivity(supportbot.Activity, {
|
||||
type: supportbot.Type,
|
||||
url: supportbot.StreamingURL,
|
||||
});
|
||||
|
||||
console.log(`\u001b[107m`, `――――――――――――――――――――――――――――――――――――――――――――`);
|
||||
console.log(`\u001b[91m`, `┏━━━┓╋╋╋╋╋╋╋╋╋╋╋╋╋┏┓┏━━┓╋╋╋┏┓`);
|
||||
console.log(`\u001b[91m`, `┃┏━┓┃╋╋╋╋╋╋╋╋╋╋╋╋┏┛┗┫┏┓┃╋╋┏┛┗┓`);
|
||||
console.log(`\u001b[91m`, `┃┗━━┳┓┏┳━━┳━━┳━━┳┻┓┏┫┗┛┗┳━┻┓┏┛`);
|
||||
console.log(`\u001b[91m`, `┗━━┓┃┃┃┃┏┓┃┏┓┃┏┓┃┏┫┃┃┏━┓┃┏┓┃┃`);
|
||||
console.log(`\u001b[91m`, `┃┗━┛┃┗┛┃┗┛┃┗┛┃┗┛┃┃┃┗┫┗━┛┃┗┛┃┗┓`);
|
||||
console.log(`\u001b[91m`, `┗━━━┻━━┫┏━┫┏━┻━━┻┛┗━┻━━━┻━━┻━┛`);
|
||||
console.log(`\u001b[91m`, `┗╋╋╋╋╋╋╋┃┃╋┃┃`);
|
||||
console.log(`\u001b[91m`, `╋╋╋╋╋╋╋┗┛╋┗┛`);
|
||||
console.log(`\u001b[32m`, `――――――――――――――――――――――――――――――――――――――――――――`);
|
||||
console.log(` `);
|
||||
console.log(`\u001b[31m`, `┏━━━┓╋╋╋╋╋╋╋╋╋╋╋╋╋┏┓┏━━┓╋╋╋┏┓`);
|
||||
console.log(`\u001b[31m`, `┃┏━┓┃╋╋╋╋╋╋╋╋╋╋╋╋┏┛┗┫┏┓┃╋╋┏┛┗┓`);
|
||||
console.log(`\u001b[31m`, `┃┗━━┳┓┏┳━━┳━━┳━━┳┻┓┏┫┗┛┗┳━┻┓┏┛`);
|
||||
console.log(`\u001b[31m`, `┗━━┓┃┃┃┃┏┓┃┏┓┃┏┓┃┏┫┃┃┏━┓┃┏┓┃┃`);
|
||||
console.log(`\u001b[31m`, `┃┗━┛┃┗┛┃┗┛┃┗┛┃┗┛┃┃┃┗┫┗━┛┃┗┛┃┗┓`);
|
||||
console.log(`\u001b[31m`, `┗━━━┻━━┫┏━┫┏━┻━━┻┛┗━┻━━━┻━━┻━┛`);
|
||||
console.log(`\u001b[31m`, `┗╋╋╋╋╋╋╋┃┃╋┃┃`);
|
||||
console.log(`\u001b[31m`, `╋╋╋╋╋╋╋┗┛╋┗┛`);
|
||||
console.log(` `);
|
||||
console.log(`\u001b[32m`, `――――――――――――――――――――――――――――――――――――――――――――`);
|
||||
console.log(` `);
|
||||
console.log(
|
||||
`\u001b[33m`,
|
||||
`${supportbot.Name} | v${supportbot.SupportBot_Version}`,
|
||||
`\u001b[36m`,
|
||||
`Connected to Discord`
|
||||
`\u001b[31m`,
|
||||
`${supportbot.General.Name} | [${supportbot.SupportBot_Version}]`,
|
||||
`\u001b[32m`,
|
||||
`Connected to Discord`,
|
||||
);
|
||||
|
||||
console.log(`\u001b[31m`, `SupportBot proudly created by Emerald Development`);
|
||||
|
||||
console.log(` `);
|
||||
|
||||
console.log(
|
||||
`\u001b[33m`,
|
||||
`Invite to your server:`,
|
||||
`\u001b[31m`,
|
||||
`Discord`,
|
||||
`\u001b[32m`,
|
||||
`https://dsc.gg/emerald-dev`,
|
||||
);
|
||||
|
||||
console.log(
|
||||
`\u001b[31m`,
|
||||
`Resources`,
|
||||
`\u001b[32m`,
|
||||
`https://emeraldsrv.dev`,
|
||||
);
|
||||
|
||||
console.log(
|
||||
`\u001b[31m`,
|
||||
`Documentation`,
|
||||
`\u001b[32m`,
|
||||
`https://emeraldsrv.dev/wiki`,
|
||||
);
|
||||
|
||||
console.log(
|
||||
`\u001b[31m`,
|
||||
`Third-Party Documentation`,
|
||||
`\u001b[32m`,
|
||||
`https://emeraldsrv.dev/third-party`,
|
||||
);
|
||||
|
||||
console.log(` `);
|
||||
|
||||
console.log(
|
||||
`\u001b[31m`,
|
||||
`Invite URL:`,
|
||||
`\u001b[36m`,
|
||||
`https://discord.com/api/oauth2/authorize?client_id=` +
|
||||
client.user.id +
|
||||
`&permissions=8&scope=bot%20applications.commands`
|
||||
);
|
||||
console.log(
|
||||
`\u001b[33m`,
|
||||
`Resources:`,
|
||||
`\u001b[36m`,
|
||||
`https://emeraldsrv.dev/resources`
|
||||
);
|
||||
console.log(
|
||||
`\u001b[33m`,
|
||||
`Documentation:`,
|
||||
`\u001b[36m`,
|
||||
`https://emeraldsrv.dev/wiki/supportbot`
|
||||
);
|
||||
console.log(
|
||||
`\u001b[33m`,
|
||||
`Discord:`,
|
||||
`\u001b[36m`,
|
||||
`https://emeraldsrv.dev/discord`
|
||||
);
|
||||
console.log(
|
||||
`\u001b[33m`,
|
||||
`Hosting:`,
|
||||
`\u001b[36m`,
|
||||
`https://emeraldsrv.dev/hosting`
|
||||
);
|
||||
|
||||
console.log(` `);
|
||||
console.log(`\u001b[37m`, `SupportBot proudly created by Emerald Services`);
|
||||
console.log(` `);
|
||||
console.log(`\u001b[31m`, `――――――――――――――――――――――――――――――――――――――――――――`);
|
||||
|
||||
|
||||
|
||||
console.log(`\u001b[32m`, `――――――――――――――――――――――――――――――――――――――――――――`);
|
||||
|
||||
const roles = [
|
||||
supportbot.Admin,
|
||||
@@ -121,27 +129,33 @@ module.exports = new Event("ready", async (client, interaction) => {
|
||||
|
||||
if (missingR.length > 0) {
|
||||
console.log(
|
||||
"\u001b[31m",
|
||||
`[MISSING CONFIGURATION]`,
|
||||
"\u001b[33m",
|
||||
`[WARN] The following Roles could not be found! Please check your configs!\n${missingR.join(
|
||||
`The following Roles could not be found in your server.\n`, `\u001b[31m`, `[${missingR.join(
|
||||
", "
|
||||
)}`
|
||||
)}]`, `\n `,
|
||||
);
|
||||
}
|
||||
|
||||
if (missingC.length > 0) {
|
||||
console.log(
|
||||
"\u001b[31m",
|
||||
`[MISSING CONFIGURATION]`,
|
||||
"\u001b[33m",
|
||||
`[WARN] The following Channels could not be found! Please check your configs!\n${missingC.join(
|
||||
`The following Channels could not be found in your server.\n`, `\u001b[31m`, `[${missingC.join(
|
||||
", "
|
||||
)}`
|
||||
)}]`, `\n `
|
||||
);
|
||||
}
|
||||
if (missingCat.length > 0) {
|
||||
console.log(
|
||||
"\u001b[31m",
|
||||
`[MISSING CONFIGURATION]`,
|
||||
"\u001b[33m",
|
||||
`[WARN] The following Categories could not be found! Please check your configs!\n${missingCat.join(
|
||||
`The following Categories could not be found in your server.\n`, `\u001b[31m`, `[${missingCat.join(
|
||||
", "
|
||||
)}`
|
||||
)}]`, `\n `,
|
||||
);
|
||||
}
|
||||
if (panelconfig.TicketPanel) {
|
||||
@@ -152,8 +166,10 @@ module.exports = new Event("ready", async (client, interaction) => {
|
||||
|
||||
if (!chan1) {
|
||||
console.log(
|
||||
"\u001b[31m",
|
||||
`[TICKET PANEL]`,
|
||||
"\u001b[33m",
|
||||
"[WARN] Ticket reaction panel is not setup, You can do so via the configuration file!"
|
||||
"Ticket Panel is not setup, You can set this in", `\u001b[31m`, '/Configs/Ticket-Panel.yml', `\n `,
|
||||
);
|
||||
return false;
|
||||
}
|
||||
@@ -163,7 +179,7 @@ module.exports = new Event("ready", async (client, interaction) => {
|
||||
);
|
||||
|
||||
chan1.messages.fetch(panelid.TicketPanelID).catch(async () => {
|
||||
let embed = new Discord.MessageEmbed()
|
||||
let embed = new Discord.EmbedBuilder()
|
||||
.setTitle(panelconfig.PanelTitle)
|
||||
.setColor(panelconfig.PanelColour)
|
||||
.setFooter({
|
||||
@@ -185,14 +201,14 @@ module.exports = new Event("ready", async (client, interaction) => {
|
||||
let button;
|
||||
|
||||
button = supportbot.Departments.map((x) =>
|
||||
new Discord.MessageButton()
|
||||
new Discord.ButtonBuilder()
|
||||
.setCustomId("department-" + supportbot.Departments.indexOf(x))
|
||||
.setLabel(x.title)
|
||||
.setStyle(x.color)
|
||||
.setEmoji(x.emoji)
|
||||
);
|
||||
|
||||
let row = new Discord.MessageActionRow().addComponents(button);
|
||||
let row = new Discord.ActionRowBuilder().addComponents(button);
|
||||
|
||||
await chan1
|
||||
.send({
|
||||
|
||||
Reference in new issue
Block a user