v8.0 - Dev-1

This commit is contained in:
ItzEmerald committed 2022-07-22 13:19:05 +01:00
1 parent 6d363abb54
commit 209ec0b435
25 files changed
+598 -501

No files matched your search

+7 -6
View File
@@ -15,11 +15,12 @@ const Command = require("../Structures/Command.js");
module.exports = new Command({
name: cmdconfig.TicketAdd,
description: cmdconfig.TicketAddDesc,
type: Discord.ApplicationCommandType.ChatInput,
options: [
{
name: "user",
description: "User to add",
type: "USER",
type: Discord.ApplicationCommandOptionType.User,
required: true,
},
],
@@ -34,7 +35,7 @@ module.exports = new Command({
"Some roles seem to be missing!\nPlease check for errors when starting the bot."
);
const NoPerms = new Discord.MessageEmbed()
const NoPerms = new Discord.EmbedBuilder()
.setTitle("Invalid Permissions!")
.setDescription(
`${supportbot.IncorrectPerms}\n\nRole Required: \`${supportbot.Staff}\` or \`${supportbot.Admin}\``
@@ -54,7 +55,7 @@ module.exports = new Command({
(t) => t.id === interaction.channel.id
);
if (ticket === -1) {
const Exists = new Discord.MessageEmbed()
const Exists = new Discord.EmbedBuilder()
.setTitle("No Ticket Found!")
.setDescription(supportbot.NoValidTicket)
.setColor(supportbot.WarningColour);
@@ -62,7 +63,7 @@ module.exports = new Command({
}
let uMember = interaction.options.getUser("user");
const UserNotExist = new Discord.MessageEmbed()
const UserNotExist = new Discord.EmbedBuilder()
.setTitle("User Not Found!")
.setDescription(
`${supportbot.UserNotFound}\n\nTry Again:\`/${cmdconfig.TicketAdd} <user#0000>\``
@@ -74,11 +75,11 @@ module.exports = new Command({
await interaction.channel.permissionOverwrites.edit(uMember.id, {
VIEW_CHANNEL: true,
});
const Complete = new Discord.MessageEmbed()
const Complete = new Discord.EmbedBuilder()
.setTitle("User Added!")
.setDescription(supportbot.AddedUser.replace(/%user%/g, uMember.id))
.setTimestamp()
.setColor(supportbot.EmbedColour);
.setColor(supportbot.GeneralColour);
interaction.reply({ embeds: [Complete] });
TicketData.tickets[ticket].subUsers.push(uMember.id);
fs.writeFileSync(
+10 -9
View File
@@ -15,11 +15,12 @@ const Command = require("../Structures/Command.js");
module.exports = new Command({
name: cmdconfig.CloseTicket,
description: cmdconfig.CloseTicketDesc,
type: Discord.ApplicationCommandType.ChatInput,
options: [
{
name: "reason",
description: "Ticket Close Reason",
type: "STRING",
type: Discord.ApplicationCommandOptionType.String,
},
],
permissions: ["SEND_MESSAGES"],
@@ -33,7 +34,7 @@ module.exports = new Command({
return interaction.reply(
"Some roles seem to be missing!\nPlease check for errors when starting the bot."
);
const NoPerms = new Discord.MessageEmbed()
const NoPerms = new Discord.EmbedBuilder()
.setTitle("Invalid Permissions!")
.setDescription(
`${supportbot.IncorrectPerms}\n\nRole Required: \`${supportbot.Staff}\` or \`${supportbot.Admin}\``
@@ -55,7 +56,7 @@ module.exports = new Command({
);
let ticket = tickets.tickets[TicketData];
if (TicketData === -1) {
const Exists = new Discord.MessageEmbed()
const Exists = new Discord.EmbedBuilder()
.setTitle("No Ticket Found!")
.setDescription(supportbot.NoValidTicket)
.setColor(supportbot.WarningColour);
@@ -73,12 +74,12 @@ module.exports = new Command({
if (!transcriptChannel || !logChannel)
return interaction.followUp("Some Channels seem to be missing!");
if (supportbot.CloseConfirmation) {
const CloseTicketRequest = new Discord.MessageEmbed()
const CloseTicketRequest = new Discord.EmbedBuilder()
.setTitle(`**${supportbot.ClosingTicket}**`)
.setDescription(
`Please confirm by repeating the following word.. \`${supportbot.ClosingConfirmation_Word}\` `
)
.setColor(supportbot.EmbedColour);
.setColor(supportbot.GeneralColour);
await interaction.followUp({ embeds: [CloseTicketRequest] });
let filter = (m) =>
m.content.toLowerCase() === supportbot.ClosingConfirmation_Word &&
@@ -100,9 +101,9 @@ module.exports = new Command({
}
);
await interaction.followUp(`**${supportbot.ClosingTicket}**`);
const transcriptEmbed = new Discord.MessageEmbed()
const transcriptEmbed = new Discord.EmbedBuilder()
.setTitle(supportbot.TranscriptTitle)
.setColor(supportbot.EmbedColour)
.setColor(supportbot.GeneralColour)
.setFooter({
text: supportbot.EmbedFooter,
iconURL: interaction.user.displayAvatarURL(),
@@ -119,9 +120,9 @@ module.exports = new Command({
)
.addField("Closed By", interaction.user.tag)
.addField("Reason", reason);
const logEmbed = new Discord.MessageEmbed()
const logEmbed = new Discord.EmbedBuilder()
.setTitle(supportbot.TicketLog_Title)
.setColor(supportbot.EmbedColour)
.setColor(supportbot.GeneralColour)
.setFooter({
text: supportbot.EmbedFooter,
iconURL: interaction.user.displayAvatarURL(),
+12 -4
View File
@@ -15,47 +15,55 @@ const Command = require("../Structures/Command.js");
module.exports = new Command({
name: cmdconfig.EmbedCommand,
description: cmdconfig.EmbedCommandDesc,
type: Discord.ApplicationCommandType.ChatInput,
options: [
{
name: "title",
description: "Embed Title",
type: "STRING",
type: Discord.ApplicationCommandOptionType.String,
required: true,
},
{
name: "message",
description: "Embed Message",
type: "STRING",
type: Discord.ApplicationCommandOptionType.String,
required: true,
},
{
name: "color",
description: "Embed HEX Color",
type: "STRING",
type: Discord.ApplicationCommandOptionType.String,
required: false,
},
{
name: "fieldtitle",
description: "Add an additional Embed Field",
type: "STRING",
type: Discord.ApplicationCommandOptionType.String,
required: false,
},
{
name: "fieldcontent",
description: "Add an additional Embed Field",
type: "STRING",
type: Discord.ApplicationCommandOptionType.String,
required: false,
},
{
name: "thumbnail",
description: "Embed Thumbnail URL",
type: "STRING",
type: Discord.ApplicationCommandOptionType.String,
required: false,
},
{
name: "image",
description: "Embed Image URL",
type: "STRING",
type: Discord.ApplicationCommandOptionType.String,
required: false,
},
],
@@ -70,7 +78,7 @@ module.exports = new Command({
return interaction.reply(
"Some roles seem to be missing!\nPlease check for errors when starting the bot."
);
const NoPerms = new Discord.MessageEmbed()
const NoPerms = new Discord.EmbedBuilder()
.setTitle("Invalid Permissions!")
.setDescription(
`${supportbot.IncorrectPerms}\n\nRole Required: \`${supportbot.Staff}\` or \`${supportbot.Admin}\``
@@ -83,16 +91,16 @@ module.exports = new Command({
) {
const EmbedTitle = interaction.options.getString("title");
const EmbedSubject = interaction.options.getString("message");
const EmbedColour = interaction.options.getString("color");
const GeneralColour = interaction.options.getString("color");
const EmbedThumbnail = interaction.options.getString("thumbnail");
const EmbedImage = interaction.options.getString("image");
const EmbedFieldContent = interaction.options.getString("fieldcontent");
const EmbedFieldTitle = interaction.options.getString("fieldtitle");
const EmbedMsg = new Discord.MessageEmbed()
const EmbedMsg = new Discord.EmbedBuilder()
.setTitle(EmbedTitle)
.setDescription(EmbedSubject)
.setColor(EmbedColour)
.setColor(GeneralColour)
.setThumbnail(EmbedThumbnail)
.setImage(EmbedImage)
if (EmbedFieldTitle && EmbedFieldContent) { EmbedMsg.addField(EmbedFieldTitle, EmbedFieldContent) };
+5 -4
View File
@@ -15,6 +15,7 @@ const Command = require("../Structures/Command.js");
module.exports = new Command({
name: cmdconfig.HelpCommand,
description: cmdconfig.HelpCommandDesc,
type: Discord.ApplicationCommandType.ChatInput,
options: [],
permissions: ["SEND_MESSAGES"],
@@ -47,10 +48,10 @@ module.exports = new Command({
staffCommands += `**/${cmdconfig.UserInfoCommand}** ${cmdconfig.UserInfoCommandDesc}\n`;
staffCommands += `**/${cmdconfig.TranslateCommand}** ${cmdconfig.TranslateCommandDesc}\n`;
const HelpEmbed1 = new Discord.MessageEmbed()
.setTitle(supportbot.Name + " Commands")
const HelpEmbed1 = new Discord.EmbedBuilder()
.setTitle(supportbot.General.Name + " Commands")
.setThumbnail(interaction.user.displayAvatarURL())
.setColor(supportbot.GeneralColour)
.addFields(
{
name: "🖥️ General Commands\n",
@@ -64,7 +65,7 @@ module.exports = new Command({
}
)
.setColor(supportbot.EmbedColour)
.setColor(supportbot.GeneralColour)
.setFooter({
text: supportbot.EmbedFooter,
iconURL: interaction.user.displayAvatarURL(),
+7 -6
View File
@@ -19,21 +19,22 @@ module.exports = new Command({
permissions: ["SEND_MESSAGES"],
async run(interaction) {
const InfoButton = new Discord.MessageButton()
const InfoButton = new Discord.ButtonBuilder()
.setLabel(supportbot.InfoButtonText)
.setURL(supportbot.InfoURL)
.setStyle("LINK");
.setStyle("Link");
const inforow = new Discord.MessageActionRow().addComponents(InfoButton);
const inforow = new Discord.ActionRowBuilder().addComponents(InfoButton);
const InfoEmbed = new Discord.MessageEmbed()
const InfoEmbed = new Discord.EmbedBuilder()
.setURL(supportbot.InfoURL)
.setTitle(supportbot.InfoTitle)
.setColor(supportbot.InfoColour);
.setDescription(supportbot.InfoDesc)
.setColor(supportbot.InfoColour)
interaction.reply({
embeds: [InfoEmbed],
components: [inforow],
});
},
});
});
+2 -2
View File
@@ -19,11 +19,11 @@ module.exports = new Command({
permissions: ["SEND_MESSAGES"],
async run(interaction) {
const PingEmbed = new Discord.MessageEmbed()
const PingEmbed = new Discord.EmbedBuilder()
.setDescription(
`:ping_pong: **Ping:** \`${interaction.client.ws.ping} ms\``
)
.setColor(supportbot.EmbedColour);
.setColor(supportbot.GeneralColour);
interaction.reply({
embeds: [PingEmbed],
+7 -5
View File
@@ -15,11 +15,13 @@ const Command = require("../Structures/Command.js");
module.exports = new Command({
name: cmdconfig.TicketRemove,
description: cmdconfig.TicketRemoveDesc,
type: Discord.ApplicationCommandType.ChatInput,
options: [
{
name: "user",
description: "User to remove",
type: "USER",
type: Discord.ApplicationCommandOptionType.User,
required: true,
},
],
@@ -34,7 +36,7 @@ module.exports = new Command({
"Some roles seem to be missing!\nPlease check for errors when starting the bot."
);
const NoPerms = new Discord.MessageEmbed()
const NoPerms = new Discord.EmbedBuilder()
.setTitle("Invalid Permissions!")
.setDescription(
`${supportbot.IncorrectPerms}\n\nRole Required: \`${supportbot.Staff}\` or \`${supportbot.Admin}\``
@@ -53,7 +55,7 @@ module.exports = new Command({
(t) => t.id === interaction.channel.id
);
if (ticket === -1) {
const Exists = new Discord.MessageEmbed()
const Exists = new Discord.EmbedBuilder()
.setTitle("No Ticket Found!")
.setDescription(supportbot.NoValidTicket)
.setColor(supportbot.WarningColour);
@@ -61,7 +63,7 @@ module.exports = new Command({
}
let uMember = interaction.options.getUser("user");
const UserNotExist = new Discord.MessageEmbed()
const UserNotExist = new Discord.EmbedBuilder()
.setTitle("User Not Found!")
.setDescription(
`${supportbot.UserNotFound}\n\nTry Again:\`/${cmdconfig.TicketRemove} <user#0000>\``
@@ -74,11 +76,11 @@ module.exports = new Command({
VIEW_CHANNEL: false,
});
const Complete = new Discord.MessageEmbed()
const Complete = new Discord.EmbedBuilder()
.setTitle("User Removed!")
.setDescription(supportbot.RemovedUser.replace(/%user%/g, uMember.id))
.setTimestamp()
.setColor(supportbot.EmbedColour);
.setColor(supportbot.GeneralColour);
interaction.reply({ embeds: [Complete] });
TicketData.tickets[ticket].subUsers = TicketData.tickets[
ticket
+6 -4
View File
@@ -15,11 +15,13 @@ const Command = require("../Structures/Command.js");
module.exports = new Command({
name: cmdconfig.SuggestCommand,
description: cmdconfig.SuggestCommandDesc,
type: Discord.ApplicationCommandType.ChatInput,
options: [
{
name: "suggestion",
description: "Create a Suggestion",
type: "STRING",
type: Discord.ApplicationCommandOptionType.String,
required: true,
},
],
@@ -32,7 +34,7 @@ module.exports = new Command({
interaction.guild
);
const NoChannel = new Discord.MessageEmbed()
const NoChannel = new Discord.EmbedBuilder()
.setTitle("Missing Channel!")
.setDescription(supportbot.InvalidChannel)
.setColor(supportbot.ErrorColour);
@@ -41,7 +43,7 @@ module.exports = new Command({
let suggestion = interaction.options.getString("suggestion");
const SuggestEmbed = new Discord.MessageEmbed()
const SuggestEmbed = new Discord.EmbedBuilder()
.addField("Suggestion", suggestion, true)
.addField("From", `<@${interaction.user.id}>`)
.setThumbnail(interaction.user.displayAvatarURL())
@@ -49,7 +51,7 @@ module.exports = new Command({
text: supportbot.EmbedFooter,
iconURL: interaction.user.displayAvatarURL(),
})
.setColor(supportbot.EmbedColour);
.setColor(supportbot.GeneralColour);
const suggestionMsg = await suggestChannel.send({ embeds: [SuggestEmbed] });
if (supportbot.SuggestionUpvote && supportbot.SuggestionDownvote) {
@@ -67,7 +69,7 @@ module.exports = new Command({
}
}
const Submitted = new Discord.MessageEmbed()
const Submitted = new Discord.EmbedBuilder()
.setTitle("Suggestion Submitted!")
.setDescription(
`:white_check_mark: You have successfully submitted a suggestion.`
+11 -5
View File
@@ -8,7 +8,11 @@ const {
Permissions,
MessageButton,
MessageActionRow,
ApplicationCommandOptionType,
ApplicationCommandType,
ButtonStyle
} = require("discord.js");
const yaml = require("js-yaml");
const supportbot = yaml.load(
fs.readFileSync("./Configs/supportbot.yml", "utf8")
@@ -21,12 +25,14 @@ const TicketNumberID = require("../Structures/TicketID.js");
module.exports = new Command({
name: cmdconfig.OpenTicket,
description: cmdconfig.OpenTicketDesc,
type: ApplicationCommandType.ChatInput,
options: [
{
name: "reason",
description: "Ticket Reason",
type: "STRING",
type: ApplicationCommandOptionType.String,
},
],
permissions: ["SEND_MESSAGES"],
@@ -164,7 +170,7 @@ module.exports = new Command({
.replace(/%ticketid%/g, ticketChannel.id)
.replace(/%ticketusername%/g, interaction.user.username)
)
.setColor(supportbot.EmbedColour);
.setColor(supportbot.GeneralColour);
await interaction.reply({ embeds: [CreatedTicket], ephemeral: true });
if (supportbot.AllowTicketMentions) {
@@ -182,7 +188,7 @@ module.exports = new Command({
.replace(/%ticketid%/g, ticketChannel.id)
.replace(/%ticketusername%/g, interaction.user.username)
)
.setColor(supportbot.EmbedColour);
.setColor(supportbot.GeneralColour);
if (supportbot.TicketSubject === "embed") {
if (TicketSubject !== "No Reason Provided.") {
@@ -280,7 +286,7 @@ module.exports = new Command({
embeds: [
{
description: `> Thank for reaching out to the **${title} Department**. Please provide us information regarding your query.`,
color: supportbot.EmbedColour,
color: supportbot.GeneralColour,
},
],
});
@@ -317,7 +323,7 @@ module.exports = new Command({
embeds: [
{
description: `> Thank for reaching out to the **${title} Department**. Please provide us information regarding your query.`,
color: supportbot.EmbedColour,
color: supportbot.GeneralColour,
},
],
});
+6 -5
View File
@@ -18,15 +18,16 @@ const translate = require("@vitalets/google-translate-api");
module.exports = new Command({
name: cmdconfig.TranslateCommand, // Name of command
description: cmdconfig.TranslateCommandDesc, // Description of command
type: Discord.ApplicationCommandType.ChatInput,
options: [
{
type: "STRING",
type: Discord.ApplicationCommandOptionType.String,
name: "language",
description: "A 2 letter language code",
required: true,
},
{
type: "STRING",
type: Discord.ApplicationCommandOptionType.String,
name: "text",
description: "The text to translate",
required: true,
@@ -44,7 +45,7 @@ module.exports = new Command({
"Some roles seem to be missing!\nPlease check the error logs."
);
const NoPerms = new Discord.MessageEmbed()
const NoPerms = new Discord.EmbedBuilder()
.setTitle("Invalid Permissions!")
.setDescription(
`${supportbot.IncorrectPerms}\n\nRole Required: \`${supportbot.Staff}\` or \`${supportbot.Admin}\``
@@ -72,7 +73,7 @@ module.exports = new Command({
if (err && err.code == 400) {
await interaction.reply({
embeds: [
new Discord.MessageEmbed()
new Discord.EmbedBuilder()
.setColor(supportbot.WarningColour)
.setTitle("Valid Language Codes")
.setURL(url)
@@ -87,7 +88,7 @@ module.exports = new Command({
if (!result) return;
// Embed containing language code, original text and translated text
let transembed = new Discord.MessageEmbed()
let transembed = new Discord.EmbedBuilder()
.setAuthor({ name: interaction.user.tag, iconURL: interaction.user.displayAvatarURL({ dynamic: true }) })
.setColor(supportbot.SuccessColour)
.setDescription(`**Translation to ${lang}**`)
+5 -4
View File
@@ -18,9 +18,10 @@ const Command = require("../Structures/Command.js");
module.exports = new Command({
name: cmdconfig.UserInfoCommand, // Name of command
description: cmdconfig.UserInfoCommandDesc, // Description of command
type: Discord.ApplicationCommandType.ChatInput,
options: [
{
type: "USER",
type: Discord.ApplicationCommandOptionType.User,
name: "user",
description: "The user you want to get info about.",
required: true,
@@ -37,7 +38,7 @@ module.exports = new Command({
"Some roles seem to be missing!\nPlease check the error logs."
);
const NoPerms = new Discord.MessageEmbed()
const NoPerms = new Discord.EmbedBuilder()
.setTitle("Invalid Permissions!")
.setDescription(
`${supportbot.IncorrectPerms}\n\nRole Required: \`${supportbot.Staff}\` or \`${supportbot.Admin}\``
@@ -53,7 +54,7 @@ module.exports = new Command({
let user = await interaction.options.getUser("user") || interaction.author; // Grab the mentioned user
let member = await interaction.guild.members.cache.get(user.id) // Check for user and his ID
const UserNotExist = new Discord.MessageEmbed()
const UserNotExist = new Discord.EmbedBuilder()
.setTitle("User Not Found!")
.setDescription(
`${supportbot.UserNotFound}\n\nTry Again:\`/${cmdconfig.UserInfoCommand} <@!User_ID> or @User\``
@@ -90,7 +91,7 @@ module.exports = new Command({
const userFlags = user.flags.toArray();
// Embed containing the userinfo
let userembed = new Discord.MessageEmbed()
let userembed = new Discord.EmbedBuilder()
.setTitle(`User Info for User: ${user.tag}`)
.setThumbnail(member.displayAvatarURL({ dynamic: true, size: 512 }))
.setColor(member.roles.highest.hexColor)