-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: remove nearly all of the ticket system
- Loading branch information
Showing
6 changed files
with
1 addition
and
139 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>."); | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.