8.0 Dev 1.2
Reworked configuration files & completed upgrade to V14
This commit is contained in:
1 parent
4e081358ff
commit
4eadef8b65
13 files changed
+373
-79
No files matched your search
@@ -29,14 +29,6 @@ module.exports = new Command({
|
||||
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);
|
||||
|
||||
@@ -28,14 +28,6 @@ module.exports = new Command({
|
||||
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);
|
||||
|
||||
+1
-7
@@ -20,49 +20,43 @@ module.exports = new Command({
|
||||
{
|
||||
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,
|
||||
},
|
||||
|
||||
+3
-3
@@ -60,7 +60,7 @@ module.exports = new Command({
|
||||
const HelpEmbed1 = new Discord.EmbedBuilder()
|
||||
.setTitle(supportbot.General.Name + " Commands")
|
||||
.setThumbnail(interaction.user.displayAvatarURL())
|
||||
.setColor(supportbot.GeneralColour)
|
||||
.setColor(supportbot.Embed.Colours.General)
|
||||
.addFields(
|
||||
{
|
||||
name: "🖥️ General Commands\n",
|
||||
@@ -74,9 +74,9 @@ module.exports = new Command({
|
||||
}
|
||||
)
|
||||
|
||||
.setColor(supportbot.GeneralColour)
|
||||
.setColor(supportbot.Embed.Colours.General)
|
||||
.setFooter({
|
||||
text: supportbot.EmbedFooter,
|
||||
text: supportbot.Embed.Footer,
|
||||
iconURL: interaction.user.displayAvatarURL(),
|
||||
});
|
||||
|
||||
|
||||
+12
-15
@@ -11,6 +11,7 @@ const supportbot = yaml.load(
|
||||
const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
|
||||
|
||||
const Command = require("../Structures/Command.js");
|
||||
const { channel } = require("diagnostics_channel");
|
||||
|
||||
module.exports = new Command({
|
||||
name: cmdconfig.Suggestion.Command,
|
||||
@@ -20,7 +21,6 @@ module.exports = new Command({
|
||||
{
|
||||
name: "suggestion",
|
||||
description: "Create a Suggestion",
|
||||
type: "STRING",
|
||||
type: Discord.ApplicationCommandOptionType.String,
|
||||
required: true,
|
||||
},
|
||||
@@ -30,15 +30,8 @@ module.exports = new Command({
|
||||
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,
|
||||
interaction.guild
|
||||
@@ -54,8 +47,11 @@ module.exports = new Command({
|
||||
let suggestion = interaction.options.getString("suggestion");
|
||||
|
||||
const SuggestEmbed = new Discord.EmbedBuilder()
|
||||
.addField("Suggestion", suggestion, true)
|
||||
.addField("From", `<@${interaction.user.id}>`)
|
||||
.addFields(
|
||||
{ name: "Suggestion", value: suggestion, inline: true},
|
||||
{ name: "From", value: `<@${interaction.user.id}>`},
|
||||
)
|
||||
|
||||
.setThumbnail(interaction.user.displayAvatarURL())
|
||||
.setFooter({
|
||||
text: supportbot.EmbedFooter,
|
||||
@@ -64,6 +60,7 @@ module.exports = new Command({
|
||||
.setColor(supportbot.GeneralColour);
|
||||
|
||||
const suggestionMsg = await suggestChannel.send({ embeds: [SuggestEmbed] });
|
||||
|
||||
if (supportbot.SuggestionUpvote && supportbot.SuggestionDownvote) {
|
||||
await suggestionMsg.react(supportbot.SuggestionUpvote);
|
||||
await suggestionMsg.react(supportbot.SuggestionDownvote);
|
||||
@@ -72,7 +69,7 @@ module.exports = new Command({
|
||||
await suggestionMsg.startThread({
|
||||
name: `Suggestion-releated Thread`,
|
||||
autoArchiveDuration: 60,
|
||||
type: 'GUILD_PUBLIC_THREAD',
|
||||
type: Discord.ChannelType.GuildPublicThread,
|
||||
reason: 'Suggestion-releated thread',
|
||||
})
|
||||
|
||||
@@ -81,10 +78,10 @@ module.exports = new Command({
|
||||
|
||||
const Submitted = new Discord.EmbedBuilder()
|
||||
.setTitle("Suggestion Submitted!")
|
||||
.setDescription(
|
||||
`:white_check_mark: You have successfully submitted a suggestion.`
|
||||
.setDescription(`:white_check_mark: You have successfully submitted a suggestion.`)
|
||||
.addFields(
|
||||
{ name: "Sent to:", value: `<#${suggestChannel.id}>`},
|
||||
)
|
||||
.addField("Sent to:", `<#${suggestChannel.id}>`)
|
||||
.setColor(supportbot.SuccessColour);
|
||||
|
||||
return interaction.reply({
|
||||
|
||||
+18
-18
@@ -11,7 +11,10 @@ const {
|
||||
ApplicationCommandOptionType,
|
||||
ApplicationCommandType,
|
||||
ButtonStyle,
|
||||
InteractionType
|
||||
InteractionType,
|
||||
DiscordAPIError,
|
||||
ChannelType,
|
||||
InteractionCollector
|
||||
} = require("discord.js");
|
||||
|
||||
const yaml = require("js-yaml");
|
||||
@@ -40,13 +43,7 @@ module.exports = new Command({
|
||||
async run(interaction) {
|
||||
let disableCommand = true;
|
||||
|
||||
if (cmdconfig.OpenTicket.Enabled === false) {
|
||||
if (interaction.type === InteractionType.ApplicationCommand && disableCommand)
|
||||
return interaction.reply({
|
||||
content: ":x: This command is `disabled`",
|
||||
ephemeral: true,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
let department = interaction.customId?.split("-")[1] || null;
|
||||
let TicketData = await JSON.parse(
|
||||
@@ -55,6 +52,8 @@ module.exports = new Command({
|
||||
const { getRole, getCategory } = interaction.client;
|
||||
let User = interaction.guild.members.cache.get(interaction.user.id);
|
||||
|
||||
|
||||
|
||||
if (
|
||||
supportbot.MaxAllowedTickets &&
|
||||
TicketData.tickets.filter((t) => t.user === interaction.user.id && t.open)
|
||||
@@ -77,6 +76,7 @@ module.exports = new Command({
|
||||
ephemeral: true,
|
||||
})
|
||||
};
|
||||
|
||||
if (User.roles.cache.has(supportbot.TicketMutedRole)) {
|
||||
return interaction.reply({
|
||||
content: supportbot.TicketMutedMessage,
|
||||
@@ -89,7 +89,7 @@ module.exports = new Command({
|
||||
|
||||
// Ticket Subject
|
||||
const TicketSubject =
|
||||
interaction.options?.getString("reason") || supportbot.NoTicketSubject;
|
||||
interaction.options?.getString("reason") || supportbot.Tickets.Messages.InvalidSubject;
|
||||
|
||||
const TicketExists = new EmbedBuilder()
|
||||
.setTitle("Ticket Exists!")
|
||||
@@ -121,32 +121,32 @@ module.exports = new Command({
|
||||
const ticketChannel = await interaction.guild.channels.create(
|
||||
`${supportbot.TicketPrefix}${ticketNumberID}`,
|
||||
{
|
||||
type: "GUILD_TEXT",
|
||||
type: ChannelType.GuildText,
|
||||
parent: TicketCategory.id,
|
||||
permissionOverwrites: [
|
||||
{
|
||||
id: Admin.id,
|
||||
allow: [Permissions.FLAGS.VIEW_CHANNEL],
|
||||
allow: [PermissionsBitField.Flags.ViewChannel],
|
||||
},
|
||||
{
|
||||
id: interaction.user.id,
|
||||
allow: [Permissions.FLAGS.VIEW_CHANNEL],
|
||||
allow: [PermissionsBitField.Flags.ViewChannel],
|
||||
},
|
||||
{
|
||||
id: interaction.guild.id,
|
||||
deny: [Permissions.FLAGS.VIEW_CHANNEL],
|
||||
deny: [PermissionsBitField.Flags.ViewChannel],
|
||||
},
|
||||
],
|
||||
}
|
||||
);
|
||||
if (supportbot.AllowAllStaff) {
|
||||
await ticketChannel.permissionOverwrites.edit(Staff.id, {
|
||||
VIEW_CHANNEL: true,
|
||||
ViewChannel: true,
|
||||
});
|
||||
}
|
||||
if (!department) {
|
||||
await ticketChannel.permissionOverwrites.edit(interaction.user.id, {
|
||||
SEND_MESSAGES: false,
|
||||
SendMessages: false,
|
||||
});
|
||||
}
|
||||
await TicketData.tickets.push({
|
||||
@@ -281,10 +281,10 @@ module.exports = new Command({
|
||||
let title = supportbot.Departments[num].title;
|
||||
|
||||
await ticketChannel.permissionOverwrites.edit(role.id, {
|
||||
VIEW_CHANNEL: true,
|
||||
ViewChannel: true,
|
||||
});
|
||||
await ticketChannel.permissionOverwrites.edit(interaction.user.id, {
|
||||
SEND_MESSAGES: true,
|
||||
SendMessages: true,
|
||||
});
|
||||
|
||||
await collector.reply({
|
||||
@@ -316,7 +316,7 @@ module.exports = new Command({
|
||||
);
|
||||
let title = supportbot.Departments[department].title;
|
||||
await ticketChannel.permissionOverwrites.edit(role.id, {
|
||||
VIEW_CHANNEL: true,
|
||||
ViewChannel: true,
|
||||
});
|
||||
let TicketCat = await getCategory(
|
||||
supportbot.Departments[department].category,
|
||||
|
||||
Reference in new issue
Block a user