v8.0-Dev-1.1

This commit is contained in:
ItzEmerald committed 2022-07-23 07:50:12 +01:00
1 parent 209ec0b435
commit 4e081358ff
17 files changed
+256 -99

No files matched your search

+13 -3
View File
@@ -13,8 +13,8 @@ const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
const Command = require("../Structures/Command.js");
module.exports = new Command({
name: cmdconfig.TicketAdd,
description: cmdconfig.TicketAddDesc,
name: cmdconfig.TicketAdd.Command,
description: cmdconfig.TicketAdd.Description,
type: Discord.ApplicationCommandType.ChatInput,
options: [
{
@@ -24,9 +24,19 @@ module.exports = new Command({
required: true,
},
],
permissions: ["SEND_MESSAGES"],
permissions: cmdconfig.TicketAdd.Permission,
async run(interaction) {
let disableCommand = true;
if (cmdconfig.TicketAdd.Enabled === false) {
if (interaction.type === Discord.InteractionType.ApplicationCommand && disableCommand)
return interaction.reply({
content: ":x: This command is `disabled`",
ephemeral: true,
});
}
const { getRole } = interaction.client;
let SupportStaff = await getRole(supportbot.Staff, interaction.guild);
let Admin = await getRole(supportbot.Admin, interaction.guild);
+13 -3
View File
@@ -13,8 +13,8 @@ const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
const Command = require("../Structures/Command.js");
module.exports = new Command({
name: cmdconfig.CloseTicket,
description: cmdconfig.CloseTicketDesc,
name: cmdconfig.CloseTicket.Command,
description: cmdconfig.CloseTicket.Description,
type: Discord.ApplicationCommandType.ChatInput,
options: [
{
@@ -23,9 +23,19 @@ module.exports = new Command({
type: Discord.ApplicationCommandOptionType.String,
},
],
permissions: ["SEND_MESSAGES"],
permissions: cmdconfig.CloseTicket.Permission,
async run(interaction) {
let disableCommand = true;
if (cmdconfig.CloseTicket.Enabled === false) {
if (interaction.type === Discord.InteractionType.ApplicationCommand && disableCommand)
return interaction.reply({
content: ":x: This command is `disabled`",
ephemeral: true,
});
}
const { getRole, getChannel } = interaction.client;
if (supportbot.StaffOnly) {
let SupportStaff = await getRole(supportbot.Staff, interaction.guild);
+13 -3
View File
@@ -13,8 +13,8 @@ const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
const Command = require("../Structures/Command.js");
module.exports = new Command({
name: cmdconfig.EmbedCommand,
description: cmdconfig.EmbedCommandDesc,
name: cmdconfig.Embed.Command,
description: cmdconfig.Embed.Description,
type: Discord.ApplicationCommandType.ChatInput,
options: [
{
@@ -67,9 +67,19 @@ module.exports = new Command({
required: false,
},
],
permissions: ["SEND_MESSAGES"],
permissions: cmdconfig.Embed.Permission,
async run(interaction) {
let disableCommand = true;
if (cmdconfig.Embed.Enabled === false) {
if (interaction.type === Discord.InteractionType.ApplicationCommand && disableCommand)
return interaction.reply({
content: ":x: This command is `disabled`",
ephemeral: true,
});
}
const { getRole } = interaction.client;
let SupportStaff = await getRole(supportbot.Staff, interaction.guild);
let Admin = await getRole(supportbot.Admin, interaction.guild);
+23 -14
View File
@@ -13,13 +13,23 @@ const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
const Command = require("../Structures/Command.js");
module.exports = new Command({
name: cmdconfig.HelpCommand,
description: cmdconfig.HelpCommandDesc,
name: cmdconfig.Help.Command,
description: cmdconfig.Help.Description,
type: Discord.ApplicationCommandType.ChatInput,
options: [],
permissions: ["SEND_MESSAGES"],
permissions: cmdconfig.Help.Permission,
async run(interaction) {
let disableCommand = true;
if (cmdconfig.Help.Enabled === false) {
if (interaction.type === Discord.InteractionType.ApplicationCommand && disableCommand)
return interaction.reply({
content: ":x: This command is `disabled`",
ephemeral: true,
});
}
const { getRole } = interaction.client;
let SupportStaff = await getRole(supportbot.Staff, interaction.guild);
let Admin = await getRole(supportbot.Admin, interaction.guild);
@@ -29,24 +39,23 @@ module.exports = new Command({
);
let botCommands = "";
botCommands += `**/${cmdconfig.HelpCommand}** ${cmdconfig.HelpCommandDesc}\n`;
botCommands += `**/${cmdconfig.InfoCommand}** ${cmdconfig.InfoCommandDesc}\n`;
botCommands += `**/${cmdconfig.PingCommand}** ${cmdconfig.PingCommandDesc}\n`;
botCommands += `**/${cmdconfig.UserInfoCommand}** ${cmdconfig.UserInfoCommandDesc}\n`;
botCommands += ` \`${cmdconfig.Help.Command}\` `;
botCommands += `\`${cmdconfig.Ping.Command}\` `;
botCommands += `\`${cmdconfig.Info.Command}\` `;
if (supportbot.DisableSuggestions === false) {
botCommands += `**/${cmdconfig.SuggestCommand}** ${cmdconfig.SuggestCommandDesc}\n`;
botCommands += `\`${cmdconfig.Suggestion.Command}\` `;
}
let ticketCommands = "";
ticketCommands += `**/${cmdconfig.OpenTicket}** ${cmdconfig.OpenTicketDesc}\n`;
ticketCommands += `**/${cmdconfig.CloseTicket}** ${cmdconfig.CloseTicketDesc}\n`;
ticketCommands += ` \`${cmdconfig.OpenTicket.Command}\` `;
ticketCommands += `\`${cmdconfig.CloseTicket.Command}\` `;
let staffCommands = "";
staffCommands += `**/${cmdconfig.TicketAdd}** ${cmdconfig.TicketAddDesc}\n`;
staffCommands += `**/${cmdconfig.TicketRemove}** ${cmdconfig.TicketRemoveDesc}\n`;
staffCommands += `**/${cmdconfig.UserInfoCommand}** ${cmdconfig.UserInfoCommandDesc}\n`;
staffCommands += `**/${cmdconfig.TranslateCommand}** ${cmdconfig.TranslateCommandDesc}\n`;
staffCommands += ` \`${cmdconfig.TicketAdd.Command}\` `;
staffCommands += `\`${cmdconfig.TicketRemove.Command}\` `;
staffCommands += `\`${cmdconfig.UserInfo.Command}\` `;
staffCommands += `\`${cmdconfig.Translate.Command}\` `;
const HelpEmbed1 = new Discord.EmbedBuilder()
.setTitle(supportbot.General.Name + " Commands")
+26 -17
View File
@@ -13,28 +13,37 @@ const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
const Command = require("../Structures/Command.js");
module.exports = new Command({
name: cmdconfig.InfoCommand,
description: cmdconfig.InfoCommandDesc,
name: cmdconfig.Info.Command,
description: cmdconfig.Info.Description,
options: [],
permissions: ["SEND_MESSAGES"],
permissions: cmdconfig.Info.Permission,
async run(interaction) {
const InfoButton = new Discord.ButtonBuilder()
.setLabel(supportbot.InfoButtonText)
.setURL(supportbot.InfoURL)
.setStyle("Link");
if (cmdconfig.Info.Enabled === false) {
if (interaction.type === Discord.InteractionType.ApplicationCommand && disableCommand)
return interaction.reply({
content: ":x: This command is `disabled`",
ephemeral: true,
});
}
const inforow = new Discord.ActionRowBuilder().addComponents(InfoButton);
const InfoButton = new Discord.ButtonBuilder()
.setLabel(supportbot.InfoButtonText)
.setURL(supportbot.InfoURL)
.setStyle("Link");
const InfoEmbed = new Discord.EmbedBuilder()
.setURL(supportbot.InfoURL)
.setTitle(supportbot.InfoTitle)
.setDescription(supportbot.InfoDesc)
.setColor(supportbot.InfoColour)
const inforow = new Discord.ActionRowBuilder().addComponents(InfoButton);
const InfoEmbed = new Discord.EmbedBuilder()
.setURL(supportbot.InfoURL)
.setTitle(supportbot.InfoTitle)
.setDescription(supportbot.InfoDesc)
.setColor(supportbot.InfoColour)
interaction.reply({
embeds: [InfoEmbed],
components: [inforow],
});
interaction.reply({
embeds: [InfoEmbed],
components: [inforow],
});
},
});
+13 -3
View File
@@ -13,12 +13,22 @@ const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
const Command = require("../Structures/Command.js");
module.exports = new Command({
name: cmdconfig.PingCommand,
description: cmdconfig.PingCommandDesc,
name: cmdconfig.Ping.Command,
description: cmdconfig.Ping.Description,
options: [],
permissions: ["SEND_MESSAGES"],
permissions: cmdconfig.Ping.Permission,
async run(interaction) {
let disableCommand = true;
if (cmdconfig.Ping.Enabled === false) {
if (interaction.type === Discord.InteractionType.ApplicationCommand && disableCommand)
return interaction.reply({
content: ":x: This command is `disabled`",
ephemeral: true,
});
}
const PingEmbed = new Discord.EmbedBuilder()
.setDescription(
`:ping_pong: **Ping:** \`${interaction.client.ws.ping} ms\``
+13 -3
View File
@@ -13,8 +13,8 @@ const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
const Command = require("../Structures/Command.js");
module.exports = new Command({
name: cmdconfig.TicketRemove,
description: cmdconfig.TicketRemoveDesc,
name: cmdconfig.TicketRemove.Command,
description: cmdconfig.TicketRemove.Description,
type: Discord.ApplicationCommandType.ChatInput,
options: [
{
@@ -25,9 +25,19 @@ module.exports = new Command({
required: true,
},
],
permissions: ["SEND_MESSAGES"],
permissions: cmdconfig.TicketRemove.Permission,
async run(interaction) {
let disableCommand = true;
if (cmdconfig.TicketRemove.Enabled === false) {
if (interaction.type === Discord.InteractionType.ApplicationCommand && disableCommand)
return interaction.reply({
content: ":x: This command is `disabled`",
ephemeral: true,
});
}
const { getRole } = interaction.client;
let Staff = await getRole(supportbot.Staff, interaction.guild);
let Admin = await getRole(supportbot.Admin, interaction.guild);
+13 -3
View File
@@ -13,8 +13,8 @@ const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
const Command = require("../Structures/Command.js");
module.exports = new Command({
name: cmdconfig.SuggestCommand,
description: cmdconfig.SuggestCommandDesc,
name: cmdconfig.Suggestion.Command,
description: cmdconfig.Suggestion.Description,
type: Discord.ApplicationCommandType.ChatInput,
options: [
{
@@ -25,9 +25,19 @@ module.exports = new Command({
required: true,
},
],
permissions: ["SEND_MESSAGES"],
permissions: cmdconfig.Suggestion.Permission,
async run(interaction) {
let disableCommand = true;
if (cmdconfig.Suggestion.Enabled === false) {
if (interaction.type === Discord.InteractionType.ApplicationCommand && disableCommand)
return interaction.reply({
content: ":x: This command is `disabled`",
ephemeral: true,
});
}
const { getChannel } = interaction.client;
const suggestChannel = await getChannel(
supportbot.SuggestionChannel,
+15 -10
View File
@@ -4,13 +4,14 @@
const fs = require("fs");
const {
MessageEmbed,
EmbedBuilder,
Permissions,
MessageButton,
MessageActionRow,
ApplicationCommandOptionType,
ApplicationCommandType,
ButtonStyle
ButtonStyle,
InteractionType
} = require("discord.js");
const yaml = require("js-yaml");
@@ -23,8 +24,8 @@ const Command = require("../Structures/Command.js");
const TicketNumberID = require("../Structures/TicketID.js");
module.exports = new Command({
name: cmdconfig.OpenTicket,
description: cmdconfig.OpenTicketDesc,
name: cmdconfig.OpenTicket.Command,
description: cmdconfig.OpenTicket.Description,
type: ApplicationCommandType.ChatInput,
options: [
{
@@ -34,15 +35,19 @@ module.exports = new Command({
},
],
permissions: ["SEND_MESSAGES"],
permissions: cmdconfig.OpenTicket.Permission,
async run(interaction) {
let disableCommand = true;
if (interaction.isCommand() && disableCommand)
if (cmdconfig.OpenTicket.Enabled === false) {
if (interaction.type === InteractionType.ApplicationCommand && disableCommand)
return interaction.reply({
content: "This command is disabled",
content: ":x: This command is `disabled`",
ephemeral: true,
});
}
let department = interaction.customId?.split("-")[1] || null;
let TicketData = await JSON.parse(
fs.readFileSync("./Data/TicketData.json", "utf8")
@@ -86,7 +91,7 @@ module.exports = new Command({
const TicketSubject =
interaction.options?.getString("reason") || supportbot.NoTicketSubject;
const TicketExists = new MessageEmbed()
const TicketExists = new EmbedBuilder()
.setTitle("Ticket Exists!")
.setDescription(supportbot.TicketExists);
@@ -161,7 +166,7 @@ module.exports = new Command({
}
);
const CreatedTicket = new MessageEmbed()
const CreatedTicket = new EmbedBuilder()
.setDescription(
supportbot.TicketCreatedAlert.replace(
/%ticketauthor%/g,
@@ -177,7 +182,7 @@ module.exports = new Command({
await ticketChannel.send(`${interaction.user}`);
}
const TicketMessage = new MessageEmbed()
const TicketMessage = new EmbedBuilder()
.setTitle(
supportbot.Ticket_Title.replace(/%ticketauthor%/g, interaction.user.id)
.replace(/%ticketid%/g, ticketChannel.id)
+12 -3
View File
@@ -16,8 +16,8 @@ const Command = require("../Structures/Command.js");
const translate = require("@vitalets/google-translate-api");
module.exports = new Command({
name: cmdconfig.TranslateCommand, // Name of command
description: cmdconfig.TranslateCommandDesc, // Description of command
name: cmdconfig.Translate.Command,
description: cmdconfig.Translate.Description,
type: Discord.ApplicationCommandType.ChatInput,
options: [
{
@@ -33,9 +33,18 @@ module.exports = new Command({
required: true,
}, // The input text for the translation
],
permissions: ["SEND_MESSAGES"], // The permission the user/role at least requires
permissions: cmdconfig.Translate.Permission, // The permission the user/role at least requires
async run(interaction) {
let disableCommand = true;
if (cmdconfig.Translate.Enabled === false) {
if (interaction.type === Discord.InteractionType.ApplicationCommand && disableCommand)
return interaction.reply({
content: ":x: This command is `disabled`",
ephemeral: true,
});
}
const { getRole } = interaction.client;
let SupportStaff = await getRole(supportbot.Staff, interaction.guild);
+13 -3
View File
@@ -16,8 +16,8 @@ const cmdconfig = yaml.load(
const Command = require("../Structures/Command.js");
module.exports = new Command({
name: cmdconfig.UserInfoCommand, // Name of command
description: cmdconfig.UserInfoCommandDesc, // Description of command
name: cmdconfig.UserInfo.Command,
description: cmdconfig.UserInfo.Description,
type: Discord.ApplicationCommandType.ChatInput,
options: [
{
@@ -27,9 +27,19 @@ module.exports = new Command({
required: true,
}, // The user input
],
permissions: ["SEND_MESSAGES"], // The permission the user/role at least requires
permissions: cmdconfig.UserInfo.Permission,
async run(interaction) {
let disableCommand = true;
if (cmdconfig.UserInfo.Enabled === false) {
if (interaction.type === Discord.InteractionType.ApplicationCommand && disableCommand)
return interaction.reply({
content: ":x: This command is `disabled`",
ephemeral: true,
});
}
const { getRole } = interaction.client;
let SupportStaff = await getRole(supportbot.Staff, interaction.guild);
let Admin = await getRole(supportbot.Admin, interaction.guild);