Skip to content

Commit

Permalink
feat: remove nearly all of the ticket system
Browse files Browse the repository at this point in the history
  • Loading branch information
wdhdev authored Oct 14, 2023
1 parent 80cbe41 commit 7c5b939
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 139 deletions.
20 changes: 0 additions & 20 deletions bot/discord/commands/ticket/add.js

This file was deleted.

12 changes: 0 additions & 12 deletions bot/discord/commands/ticket/downgrade.js

This file was deleted.

14 changes: 0 additions & 14 deletions bot/discord/commands/ticket/help.js

This file was deleted.

65 changes: 1 addition & 64 deletions bot/discord/commands/ticket/new.js
Original file line number Diff line number Diff line change
@@ -1,68 +1,5 @@
const Discord = require("discord.js");

exports.run = async (client, message, args) => {
let category = message.guild.channels.cache.find((c) => c.id === "924757852504096768" && c.type === "category");
if (!category) return;

if (
message.guild.channels.cache.find((ch) =>
ch.name.includes(message.author.username.toLowerCase().replace(" ", "-"))
)
)
return message.reply(`You already have an open ticket.`);

let channel = await message.guild.channels
.create("🎫╏" + message.author.username + "-ticket", "text")

.catch((err) => {
console.log(err);
});

await channel.setParent(category.id).catch(console.error);

setTimeout(() => {
channel.updateOverwrite(message.guild.roles.everyone, {
SEND_MESSAGES: false,
VIEW_CHANNEL: false,
});

channel.updateOverwrite(message.author.id, {
SEND_MESSAGES: true,
VIEW_CHANNEL: true,
READ_MESSAGE_HISTORY: true,
});

channel.updateOverwrite("898041751099539497", {
SEND_MESSAGES: true,
VIEW_CHANNEL: true,
READ_MESSAGE_HISTORY: true,
});
}, 1000);

message.reply(`A ticket has been opened for you, check it out here: ${channel}`);

if (userData.get(message.author.id) == null) {
const embed = new Discord.MessageEmbed()
.setAuthor(`${client.user.username} | Tickets`, client.user.avatarURL())
.setDescription("Please do not ping staff, it will not solve your problem faster.")
.addField(`📡 | Account Info`, `> This account is not linked with a console account.`)
.setColor(message.guild.me.displayHexColor)
.setTimestamp();
channel.send(`${message.author} <@&983825037050142782>`, embed);
} else {
const embed = new Discord.MessageEmbed()
.setAuthor(`${client.user.username} | Tickets`, client.user.avatarURL())
.setDescription(`Please do not ping staff, it will not solve your problem faster.`)
.addField(
`📡 | Account Info`,
`> **Username:** ${userData.fetch(message.author.id + ".username")}\n> **Email:** ||${userData.fetch(
message.author.id + ".email"
)}||\n> **Link Date:** ${userData.fetch(
message.author.id + ".linkDate"
)}\n> **Link Time:** ${userData.fetch(message.author.id + ".linkTime")}`
)
.setColor(message.guild.me.displayHexColor)
.setTimestamp();
channel.send(`${message.author} <@&983825037050142782>`, embed);
}
message.reply("Creating tickets using this bot has been deprecated. Please use the `/open` command on <@748317979971682385>.");
};
15 changes: 0 additions & 15 deletions bot/discord/commands/ticket/remove.js

This file was deleted.

14 changes: 0 additions & 14 deletions bot/discord/commands/ticket/upgrade.js

This file was deleted.

0 comments on commit 7c5b939

Please sign in to comment.