Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d282a516e6 | ||
|
|
9638179d45 | ||
|
|
30d45ddc39 | ||
|
|
2c08ca7245 | ||
|
|
3d5b1f6e8d | ||
|
|
edc8d4bc44 | ||
|
|
c57507cea9 | ||
|
|
ace46deb52 | ||
|
|
fc09858f92 |
@@ -1,8 +1,13 @@
|
|||||||
### large announcement:
|
## We need translators!
|
||||||
[](https://www.dj-dj.be/projects/open-moderation)
|
If you know a language that isn't already in open ticket and you can write json,
|
||||||
|
then is this the job for you!
|
||||||
|
|
||||||
|
make a ticket in our server to start!
|
||||||
|
|
||||||
|
*if you translate, you will come in the credits*
|
||||||
|
|
||||||
# open-ticket
|
# open-ticket
|
||||||
[](https://discord.com/invite/26vT9wt3n3) [](https://github.com/DJj123dj/open-ticket/releases/tag/v2.1.2) [](#packages) [](https://github.com/DJj123dj/open-ticket/blob/main/LICENSE)
|
[](https://discord.com/invite/26vT9wt3n3) [](https://github.com/DJj123dj/open-ticket/releases/tag/v2.3.1) [](#packages) [](https://github.com/DJj123dj/open-ticket/blob/main/LICENSE)
|
||||||
|
|
||||||
This is an open-source discord ticket bot, you can configure it and it comes with cool features like transcripts & custom options!
|
This is an open-source discord ticket bot, you can configure it and it comes with cool features like transcripts & custom options!
|
||||||
|
|
||||||
@@ -14,6 +19,8 @@ This is an open-source discord ticket bot, you can configure it and it comes wit
|
|||||||
- DJ-Lite: for doing the administration
|
- DJ-Lite: for doing the administration
|
||||||
- Sanke: for translation & new ideas
|
- Sanke: for translation & new ideas
|
||||||
- ExothDE: for translation
|
- ExothDE: for translation
|
||||||
|
- 1x1: for translation
|
||||||
|
- R0JO: for translation
|
||||||
- Everyone that reported a bug
|
- Everyone that reported a bug
|
||||||
|
|
||||||
## features
|
## features
|
||||||
@@ -35,6 +42,9 @@ This is an open-source discord ticket bot, you can configure it and it comes wit
|
|||||||
## installation
|
## installation
|
||||||
**You need `node.js 16` to run this project!**
|
**You need `node.js 16` to run this project!**
|
||||||
|
|
||||||
|
**At this moment you still need discord.js v13!**
|
||||||
|
This will change soon!
|
||||||
|
|
||||||
You can clone or download this project.
|
You can clone or download this project.
|
||||||
|
|
||||||
### packages
|
### packages
|
||||||
@@ -52,7 +62,7 @@ if there are any errors, you can open an **issue on github** or **contact me in
|
|||||||
|
|
||||||
### config
|
### config
|
||||||
Our config documentation is moved to another file:
|
Our config documentation is moved to another file:
|
||||||
[click here to view](https://www.github.com/DJj123dj/open-ticket/wiki/config-v2.1.2)
|
[click here to view](https://www.github.com/DJj123dj/open-ticket/wiki/config-v2.3.1)
|
||||||
|
|
||||||
### intents & permissions
|
### intents & permissions
|
||||||
In the discord developer portal in the "bot" panel you will find 3 switches under the title "Gateaway Intents". The following switches should always be turned on
|
In the discord developer portal in the "bot" panel you will find 3 switches under the title "Gateaway Intents". The following switches should always be turned on
|
||||||
@@ -64,8 +74,11 @@ You can also configure your own permissions
|
|||||||
|
|
||||||
## information
|
## information
|
||||||
|
|
||||||
_v2.1.2 stable_
|
_v2.3.1 stable_
|
||||||
|
|
||||||
changelog: [click here](https://www.github.com/DJj123dj/open-ticket/wiki/Changelog)
|
changelog: [click here](https://www.github.com/DJj123dj/open-ticket/wiki/Changelog)
|
||||||
|
|
||||||
© 2022 - DJdj Development | [website](https://www.dj-dj.be) | [discord](https://discord.com/invite/26vT9wt3n3)
|
© 2022 - DJdj Development | [website](https://www.dj-dj.be) | [discord](https://discord.com/invite/26vT9wt3n3)
|
||||||
|
|
||||||
|
### large announcement:
|
||||||
|
[](https://www.dj-dj.be/projects/open-moderation)
|
||||||
+1
-2
@@ -31,7 +31,7 @@ module.exports = () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
client.on("interactionCreate",(interaction) => {
|
client.on("interactionCreate",(interaction) => {
|
||||||
if (!interaction.isCommand()) return
|
if (!interaction.isChatInputCommand()) return
|
||||||
if (interaction.commandName != "add") return
|
if (interaction.commandName != "add") return
|
||||||
const user = interaction.options.getUser("user")
|
const user = interaction.options.getUser("user")
|
||||||
|
|
||||||
@@ -41,7 +41,6 @@ module.exports = () => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
interaction.channel.messages.fetchPinned().then(msglist => {
|
interaction.channel.messages.fetchPinned().then(msglist => {
|
||||||
var firstmsg = msglist.last()
|
var firstmsg = msglist.last()
|
||||||
|
|
||||||
|
|||||||
+7
-7
@@ -15,12 +15,12 @@ module.exports = () => {
|
|||||||
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return msg.channel.send({embeds:[bot.errorLog.notInATicket]})
|
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return msg.channel.send({embeds:[bot.errorLog.notInATicket]})
|
||||||
|
|
||||||
const closebutton = new discord.MessageActionRow()
|
const closebutton = new discord.ActionRowBuilder()
|
||||||
.addComponents([
|
.addComponents([
|
||||||
new discord.MessageButton()
|
new discord.ButtonBuilder()
|
||||||
.setCustomId("closeTicketTrue1")
|
.setCustomId("closeTicketTrue1")
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setStyle("SECONDARY")
|
.setStyle(discord.ButtonStyle.Secondary)
|
||||||
.setEmoji("🔒")
|
.setEmoji("🔒")
|
||||||
])
|
])
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ module.exports = () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
client.on("interactionCreate",(interaction) => {
|
client.on("interactionCreate",(interaction) => {
|
||||||
if (!interaction.isCommand()) return
|
if (!interaction.isChatInputCommand()) return
|
||||||
if (interaction.commandName != "close") return
|
if (interaction.commandName != "close") return
|
||||||
|
|
||||||
interaction.channel.messages.fetchPinned().then(msglist => {
|
interaction.channel.messages.fetchPinned().then(msglist => {
|
||||||
@@ -42,12 +42,12 @@ module.exports = () => {
|
|||||||
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return interaction.reply({embeds:[bot.errorLog.notInATicket]})
|
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return interaction.reply({embeds:[bot.errorLog.notInATicket]})
|
||||||
|
|
||||||
const closebutton = new discord.MessageActionRow()
|
const closebutton = new discord.ActionRowBuilder()
|
||||||
.addComponents([
|
.addComponents([
|
||||||
new discord.MessageButton()
|
new discord.ButtonBuilder()
|
||||||
.setCustomId("closeTicketTrue1")
|
.setCustomId("closeTicketTrue1")
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setStyle("SECONDARY")
|
.setStyle(discord.ButtonStyle.Secondary)
|
||||||
.setEmoji("🔒")
|
.setEmoji("🔒")
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|||||||
+7
-7
@@ -18,12 +18,12 @@ module.exports = () => {
|
|||||||
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return msg.channel.send({embeds:[bot.errorLog.notInATicket]})
|
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return msg.channel.send({embeds:[bot.errorLog.notInATicket]})
|
||||||
|
|
||||||
const closebutton = new discord.MessageActionRow()
|
const closebutton = new discord.ActionRowBuilder()
|
||||||
.addComponents([
|
.addComponents([
|
||||||
new discord.MessageButton()
|
new discord.ButtonBuilder()
|
||||||
.setCustomId("deleteTicketTrue")
|
.setCustomId("deleteTicketTrue")
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setStyle("SECONDARY")
|
.setStyle(discord.ButtonStyle.Secondary)
|
||||||
.setEmoji("❌")
|
.setEmoji("❌")
|
||||||
])
|
])
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ module.exports = () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
client.on("interactionCreate",(interaction) => {
|
client.on("interactionCreate",(interaction) => {
|
||||||
if (!interaction.isCommand()) return
|
if (!interaction.isChatInputCommand()) return
|
||||||
if (interaction.commandName != "delete") return
|
if (interaction.commandName != "delete") return
|
||||||
|
|
||||||
const permsmember = client.guilds.cache.find(g => g.id == interaction.guild.id).members.cache.find(m => m.id == interaction.member.id)
|
const permsmember = client.guilds.cache.find(g => g.id == interaction.guild.id).members.cache.find(m => m.id == interaction.member.id)
|
||||||
@@ -51,12 +51,12 @@ module.exports = () => {
|
|||||||
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return interaction.reply({embeds:[bot.errorLog.notInATicket]})
|
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return interaction.reply({embeds:[bot.errorLog.notInATicket]})
|
||||||
|
|
||||||
const closebutton = new discord.MessageActionRow()
|
const closebutton = new discord.ActionRowBuilder()
|
||||||
.addComponents([
|
.addComponents([
|
||||||
new discord.MessageButton()
|
new discord.ButtonBuilder()
|
||||||
.setCustomId("deleteTicketTrue")
|
.setCustomId("deleteTicketTrue")
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setStyle("SECONDARY")
|
.setStyle(discord.ButtonStyle.Secondary)
|
||||||
.setEmoji("❌")
|
.setEmoji("❌")
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|||||||
+8
-2
@@ -6,7 +6,7 @@ const log = bot.errorLog.log
|
|||||||
const l = bot.language
|
const l = bot.language
|
||||||
|
|
||||||
module.exports = () => {
|
module.exports = () => {
|
||||||
const helpEmbed = new discord.MessageEmbed()
|
const helpEmbed = new discord.EmbedBuilder()
|
||||||
.setColor(config.main_color)
|
.setColor(config.main_color)
|
||||||
.setTitle(l.helpMenu.title)
|
.setTitle(l.helpMenu.title)
|
||||||
|
|
||||||
@@ -20,6 +20,12 @@ module.exports = () => {
|
|||||||
client.on("messageCreate",msg => {
|
client.on("messageCreate",msg => {
|
||||||
if (!msg.content.startsWith(config.prefix)) return
|
if (!msg.content.startsWith(config.prefix)) return
|
||||||
var args = msg.content.split(config.prefix)
|
var args = msg.content.split(config.prefix)
|
||||||
|
|
||||||
|
if (!args[1]){
|
||||||
|
msg.channel.send({embeds:[helpEmbed]})
|
||||||
|
log("command","someone used the 'help' command",[{key:"user",value:msg.author.tag}])
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (!args[1].startsWith("close") && !args[1].startsWith("delete") && !args[1].startsWith("remove") && !args[1].startsWith("add") && !args[1].startsWith("msg") && !args[1].startsWith("remove") && !args[1].startsWith("rename") && !args[1].startsWith("reopen")){
|
if (!args[1].startsWith("close") && !args[1].startsWith("delete") && !args[1].startsWith("remove") && !args[1].startsWith("add") && !args[1].startsWith("msg") && !args[1].startsWith("remove") && !args[1].startsWith("rename") && !args[1].startsWith("reopen")){
|
||||||
|
|
||||||
@@ -29,7 +35,7 @@ module.exports = () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
client.on("interactionCreate",(interaction) => {
|
client.on("interactionCreate",(interaction) => {
|
||||||
if (!interaction.isCommand()) return
|
if (!interaction.isChatInputCommand()) return
|
||||||
if (interaction.commandName != "help") return
|
if (interaction.commandName != "help") return
|
||||||
|
|
||||||
interaction.reply({embeds:[helpEmbed]})
|
interaction.reply({embeds:[helpEmbed]})
|
||||||
|
|||||||
+1
-1
@@ -32,7 +32,7 @@ module.exports = () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
client.on("interactionCreate",(interaction) => {
|
client.on("interactionCreate",(interaction) => {
|
||||||
if (!interaction.isCommand()) return
|
if (!interaction.isChatInputCommand()) return
|
||||||
if (interaction.commandName != "remove") return
|
if (interaction.commandName != "remove") return
|
||||||
const user = interaction.options.getUser("user")
|
const user = interaction.options.getUser("user")
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -45,7 +45,7 @@ module.exports = () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
client.on("interactionCreate",(interaction) => {
|
client.on("interactionCreate",(interaction) => {
|
||||||
if (!interaction.isCommand()) return
|
if (!interaction.isChatInputCommand()) return
|
||||||
if (interaction.commandName != "rename") return
|
if (interaction.commandName != "rename") return
|
||||||
|
|
||||||
interaction.channel.messages.fetchPinned().then(msglist => {
|
interaction.channel.messages.fetchPinned().then(msglist => {
|
||||||
|
|||||||
+4
-4
@@ -6,12 +6,12 @@ const log = bot.errorLog.log
|
|||||||
const l = bot.language
|
const l = bot.language
|
||||||
|
|
||||||
module.exports = () => {
|
module.exports = () => {
|
||||||
var reopenCommandBar = new discord.MessageActionRow()
|
var reopenCommandBar = new discord.ActionRowBuilder()
|
||||||
.addComponents(
|
.addComponents(
|
||||||
new discord.MessageButton()
|
new discord.ButtonBuilder()
|
||||||
.setCustomId("reopenTicket1")
|
.setCustomId("reopenTicket1")
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setStyle("SECONDARY")
|
.setStyle(discord.ButtonStyle.Secondary)
|
||||||
.setEmoji("🔓")
|
.setEmoji("🔓")
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ module.exports = () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
client.on("interactionCreate",(interaction) => {
|
client.on("interactionCreate",(interaction) => {
|
||||||
if (!interaction.isCommand()) return
|
if (!interaction.isChatInputCommand()) return
|
||||||
if (interaction.commandName != "reopen") return
|
if (interaction.commandName != "reopen") return
|
||||||
|
|
||||||
interaction.channel.messages.fetchPinned().then(msglist => {
|
interaction.channel.messages.fetchPinned().then(msglist => {
|
||||||
|
|||||||
+1
-1
@@ -35,7 +35,7 @@ module.exports = () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
client.on("interactionCreate", (interaction) => {
|
client.on("interactionCreate", (interaction) => {
|
||||||
if (!interaction.isCommand()) return
|
if (!interaction.isChatInputCommand()) return
|
||||||
if (interaction.commandName != "message") return
|
if (interaction.commandName != "message") return
|
||||||
|
|
||||||
const permsmember = client.guilds.cache.find(g => g.id == interaction.guild.id).members.cache.find(m => m.id == interaction.member.id)
|
const permsmember = client.guilds.cache.find(g => g.id == interaction.guild.id).members.cache.find(m => m.id == interaction.member.id)
|
||||||
|
|||||||
+2
-2
@@ -11,7 +11,7 @@
|
|||||||
"status":{
|
"status":{
|
||||||
"enabled":true,
|
"enabled":true,
|
||||||
"type":"PLAYING",
|
"type":"PLAYING",
|
||||||
"text":"!ticket"
|
"text":"!ticket help"
|
||||||
},
|
},
|
||||||
|
|
||||||
"system":{
|
"system":{
|
||||||
@@ -79,7 +79,7 @@
|
|||||||
"name":"Choose Your Ticket",
|
"name":"Choose Your Ticket",
|
||||||
"description":"You can click one of the buttons below!\nYou can also customize all the embeds now!",
|
"description":"You can click one of the buttons below!\nYou can also customize all the embeds now!",
|
||||||
"enableFooter":true,
|
"enableFooter":true,
|
||||||
"footer":"Open Ticket v2.1.2 - I'm a footer!",
|
"footer":"Open Ticket v2.3.1 - I'm a footer!",
|
||||||
"enableThumbnail":false,
|
"enableThumbnail":false,
|
||||||
"thumbnail":"https://www.example.com/catmemes/cat.png",
|
"thumbnail":"https://www.example.com/catmemes/cat.png",
|
||||||
"color":"#ffffff",
|
"color":"#ffffff",
|
||||||
|
|||||||
+4
-8
@@ -252,14 +252,8 @@ exports.checker = async () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
checkType(config.bot_name,"string","bot_name")
|
checkType(config.bot_name,"string","bot_name")
|
||||||
if (config.main_color.startsWith("#")){
|
checkHexColor(config.main_color,"main_color")
|
||||||
checkHexColor(config.main_color,"main_color")
|
|
||||||
}else{
|
|
||||||
checkEmbedColor(config.main_color,"main_color")
|
|
||||||
}
|
|
||||||
checkDiscord("serverid",config.server_id,"server_id")
|
checkDiscord("serverid",config.server_id,"server_id")
|
||||||
checkToken(config.auth_token)
|
checkToken(config.auth_token)
|
||||||
checkDiscordArray("roleid",config.main_adminroles,"main_adminroles")
|
checkDiscordArray("roleid",config.main_adminroles,"main_adminroles")
|
||||||
@@ -267,7 +261,7 @@ exports.checker = async () => {
|
|||||||
//languagefile
|
//languagefile
|
||||||
checkType(config.languagefile,"string","languagefile")
|
checkType(config.languagefile,"string","languagefile")
|
||||||
const lf = config.languagefile
|
const lf = config.languagefile
|
||||||
if (!lf.startsWith("custom") && !lf.startsWith("english") && !lf.startsWith("dutch") && !lf.startsWith("romanian") && !lf.startsWith("german")){
|
if (!lf.startsWith("custom") && !lf.startsWith("english") && !lf.startsWith("dutch") && !lf.startsWith("romanian") && !lf.startsWith("german") && !lf.startsWith("arabic") && !lf.startsWith("spanish")){
|
||||||
createError("'languagefile' | invalid language, more info in the wiki")
|
createError("'languagefile' | invalid language, more info in the wiki")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -296,6 +290,8 @@ exports.checker = async () => {
|
|||||||
checkType(config.system["has@everyoneaccess"],"boolean","system/has@everyoneaccess")
|
checkType(config.system["has@everyoneaccess"],"boolean","system/has@everyoneaccess")
|
||||||
if (config.system.member_role != "" && config.system.member_role != " " && config.system.member_role != "false" && config.system.member_role != "null" && config.system.member_role != "0"){
|
if (config.system.member_role != "" && config.system.member_role != " " && config.system.member_role != "false" && config.system.member_role != "null" && config.system.member_role != "0"){
|
||||||
checkDiscord("roleid",config.system.member_role,"system/member_role")
|
checkDiscord("roleid",config.system.member_role,"system/member_role")
|
||||||
|
}else{
|
||||||
|
createWarn("'system/member_role' | You don't have a member role, but it's recommended!")
|
||||||
}
|
}
|
||||||
checkType(config.system.closeMode,"string","system/closeMode")
|
checkType(config.system.closeMode,"string","system/closeMode")
|
||||||
if (!["normal","adminonly"].includes(config.system.closeMode)){
|
if (!["normal","adminonly"].includes(config.system.closeMode)){
|
||||||
|
|||||||
+35
-35
@@ -7,109 +7,109 @@ const l = bot.language
|
|||||||
|
|
||||||
module.exports = () => {
|
module.exports = () => {
|
||||||
//closebar
|
//closebar
|
||||||
var closeBar = new discord.MessageActionRow()
|
var closeBar = new discord.ActionRowBuilder()
|
||||||
.addComponents(
|
.addComponents(
|
||||||
new discord.MessageButton()
|
new discord.ButtonBuilder()
|
||||||
.setCustomId("closeTicketTrue")
|
.setCustomId("closeTicketTrue")
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setStyle("SECONDARY")
|
.setStyle(discord.ButtonStyle.Secondary)
|
||||||
.setEmoji("✅")
|
.setEmoji("✅")
|
||||||
)
|
)
|
||||||
.addComponents(
|
.addComponents(
|
||||||
new discord.MessageButton()
|
new discord.ButtonBuilder()
|
||||||
.setCustomId("closeTicketFalse")
|
.setCustomId("closeTicketFalse")
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setStyle("SECONDARY")
|
.setStyle(discord.ButtonStyle.Secondary)
|
||||||
.setEmoji("❌")
|
.setEmoji("❌")
|
||||||
)
|
)
|
||||||
var deleteBar = new discord.MessageActionRow()
|
var deleteBar = new discord.ActionRowBuilder()
|
||||||
.addComponents(
|
.addComponents(
|
||||||
new discord.MessageButton()
|
new discord.ButtonBuilder()
|
||||||
.setCustomId("deleteTicketTrue")
|
.setCustomId("deleteTicketTrue")
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setStyle("SECONDARY")
|
.setStyle(discord.ButtonStyle.Secondary)
|
||||||
.setEmoji("✅")
|
.setEmoji("✅")
|
||||||
)
|
)
|
||||||
.addComponents(
|
.addComponents(
|
||||||
new discord.MessageButton()
|
new discord.ButtonBuilder()
|
||||||
.setCustomId("deleteTicketFalse")
|
.setCustomId("deleteTicketFalse")
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setStyle("SECONDARY")
|
.setStyle(discord.ButtonStyle.Secondary)
|
||||||
.setEmoji("❌")
|
.setEmoji("❌")
|
||||||
)
|
)
|
||||||
var deleteBar1 = new discord.MessageActionRow()
|
var deleteBar1 = new discord.ActionRowBuilder()
|
||||||
.addComponents(
|
.addComponents(
|
||||||
new discord.MessageButton()
|
new discord.ButtonBuilder()
|
||||||
.setCustomId("deleteTicketTrue1")
|
.setCustomId("deleteTicketTrue1")
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setStyle("SECONDARY")
|
.setStyle(discord.ButtonStyle.Secondary)
|
||||||
.setEmoji("✅")
|
.setEmoji("✅")
|
||||||
)
|
)
|
||||||
.addComponents(
|
.addComponents(
|
||||||
new discord.MessageButton()
|
new discord.ButtonBuilder()
|
||||||
.setCustomId("deleteTicketFalse1")
|
.setCustomId("deleteTicketFalse1")
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setStyle("SECONDARY")
|
.setStyle(discord.ButtonStyle.Secondary)
|
||||||
.setEmoji("❌")
|
.setEmoji("❌")
|
||||||
)
|
)
|
||||||
//closebutton
|
//closebutton
|
||||||
var closeRowNormal = new discord.MessageActionRow()
|
var closeRowNormal = new discord.ActionRowBuilder()
|
||||||
.addComponents(
|
.addComponents(
|
||||||
new discord.MessageButton()
|
new discord.ButtonBuilder()
|
||||||
.setCustomId("closeTicket")
|
.setCustomId("closeTicket")
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setStyle("SECONDARY")
|
.setStyle(discord.ButtonStyle.Secondary)
|
||||||
.setLabel(l.buttons.close)
|
.setLabel(l.buttons.close)
|
||||||
.setEmoji("🔒")
|
.setEmoji("🔒")
|
||||||
)
|
)
|
||||||
.addComponents(
|
.addComponents(
|
||||||
new discord.MessageButton()
|
new discord.ButtonBuilder()
|
||||||
.setCustomId("deleteTicket")
|
.setCustomId("deleteTicket")
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setStyle("DANGER")
|
.setStyle(discord.ButtonStyle.Danger)
|
||||||
.setLabel(l.buttons.delete)
|
.setLabel(l.buttons.delete)
|
||||||
.setEmoji("✖️")
|
.setEmoji("✖️")
|
||||||
)
|
)
|
||||||
var closeRowClosed = new discord.MessageActionRow()
|
var closeRowClosed = new discord.ActionRowBuilder()
|
||||||
.addComponents(
|
.addComponents(
|
||||||
new discord.MessageButton()
|
new discord.ButtonBuilder()
|
||||||
.setCustomId("deleteTicket1")
|
.setCustomId("deleteTicket1")
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setStyle("DANGER")
|
.setStyle(discord.ButtonStyle.Danger)
|
||||||
.setLabel(l.buttons.delete)
|
.setLabel(l.buttons.delete)
|
||||||
.setEmoji("✖️")
|
.setEmoji("✖️")
|
||||||
)
|
)
|
||||||
.addComponents(
|
.addComponents(
|
||||||
new discord.MessageButton()
|
new discord.ButtonBuilder()
|
||||||
.setCustomId("sendTranscript")
|
.setCustomId("sendTranscript")
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setStyle("SECONDARY")
|
.setStyle(discord.ButtonStyle.Secondary)
|
||||||
.setLabel(l.buttons.sendTranscript)
|
.setLabel(l.buttons.sendTranscript)
|
||||||
.setEmoji("📄")
|
.setEmoji("📄")
|
||||||
)
|
)
|
||||||
.addComponents(
|
.addComponents(
|
||||||
new discord.MessageButton()
|
new discord.ButtonBuilder()
|
||||||
.setCustomId("reopenTicket")
|
.setCustomId("reopenTicket")
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setStyle("SUCCESS")
|
.setStyle(discord.ButtonStyle.Success)
|
||||||
.setLabel(l.buttons.reopen)
|
.setLabel(l.buttons.reopen)
|
||||||
.setEmoji("✔")
|
.setEmoji("✔")
|
||||||
)
|
)
|
||||||
|
|
||||||
var closeRowDisabled = new discord.MessageActionRow()
|
var closeRowDisabled = new discord.ActionRowBuilder()
|
||||||
.addComponents(
|
.addComponents(
|
||||||
new discord.MessageButton()
|
new discord.ButtonBuilder()
|
||||||
.setCustomId("closeTicket")
|
.setCustomId("closeTicket")
|
||||||
.setDisabled(true)
|
.setDisabled(true)
|
||||||
.setStyle("SECONDARY")
|
.setStyle(discord.ButtonStyle.Secondary)
|
||||||
.setLabel(l.buttons.close)
|
.setLabel(l.buttons.close)
|
||||||
.setEmoji("🔒")
|
.setEmoji("🔒")
|
||||||
)
|
)
|
||||||
.addComponents(
|
.addComponents(
|
||||||
new discord.MessageButton()
|
new discord.ButtonBuilder()
|
||||||
.setCustomId("deleteTicket")
|
.setCustomId("deleteTicket")
|
||||||
.setDisabled(true)
|
.setDisabled(true)
|
||||||
.setStyle("DANGER")
|
.setStyle(discord.ButtonStyle.Danger)
|
||||||
.setLabel(l.buttons.delete)
|
.setLabel(l.buttons.delete)
|
||||||
.setEmoji("✖️")
|
.setEmoji("✖️")
|
||||||
)
|
)
|
||||||
@@ -176,12 +176,12 @@ module.exports = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const closedButtonDisabled = new discord.MessageActionRow()
|
const closedButtonDisabled = new discord.ActionRowBuilder()
|
||||||
.addComponents([
|
.addComponents([
|
||||||
new discord.MessageButton()
|
new discord.ButtonBuilder()
|
||||||
.setCustomId("closeTicketTrue1")
|
.setCustomId("closeTicketTrue1")
|
||||||
.setDisabled(true)
|
.setDisabled(true)
|
||||||
.setStyle("SECONDARY")
|
.setStyle(discord.ButtonStyle.Secondary)
|
||||||
.setEmoji("🔒")
|
.setEmoji("🔒")
|
||||||
])
|
])
|
||||||
interaction.message.edit({components:[closedButtonDisabled]})
|
interaction.message.edit({components:[closedButtonDisabled]})
|
||||||
|
|||||||
@@ -7,17 +7,18 @@ const l = bot.language
|
|||||||
const loadChalk = async () => {
|
const loadChalk = async () => {
|
||||||
return await (await import("chalk")).default
|
return await (await import("chalk")).default
|
||||||
}
|
}
|
||||||
const embed = discord.MessageEmbed
|
const embed = discord.EmbedBuilder
|
||||||
|
const c = discord.Colors
|
||||||
|
|
||||||
exports.noPermsMessage = new embed()
|
exports.noPermsMessage = new embed()
|
||||||
.setColor("RED")
|
.setColor(c.Red)
|
||||||
.setTitle(":x: "+l.errors.noPermsTitle+" :x:")
|
.setTitle(":x: "+l.errors.noPermsTitle+" :x:")
|
||||||
.setDescription(l.errors.noPermsDescription)
|
.setDescription(l.errors.noPermsDescription)
|
||||||
|
|
||||||
/**@param {String} message */
|
/**@param {String} message */
|
||||||
exports.invalidArgsMessage = (message) => {
|
exports.invalidArgsMessage = (message) => {
|
||||||
var x = new embed()
|
var x = new embed()
|
||||||
.setColor("RED")
|
.setColor(c.Red)
|
||||||
.setTitle(":x: "+l.errors.missingArgsTitle+" :x:")
|
.setTitle(":x: "+l.errors.missingArgsTitle+" :x:")
|
||||||
.setDescription(message)
|
.setDescription(message)
|
||||||
|
|
||||||
@@ -27,7 +28,7 @@ exports.invalidArgsMessage = (message) => {
|
|||||||
/**@param {String} message */
|
/**@param {String} message */
|
||||||
exports.serverError = (message) => {
|
exports.serverError = (message) => {
|
||||||
var x = new embed()
|
var x = new embed()
|
||||||
.setColor("ORANGE")
|
.setColor(c.Orange)
|
||||||
.setTitle(":warning: "+l.errors.boterror+" :warning:")
|
.setTitle(":warning: "+l.errors.boterror+" :warning:")
|
||||||
.setDescription(message)
|
.setDescription(message)
|
||||||
|
|
||||||
@@ -37,14 +38,14 @@ exports.serverError = (message) => {
|
|||||||
/**@param {String[]} list */
|
/**@param {String[]} list */
|
||||||
exports.invalidIdChooseFromList = (list) => {
|
exports.invalidIdChooseFromList = (list) => {
|
||||||
var x = new embed()
|
var x = new embed()
|
||||||
.setColor("RED")
|
.setColor(c.Red)
|
||||||
.setTitle(":x: "+l.errors.chooseFromListTitle+" :x:")
|
.setTitle(":x: "+l.errors.chooseFromListTitle+" :x:")
|
||||||
.setDescription(l.errors.chooseFromListDescription+"\n`"+list.join("`\n`")+"`")
|
.setDescription(l.errors.chooseFromListDescription+"\n`"+list.join("`\n`")+"`")
|
||||||
return x
|
return x
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.notInATicket = new embed()
|
exports.notInATicket = new embed()
|
||||||
.setColor("RED")
|
.setColor(c.Red)
|
||||||
.setTitle(":x: "+l.errors.notInTicketTitle+" :x:")
|
.setTitle(":x: "+l.errors.notInTicketTitle+" :x:")
|
||||||
.setDescription(l.errors.notInTicketDescription)
|
.setDescription(l.errors.notInTicketDescription)
|
||||||
|
|
||||||
@@ -62,7 +63,7 @@ exports.success = (title,message) => {
|
|||||||
/**@param {String} message @param {String} title */
|
/**@param {String} message @param {String} title */
|
||||||
exports.warning = (title,message) => {
|
exports.warning = (title,message) => {
|
||||||
var x = new embed()
|
var x = new embed()
|
||||||
.setColor("ORANGE")
|
.setColor(c.Orange)
|
||||||
.setTitle(":warning: "+title+" :warning:")
|
.setTitle(":warning: "+title+" :warning:")
|
||||||
.setDescription(message)
|
.setDescription(message)
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ else if (config.languagefile.startsWith("english")) localLanguage = require("../
|
|||||||
else if (config.languagefile.startsWith("german")) localLanguage = require("../language/german.json")
|
else if (config.languagefile.startsWith("german")) localLanguage = require("../language/german.json")
|
||||||
else if (config.languagefile.startsWith("french")) localLanguage = require("../language/french.json")
|
else if (config.languagefile.startsWith("french")) localLanguage = require("../language/french.json")
|
||||||
else if (config.languagefile.startsWith("romanian")) localLanguage = require("../language/romanian.json")
|
else if (config.languagefile.startsWith("romanian")) localLanguage = require("../language/romanian.json")
|
||||||
|
else if (config.languagefile.startsWith("arabic")) localLanguage = require("../language/arabic.json")
|
||||||
|
else if (config.languagefile.startsWith("spanish")) localLanguage = require("../language/spanish.json")
|
||||||
|
|
||||||
const errorLog = async () => {
|
const errorLog = async () => {
|
||||||
const chalk = await (await import("chalk")).default
|
const chalk = await (await import("chalk")).default
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ module.exports = async () => {
|
|||||||
|
|
||||||
console.log(chalk.red("\nINSTRUCTIONS:\n\n1: Run the command you want to delete in discord.\n2: You get the message 'This command is now deleted!'\n3: There is also a message in the console that says the command is deleted.\n4: reload your discord."))
|
console.log(chalk.red("\nINSTRUCTIONS:\n\n1: Run the command you want to delete in discord.\n2: You get the message 'This command is now deleted!'\n3: There is also a message in the console that says the command is deleted.\n4: reload your discord."))
|
||||||
client.on("interactionCreate",(interaction) => {
|
client.on("interactionCreate",(interaction) => {
|
||||||
if (!interaction.isCommand()) return console.log("this isn't a command!")
|
if (!interaction.isChatInputCommand()) return console.log("this isn't a command!")
|
||||||
|
|
||||||
interaction.reply({content:"This command is now deleted!"})
|
interaction.reply({content:"This command is now deleted!"})
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ const client = require("../../index").client
|
|||||||
const config = bot.config
|
const config = bot.config
|
||||||
const getoptions = require("../getoptions")
|
const getoptions = require("../getoptions")
|
||||||
|
|
||||||
|
const act = discord.ApplicationCommandType
|
||||||
|
const acot = discord.ApplicationCommandOptionType
|
||||||
|
|
||||||
module.exports = async () => {
|
module.exports = async () => {
|
||||||
const chalk = (await import("chalk")).default
|
const chalk = (await import("chalk")).default
|
||||||
const sid = config.server_id
|
const sid = config.server_id
|
||||||
@@ -42,10 +45,10 @@ module.exports = async () => {
|
|||||||
name:"ticket",
|
name:"ticket",
|
||||||
description:"Create a ticket!",
|
description:"Create a ticket!",
|
||||||
defaultPermission:true,
|
defaultPermission:true,
|
||||||
type:"CHAT_INPUT",
|
type:act.ChatInput,
|
||||||
options:[
|
options:[
|
||||||
{
|
{
|
||||||
type:"STRING",
|
type:acot.String,
|
||||||
name:"type",
|
name:"type",
|
||||||
description:"The type of ticket.",
|
description:"The type of ticket.",
|
||||||
required:true,
|
required:true,
|
||||||
@@ -61,10 +64,10 @@ module.exports = async () => {
|
|||||||
name:"new",
|
name:"new",
|
||||||
description:"Create a ticket!",
|
description:"Create a ticket!",
|
||||||
defaultPermission:true,
|
defaultPermission:true,
|
||||||
type:"CHAT_INPUT",
|
type:act.ChatInput,
|
||||||
options:[
|
options:[
|
||||||
{
|
{
|
||||||
type:"STRING",
|
type:acot.String,
|
||||||
name:"type",
|
name:"type",
|
||||||
description:"The type of ticket.",
|
description:"The type of ticket.",
|
||||||
required:true,
|
required:true,
|
||||||
@@ -81,7 +84,7 @@ module.exports = async () => {
|
|||||||
name:"help",
|
name:"help",
|
||||||
description:"The help menu",
|
description:"The help menu",
|
||||||
defaultPermission:true,
|
defaultPermission:true,
|
||||||
type:"CHAT_INPUT"
|
type:act.ChatInput
|
||||||
},sid).then(() => {
|
},sid).then(() => {
|
||||||
readystats++
|
readystats++
|
||||||
|
|
||||||
@@ -92,7 +95,7 @@ module.exports = async () => {
|
|||||||
name:"close",
|
name:"close",
|
||||||
description:"Close the current ticket.",
|
description:"Close the current ticket.",
|
||||||
defaultPermission:true,
|
defaultPermission:true,
|
||||||
type:"CHAT_INPUT"
|
type:act.ChatInput
|
||||||
},sid).then(() => {
|
},sid).then(() => {
|
||||||
readystats++
|
readystats++
|
||||||
})
|
})
|
||||||
@@ -102,7 +105,7 @@ module.exports = async () => {
|
|||||||
name:"delete",
|
name:"delete",
|
||||||
description:"Delete the current ticket.",
|
description:"Delete the current ticket.",
|
||||||
defaultPermission:true,
|
defaultPermission:true,
|
||||||
type:"CHAT_INPUT"
|
type:act.ChatInput
|
||||||
},sid).then(() => {
|
},sid).then(() => {
|
||||||
readystats++
|
readystats++
|
||||||
})
|
})
|
||||||
@@ -112,14 +115,15 @@ module.exports = async () => {
|
|||||||
name:"message",
|
name:"message",
|
||||||
description:"Create a ticket message.",
|
description:"Create a ticket message.",
|
||||||
defaultPermission:true,
|
defaultPermission:true,
|
||||||
type:"CHAT_INPUT",
|
type:act.ChatInput,
|
||||||
options:[
|
options:[
|
||||||
{
|
{
|
||||||
type:"STRING",
|
type:acot.String,
|
||||||
name:"id",
|
name:"id",
|
||||||
description:"The message id.",
|
description:"The message id.",
|
||||||
required:true,
|
required:true,
|
||||||
choices:msgchoices
|
choices:msgchoices,
|
||||||
|
max_length:30
|
||||||
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -132,10 +136,10 @@ module.exports = async () => {
|
|||||||
name:"add",
|
name:"add",
|
||||||
description:"Add people to this ticket.",
|
description:"Add people to this ticket.",
|
||||||
defaultPermission:true,
|
defaultPermission:true,
|
||||||
type:"CHAT_INPUT",
|
type:act.ChatInput,
|
||||||
options:[
|
options:[
|
||||||
{
|
{
|
||||||
type:"USER",
|
type:acot.User,
|
||||||
name:"user",
|
name:"user",
|
||||||
description:"The user to add.",
|
description:"The user to add.",
|
||||||
required:true
|
required:true
|
||||||
@@ -150,10 +154,10 @@ module.exports = async () => {
|
|||||||
name:"remove",
|
name:"remove",
|
||||||
description:"Remove people from this ticket.",
|
description:"Remove people from this ticket.",
|
||||||
defaultPermission:true,
|
defaultPermission:true,
|
||||||
type:"CHAT_INPUT",
|
type:act.ChatInput,
|
||||||
options:[
|
options:[
|
||||||
{
|
{
|
||||||
type:"USER",
|
type:acot.User,
|
||||||
name:"user",
|
name:"user",
|
||||||
description:"The user to remove.",
|
description:"The user to remove.",
|
||||||
required:true
|
required:true
|
||||||
@@ -168,10 +172,10 @@ module.exports = async () => {
|
|||||||
name:"rename",
|
name:"rename",
|
||||||
description:"Rename this ticket.",
|
description:"Rename this ticket.",
|
||||||
defaultPermission:true,
|
defaultPermission:true,
|
||||||
type:"CHAT_INPUT",
|
type:act.ChatInput,
|
||||||
options:[
|
options:[
|
||||||
{
|
{
|
||||||
type:"STRING",
|
type:acot.String,
|
||||||
name:"name",
|
name:"name",
|
||||||
description:"The new name (without prefix).",
|
description:"The new name (without prefix).",
|
||||||
required:true
|
required:true
|
||||||
@@ -186,7 +190,7 @@ module.exports = async () => {
|
|||||||
name:"reopen",
|
name:"reopen",
|
||||||
description:"Reopen this ticket.",
|
description:"Reopen this ticket.",
|
||||||
defaultPermission:true,
|
defaultPermission:true,
|
||||||
type:"CHAT_INPUT"
|
type:act.ChatInput
|
||||||
},sid).then(() => {
|
},sid).then(() => {
|
||||||
readystats++
|
readystats++
|
||||||
})
|
})
|
||||||
|
|||||||
Regular → Executable
+27
-18
@@ -41,6 +41,7 @@ exports.closeTicket = async (interaction,prefix,mode) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var enableTranscript = true
|
var enableTranscript = true
|
||||||
|
var deleteRequired = false
|
||||||
|
|
||||||
if (mode == "delete"){
|
if (mode == "delete"){
|
||||||
const permsmember = client.guilds.cache.find(g => g.id == interaction.guild.id).members.cache.find(m => m.id == interaction.member.id)
|
const permsmember = client.guilds.cache.find(g => g.id == interaction.guild.id).members.cache.find(m => m.id == interaction.member.id)
|
||||||
@@ -48,8 +49,8 @@ exports.closeTicket = async (interaction,prefix,mode) => {
|
|||||||
interaction.channel.send({embeds:[bot.errorLog.noPermsMessage]})
|
interaction.channel.send({embeds:[bot.errorLog.noPermsMessage]})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
deleteRequired = true
|
||||||
interaction.channel.delete()
|
interaction.channel.send({content:"**"+l.messages.gettingdeleted+"**"})
|
||||||
log("system","deleted a ticket",[{key:"user",value:interaction.user.tag},{key:"ticket",value:interaction.channel.name}])
|
log("system","deleted a ticket",[{key:"user",value:interaction.user.tag},{key:"ticket",value:interaction.channel.name}])
|
||||||
|
|
||||||
if (!isDatabaseError) storage.set("ticketStorage",getuserID,Number(storage.get("ticketStorage",getuserID)) - 1)
|
if (!isDatabaseError) storage.set("ticketStorage",getuserID,Number(storage.get("ticketStorage",getuserID)) - 1)
|
||||||
@@ -84,49 +85,51 @@ exports.closeTicket = async (interaction,prefix,mode) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var permissionArray = []
|
var permissionArray = []
|
||||||
|
const pfb = discord.PermissionFlagsBits
|
||||||
|
|
||||||
if (!isDatabaseError) permissionArray.push({
|
if (!isDatabaseError) permissionArray.push({
|
||||||
id:getusernameStep1.id,
|
id:getusernameStep1,
|
||||||
type:"member",
|
type:"member",
|
||||||
allow:["VIEW_CHANNEL"],
|
allow:[pfb.ViewChannel],
|
||||||
deny:["ADD_REACTIONS","ATTACH_FILES","EMBED_LINKS","SEND_MESSAGES"]
|
deny:[pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages]
|
||||||
})
|
})
|
||||||
|
|
||||||
permissionArray.push({
|
permissionArray.push({
|
||||||
id:interaction.guild.id,
|
id:interaction.guild.roles.everyone,
|
||||||
type:"role",
|
type:"role",
|
||||||
deny:["ADD_REACTIONS","ATTACH_FILES","EMBED_LINKS","SEND_MESSAGES","VIEW_CHANNEL"]
|
deny:[pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages,pfb.ViewChannel]
|
||||||
})
|
})
|
||||||
|
|
||||||
interaction.channel.permissionOverwrites.set(permissionArray)
|
interaction.channel.permissionOverwrites.set(permissionArray)
|
||||||
|
|
||||||
//message
|
//message
|
||||||
var closeButtonRow = new discord.MessageActionRow()
|
var closeButtonRow = new discord.ActionRowBuilder()
|
||||||
.addComponents(
|
.addComponents(
|
||||||
new discord.MessageButton()
|
new discord.ButtonBuilder()
|
||||||
.setCustomId("deleteTicket1")
|
.setCustomId("deleteTicket1")
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setStyle("DANGER")
|
.setStyle(discord.ButtonStyle.Danger)
|
||||||
.setLabel(l.buttons.delete)
|
.setLabel(l.buttons.delete)
|
||||||
.setEmoji("✖️")
|
.setEmoji("✖️")
|
||||||
)
|
)
|
||||||
.addComponents(
|
.addComponents(
|
||||||
new discord.MessageButton()
|
new discord.ButtonBuilder()
|
||||||
.setCustomId("sendTranscript")
|
.setCustomId("sendTranscript")
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setStyle("SECONDARY")
|
.setStyle(discord.ButtonStyle.Secondary)
|
||||||
.setLabel(l.buttons.sendTranscript)
|
.setLabel(l.buttons.sendTranscript)
|
||||||
.setEmoji("📄")
|
.setEmoji("📄")
|
||||||
)
|
)
|
||||||
.addComponents(
|
.addComponents(
|
||||||
new discord.MessageButton()
|
new discord.ButtonBuilder()
|
||||||
.setCustomId("reopenTicket")
|
.setCustomId("reopenTicket")
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setStyle("SUCCESS")
|
.setStyle(discord.ButtonStyle.Success)
|
||||||
.setLabel(l.buttons.reopen)
|
.setLabel(l.buttons.reopen)
|
||||||
.setEmoji("✔")
|
.setEmoji("✔")
|
||||||
)
|
)
|
||||||
|
|
||||||
const embed = new discord.MessageEmbed()
|
const embed = new discord.EmbedBuilder()
|
||||||
.setColor(config.main_color)
|
.setColor(config.main_color)
|
||||||
.setTitle(":lock: "+l.messages.closedTitle+" :lock:")
|
.setTitle(":lock: "+l.messages.closedTitle+" :lock:")
|
||||||
.setDescription(l.messages.closedDescription)
|
.setDescription(l.messages.closedDescription)
|
||||||
@@ -162,7 +165,8 @@ exports.closeTicket = async (interaction,prefix,mode) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
enableTranscript = false
|
enableTranscript = false
|
||||||
interaction.channel.delete()
|
deleteRequired = true
|
||||||
|
interaction.channel.send({content:"**"+l.messages.gettingdeleted+"**"})
|
||||||
log("system","deleted a ticket",[{key:"user",value:interaction.user.tag},{key:"ticket",value:interaction.channel.name}])
|
log("system","deleted a ticket",[{key:"user",value:interaction.user.tag},{key:"ticket",value:interaction.channel.name}])
|
||||||
|
|
||||||
if (!isDatabaseError) storage.set("ticketStorage",getuserID,Number(storage.get("ticketStorage",getuserID)) - 1)
|
if (!isDatabaseError) storage.set("ticketStorage",getuserID,Number(storage.get("ticketStorage",getuserID)) - 1)
|
||||||
@@ -186,6 +190,7 @@ exports.closeTicket = async (interaction,prefix,mode) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (enableTranscript == true && mode != "deletenotranscript"){
|
if (enableTranscript == true && mode != "deletenotranscript"){
|
||||||
|
|
||||||
if (config.system.enable_transcript || config.system.enable_DM_transcript){
|
if (config.system.enable_transcript || config.system.enable_DM_transcript){
|
||||||
@@ -195,7 +200,7 @@ exports.closeTicket = async (interaction,prefix,mode) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (config.system.enable_transcript){
|
if (config.system.enable_transcript){
|
||||||
const transcriptEmbed = new discord.MessageEmbed()
|
const transcriptEmbed = new discord.EmbedBuilder()
|
||||||
.setColor(config.main_color)
|
.setColor(config.main_color)
|
||||||
.setTitle(l.messages.newTranscriptTitle)
|
.setTitle(l.messages.newTranscriptTitle)
|
||||||
.setAuthor({name:interaction.user.username,iconURL:interaction.user.displayAvatarURL({format:"png"})})
|
.setAuthor({name:interaction.user.username,iconURL:interaction.user.displayAvatarURL({format:"png"})})
|
||||||
@@ -209,7 +214,7 @@ exports.closeTicket = async (interaction,prefix,mode) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (config.system.enable_DM_transcript){
|
if (config.system.enable_DM_transcript){
|
||||||
const transcriptEmbed = new discord.MessageEmbed()
|
const transcriptEmbed = new discord.EmbedBuilder()
|
||||||
.setColor(config.main_color)
|
.setColor(config.main_color)
|
||||||
.setTitle(l.messages.newTranscriptTitle)
|
.setTitle(l.messages.newTranscriptTitle)
|
||||||
.setDescription(l.messages.newTranscriptDescription)
|
.setDescription(l.messages.newTranscriptDescription)
|
||||||
@@ -221,6 +226,10 @@ exports.closeTicket = async (interaction,prefix,mode) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (deleteRequired){
|
||||||
|
interaction.channel.delete()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.runThis = () => {
|
exports.runThis = () => {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ const l = bot.language
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {String} id the id from an open-ticket embed
|
* @param {String} id the id from an open-ticket embed
|
||||||
* @returns {{embed:discord.MessageEmbed,componentRows:discord.MessageActionRow[]}} discord embed
|
* @returns {{embed:discord.EmbedBuilder,componentRows:discord.MessageActionRow[]}} discord embed
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@ exports.createEmbed = (id) => {
|
|||||||
//-----------------------------------
|
//-----------------------------------
|
||||||
//general importing
|
//general importing
|
||||||
const data = require("./utils/getTicketMessages").getTicketMessage(id)
|
const data = require("./utils/getTicketMessages").getTicketMessage(id)
|
||||||
/**@type {discord.MessageButton[]}*/
|
/**@type {discord.ButtonBuilder[]}*/
|
||||||
var buttons = []
|
var buttons = []
|
||||||
/**@type {getButton.rawButtonData[]} */
|
/**@type {getButton.rawButtonData[]} */
|
||||||
var buttonData = []
|
var buttonData = []
|
||||||
@@ -32,7 +32,7 @@ exports.createEmbed = (id) => {
|
|||||||
|
|
||||||
//-----------------------------------
|
//-----------------------------------
|
||||||
//create the embed
|
//create the embed
|
||||||
const embed = new discord.MessageEmbed()
|
const embed = new discord.EmbedBuilder()
|
||||||
.setColor(data.color)
|
.setColor(data.color)
|
||||||
.setTitle(data.name)
|
.setTitle(data.name)
|
||||||
if (data.enableFooter) embed.setFooter({text:data.footer})
|
if (data.enableFooter) embed.setFooter({text:data.footer})
|
||||||
@@ -70,7 +70,7 @@ exports.createEmbed = (id) => {
|
|||||||
|
|
||||||
for (let i = AmountOfRows; i > 0; i--){
|
for (let i = AmountOfRows; i > 0; i--){
|
||||||
|
|
||||||
componentRows.push(new discord.MessageActionRow())
|
componentRows.push(new discord.ActionRowBuilder())
|
||||||
}
|
}
|
||||||
|
|
||||||
buttons.forEach((button,index) => {
|
buttons.forEach((button,index) => {
|
||||||
@@ -86,7 +86,7 @@ exports.createEmbed = (id) => {
|
|||||||
|
|
||||||
//return everything
|
//return everything
|
||||||
/**
|
/**
|
||||||
* @type {{embed:discord.MessageEmbed,componentRows:discord.MessageActionRow[]}}
|
* @type {{embed:discord.EmbedBuilder,componentRows:discord.MessageActionRow[]}}
|
||||||
*/
|
*/
|
||||||
const returnedData = {embed:embed,componentRows:componentRows}
|
const returnedData = {embed:embed,componentRows:componentRows}
|
||||||
return returnedData
|
return returnedData
|
||||||
|
|||||||
Regular → Executable
+63
-39
@@ -9,39 +9,42 @@ const getconfigoptions = require("./getoptions")
|
|||||||
const storage = bot.storage
|
const storage = bot.storage
|
||||||
|
|
||||||
module.exports = () => {
|
module.exports = () => {
|
||||||
var closeButton = new discord.MessageActionRow()
|
var closeButton = new discord.ActionRowBuilder()
|
||||||
.addComponents(
|
.addComponents(
|
||||||
new discord.MessageButton()
|
new discord.ButtonBuilder()
|
||||||
.setCustomId("closeTicket")
|
.setCustomId("closeTicket")
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setStyle("SECONDARY")
|
.setStyle(discord.ButtonStyle.Secondary)
|
||||||
.setLabel(l.buttons.close)
|
.setLabel(l.buttons.close)
|
||||||
.setEmoji("🔒")
|
.setEmoji("🔒")
|
||||||
)
|
)
|
||||||
.addComponents(
|
.addComponents(
|
||||||
new discord.MessageButton()
|
new discord.ButtonBuilder()
|
||||||
.setCustomId("deleteTicket")
|
.setCustomId("deleteTicket")
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setStyle("DANGER")
|
.setStyle(discord.ButtonStyle.Danger)
|
||||||
.setLabel(l.buttons.delete)
|
.setLabel(l.buttons.delete)
|
||||||
.setEmoji("✖️")
|
.setEmoji("✖️")
|
||||||
)
|
)
|
||||||
|
|
||||||
//ticket button click / create ticket
|
//ticket button click / create ticket
|
||||||
client.on("interactionCreate",(interaction) => {
|
client.on("interactionCreate",(interaction) => {
|
||||||
if (interaction.isCommand() && (interaction.commandName == "new" || interaction.commandName == "ticket")){
|
if (interaction.isChatInputCommand() && (interaction.commandName == "new" || interaction.commandName == "ticket")){
|
||||||
var customId = "newT"+interaction.options.getString("type")
|
var customId = "newT"+interaction.options.getString("type")
|
||||||
}else if (interaction.isButton()){
|
}else if (interaction.isButton()){
|
||||||
var customId = interaction.customId
|
var customId = interaction.customId
|
||||||
}else return
|
}else return
|
||||||
|
|
||||||
if (interaction.customId.startsWith("newT")){
|
if (interaction.isButton()){
|
||||||
const optionid = interaction.customId.split("newT")[1]
|
if (interaction.customId.startsWith("newT")){
|
||||||
if (!optionid){
|
const optionid = interaction.customId.split("newT")[1]
|
||||||
interaction.reply({embeds:[bot.errorLog.serverError(l.errors.ticketDoesntExist)]})
|
if (!optionid){
|
||||||
return
|
interaction.reply({embeds:[bot.errorLog.serverError(l.errors.ticketDoesntExist)]})
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (getconfigoptions.getTicketValues("id").includes(customId)){
|
if (getconfigoptions.getTicketValues("id").includes(customId)){
|
||||||
|
|
||||||
@@ -52,7 +55,7 @@ module.exports = () => {
|
|||||||
|
|
||||||
if (interaction.isButton()){
|
if (interaction.isButton()){
|
||||||
interaction.deferUpdate()
|
interaction.deferUpdate()
|
||||||
}else if (interaction.isCommand()){
|
}else if (interaction.isChatInputCommand()){
|
||||||
interaction.reply({embeds:[bot.errorLog.success(l.messages.createdTitle,l.messages.createdDescription)]})
|
interaction.reply({embeds:[bot.errorLog.success(l.messages.createdTitle,l.messages.createdDescription)]})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,7 +68,6 @@ module.exports = () => {
|
|||||||
}
|
}
|
||||||
catch{log("system","can't send DM to member, member doesn't allow dm's")}
|
catch{log("system","can't send DM to member, member doesn't allow dm's")}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//update storage
|
//update storage
|
||||||
storage.set("ticketStorage",interaction.member.id,Number(storage.get("ticketStorage",interaction.member.id))+1)
|
storage.set("ticketStorage",interaction.member.id,Number(storage.get("ticketStorage",interaction.member.id))+1)
|
||||||
@@ -83,17 +85,19 @@ module.exports = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var permissionsArray = []
|
var permissionsArray = []
|
||||||
|
const pfb = discord.PermissionFlagsBits
|
||||||
|
const guild = client.guilds.cache.find(g => g.id == interaction.guild.id)
|
||||||
|
|
||||||
//set everyone allowed
|
//set everyone allowed
|
||||||
if (config.system['has@everyoneaccess']){
|
if (config.system['has@everyoneaccess']){
|
||||||
var everyoneAllowPerms = ["ADD_REACTIONS","ATTACH_FILES","EMBED_LINKS","SEND_MESSAGES","VIEW_CHANNEL"]
|
var everyoneAllowPerms = [pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages,pfb.ViewChannel]
|
||||||
var everyoneDenyPerms = []
|
var everyoneDenyPerms = []
|
||||||
}else{
|
}else{
|
||||||
var everyoneAllowPerms = []
|
var everyoneAllowPerms = []
|
||||||
var everyoneDenyPerms = ["VIEW_CHANNEL"]
|
var everyoneDenyPerms = [pfb.ViewChannel]
|
||||||
}
|
}
|
||||||
permissionsArray.push({
|
permissionsArray.push({
|
||||||
id:interaction.guild.id,
|
id:interaction.guild.roles.everyone,
|
||||||
type:"role",
|
type:"role",
|
||||||
allow:everyoneAllowPerms,
|
allow:everyoneAllowPerms,
|
||||||
deny:everyoneDenyPerms
|
deny:everyoneDenyPerms
|
||||||
@@ -101,18 +105,25 @@ module.exports = () => {
|
|||||||
|
|
||||||
//add the user that created the ticket
|
//add the user that created the ticket
|
||||||
permissionsArray.push({
|
permissionsArray.push({
|
||||||
id:interaction.member.id,
|
id:interaction.member.user,
|
||||||
type:"member",
|
type:"member",
|
||||||
allow:["ADD_REACTIONS","ATTACH_FILES","EMBED_LINKS","SEND_MESSAGES","VIEW_CHANNEL"]
|
allow:[pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages,pfb.ViewChannel]
|
||||||
})
|
})
|
||||||
|
|
||||||
//add main adminroles
|
//add main adminroles
|
||||||
config.main_adminroles.forEach((role) => {
|
config.main_adminroles.forEach((role,index) => {
|
||||||
permissionsArray.push({
|
try {
|
||||||
id:role,
|
const adminrole = guild.roles.cache.find(r => r.id == role)
|
||||||
type:"role",
|
if (!adminrole) return
|
||||||
allow:["ADD_REACTIONS","ATTACH_FILES","EMBED_LINKS","SEND_MESSAGES","VIEW_CHANNEL"]
|
|
||||||
})
|
permissionsArray.push({
|
||||||
|
id:adminrole,
|
||||||
|
type:"role",
|
||||||
|
allow:[pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages,pfb.ViewChannel]
|
||||||
|
})
|
||||||
|
}catch{
|
||||||
|
log("system","invalid role! At 'config.json => main_adminroles:"+index)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
//add ticket adminroles
|
//add ticket adminroles
|
||||||
@@ -120,29 +131,42 @@ module.exports = () => {
|
|||||||
* @type {String[]}
|
* @type {String[]}
|
||||||
*/
|
*/
|
||||||
const ticketadmin = currentTicketOptions.adminroles
|
const ticketadmin = currentTicketOptions.adminroles
|
||||||
ticketadmin.forEach((role) => {
|
ticketadmin.forEach((role,index) => {
|
||||||
if (!config.main_adminroles.includes(role)){
|
if (!config.main_adminroles.includes(role)){
|
||||||
permissionsArray.push({
|
try {
|
||||||
id:role,
|
const adminrole = guild.roles.cache.find(r => r.id == role)
|
||||||
type:"role",
|
if (!adminrole) return
|
||||||
allow:["ADD_REACTIONS","ATTACH_FILES","EMBED_LINKS","SEND_MESSAGES","VIEW_CHANNEL"]
|
|
||||||
})
|
permissionsArray.push({
|
||||||
|
id:adminrole,
|
||||||
|
type:"role",
|
||||||
|
allow:[pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages,pfb.ViewChannel]
|
||||||
|
})
|
||||||
|
}catch{
|
||||||
|
log("system","invalid role! At 'config.json => options/ticket/...:"+index)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
//add member role
|
//add member role
|
||||||
if (config.system.member_role != "" && config.system.member_role != " " && config.system.member_role != "false" && config.system.member_role != "null" && config.system.member_role != "0"){
|
if (config.system.member_role != "" && config.system.member_role != " " && config.system.member_role != "false" && config.system.member_role != "null" && config.system.member_role != "0"){
|
||||||
permissionsArray.push({
|
try {
|
||||||
id:config.system.member_role,
|
const userrole = guild.roles.cache.find(r => r.id == config.system.member_role)
|
||||||
type:"role",
|
if (!userrole) return
|
||||||
deny:["VIEW_CHANNEL"]
|
permissionsArray.push({
|
||||||
})
|
id:userrole,
|
||||||
|
type:"role",
|
||||||
|
deny:[pfb.ViewChannel]
|
||||||
|
})
|
||||||
|
}catch{
|
||||||
|
log("system","invalid role! At 'config.json => system/member_role")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//create the channel
|
//create the channel
|
||||||
interaction.guild.channels.create(ticketName,{
|
interaction.guild.channels.create({
|
||||||
type:"GUILD_TEXT",
|
name:ticketName,
|
||||||
|
type:discord.ChannelType.GuildText,
|
||||||
parent:newTicketCategory,
|
parent:newTicketCategory,
|
||||||
reason:"A new ticket is created",
|
reason:"A new ticket is created",
|
||||||
permissionOverwrites:permissionsArray
|
permissionOverwrites:permissionsArray
|
||||||
@@ -150,7 +174,7 @@ module.exports = () => {
|
|||||||
}).then((ticketChannel) => {
|
}).then((ticketChannel) => {
|
||||||
storage.set("userTicketStorage",ticketChannel.id,interaction.member.id)
|
storage.set("userTicketStorage",ticketChannel.id,interaction.member.id)
|
||||||
|
|
||||||
var ticketEmbed = new discord.MessageEmbed()
|
var ticketEmbed = new discord.EmbedBuilder()
|
||||||
.setAuthor({name:interaction.user.id})
|
.setAuthor({name:interaction.user.id})
|
||||||
.setColor(config.main_color)
|
.setColor(config.main_color)
|
||||||
.setTitle(currentTicketOptions.name)
|
.setTitle(currentTicketOptions.name)
|
||||||
|
|||||||
Regular → Executable
+37
-35
@@ -7,88 +7,88 @@ const l = bot.language
|
|||||||
const storage = bot.storage
|
const storage = bot.storage
|
||||||
|
|
||||||
module.exports = () => {
|
module.exports = () => {
|
||||||
var closeRowNormal = new discord.MessageActionRow()
|
var closeRowNormal = new discord.ActionRowBuilder()
|
||||||
.addComponents(
|
.addComponents(
|
||||||
new discord.MessageButton()
|
new discord.ButtonBuilder()
|
||||||
.setCustomId("closeTicket")
|
.setCustomId("closeTicket")
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setStyle("SECONDARY")
|
.setStyle(discord.ButtonStyle.Secondary)
|
||||||
.setLabel(l.buttons.close)
|
.setLabel(l.buttons.close)
|
||||||
.setEmoji("🔒")
|
.setEmoji("🔒")
|
||||||
)
|
)
|
||||||
.addComponents(
|
.addComponents(
|
||||||
new discord.MessageButton()
|
new discord.ButtonBuilder()
|
||||||
.setCustomId("deleteTicket")
|
.setCustomId("deleteTicket")
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setStyle("DANGER")
|
.setStyle(discord.ButtonStyle.Danger)
|
||||||
.setLabel(l.buttons.delete)
|
.setLabel(l.buttons.delete)
|
||||||
.setEmoji("✖️")
|
.setEmoji("✖️")
|
||||||
)
|
)
|
||||||
|
|
||||||
var closeRowClosed = new discord.MessageActionRow()
|
var closeRowClosed = new discord.ActionRowBuilder()
|
||||||
.addComponents(
|
.addComponents(
|
||||||
new discord.MessageButton()
|
new discord.ButtonBuilder()
|
||||||
.setCustomId("deleteTicket1")
|
.setCustomId("deleteTicket1")
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setStyle("DANGER")
|
.setStyle(discord.ButtonStyle.Danger)
|
||||||
.setLabel(l.buttons.delete)
|
.setLabel(l.buttons.delete)
|
||||||
.setEmoji("✖️")
|
.setEmoji("✖️")
|
||||||
)
|
)
|
||||||
.addComponents(
|
.addComponents(
|
||||||
new discord.MessageButton()
|
new discord.ButtonBuilder()
|
||||||
.setCustomId("sendTranscript")
|
.setCustomId("sendTranscript")
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setStyle("SECONDARY")
|
.setStyle(discord.ButtonStyle.Secondary)
|
||||||
.setLabel(l.buttons.sendTranscript)
|
.setLabel(l.buttons.sendTranscript)
|
||||||
.setEmoji("📄")
|
.setEmoji("📄")
|
||||||
)
|
)
|
||||||
.addComponents(
|
.addComponents(
|
||||||
new discord.MessageButton()
|
new discord.ButtonBuilder()
|
||||||
.setCustomId("reopenTicket")
|
.setCustomId("reopenTicket")
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setStyle("SUCCESS")
|
.setStyle(discord.ButtonStyle.Success)
|
||||||
.setLabel(l.buttons.reopen)
|
.setLabel(l.buttons.reopen)
|
||||||
.setEmoji("✔")
|
.setEmoji("✔")
|
||||||
)
|
)
|
||||||
|
|
||||||
var reopenBar = new discord.MessageActionRow()
|
var reopenBar = new discord.ActionRowBuilder()
|
||||||
.addComponents(
|
.addComponents(
|
||||||
new discord.MessageButton()
|
new discord.ButtonBuilder()
|
||||||
.setCustomId("reopenTicketTrue")
|
.setCustomId("reopenTicketTrue")
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setStyle("SECONDARY")
|
.setStyle(discord.ButtonStyle.Secondary)
|
||||||
.setEmoji("✅")
|
.setEmoji("✅")
|
||||||
)
|
)
|
||||||
.addComponents(
|
.addComponents(
|
||||||
new discord.MessageButton()
|
new discord.ButtonBuilder()
|
||||||
.setCustomId("reopenTicketFalse")
|
.setCustomId("reopenTicketFalse")
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setStyle("SECONDARY")
|
.setStyle(discord.ButtonStyle.Secondary)
|
||||||
.setEmoji("❌")
|
.setEmoji("❌")
|
||||||
)
|
)
|
||||||
|
|
||||||
var reopenBar1 = new discord.MessageActionRow()
|
var reopenBar1 = new discord.ActionRowBuilder()
|
||||||
.addComponents(
|
.addComponents(
|
||||||
new discord.MessageButton()
|
new discord.ButtonBuilder()
|
||||||
.setCustomId("reopenTicketTrue1")
|
.setCustomId("reopenTicketTrue1")
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setStyle("SECONDARY")
|
.setStyle(discord.ButtonStyle.Secondary)
|
||||||
.setEmoji("✅")
|
.setEmoji("✅")
|
||||||
)
|
)
|
||||||
.addComponents(
|
.addComponents(
|
||||||
new discord.MessageButton()
|
new discord.ButtonBuilder()
|
||||||
.setCustomId("reopenTicketFalse1")
|
.setCustomId("reopenTicketFalse1")
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setStyle("SECONDARY")
|
.setStyle(discord.ButtonStyle.Secondary)
|
||||||
.setEmoji("❌")
|
.setEmoji("❌")
|
||||||
)
|
)
|
||||||
|
|
||||||
var reopenCommandBar = new discord.MessageActionRow()
|
var reopenCommandBar = new discord.ActionRowBuilder()
|
||||||
.addComponents(
|
.addComponents(
|
||||||
new discord.MessageButton()
|
new discord.ButtonBuilder()
|
||||||
.setCustomId("reopenTicket1")
|
.setCustomId("reopenTicket1")
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setStyle("SECONDARY")
|
.setStyle(discord.ButtonStyle.Secondary)
|
||||||
.setEmoji("🔓")
|
.setEmoji("🔓")
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -111,13 +111,15 @@ module.exports = () => {
|
|||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const pfb = discord.PermissionFlagsBits
|
||||||
|
|
||||||
client.on("interactionCreate",(interaction) => {
|
client.on("interactionCreate",(interaction) => {
|
||||||
if (!interaction.isButton()) return
|
if (!interaction.isButton()) return
|
||||||
if (interaction.customId != "reopenTicketTrue") return
|
if (interaction.customId != "reopenTicketTrue") return
|
||||||
|
|
||||||
interaction.deferUpdate()
|
interaction.deferUpdate()
|
||||||
|
|
||||||
const embed = new discord.MessageEmbed()
|
const embed = new discord.EmbedBuilder()
|
||||||
.setColor(config.main_color)
|
.setColor(config.main_color)
|
||||||
.setTitle(":unlock: "+l.messages.reopenTitle+" :unlock:")
|
.setTitle(":unlock: "+l.messages.reopenTitle+" :unlock:")
|
||||||
.setDescription(l.messages.reopenDescription)
|
.setDescription(l.messages.reopenDescription)
|
||||||
@@ -131,14 +133,14 @@ module.exports = () => {
|
|||||||
|
|
||||||
//set everyone allowed
|
//set everyone allowed
|
||||||
if (config.system['has@everyoneaccess']){
|
if (config.system['has@everyoneaccess']){
|
||||||
var everyoneAllowPerms = ["ADD_REACTIONS","ATTACH_FILES","EMBED_LINKS","SEND_MESSAGES","VIEW_CHANNEL"]
|
var everyoneAllowPerms = [pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages,pfb.ViewChannel]
|
||||||
var everyoneDenyPerms = []
|
var everyoneDenyPerms = []
|
||||||
}else{
|
}else{
|
||||||
var everyoneAllowPerms = []
|
var everyoneAllowPerms = []
|
||||||
var everyoneDenyPerms = ["VIEW_CHANNEL"]
|
var everyoneDenyPerms = [pfb.ViewChannel]
|
||||||
}
|
}
|
||||||
permissionsArray.push({
|
permissionsArray.push({
|
||||||
id:interaction.guild.id,
|
id:interaction.guild.roles.everyone,
|
||||||
type:"role",
|
type:"role",
|
||||||
allow:everyoneAllowPerms,
|
allow:everyoneAllowPerms,
|
||||||
deny:everyoneDenyPerms
|
deny:everyoneDenyPerms
|
||||||
@@ -149,7 +151,7 @@ module.exports = () => {
|
|||||||
permissionsArray.push({
|
permissionsArray.push({
|
||||||
id:p.id,
|
id:p.id,
|
||||||
type:"member",
|
type:"member",
|
||||||
allow:["ADD_REACTIONS","ATTACH_FILES","EMBED_LINKS","SEND_MESSAGES","VIEW_CHANNEL"],
|
allow:[pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages,pfb.ViewChannel],
|
||||||
deny:[]
|
deny:[]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -184,7 +186,7 @@ module.exports = () => {
|
|||||||
|
|
||||||
interaction.deferUpdate()
|
interaction.deferUpdate()
|
||||||
|
|
||||||
const embed = new discord.MessageEmbed()
|
const embed = new discord.EmbedBuilder()
|
||||||
.setColor(config.main_color)
|
.setColor(config.main_color)
|
||||||
.setTitle(":unlock: "+l.messages.reopenTitle+" :unlock:")
|
.setTitle(":unlock: "+l.messages.reopenTitle+" :unlock:")
|
||||||
.setDescription(l.messages.reopenDescription)
|
.setDescription(l.messages.reopenDescription)
|
||||||
@@ -198,14 +200,14 @@ module.exports = () => {
|
|||||||
|
|
||||||
//set everyone allowed
|
//set everyone allowed
|
||||||
if (config.system['has@everyoneaccess']){
|
if (config.system['has@everyoneaccess']){
|
||||||
var everyoneAllowPerms = ["ADD_REACTIONS","ATTACH_FILES","EMBED_LINKS","SEND_MESSAGES","VIEW_CHANNEL"]
|
var everyoneAllowPerms = [pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages,pfb.ViewChannel]
|
||||||
var everyoneDenyPerms = []
|
var everyoneDenyPerms = []
|
||||||
}else{
|
}else{
|
||||||
var everyoneAllowPerms = []
|
var everyoneAllowPerms = []
|
||||||
var everyoneDenyPerms = ["VIEW_CHANNEL"]
|
var everyoneDenyPerms = [pfb.ViewChannel]
|
||||||
}
|
}
|
||||||
permissionsArray.push({
|
permissionsArray.push({
|
||||||
id:interaction.guild.id,
|
id:interaction.guild.roles.everyone,
|
||||||
type:"role",
|
type:"role",
|
||||||
allow:everyoneAllowPerms,
|
allow:everyoneAllowPerms,
|
||||||
deny:everyoneDenyPerms
|
deny:everyoneDenyPerms
|
||||||
@@ -216,7 +218,7 @@ module.exports = () => {
|
|||||||
permissionsArray.push({
|
permissionsArray.push({
|
||||||
id:p.id,
|
id:p.id,
|
||||||
type:"member",
|
type:"member",
|
||||||
allow:["ADD_REACTIONS","ATTACH_FILES","EMBED_LINKS","SEND_MESSAGES","VIEW_CHANNEL"],
|
allow:[pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages,pfb.ViewChannel],
|
||||||
deny:[]
|
deny:[]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Regular → Executable
+2
-2
@@ -39,7 +39,7 @@ const getUserInfo = (channel) => {
|
|||||||
*
|
*
|
||||||
* @param {discord.Message[]} messagecollection
|
* @param {discord.Message[]} messagecollection
|
||||||
* @param {discord.Channel} channel
|
* @param {discord.Channel} channel
|
||||||
* @returns new `discord.messageAttachment`
|
* @returns new `discord.attachmentBuilder`
|
||||||
*/
|
*/
|
||||||
|
|
||||||
exports.createTranscript = async (messagecollection,channel) => {
|
exports.createTranscript = async (messagecollection,channel) => {
|
||||||
@@ -64,7 +64,7 @@ exports.createTranscript = async (messagecollection,channel) => {
|
|||||||
if (filearray.length < 2) filearray.push("transcript is empty")
|
if (filearray.length < 2) filearray.push("transcript is empty")
|
||||||
const filestring = filearray.join("\n")
|
const filestring = filearray.join("\n")
|
||||||
const filebuff = Buffer.from(filestring,"utf-8")
|
const filebuff = Buffer.from(filestring,"utf-8")
|
||||||
return new discord.MessageAttachment(filebuff,"transcript_"+ticketuserdata.ticketname+".txt")
|
return new discord.AttachmentBuilder(filebuff,{name:"transcript_"+ticketuserdata.ticketname+".txt",description:"An Open Ticket transcript"})
|
||||||
}catch(err){
|
}catch(err){
|
||||||
console.log("[error] "+err)
|
console.log("[error] "+err)
|
||||||
return false
|
return false
|
||||||
|
|||||||
+12
-11
@@ -6,19 +6,20 @@ const l = bot.language
|
|||||||
|
|
||||||
/**@returns {"DANGER"|"SUCCESS"|"PRIMARY"|"SECONDARY"} */
|
/**@returns {"DANGER"|"SUCCESS"|"PRIMARY"|"SECONDARY"} */
|
||||||
const getColor = (color) => {
|
const getColor = (color) => {
|
||||||
|
const b = discord.ButtonStyle
|
||||||
if (color.toLowerCase() == "red"){
|
if (color.toLowerCase() == "red"){
|
||||||
return "DANGER"
|
return b.Danger
|
||||||
}else if (color.toLowerCase() == "green"){
|
}else if (color.toLowerCase() == "green"){
|
||||||
return "SUCCESS"
|
return b.Success
|
||||||
}else if (color.toLowerCase() == "blue" || color.toLowerCase() == "blurple"){
|
}else if (color.toLowerCase() == "blue" || color.toLowerCase() == "blurple"){
|
||||||
return "PRIMARY"
|
return b.Primary
|
||||||
}else if (color.toLowerCase() == "black" || color.toLowerCase() == "gray" || color.toLowerCase() == "grey"){
|
}else if (color.toLowerCase() == "black" || color.toLowerCase() == "gray" || color.toLowerCase() == "grey"){
|
||||||
return "SECONDARY"
|
return b.Secondary
|
||||||
}else if (color == "DANGER" || color == "SECONDARY" || color == "SUCCESS" || color == "PRIMARY"){
|
}else if (color == "DANGER" || color == "SECONDARY" || color == "SUCCESS" || color == "PRIMARY"){
|
||||||
return color
|
return color
|
||||||
}else if (color.toLowerCase() == "none" || color.toLowerCase() == "false" || color.toLowerCase() == ""){
|
}else if (color.toLowerCase() == "none" || color.toLowerCase() == "false" || color.toLowerCase() == ""){
|
||||||
return "SECONDARY"
|
return b.Secondary
|
||||||
}else return "SECONDARY"
|
}else return b.Secondary
|
||||||
}
|
}
|
||||||
|
|
||||||
const getOption = (id) => {
|
const getOption = (id) => {
|
||||||
@@ -29,13 +30,13 @@ exports.getOption = getOption
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {String} id
|
* @param {String} id
|
||||||
* @returns {discord.MessageButton|false}
|
* @returns {discord.ButtonBuilder|false}
|
||||||
*/
|
*/
|
||||||
exports.getButton = (id) => {
|
exports.getButton = (id) => {
|
||||||
const option = getOption(id)
|
const option = getOption(id)
|
||||||
if (!option) return false
|
if (!option) return false
|
||||||
if (option.type == "ticket"){
|
if (option.type == "ticket"){
|
||||||
var button = new discord.MessageButton()
|
var button = new discord.ButtonBuilder()
|
||||||
.setCustomId("newT"+option.id)
|
.setCustomId("newT"+option.id)
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setStyle(getColor(option.color))
|
.setStyle(getColor(option.color))
|
||||||
@@ -45,9 +46,9 @@ exports.getButton = (id) => {
|
|||||||
if (!option.label && !option.icon){button.setLabel("no label or emoji")}
|
if (!option.label && !option.icon){button.setLabel("no label or emoji")}
|
||||||
|
|
||||||
}else if (option.type == "website"){
|
}else if (option.type == "website"){
|
||||||
var button = new discord.MessageButton()
|
var button = new discord.ButtonBuilder()
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setStyle("LINK")
|
.setStyle(discord.ButtonStyle.Link)
|
||||||
.setURL(option.url)
|
.setURL(option.url)
|
||||||
|
|
||||||
if (option.label){button.setLabel(option.label)}
|
if (option.label){button.setLabel(option.label)}
|
||||||
@@ -55,7 +56,7 @@ exports.getButton = (id) => {
|
|||||||
if (!option.label && !option.icon){button.setLabel("no label or emoji")}
|
if (!option.label && !option.icon){button.setLabel("no label or emoji")}
|
||||||
|
|
||||||
}else if (option.type == "role"){
|
}else if (option.type == "role"){
|
||||||
var button = new discord.MessageButton()
|
var button = new discord.ButtonBuilder()
|
||||||
.setCustomId("newR"+option.id)
|
.setCustomId("newR"+option.id)
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setStyle(getColor(option.color))
|
.setStyle(getColor(option.color))
|
||||||
|
|||||||
@@ -12,8 +12,18 @@
|
|||||||
|
|
||||||
const discord = require('discord.js')
|
const discord = require('discord.js')
|
||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
const intents = discord.Intents
|
const {GatewayIntentBits,Partials} = discord
|
||||||
const client = new discord.Client({intents:[intents.FLAGS.GUILDS,intents.FLAGS.GUILD_MESSAGES,intents.FLAGS.GUILD_MEMBERS],partials:["CHANNEL"]})
|
const client = new discord.Client({
|
||||||
|
intents:[
|
||||||
|
GatewayIntentBits.DirectMessages,
|
||||||
|
GatewayIntentBits.GuildInvites,
|
||||||
|
GatewayIntentBits.GuildMembers,
|
||||||
|
GatewayIntentBits.GuildMessages,
|
||||||
|
GatewayIntentBits.Guilds,
|
||||||
|
GatewayIntentBits.MessageContent
|
||||||
|
],
|
||||||
|
partials:[Partials.Channel,Partials.Message]
|
||||||
|
})
|
||||||
exports.client = client
|
exports.client = client
|
||||||
|
|
||||||
client.setMaxListeners(30)
|
client.setMaxListeners(30)
|
||||||
@@ -42,6 +52,20 @@ exports.errorLog = require("./core/errorLogSystem")
|
|||||||
const log = this.errorLog.log
|
const log = this.errorLog.log
|
||||||
|
|
||||||
client.on('ready',async () => {
|
client.on('ready',async () => {
|
||||||
|
var statusSet = false
|
||||||
|
const setStatus = (type,text) => {
|
||||||
|
if (statusSet == true) return
|
||||||
|
const getTypeEnum = (text) => {
|
||||||
|
if (text.toLowerCase() == "playing") return discord.ActivityType.Playing
|
||||||
|
else if (text.toLowerCase() == "listening") return discord.ActivityType.Listening
|
||||||
|
else if (text.toLowerCase() == "watching") return discord.ActivityType.Watching
|
||||||
|
else return discord.ActivityType.Listening
|
||||||
|
}
|
||||||
|
client.user.setActivity(text,{type:getTypeEnum(type)})
|
||||||
|
statusSet = true
|
||||||
|
log("system","loaded status",[{key:"type",value:type},{key:"text",value:text}])
|
||||||
|
}
|
||||||
|
|
||||||
const chalk = await (await import("chalk")).default
|
const chalk = await (await import("chalk")).default
|
||||||
|
|
||||||
if (!process.argv[2]){
|
if (!process.argv[2]){
|
||||||
@@ -50,7 +74,7 @@ client.on('ready',async () => {
|
|||||||
|
|
||||||
console.log(chalk.blue("\n\nlogs:")+"\n============")
|
console.log(chalk.blue("\n\nlogs:")+"\n============")
|
||||||
if (config.status.enabled){
|
if (config.status.enabled){
|
||||||
client.user.setActivity(config.status.text,{type:config.status.type})
|
setStatus(config.status.type,config.status.text)
|
||||||
}
|
}
|
||||||
|
|
||||||
log("system","bot logged in!")
|
log("system","bot logged in!")
|
||||||
@@ -59,13 +83,19 @@ client.on('ready',async () => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (process.argv[2] == "d"){
|
||||||
|
if (config.status.enabled){
|
||||||
|
setStatus(config.status.type,config.status.text)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!process.argv[2].startsWith("slash")){
|
if (!process.argv[2].startsWith("slash")){
|
||||||
console.log(chalk.red("WELCOME TO OPEN TICKET!"))
|
console.log(chalk.red("WELCOME TO OPEN TICKET!"))
|
||||||
log("info","open ticket ready",[{key:"version",value:require("./package.json").version},{key:"language",value:config.languagefile}])
|
log("info","open ticket ready",[{key:"version",value:require("./package.json").version},{key:"language",value:config.languagefile}])
|
||||||
|
|
||||||
console.log(chalk.blue("\n\nlogs:")+"\n============")
|
console.log(chalk.blue("\n\nlogs:")+"\n============")
|
||||||
if (config.status.enabled){
|
if (config.status.enabled){
|
||||||
client.user.setActivity(config.status.text,{type:config.status.type})
|
setStatus(config.status.type,config.status.text)
|
||||||
}
|
}
|
||||||
|
|
||||||
log("system","bot logged in!")
|
log("system","bot logged in!")
|
||||||
|
|||||||
@@ -0,0 +1,80 @@
|
|||||||
|
{
|
||||||
|
"errors":{
|
||||||
|
"missingArgsTitle":"حجج باطلة",
|
||||||
|
"missingArgsDescription":"حجة مفقودة",
|
||||||
|
"noPermsTitle":"ليس لديك إذن",
|
||||||
|
"noPermsDescription":"ليس لديك إذن لاستخدام هذا\nأنت بحاجة إلى إذن 'ADMINISTRATOR' أو أن تكون في قائمة الأدوار المسموح بها!",
|
||||||
|
"chooseFromListTitle":"بطاقة التعريف غير صالحة",
|
||||||
|
"chooseFromListDescription":"اختر أحد المعرفات أدناه:",
|
||||||
|
"boterror":"مشكلة في الروبوت",
|
||||||
|
"notInTicketTitle":"أنت لست في تذكرة!",
|
||||||
|
"notInTicketDescription":"هذا الأمر لا يعمل خارج التذاكر!",
|
||||||
|
"ticketDoesntExist":"هذه التذكرة لم تعد موجودة!",
|
||||||
|
"roleDoesntExist":"هذا الدور لم يعد موجودًا!",
|
||||||
|
"anotherOption":"هذا الخيار ليس تذكرة بل نوع آخر!",
|
||||||
|
"maxAmountTitle":"بلغ الحد الأقصى!",
|
||||||
|
"maxAmountDescription":"لقد وصلت إلى الحد الأقصى لعدد التذاكر المسموح بها!\nلذلك لا يمكنك إنشاء واحدة جديدة!",
|
||||||
|
"somethingWentWrong":"هناك خطأ ما!**\nالرجاء المحاولة مرة أخرى!",
|
||||||
|
"somethingWentWrongTranscript":"حدث خطأ ما أثناء كتابة النص!**\nالرجاء المحاولة مرة أخرى!"
|
||||||
|
},
|
||||||
|
"commands":{
|
||||||
|
"userAddedTitle":"تمت إضافة المستخدم!",
|
||||||
|
"userAddedDescription":"{0} يضاف إلى هذه التذكرة!",
|
||||||
|
"userRemovedTitle":"تمت إزالة المستخدم!",
|
||||||
|
"userRemovedDescription":"{0} تمت إزالته من هذه التذكرة!",
|
||||||
|
|
||||||
|
"renameTitle":"تم تغيير الاسم!",
|
||||||
|
"renameWarning":"تحذير: يمكنك فقط تغيير اسم القناة مرتين في الدقيقة!\n(هذا يرجع إلى حدود معدل الخلاف)",
|
||||||
|
|
||||||
|
"closeTitle":"أغلق هذه التذكرة!",
|
||||||
|
"closeDescription":"يمكنك إغلاق هذه التذكرة بالضغط على الزر أدناه!",
|
||||||
|
"deleteTitle":"احذف هذه التذكرة!",
|
||||||
|
"deleteDescription":"يمكنك حذف هذه التذكرة بالضغط على الزر أدناه!",
|
||||||
|
"reopenTitle":"أعد فتح هذه التذكرة!",
|
||||||
|
"reopenDescription":"يمكنك إعادة فتح هذه التذكرة بالضغط على الزر أدناه!",
|
||||||
|
|
||||||
|
"ticketWarning":"التضمين في الرسالة أدناه!",
|
||||||
|
"maxTicketWarning":"**تحذير:** _يمكنك فقط إنشاء ملفات {0} تذكرة في كل مرة!_"
|
||||||
|
},
|
||||||
|
"helpMenu":{
|
||||||
|
"title":"قائمة التعليمات:",
|
||||||
|
"header1":"**اذهب إلى {0} لإنشاء تذكرة!**\n\n",
|
||||||
|
"header2":"**قم بتشغيل الأمر `/new` أو `/ticket` لإنشاء تذكرة!**\n\n",
|
||||||
|
|
||||||
|
"msgCmd":"تفرخ تضمين مع الأزرار. (المسؤولون فقط)",
|
||||||
|
"renameCmd":"إعادة تسمية تذكرة. (بدون مسافات)",
|
||||||
|
"closeCmd":"أغلق التذكرة.",
|
||||||
|
"deleteCmd":"حذف التذكرة.",
|
||||||
|
"addCmd":"أضف مستخدمًا إلى التذكرة.",
|
||||||
|
"removeCmd":"إزالة مستخدم من التذكرة.",
|
||||||
|
"reopenCmd":"أعد فتح التذكرة بعد إغلاقه."
|
||||||
|
},
|
||||||
|
"buttons":{
|
||||||
|
"close":"إغلاق التذكرة",
|
||||||
|
"delete":"حذف التذكرة",
|
||||||
|
"reopen":"إعادة فتح التذكرة",
|
||||||
|
"sendTranscript":"إرسال ملف النص"
|
||||||
|
},
|
||||||
|
"messages":{
|
||||||
|
"reopenTitle":"أعيد فتح هذه التذكرة!",
|
||||||
|
"reopenDescription":"لا تتردد في التحدث مرة أخرى!",
|
||||||
|
"closedTitle":"أغلقت هذه التذكرة!",
|
||||||
|
"closedDescription":"يمكن للمسؤولين فقط التحدث في هذه التذكرة الآن!\n\n*انقر فوق الزر أدناه لحذف هذه التذكرة أو إعادة فتحها!*",
|
||||||
|
"createdTitle":"تم إنشاء التذكرة!",
|
||||||
|
"createdDescription":"تم إنشاء تذكرتك ، يمكنك اكتشافها عن طريق ping",
|
||||||
|
|
||||||
|
"newTicketDmTitle":"تذكرة جديدة!",
|
||||||
|
"closedTicketDmTitle":"تم إغلاق التذكرة!",
|
||||||
|
"deletedTicketDmTitle":"تم حذف التذكرة!",
|
||||||
|
"closedTicketDmDescription":"تم إغلاق تذكرتك!",
|
||||||
|
"deletedTicketDmDescription":"تم حذف تذكرتك!",
|
||||||
|
"reopenTicketDmTitle":"أعيد فتح التذكرة!",
|
||||||
|
"reopenTicketDmDescription":"تم إعادة فتح تذكرتك!",
|
||||||
|
"newTranscriptTitle":"نسخة جديدة هنا!",
|
||||||
|
"newTranscriptDescription":"يمكنك العثور على النص في الملف النصي أعلاه!",
|
||||||
|
"hereIsTheTranscript":"هذا هو النص:",
|
||||||
|
|
||||||
|
"chooseCategory":"اختر فئة:",
|
||||||
|
"gettingdeleted":"Ticket is getting deleted..."
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -74,6 +74,7 @@
|
|||||||
"newTranscriptDescription":"You can find the transcript in the text file above!",
|
"newTranscriptDescription":"You can find the transcript in the text file above!",
|
||||||
"hereIsTheTranscript":"Here is the transcript:",
|
"hereIsTheTranscript":"Here is the transcript:",
|
||||||
|
|
||||||
"chooseCategory":"choose a category:"
|
"chooseCategory":"choose a category:",
|
||||||
|
"gettingdeleted":"Ticket is getting deleted..."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+2
-1
@@ -74,6 +74,7 @@
|
|||||||
"newTranscriptDescription":"Je kan het transcript vinden in het bestand hierboven!",
|
"newTranscriptDescription":"Je kan het transcript vinden in het bestand hierboven!",
|
||||||
"hereIsTheTranscript":"Hier is het transcript:",
|
"hereIsTheTranscript":"Hier is het transcript:",
|
||||||
|
|
||||||
"chooseCategory":"kies een categorie:"
|
"chooseCategory":"kies een categorie:",
|
||||||
|
"gettingdeleted":"Ticket wordt verwijderd..."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -74,6 +74,7 @@
|
|||||||
"newTranscriptDescription":"You can find the transcript in the text file above!",
|
"newTranscriptDescription":"You can find the transcript in the text file above!",
|
||||||
"hereIsTheTranscript":"Here is the transcript:",
|
"hereIsTheTranscript":"Here is the transcript:",
|
||||||
|
|
||||||
"chooseCategory":"choose a category:"
|
"chooseCategory":"choose a category:",
|
||||||
|
"gettingdeleted":"Ticket is getting deleted..."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
{
|
||||||
|
"errors":{
|
||||||
|
"missingArgsTitle":"Arguments invalides !",
|
||||||
|
"missingArgsDescription":"Argument manquant",
|
||||||
|
"noPermsTitle":"Pas de permissions!",
|
||||||
|
"noPermsDescription":"Vous n'avez pas les bons rôles pour exécuter cette commande !\nVous avez besoin de la permission `ADMINISTRATOR` ou d'être dans la liste des rôles autorisés !",
|
||||||
|
"chooseFromListTitle":"Invalid ID",
|
||||||
|
"chooseFromListDescription":"Choisissez l'un des identifiants ci-dessous:",
|
||||||
|
"boterror":"Bot Error!",
|
||||||
|
"notInTicketTitle":"Vous n'êtes pas dans un ticket !",
|
||||||
|
"notInTicketDescription":"Cette commande ne fonctionne pas en dehors des tickets !",
|
||||||
|
"ticketDoesntExist":"Ce billet n'existe plus !",
|
||||||
|
"roleDoesntExist":"Ce rôle n'existe plus !",
|
||||||
|
"anotherOption":"Cette option n'est pas un ticket mais un autre type !",
|
||||||
|
"maxAmountTitle":"Montant max atteint !",
|
||||||
|
"maxAmountDescription":"Vous avez atteint le nombre maximum de tickets autorisés !\nVous ne pouvez donc pas en créer un nouveau !",
|
||||||
|
"somethingWentWrong":"Une erreur s'est produite !**\nVeuillez réessayer une autre fois !",
|
||||||
|
"somethingWentWrongTranscript":"Une erreur s'est produite lors de la création de la transcription !**\nVeuillez réessayer une autre fois !"
|
||||||
|
},
|
||||||
|
"commands":{
|
||||||
|
"userAddedTitle":"Utilisateur ajouté !",
|
||||||
|
"userAddedDescription":"{0} est ajouté à ce billet !",
|
||||||
|
"userRemovedTitle":"Utilisateur supprimé!",
|
||||||
|
"userRemovedDescription":"{0} est supprimé de ce ticket!",
|
||||||
|
|
||||||
|
"renameTitle":"Le nom est changé !",
|
||||||
|
"renameWarning":"Attention : vous ne pouvez modifier le nom de la chaîne que 2 fois par minute !\n(ceci est dû aux limites du taux de discorde)",
|
||||||
|
|
||||||
|
"closeTitle":"Fermez ce ticket !",
|
||||||
|
"closeDescription":"Vous pouvez fermer ce ticket en cliquant sur le bouton ci-dessous !",
|
||||||
|
"deleteTitle":"Supprimez ce billet !",
|
||||||
|
"deleteDescription":"Vous pouvez supprimer ce ticket en cliquant sur le bouton ci-dessous !",
|
||||||
|
"reopenTitle":"Ré-ouvrez ce ticket !",
|
||||||
|
"reopenDescription":"Vous pouvez rouvrir ce ticket en cliquant sur le bouton ci-dessous !",
|
||||||
|
|
||||||
|
"ticketWarning":"L'intégration est dans le message ci-dessous !",
|
||||||
|
"maxTicketWarning":"**Attention :** _Vous ne pouvez créer que {0} billet(s) à la fois !_"
|
||||||
|
},
|
||||||
|
"helpMenu":{
|
||||||
|
"title":"Menu d'aide:",
|
||||||
|
"header1":"**Allez à {0} pour créer un ticket !**\n\n",
|
||||||
|
"header2":"**Exécutez la commande `/new` ou `/ticket` pour créer un ticket!**\n\n",
|
||||||
|
|
||||||
|
"msgCmd":"Créez une intégration avec des boutons. (administrateurs uniquement)",
|
||||||
|
"renameCmd":"Renommer un ticket. (sans espaces)",
|
||||||
|
"closeCmd":"Fermer un ticket.",
|
||||||
|
"deleteCmd":"Supprimer un billet.",
|
||||||
|
"addCmd":"Ajouter un utilisateur au ticket.",
|
||||||
|
"removeCmd":"Supprimer un utilisateur du ticket.",
|
||||||
|
"reopenCmd":"Re-Open a ticket after it was closed."
|
||||||
|
},
|
||||||
|
"buttons":{
|
||||||
|
"close":"Fermer le ticket",
|
||||||
|
"delete":"Supprimer le billet",
|
||||||
|
"reopen":"Billet de réouverture",
|
||||||
|
"sendTranscript":"Envoyer le fichier de transcription"
|
||||||
|
},
|
||||||
|
"messages":{
|
||||||
|
"reopenTitle":"A rouvert ce ticket!",
|
||||||
|
"reopenDescription":"N'hésitez pas à reparler!",
|
||||||
|
"closedTitle":"Fermé ce ticket",
|
||||||
|
"closedDescription":"Seuls les administrateurs peuvent parler dans ce ticket maintenant !\n\n*Cliquez sur le bouton ci-dessous pour supprimer ou rouvrir ce ticket !*",
|
||||||
|
"createdTitle":"Ticket créé !",
|
||||||
|
"createdDescription":"Votre ticket est créé, vous pouvez le détecter par un ping !",
|
||||||
|
|
||||||
|
"newTicketDmTitle":"Nouveau ticket!",
|
||||||
|
"newTranscriptTitle":"Une nouvelle transcription est ici!",
|
||||||
|
"newTranscriptDescription":"Vous pouvez trouver la transcription dans le fichier texte ci-dessus !",
|
||||||
|
"hereIsTheTranscript":"Voici la transcription :",
|
||||||
|
|
||||||
|
"chooseCategory":"choisissez une catégorie:",
|
||||||
|
"gettingdeleted":"Le ticket est en cours de suppression..."
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -74,6 +74,7 @@
|
|||||||
"newTranscriptDescription":"Die Abschrift finden Sie in der obigen Textdatei!",
|
"newTranscriptDescription":"Die Abschrift finden Sie in der obigen Textdatei!",
|
||||||
"hereIsTheTranscript":"Hier ist das Transscript:",
|
"hereIsTheTranscript":"Hier ist das Transscript:",
|
||||||
|
|
||||||
"chooseCategory":"Wähle eine Kategorie:"
|
"chooseCategory":"Wähle eine Kategorie:",
|
||||||
|
"gettingdeleted":"Ticket wird gelöscht..."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -74,6 +74,7 @@
|
|||||||
"newTranscriptDescription":"Poti vedea copia ticket-ului in fisierul .txt de mai sus!",
|
"newTranscriptDescription":"Poti vedea copia ticket-ului in fisierul .txt de mai sus!",
|
||||||
"hereIsTheTranscript":"Aceasta este copia ticket-ului:",
|
"hereIsTheTranscript":"Aceasta este copia ticket-ului:",
|
||||||
|
|
||||||
"chooseCategory":"Alege o categorie:"
|
"chooseCategory":"Alege o categorie:",
|
||||||
|
"gettingdeleted":"Ticket-ul se sterge..."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
{
|
||||||
|
"errors":{
|
||||||
|
"missingArgsTitle":"¡Argumentos inválidos!",
|
||||||
|
"missingArgsDescription":"Argumento faltante.",
|
||||||
|
"noPermsTitle":"¡Sin permisos!",
|
||||||
|
"noPermsDescription":"¡No tienes permiso para usar este comando.!\n¡Necesitas el permiso `ADMINISTRATOR` permiso o tener uno de los roles permitidos!",
|
||||||
|
"chooseFromListTitle":"ID Invalida",
|
||||||
|
"chooseFromListDescription":"Elije una de las ID de abajo:",
|
||||||
|
"boterror":"¡Error del bot!",
|
||||||
|
"notInTicketTitle":"¡No te encuentras en un ticket!",
|
||||||
|
"notInTicketDescription":"¡Este comando no funciona fuera de los tickets!",
|
||||||
|
"ticketDoesntExist":"¡Este ticket no existe!",
|
||||||
|
"roleDoesntExist":"¡Este rol no existe!",
|
||||||
|
"anotherOption":"¡Esta opción no es un ticket, si no otra cosa!",
|
||||||
|
"maxAmountTitle":"¡Máxima cantidad alcanzada!",
|
||||||
|
"maxAmountDescription":"¡Has alcanzado la máxima cantidad de tickets permitida!\n¡Por lo que no puedes crear otro!",
|
||||||
|
"somethingWentWrong":"**¡Algo salió mal!**\n¡Prueba dentro de un rato!",
|
||||||
|
"somethingWentWrongTranscript":"**¡Algo salió mal al hacer el transcript!**\n¡Prueba en otro momento!"
|
||||||
|
},
|
||||||
|
"commands":{
|
||||||
|
"userAddedTitle":"¡Usuario agregado!",
|
||||||
|
"userAddedDescription":"¡{0} fué agregado al ticket!",
|
||||||
|
"userRemovedTitle":"¡Usuario eliminado!",
|
||||||
|
"userRemovedDescription":"¡{0} fué eliminado del ticket!",
|
||||||
|
|
||||||
|
"renameTitle":"¡El nombre fué cambiado!",
|
||||||
|
"renameWarning":"Aviso: Solo puedes cambiar el nombre 2 veces por minuto.\n(Esto es por limitaciones de Discord)",
|
||||||
|
|
||||||
|
"closeTitle":"¡Cierra el ticket!",
|
||||||
|
"closeDescription":"¡Puedes cerrar el ticket con el botón de abajo!",
|
||||||
|
"deleteTitle":"¡Elimina el ticket!",
|
||||||
|
"deleteDescription":"¡Puedes eliminar el ticket con el botón de abajo!",
|
||||||
|
"reopenTitle":"¡Re-Abre el ticket!",
|
||||||
|
"reopenDescription":"¡Puedes re-abrir el ticket con el botón de abajo!",
|
||||||
|
|
||||||
|
"ticketWarning":"¡El emblema está en el mensaje de abajo!",
|
||||||
|
"maxTicketWarning":"**Aviso:** _Solo puedes poseer {0} ticket(s) al mismo tiempo!_"
|
||||||
|
},
|
||||||
|
"helpMenu":{
|
||||||
|
"title":"Menú de ayuda:",
|
||||||
|
"header1":"**¡Dirígete a {0} para crear un nuevo ticket!**\n\n",
|
||||||
|
"header2":"**¡Ejecuta el comando `/new` o `/ticket` para crear un ticket!**\n\n",
|
||||||
|
|
||||||
|
"msgCmd":"Generar un embed con botones. (Solo admins)",
|
||||||
|
"renameCmd":"Renombrar un ticket. (Sin espacios)",
|
||||||
|
"closeCmd":"Cerrar un ticket.",
|
||||||
|
"deleteCmd":"Eliminar un ticket.",
|
||||||
|
"addCmd":"Agregar un usuario al ticket.",
|
||||||
|
"removeCmd":"Eliminar un usuario del ticket.",
|
||||||
|
"reopenCmd":"Re-Abre un ticket después de que este se vea cerrado."
|
||||||
|
},
|
||||||
|
"buttons":{
|
||||||
|
"close":"Cerrar ticket.",
|
||||||
|
"delete":"Eliminar ticket",
|
||||||
|
"reopen":"Re-Abrir ticket",
|
||||||
|
"sendTranscript":"Obtener transcript."
|
||||||
|
},
|
||||||
|
"messages":{
|
||||||
|
"reopenTitle":"¡Ticket Re-Abierto!",
|
||||||
|
"reopenDescription":"¡Siéntete libre de hablar de nuevo!",
|
||||||
|
"closedTitle":"¡Ticket cerrado!",
|
||||||
|
"closedDescription":"¡Solo admins pueden hablar ahora en este ticket!\n\n*¡Presiona en el botón de abajo para eliminar o re-abrir el ticket!*",
|
||||||
|
"createdTitle":"¡Ticket creado!",
|
||||||
|
"createdDescription":"¡Ticket creado, también te he mencionado en él!",
|
||||||
|
|
||||||
|
"newTicketDmTitle":"¡Nuevo ticket!",
|
||||||
|
"closedTicketDmTitle":"¡Ticket cerrado!",
|
||||||
|
"deletedTicketDmTitle":"¡Ticket eliminado!",
|
||||||
|
"closedTicketDmDescription":"¡Tu ticket fué cerrado!",
|
||||||
|
"deletedTicketDmDescription":"¡Tu ticket fué eliminado!",
|
||||||
|
"reopenTicketDmTitle":"¡Ticket re-abierto!",
|
||||||
|
"reopenTicketDmDescription":"¡Tu ticket se vió abierto de nuevo!",
|
||||||
|
"newTranscriptTitle":"¡Un nuevo transcript está aquí!",
|
||||||
|
"newTranscriptDescription":"¡Puedes encontrar el transcript en el archivo de texto que se muestra arriba!",
|
||||||
|
"hereIsTheTranscript":"Aquí está el transcript:",
|
||||||
|
|
||||||
|
"chooseCategory":"elije una categoría:",
|
||||||
|
"gettingdeleted":"El ticket se está viendo eliminado..."
|
||||||
|
}
|
||||||
|
}
|
||||||
+3
-3
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"name": "open-ticket",
|
"name": "open-ticket",
|
||||||
"version": "2.1.2",
|
"version": "2.3.1",
|
||||||
"description": "This is an open-source discord ticket bot, you can configure it and it comes with cool features like a transcript.",
|
"description": "This is an open-source discord ticket bot, you can configure it and it comes with cool features like a transcript.",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node index.js",
|
"start": "node index.js",
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
"test": "node index.js d",
|
||||||
"slashEnable": "node index.js slash enable",
|
"slashEnable": "node index.js slash enable",
|
||||||
"slashDisable": "node index.js slash disable",
|
"slashDisable": "node index.js slash disable",
|
||||||
"cleardata": "node ./core/dynamicdatabase/cleardata.js"
|
"cleardata": "node ./core/dynamicdatabase/cleardata.js"
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chalk": "^5.0.1",
|
"chalk": "^5.0.1",
|
||||||
"discord.js": "^13.8.0",
|
"discord.js": "^14.0.2",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"node": "^16.10.0",
|
"node": "^16.10.0",
|
||||||
"node-localstorage": "^2.2.1"
|
"node-localstorage": "^2.2.1"
|
||||||
|
|||||||
Reference in New Issue
Block a user