Merge pull request #12 from DJj123dj/dev
Open Ticket v2.1.0 Pull Request
This commit is contained in:
@@ -1,4 +1,13 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
package-lock.json
|
package-lock.json
|
||||||
devConfig.json
|
devConfig.json
|
||||||
|
devConfig1.json
|
||||||
|
devConfig2.json
|
||||||
|
devConfig3.json
|
||||||
|
devConfig4.json
|
||||||
|
devConfig5.json
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
openticketdebug.txt
|
||||||
|
developerChangelog.md
|
||||||
|
storage/dynamicDB/
|
||||||
|
storage/.DS_Store
|
||||||
@@ -1,5 +1,8 @@
|
|||||||
|
### large announcement:
|
||||||
|
[](https://www.dj-dj.be/projects/open-moderation)
|
||||||
|
|
||||||
# open-ticket
|
# open-ticket
|
||||||
[](https://discord.com/invite/26vT9wt3n3) [](https://github.com/DJj123dj/open-ticket/releases/tag/v2.0.0) [](#packages) [](https://github.com/DJj123dj/open-ticket/blob/main/LICENSE)
|
[](https://discord.com/invite/26vT9wt3n3) [](https://github.com/DJj123dj/open-ticket/releases/tag/v2.1.0) [](#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!
|
||||||
|
|
||||||
@@ -8,21 +11,20 @@ This is an open-source discord ticket bot, you can configure it and it comes wit
|
|||||||
[](https://www.github.com/DJj123dj/open-ticket/wiki/q&a)
|
[](https://www.github.com/DJj123dj/open-ticket/wiki/q&a)
|
||||||
|
|
||||||
## features
|
## features
|
||||||
- discord interaction buttons
|
- discord buttons
|
||||||
- slash & text commands
|
- slash & text commands
|
||||||
- close or delete tickets
|
- close, delete & re-open tickets
|
||||||
- translation possible
|
- translation (we are searching for translators!)
|
||||||
- dynamic database system
|
- dynamic database system
|
||||||
- transcripts
|
- advanced transcripts
|
||||||
- add/remove users from ticket
|
- add/remove users from a ticket
|
||||||
- custom colors & name
|
- large embed customisation
|
||||||
- create custom ticket names, icons & colors
|
- create custom ticket names, icons & colors
|
||||||
- create url buttons for websites
|
- create url's & reaction roles!
|
||||||
- uses discord.js 13
|
- uses discord.js v13
|
||||||
- configure your own ticket options
|
- configure your own ticket options
|
||||||
- remove credits if you want
|
- remove credits if you want (don't do it please 😉)
|
||||||
- unlimited tickets at the same time
|
- unlimited tickets at the same time
|
||||||
- localisation in +5 languages (soon™)
|
|
||||||
|
|
||||||
## installation
|
## installation
|
||||||
**You need `node.js 16` to run this project!**
|
**You need `node.js 16` to run this project!**
|
||||||
@@ -44,7 +46,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.0.0)
|
[click here to view](https://www.github.com/DJj123dj/open-ticket/wiki/config-v2.1.0)
|
||||||
|
|
||||||
### 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
|
||||||
@@ -56,7 +58,7 @@ You can also configure your own permissions
|
|||||||
|
|
||||||
## information
|
## information
|
||||||
|
|
||||||
_v2.0.0 unstable_
|
_v2.1.0 unstable_
|
||||||
|
|
||||||
changelog: [click here](https://www.github.com/DJj123dj/open-ticket/wiki/Changelog)
|
changelog: [click here](https://www.github.com/DJj123dj/open-ticket/wiki/Changelog)
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
# documentation
|
|
||||||
The documentation is not available here, go to the [wiki](https://github.com/DJj123dj/open-ticket/wiki) instead. (the wiki isn't fully done yet!)
|
|
||||||
|
|
||||||
## 2.0.0 beta
|
|
||||||
There is currently no documentation available for open-ticket v2.0.0 beta. So if you want to test it, you need to figure it out on yourself at the moment!
|
|
||||||
+17
-22
@@ -2,33 +2,30 @@ const discord = require('discord.js')
|
|||||||
const bot = require('../index')
|
const bot = require('../index')
|
||||||
const client = bot.client
|
const client = bot.client
|
||||||
const config = bot.config
|
const config = bot.config
|
||||||
|
const log = bot.errorLog.log
|
||||||
|
const l = bot.language
|
||||||
|
|
||||||
module.exports = () => {
|
module.exports = () => {
|
||||||
client.on("messageCreate",msg => {
|
client.on("messageCreate",msg => {
|
||||||
if (!msg.content.startsWith(config.prefix+"add")) return
|
if (!msg.content.startsWith(config.prefix+"add")) return
|
||||||
var user = msg.mentions.users.first()
|
var user = msg.mentions.users.first()
|
||||||
if (!user){
|
if (!user) return msg.channel.send({embeds:[bot.errorLog.invalidArgsMessage(l.errors.missingArgsDescription+" `<user>`:\n`"+config.prefix+"add <user>`")]})
|
||||||
return msg.channel.send({content:"**There is no user to add:**\nuse: `"+config.prefix+"add <user>`"})
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!msg.member.permissions.has("MANAGE_CHANNELS") && !msg.member.permissions.has("ADMINISTRATOR")){
|
if (!msg.member.permissions.has("MANAGE_CHANNELS") && !msg.member.permissions.has("ADMINISTRATOR") && config.main_adminroles.some((item)=>{return msg.member.roles.cache.has(item)}) == false){
|
||||||
return msg.channel.send({content:"You have no permissions to add someone to the channel!\nYou need the `ADMINISTRATOR` or `MANAGE_CHANNELS` permission"})
|
return msg.channel.send({embeds:[bot.errorLog.noPermsMessage]})
|
||||||
}
|
}
|
||||||
|
|
||||||
msg.channel.messages.fetchPinned().then(msglist => {
|
msg.channel.messages.fetchPinned().then(msglist => {
|
||||||
var firstmsg = msglist.last()
|
var firstmsg = msglist.last()
|
||||||
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id){
|
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return msg.channel.send({embeds:[bot.errorLog.notInATicket]})
|
||||||
msg.channel.send({content:"You are not in a ticket!"})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
msg.channel.permissionOverwrites.create(user.id, { VIEW_CHANNEL:true, ADD_REACTIONS:true,ATTACH_FILES:true, EMBED_LINKS:true, SEND_MESSAGES:true})
|
msg.channel.permissionOverwrites.create(user.id, { VIEW_CHANNEL:true, ADD_REACTIONS:true,ATTACH_FILES:true, EMBED_LINKS:true, SEND_MESSAGES:true})
|
||||||
msg.channel.send({content:"Added "+user.tag+" to the ticket"})
|
msg.channel.send({embeds:[bot.errorLog.success(l.commands.userAddedTitle,l.commands.userAddedDescription.replace("{0}",user.tag))]})
|
||||||
if (config.logs){console.log("[system] added user to ticket (name:"+user.username+",ticket:"+msg.channel.name+")")}
|
|
||||||
|
|
||||||
var loguser = msg.mentions.users.first()
|
var loguser = msg.mentions.users.first()
|
||||||
if (config.logs){console.log("[command] "+config.prefix+"add "+loguser.username+" (user:"+msg.author.username+")")}
|
log("command","someone used the 'add' command",[{key:"user",value:msg.author.tag}])
|
||||||
|
log("system","user added to ticket",[{key:"user",value:msg.author.tag},{key:"ticket",value:msg.channel.name},{key:"added_user",value:loguser.tag}])
|
||||||
})
|
})
|
||||||
|
|
||||||
})
|
})
|
||||||
@@ -37,27 +34,25 @@ module.exports = () => {
|
|||||||
if (!interaction.isCommand()) return
|
if (!interaction.isCommand()) return
|
||||||
if (interaction.commandName != "add") return
|
if (interaction.commandName != "add") return
|
||||||
const user = interaction.options.getUser("user")
|
const user = interaction.options.getUser("user")
|
||||||
const member = client.guilds.cache.find(g => g.id == interaction.guild.id).members.cache.find(m => m.id == interaction.member.id)
|
|
||||||
|
|
||||||
if (!member.permissions.has("MANAGE_CHANNELS") && !member.permissions.has("ADMINISTRATOR")){
|
const permsmember = client.guilds.cache.find(g => g.id == interaction.guild.id).members.cache.find(m => m.id == interaction.member.id)
|
||||||
return interaction.reply({content:"You have no permissions to add someone to the channel!\nYou need the `ADMINISTRATOR` or `MANAGE_CHANNELS` permission"})
|
if (config.main_adminroles.some((item)=>{return permsmember.roles.cache.has(item)}) == false && !permsmember.permissions.has("ADMINISTRATOR") && !permsmember.permissions.has("MANAGE_GUILD")){
|
||||||
|
interaction.reply({embeds:[bot.errorLog.noPermsMessage],ephemeral:true})
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
interaction.channel.messages.fetchPinned().then(msglist => {
|
interaction.channel.messages.fetchPinned().then(msglist => {
|
||||||
var firstmsg = msglist.last()
|
var firstmsg = msglist.last()
|
||||||
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id){
|
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return interaction.reply({embeds:[bot.errorLog.notInATicket]})
|
||||||
interaction.reply({content:"You are not in a ticket!"})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
interaction.channel.permissionOverwrites.create(user.id, { VIEW_CHANNEL:true, ADD_REACTIONS:true,ATTACH_FILES:true, EMBED_LINKS:true, SEND_MESSAGES:true})
|
interaction.channel.permissionOverwrites.create(user.id, { VIEW_CHANNEL:true, ADD_REACTIONS:true,ATTACH_FILES:true, EMBED_LINKS:true, SEND_MESSAGES:true})
|
||||||
interaction.reply({content:"Added "+user.tag+" to the ticket"})
|
interaction.reply({embeds:[bot.errorLog.success(l.commands.userAddedTitle,l.commands.userAddedDescription.replace("{0}",user.tag))]})
|
||||||
if (config.logs){console.log("[system] added user to ticket (name:"+user.username+",ticket:"+interaction.channel.name+")")}
|
|
||||||
|
|
||||||
var loguser = user
|
var loguser = user
|
||||||
if (config.logs){console.log("[command] "+config.prefix+"add "+loguser.username+" (user:"+interaction.user.username+")")}
|
log("command","someone used the 'add' command",[{key:"user",value:interaction.user.tag}])
|
||||||
|
log("system","user added to ticket",[{key:"user",value:interaction.user.tag},{key:"ticket",value:interaction.channel.name},{key:"added_user",value:loguser.tag}])
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+8
-12
@@ -2,6 +2,8 @@ const discord = require('discord.js')
|
|||||||
const bot = require('../index')
|
const bot = require('../index')
|
||||||
const client = bot.client
|
const client = bot.client
|
||||||
const config = bot.config
|
const config = bot.config
|
||||||
|
const log = bot.errorLog.log
|
||||||
|
const l = bot.language
|
||||||
|
|
||||||
module.exports = () => {
|
module.exports = () => {
|
||||||
client.on("messageCreate",msg => {
|
client.on("messageCreate",msg => {
|
||||||
@@ -11,10 +13,7 @@ module.exports = () => {
|
|||||||
msg.channel.messages.fetchPinned().then(msglist => {
|
msg.channel.messages.fetchPinned().then(msglist => {
|
||||||
var firstmsg = msglist.last()
|
var firstmsg = msglist.last()
|
||||||
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id){
|
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return msg.channel.send({embeds:[bot.errorLog.notInATicket]})
|
||||||
msg.channel.send({content:"You are not in a ticket!"})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
const closebutton = new discord.MessageActionRow()
|
const closebutton = new discord.MessageActionRow()
|
||||||
.addComponents([
|
.addComponents([
|
||||||
@@ -25,9 +24,9 @@ module.exports = () => {
|
|||||||
.setEmoji("🔒")
|
.setEmoji("🔒")
|
||||||
])
|
])
|
||||||
|
|
||||||
msg.channel.send({content:"**Click on the button below to close this ticket!**",components:[closebutton]})
|
msg.channel.send({embeds:[bot.errorLog.success(l.commands.closeTitle,l.commands.closeDescription)],components:[closebutton]})
|
||||||
|
|
||||||
console.log("[system] closed a ticket via command")
|
log("command","someone used the 'close' command",[{key:"user",value:msg.author.tag}])
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -41,10 +40,7 @@ module.exports = () => {
|
|||||||
interaction.channel.messages.fetchPinned().then(msglist => {
|
interaction.channel.messages.fetchPinned().then(msglist => {
|
||||||
var firstmsg = msglist.last()
|
var firstmsg = msglist.last()
|
||||||
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id){
|
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return interaction.reply({embeds:[bot.errorLog.notInATicket]})
|
||||||
interaction.reply({content:"You are not in a ticket!"})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
const closebutton = new discord.MessageActionRow()
|
const closebutton = new discord.MessageActionRow()
|
||||||
.addComponents([
|
.addComponents([
|
||||||
@@ -55,9 +51,9 @@ module.exports = () => {
|
|||||||
.setEmoji("🔒")
|
.setEmoji("🔒")
|
||||||
])
|
])
|
||||||
|
|
||||||
interaction.reply({content:"**Click on the button below to close this ticket!**",components:[closebutton]})
|
interaction.reply({embeds:[bot.errorLog.success(l.commands.closeTitle,l.commands.closeDescription)],components:[closebutton]})
|
||||||
|
|
||||||
console.log("[system] closed a ticket via command")
|
log("command","someone used the 'close' command",[{key:"user",value:interaction.user.tag}])
|
||||||
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
+17
-12
@@ -2,19 +2,21 @@ const discord = require('discord.js')
|
|||||||
const bot = require('../index')
|
const bot = require('../index')
|
||||||
const client = bot.client
|
const client = bot.client
|
||||||
const config = bot.config
|
const config = bot.config
|
||||||
|
const log = bot.errorLog.log
|
||||||
|
const l = bot.language
|
||||||
|
|
||||||
module.exports = () => {
|
module.exports = () => {
|
||||||
client.on("messageCreate",msg => {
|
client.on("messageCreate",msg => {
|
||||||
if (!msg.content.startsWith(config.prefix+"delete")) return
|
if (!msg.content.startsWith(config.prefix+"delete")) return
|
||||||
|
|
||||||
|
if (!msg.member.permissions.has("MANAGE_CHANNELS") && !msg.member.permissions.has("ADMINISTRATOR") && config.main_adminroles.some((item)=>{return msg.member.roles.cache.has(item)}) == false){
|
||||||
|
return msg.channel.send({embeds:[bot.errorLog.noPermsMessage]})
|
||||||
|
}
|
||||||
|
|
||||||
msg.channel.messages.fetchPinned().then(msglist => {
|
msg.channel.messages.fetchPinned().then(msglist => {
|
||||||
var firstmsg = msglist.last()
|
var firstmsg = msglist.last()
|
||||||
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id){
|
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return msg.channel.send({embeds:[bot.errorLog.notInATicket]})
|
||||||
msg.channel.send({content:"You are not in a ticket!"})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
const closebutton = new discord.MessageActionRow()
|
const closebutton = new discord.MessageActionRow()
|
||||||
.addComponents([
|
.addComponents([
|
||||||
@@ -25,9 +27,9 @@ module.exports = () => {
|
|||||||
.setEmoji("❌")
|
.setEmoji("❌")
|
||||||
])
|
])
|
||||||
|
|
||||||
msg.channel.send({content:"**Click on the button below to delete this ticket!**",components:[closebutton]})
|
msg.channel.send({embeds:[bot.errorLog.success(l.commands.deleteTitle,l.commands.deleteDescription)],components:[closebutton]})
|
||||||
|
|
||||||
console.log("[system] deleted a ticket via command")
|
log("command","someone used the 'delete' command",[{key:"user",value:msg.author.tag}])
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -38,13 +40,16 @@ module.exports = () => {
|
|||||||
if (!interaction.isCommand()) return
|
if (!interaction.isCommand()) 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)
|
||||||
|
if (config.main_adminroles.some((item)=>{return permsmember.roles.cache.has(item)}) == false && !permsmember.permissions.has("ADMINISTRATOR") && !permsmember.permissions.has("MANAGE_GUILD")){
|
||||||
|
interaction.reply({embeds:[bot.errorLog.noPermsMessage],ephemeral:true})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
interaction.channel.messages.fetchPinned().then(msglist => {
|
interaction.channel.messages.fetchPinned().then(msglist => {
|
||||||
var firstmsg = msglist.last()
|
var firstmsg = msglist.last()
|
||||||
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id){
|
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return interaction.reply({embeds:[bot.errorLog.notInATicket]})
|
||||||
interaction.reply({content:"You are not in a ticket!"})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
const closebutton = new discord.MessageActionRow()
|
const closebutton = new discord.MessageActionRow()
|
||||||
.addComponents([
|
.addComponents([
|
||||||
@@ -55,9 +60,9 @@ module.exports = () => {
|
|||||||
.setEmoji("❌")
|
.setEmoji("❌")
|
||||||
])
|
])
|
||||||
|
|
||||||
interaction.reply({content:"**Click on the button below to delete this ticket!**",components:[closebutton]})
|
interaction.reply({embeds:[bot.errorLog.success(l.commands.deleteTitle,l.commands.deleteDescription)],components:[closebutton]})
|
||||||
|
|
||||||
console.log("[system] deleted a ticket via command")
|
log("command","someone used the 'close' command",[{key:"user",value:interaction.user.tag}])
|
||||||
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
+9
-6
@@ -2,27 +2,29 @@ const discord = require('discord.js')
|
|||||||
const bot = require('../index')
|
const bot = require('../index')
|
||||||
const client = bot.client
|
const client = bot.client
|
||||||
const config = bot.config
|
const config = bot.config
|
||||||
|
const log = bot.errorLog.log
|
||||||
|
const l = bot.language
|
||||||
|
|
||||||
module.exports = () => {
|
module.exports = () => {
|
||||||
const helpEmbed = new discord.MessageEmbed()
|
const helpEmbed = new discord.MessageEmbed()
|
||||||
.setColor(config.main_color)
|
.setColor(config.main_color)
|
||||||
.setTitle("Help Menu:")
|
.setTitle(l.helpMenu.title)
|
||||||
|
|
||||||
const prefix = config.prefix
|
const prefix = config.prefix
|
||||||
const header = config.system.ticket_channel ? "**Go to <#"+config.system.ticket_channel+"> to create a ticket!**\n\n" : "**Run the command `/new` or `/ticket` to create a ticket!**\n\n"
|
const header = config.system.ticket_channel ? l.helpMenu.header1.replace("{0}","<#"+config.system.ticket_channel+">") : l.helpMenu.header2
|
||||||
helpEmbed.setDescription(header+"`"+prefix+"msg <id>` ➜ _Spawn an embed with buttons. (admin only)_\n\n`"+prefix+"rename <name>` ➜ _Rename a ticket. (no spaces)_\n`"+prefix+"close` ➜ _Close a ticket._\n`"+prefix+"delete` ➜ _Delete a ticket._\n\n`"+prefix+"add <user>` ➜ _Add a user to the ticket._\n`"+prefix+"remove <user>` ➜ _Remove a user from the ticket._`")
|
helpEmbed.setDescription(header+"`"+prefix+"msg <id>` ➜ _"+l.helpMenu.msgCmd+"_\n\n`"+prefix+"rename <name>` ➜ _"+l.helpMenu.renameCmd+"_\n`"+prefix+"close` ➜ _"+l.helpMenu.closeCmd+"_\n`"+prefix+"delete` ➜ _"+l.helpMenu.deleteCmd+"_\n`"+prefix+"reopen` ➜ _"+l.helpMenu.reopenCmd+"_\n\n`"+prefix+"add <user>` ➜ _"+l.helpMenu.addCmd+"_\n`"+prefix+"remove <user>` ➜ _"+l.helpMenu.removeCmd+"_`")
|
||||||
|
|
||||||
if (config.credits) helpEmbed.setFooter({text:"Open-Ticket by DJdj Development | view on github for source code"})
|
if (config.credits) helpEmbed.setFooter({text:"Open-Ticket by DJdj Development | view on github for source code",iconURL:"https://raw.githubusercontent.com/DJj123dj/open-ticket/main/logo.png"})
|
||||||
|
|
||||||
|
|
||||||
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].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")){
|
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")){
|
||||||
|
|
||||||
msg.channel.send({embeds:[helpEmbed]})
|
msg.channel.send({embeds:[helpEmbed]})
|
||||||
if (config.logs){console.log("[command] "+config.prefix+"ticket help (user:"+msg.author.username+")")}
|
log("command","someone used the 'help' command",[{key:"user",value:msg.author.tag}])
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -31,5 +33,6 @@ module.exports = () => {
|
|||||||
if (interaction.commandName != "help") return
|
if (interaction.commandName != "help") return
|
||||||
|
|
||||||
interaction.reply({embeds:[helpEmbed]})
|
interaction.reply({embeds:[helpEmbed]})
|
||||||
|
log("command","someone used the 'help' command",[{key:"user",value:interaction.user.tag}])
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
+20
-22
@@ -2,33 +2,31 @@ const discord = require('discord.js')
|
|||||||
const bot = require('../index')
|
const bot = require('../index')
|
||||||
const client = bot.client
|
const client = bot.client
|
||||||
const config = bot.config
|
const config = bot.config
|
||||||
|
const log = bot.errorLog.log
|
||||||
|
const l = bot.language
|
||||||
|
|
||||||
module.exports = () => {
|
module.exports = () => {
|
||||||
client.on("messageCreate",msg => {
|
client.on("messageCreate",msg => {
|
||||||
if (!msg.content.startsWith(config.prefix+"remove")) return
|
if (!msg.content.startsWith(config.prefix+"remove")) return
|
||||||
var user = msg.mentions.users.first()
|
var user = msg.mentions.users.first()
|
||||||
if (!user){
|
if (!user) return msg.channel.send({embeds:[bot.errorLog.invalidArgsMessage(l.errors.missingArgsDescription+" `<user>`:\n`"+config.prefix+"remove <user>`")]})
|
||||||
return msg.channel.send({content:"**There is no user to remove:**\nuse: `"+config.prefix+"remove <user>`"})
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!msg.member.permissions.has("MANAGE_CHANNELS") && !msg.member.permissions.has("ADMINISTRATOR")){
|
if (!msg.member.permissions.has("MANAGE_CHANNELS") && !msg.member.permissions.has("ADMINISTRATOR") && config.main_adminroles.some((item)=>{return msg.member.roles.cache.has(item)}) == false){
|
||||||
return msg.channel.send({content:"You have no permissions to remove someone from the channel!\nYou need the `ADMINISTRATOR` or `MANAGE_CHANNELS` permission"})
|
return msg.channel.send({embeds:[bot.errorLog.noPermsMessage]})
|
||||||
}
|
}
|
||||||
|
|
||||||
msg.channel.messages.fetchPinned().then(msglist => {
|
msg.channel.messages.fetchPinned().then(msglist => {
|
||||||
var firstmsg = msglist.last()
|
var firstmsg = msglist.last()
|
||||||
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id){
|
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return msg.channel.send({embeds:[bot.errorLog.notInATicket]})
|
||||||
msg.channel.send({content:"You are not in a ticket!"})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
msg.channel.permissionOverwrites.delete(user.id)
|
msg.channel.permissionOverwrites.delete(user.id)
|
||||||
msg.channel.send({content:"Deleted "+user.tag+" from the ticket"})
|
msg.channel.send({embeds:[bot.errorLog.success(l.commands.userRemovedTitle,l.commands.userRemovedDescription.replace("{0}",user.tag))]})
|
||||||
if (config.logs){console.log("[system] deleted user from ticket (name:"+user.username+",ticket:"+msg.channel.name+")")}
|
|
||||||
|
|
||||||
var loguser = msg.mentions.users.first()
|
var loguser = msg.mentions.users.first()
|
||||||
if (config.logs){console.log("[command] "+config.prefix+"remove "+loguser.username+" (user:"+msg.author.username+")")}
|
|
||||||
|
log("command","someone used the 'remove' command",[{key:"user",value:msg.author.tag}])
|
||||||
|
log("system","user removed from ticket",[{key:"user",value:msg.author.tag},{key:"ticket",value:msg.channel.name},{key:"removed_user",value:loguser.tag}])
|
||||||
})
|
})
|
||||||
|
|
||||||
})
|
})
|
||||||
@@ -37,27 +35,27 @@ module.exports = () => {
|
|||||||
if (!interaction.isCommand()) return
|
if (!interaction.isCommand()) return
|
||||||
if (interaction.commandName != "remove") return
|
if (interaction.commandName != "remove") return
|
||||||
const user = interaction.options.getUser("user")
|
const user = interaction.options.getUser("user")
|
||||||
const member = client.guilds.cache.find(g => g.id == interaction.guild.id).members.cache.find(m => m.id == interaction.member.id)
|
|
||||||
|
|
||||||
if (!member.permissions.has("MANAGE_CHANNELS") && !member.permissions.has("ADMINISTRATOR")){
|
const permsmember = client.guilds.cache.find(g => g.id == interaction.guild.id).members.cache.find(m => m.id == interaction.member.id)
|
||||||
return interaction.reply({content:"You have no permissions to remove someone from the channel!\nYou need the `ADMINISTRATOR` or `MANAGE_CHANNELS` permission"})
|
if (config.main_adminroles.some((item)=>{return permsmember.roles.cache.has(item)}) == false && !permsmember.permissions.has("ADMINISTRATOR") && !permsmember.permissions.has("MANAGE_GUILD")){
|
||||||
|
interaction.reply({embeds:[bot.errorLog.noPermsMessage],ephemeral:true})
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
interaction.channel.messages.fetchPinned().then(msglist => {
|
interaction.channel.messages.fetchPinned().then(msglist => {
|
||||||
var firstmsg = msglist.last()
|
var firstmsg = msglist.last()
|
||||||
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id){
|
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return interaction.reply({embeds:[bot.errorLog.notInATicket]})
|
||||||
interaction.reply({content:"You are not in a ticket!"})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
interaction.channel.permissionOverwrites.delete(user.id)
|
interaction.channel.permissionOverwrites.delete(user.id)
|
||||||
interaction.reply({content:"Deleted "+user.tag+" from the ticket"})
|
interaction.reply({embeds:[bot.errorLog.success(l.commands.userRemovedTitle,l.commands.userRemovedDescription.replace("{0}",user.tag))]})
|
||||||
if (config.logs){console.log("[system] removed user from ticket (name:"+user.username+",ticket:"+interaction.channel.name+")")}
|
|
||||||
|
|
||||||
var loguser = user
|
var loguser = user
|
||||||
if (config.logs){console.log("[command] "+config.prefix+"remove "+loguser.username+" (user:"+interaction.user.username+")")}
|
|
||||||
|
log("command","someone used the 'remove' command",[{key:"user",value:interaction.user.tag}])
|
||||||
|
log("system","user removed from ticket",[{key:"user",value:interaction.user.tag},{key:"ticket",value:interaction.channel.name},{key:"removed_user",value:loguser.tag}])
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+19
-18
@@ -2,6 +2,8 @@ const discord = require('discord.js')
|
|||||||
const bot = require('../index')
|
const bot = require('../index')
|
||||||
const client = bot.client
|
const client = bot.client
|
||||||
const config = bot.config
|
const config = bot.config
|
||||||
|
const log = bot.errorLog.log
|
||||||
|
const l = bot.language
|
||||||
|
|
||||||
module.exports = () => {
|
module.exports = () => {
|
||||||
client.on("messageCreate",msg => {
|
client.on("messageCreate",msg => {
|
||||||
@@ -10,17 +12,16 @@ module.exports = () => {
|
|||||||
msg.channel.messages.fetchPinned().then(msglist => {
|
msg.channel.messages.fetchPinned().then(msglist => {
|
||||||
var firstmsg = msglist.last()
|
var firstmsg = msglist.last()
|
||||||
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id){
|
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return msg.channel.send({embeds:[bot.errorLog.notInATicket]})
|
||||||
msg.channel.send({content:"You are not in a ticket!"})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (!msg.member.permissions.has("MANAGE_CHANNELS") && !msg.member.permissions.has("ADMINISTRATOR") && config.main_adminroles.some((item)=>{return msg.member.roles.cache.has(item)}) == false){
|
||||||
if (!msg.member.permissions.has("MANAGE_CHANNELS") && !msg.member.permissions.has("ADMINISTRATOR")){
|
return msg.channel.send({embeds:[bot.errorLog.noPermsMessage]})
|
||||||
return msg.channel.send({content:"You have no permissions to change the channel name!\nYou need the `ADMINISTRATOR` or `MANAGE_CHANNELS` permission"})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var newname = msg.content.split(config.prefix+"rename")[1].substring(1)
|
var newname = msg.content.split(config.prefix+"rename")[1].substring(1)
|
||||||
|
|
||||||
|
if (!newname) return msg.channel.send({embeds:[bot.errorLog.invalidArgsMessage(l.errors.missingArgsDescription+" `<name>`:\n`"+config.prefix+"rename <name>`")]})
|
||||||
|
|
||||||
var name = msg.channel.name
|
var name = msg.channel.name
|
||||||
var prefix = ""
|
var prefix = ""
|
||||||
const tickets = config.options
|
const tickets = config.options
|
||||||
@@ -33,9 +34,10 @@ module.exports = () => {
|
|||||||
if (!prefix) prefix = "noprefix-"
|
if (!prefix) prefix = "noprefix-"
|
||||||
|
|
||||||
msg.channel.setName(prefix+newname)
|
msg.channel.setName(prefix+newname)
|
||||||
msg.channel.send({content:"**The name is changed!**\nWarning: you can only change the channel name 2 times per minute! (this is due discord rate limits)"})
|
msg.channel.send({embeds:[bot.errorLog.success(l.commands.renameTitle,l.commands.renameWarning)]})
|
||||||
|
|
||||||
console.log("[system] renamed a ticket via command")
|
log("command","someone used the 'rename' command",[{key:"user",value:msg.author.tag}])
|
||||||
|
log("system","ticket renamed",[{key:"user",value:msg.author.tag},{key:"ticket",value:name},{key:"newname",value:newname}])
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -49,14 +51,12 @@ module.exports = () => {
|
|||||||
interaction.channel.messages.fetchPinned().then(msglist => {
|
interaction.channel.messages.fetchPinned().then(msglist => {
|
||||||
var firstmsg = msglist.last()
|
var firstmsg = msglist.last()
|
||||||
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id){
|
if (firstmsg == undefined || firstmsg.author.id != client.user.id)return interaction.reply({embeds:[bot.errorLog.notInATicket]})
|
||||||
interaction.reply({content:"You are not in a ticket!"})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
const member = 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)
|
||||||
if (!member.permissions.has("MANAGE_CHANNELS") && !member.permissions.has("ADMINISTRATOR")){
|
if (config.main_adminroles.some((item)=>{return permsmember.roles.cache.has(item)}) == false && !permsmember.permissions.has("ADMINISTRATOR") && !permsmember.permissions.has("MANAGE_GUILD")){
|
||||||
return interaction.reply({content:"You have no permissions to change the channel name!\nYou need the `ADMINISTRATOR` or `MANAGE_CHANNELS` permission"})
|
interaction.reply({embeds:[bot.errorLog.noPermsMessage],ephemeral:true})
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
var newname = interaction.options.getString("name")
|
var newname = interaction.options.getString("name")
|
||||||
@@ -72,9 +72,10 @@ module.exports = () => {
|
|||||||
if (!prefix) prefix = "noprefix-"
|
if (!prefix) prefix = "noprefix-"
|
||||||
|
|
||||||
interaction.channel.setName(prefix+newname)
|
interaction.channel.setName(prefix+newname)
|
||||||
interaction.reply({content:"**The name is changed!**\nWarning: you can only change the channel name 2 times per minute! (this is due discord rate limits)"})
|
interaction.reply({embeds:[bot.errorLog.success(l.commands.renameTitle,l.commands.renameWarning)]})
|
||||||
|
|
||||||
console.log("[system] renamed a ticket via command")
|
log("command","someone used the 'rename' command",[{key:"user",value:interaction.user.tag}])
|
||||||
|
log("system","ticket renamed",[{key:"user",value:interaction.user.tag},{key:"ticket",value:name},{key:"newname",value:newname}])
|
||||||
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
const discord = require('discord.js')
|
||||||
|
const bot = require('../index')
|
||||||
|
const client = bot.client
|
||||||
|
const config = bot.config
|
||||||
|
const log = bot.errorLog.log
|
||||||
|
const l = bot.language
|
||||||
|
|
||||||
|
module.exports = () => {
|
||||||
|
var reopenCommandBar = new discord.MessageActionRow()
|
||||||
|
.addComponents(
|
||||||
|
new discord.MessageButton()
|
||||||
|
.setCustomId("reopenTicket1")
|
||||||
|
.setDisabled(false)
|
||||||
|
.setStyle("SECONDARY")
|
||||||
|
.setEmoji("🔓")
|
||||||
|
)
|
||||||
|
|
||||||
|
client.on("messageCreate",msg => {
|
||||||
|
if (!msg.content.startsWith(config.prefix+"reopen")) return
|
||||||
|
|
||||||
|
msg.channel.messages.fetchPinned().then(msglist => {
|
||||||
|
var firstmsg = msglist.last()
|
||||||
|
|
||||||
|
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return msg.channel.send({embeds:[bot.errorLog.notInATicket]})
|
||||||
|
|
||||||
|
msg.channel.send({embeds:[bot.errorLog.success(l.commands.reopenTitle,l.commands.reopenDescription)],components:[reopenCommandBar]})
|
||||||
|
|
||||||
|
|
||||||
|
log("command","someone used the 'reopen' command",[{key:"user",value:msg.author.tag}])
|
||||||
|
})
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
client.on("interactionCreate",(interaction) => {
|
||||||
|
if (!interaction.isCommand()) return
|
||||||
|
if (interaction.commandName != "reopen") return
|
||||||
|
|
||||||
|
interaction.channel.messages.fetchPinned().then(msglist => {
|
||||||
|
var firstmsg = msglist.last()
|
||||||
|
|
||||||
|
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return msg.channel.send({embeds:[bot.errorLog.notInATicket]})
|
||||||
|
|
||||||
|
interaction.reply({embeds:[bot.errorLog.success(l.commands.reopenTitle,l.commands.reopenDescription)],components:[reopenCommandBar]})
|
||||||
|
|
||||||
|
|
||||||
|
log("command","someone used the 'reopen' command",[{key:"user",value:interaction.user.tag}])
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
+15
-18
@@ -2,10 +2,8 @@ const discord = require('discord.js')
|
|||||||
const bot = require('../index')
|
const bot = require('../index')
|
||||||
const client = bot.client
|
const client = bot.client
|
||||||
const config = bot.config
|
const config = bot.config
|
||||||
|
const log = bot.errorLog.log
|
||||||
/** =============================
|
const l = bot.language
|
||||||
** NOT READY YET
|
|
||||||
** =============================*/
|
|
||||||
|
|
||||||
module.exports = () => {
|
module.exports = () => {
|
||||||
/**@type {String[]} */
|
/**@type {String[]} */
|
||||||
@@ -16,24 +14,23 @@ module.exports = () => {
|
|||||||
|
|
||||||
|
|
||||||
client.on("messageCreate", msg => {
|
client.on("messageCreate", msg => {
|
||||||
if (msg.content.startsWith(config.prefix+"msg")){
|
if (msg.content.startsWith(config.prefix+"msg"||config.prefix+"message")){
|
||||||
if (config.main_adminroles.some((item)=>{return msg.member.roles.cache.has(item)}) == false){
|
|
||||||
msg.channel.send({content:"You have no permission to run this command!"})
|
if (!msg.member.permissions.has("MANAGE_CHANNELS") && !msg.member.permissions.has("ADMINISTRATOR") && config.main_adminroles.some((item)=>{return msg.member.roles.cache.has(item)}) == false){
|
||||||
return
|
return msg.channel.send({embeds:[bot.errorLog.noPermsMessage]})
|
||||||
}
|
}
|
||||||
|
|
||||||
const id = msg.content.split(config.prefix+"msg")[1].substring(1) ? msg.content.split(config.prefix+"msg")[1].substring(1) : false
|
const id = msg.content.split(config.prefix+"msg")[1].substring(1) ? msg.content.split(config.prefix+"msg")[1].substring(1) : false
|
||||||
|
|
||||||
if (!id) return msg.channel.send({content:"**There is no id!**\nUse: `"+config.prefix+"msg <id>`"})
|
if (!id) return msg.channel.send({embeds:[bot.errorLog.invalidArgsMessage(l.errors.missingArgsDescription+" `<id>`:\n`"+config.prefix+"msg <id>`")]})
|
||||||
if (!msgIds.includes(id)) return msg.channel.send({content:"**Invalid id!**\nChoose from this list:\n_"+msgIds.join("_\n_")+"_"})
|
if (!msgIds.includes(id)) return msg.channel.send({embeds:[bot.errorLog.invalidIdChooseFromList(msgIds)]})
|
||||||
|
|
||||||
|
|
||||||
const {embed,componentRows} = require("../core/ticketMessageEmbed").createEmbed(id)
|
const {embed,componentRows} = require("../core/ticketMessageEmbed").createEmbed(id)
|
||||||
|
|
||||||
msg.channel.send({embeds:[embed],components:componentRows})
|
msg.channel.send({embeds:[embed],components:componentRows})
|
||||||
|
|
||||||
if (config.logs){console.log("[command] "+config.prefix+"ticket msg (user:"+msg.author.username+")")}
|
log("command","someone used the 'msg' command",[{key:"user",value:msg.author.tag},{key:"id",value:id}])
|
||||||
if (config.logs){console.log("[system] created ticket message")}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -41,22 +38,22 @@ module.exports = () => {
|
|||||||
if (!interaction.isCommand()) return
|
if (!interaction.isCommand()) return
|
||||||
if (interaction.commandName != "message") return
|
if (interaction.commandName != "message") return
|
||||||
|
|
||||||
if (config.main_adminroles.some((item)=>{return interaction.guild.members.cache.find((m) => m.id == interaction.member.id).roles.cache.has(item)}) == false){
|
const permsmember = client.guilds.cache.find(g => g.id == interaction.guild.id).members.cache.find(m => m.id == interaction.member.id)
|
||||||
interaction.reply({content:"You have no permission to run this command!"})
|
if (config.main_adminroles.some((item)=>{return permsmember.roles.cache.has(item)}) == false && !permsmember.permissions.has("ADMINISTRATOR") && !permsmember.permissions.has("MANAGE_GUILD")){
|
||||||
|
interaction.reply({embeds:[bot.errorLog.noPermsMessage],ephemeral:true})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const id = interaction.options.getString("id")
|
const id = interaction.options.getString("id")
|
||||||
|
|
||||||
if (!msgIds.includes(id)) return interaction.reply({content:"**Invalid id!**\nChoose from this list:\n_"+msgIds.join("_\n_")+"_"})
|
if (!msgIds.includes(id)) return interaction.reply({embeds:[bot.errorLog.invalidIdChooseFromList(msgIds)]})
|
||||||
|
|
||||||
const {embed,componentRows} = require("../core/ticketMessageEmbed").createEmbed(id)
|
const {embed,componentRows} = require("../core/ticketMessageEmbed").createEmbed(id)
|
||||||
|
|
||||||
interaction.reply({content:"The embed is in the message below!"})
|
interaction.reply({content:l.commands.ticketWarning})
|
||||||
interaction.channel.send({embeds:[embed],components:componentRows})
|
interaction.channel.send({embeds:[embed],components:componentRows})
|
||||||
|
|
||||||
if (config.logs){console.log("[command] "+config.prefix+"ticket msg (user:"+interaction.member.user.username+")")}
|
log("command","someone used the 'msg' command",[{key:"user",value:interaction.user.tag},{key:"id",value:id}])
|
||||||
if (config.logs){console.log("[system] created ticket message")}
|
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
+7
-6
@@ -1,12 +1,11 @@
|
|||||||
{
|
{
|
||||||
"bot_name":"Wumpus",
|
"bot_name":"Wumpus",
|
||||||
"main_color":"#fffff",
|
"main_color":"#ffffff",
|
||||||
"server_id":"server id (for slash cmds)",
|
"server_id":"server id (for slash cmds)",
|
||||||
"auth_token":"auth token",
|
"auth_token":"auth token",
|
||||||
"main_adminroles":["discord role id"],
|
"main_adminroles":["discord role id"],
|
||||||
"prefix":"!ticket ",
|
"prefix":"!ticket ",
|
||||||
"logs":true,
|
"languagefile":"english",
|
||||||
"languagefile":"english.json (currently not working)",
|
|
||||||
|
|
||||||
"credits":true,
|
"credits":true,
|
||||||
"status":{
|
"status":{
|
||||||
@@ -22,6 +21,7 @@
|
|||||||
|
|
||||||
"has@everyoneaccess":false,
|
"has@everyoneaccess":false,
|
||||||
"member_role":"member role (doesn't have access to tickets)",
|
"member_role":"member role (doesn't have access to tickets)",
|
||||||
|
"closeMode":"adminonly|normal",
|
||||||
|
|
||||||
"enable_transcript":false,
|
"enable_transcript":false,
|
||||||
"enable_DM_transcript":false,
|
"enable_DM_transcript":false,
|
||||||
@@ -42,7 +42,8 @@
|
|||||||
"channelprefix":"question-",
|
"channelprefix":"question-",
|
||||||
"category":"category id",
|
"category":"category id",
|
||||||
"message":"You created a ticket!",
|
"message":"You created a ticket!",
|
||||||
"enableDMMessage":true
|
"enableDMMessage":true,
|
||||||
|
"ticketmessage":"The staff will help you soon!\n\n*Click on the button below to close the ticket!*"
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -78,10 +79,10 @@
|
|||||||
"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.0.0 beta - sneakpeak",
|
"footer":"Open Ticket v2.1.0 - 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":"#0075e9",
|
"color":"#ffffff",
|
||||||
"options":["general","apply"],
|
"options":["general","apply"],
|
||||||
"enableTicketExplaination":true,
|
"enableTicketExplaination":true,
|
||||||
"enableMaxTicketsWarning":true
|
"enableMaxTicketsWarning":true
|
||||||
|
|||||||
+49
-9
@@ -47,9 +47,18 @@ exports.checker = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**@param {String} value @param {String} path */
|
/**@param {String} value @param {String} path */
|
||||||
const checkColor = (value,path) => {
|
const checkHexColor = (value,path) => {
|
||||||
if (!/^#[a-f0-9]{6}$/.test(value)){
|
if (!/^#[a-fA-F0-9]{3,6}$/.test(value)){
|
||||||
createError("'"+path+"' | invalid color!")
|
if (value.length < 4) return createError("'"+path+"' | hex color too short! (example: #123abc)")
|
||||||
|
if (value.length > 7) return createError("'"+path+"' | hex color too long! (example: #123abc)")
|
||||||
|
createError("'"+path+"' | invalid color! (example: #123abc)")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**@param {String} value @param {String} path */
|
||||||
|
const checkEmbedColor = (value,path) => {
|
||||||
|
if (!['DEFAULT','WHITE','AQUA','GREEN','BLUE','YELLOW','PURPLE','LUMINOUS_VIVID_PINK','FUCHSIA','GOLD','ORANGE','RED','GREY','DARKER_GREY','NAVY','DARK_AQUA','DARK_GREEN','DARK_BLUE','DARK_PURPLE','DARK_VIVID_PINK','DARK_GOLD','DARK_ORANGE','DARK_RED','DARK_GREY','LIGHT_GREY','DARK_NAVY','BLURPLE','GREYPLE','DARK_BUT_NOT_BLACK','NOT_QUITE_BLACK','RANDOM'].includes(value)){
|
||||||
|
return createError("'"+path+"' | invalid color, must be a hex code or default color (more info in the wiki)")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -123,13 +132,15 @@ exports.checker = async () => {
|
|||||||
createError("'"+path+"/id' | option id can't contain space characters!")
|
createError("'"+path+"/id' | option id can't contain space characters!")
|
||||||
}
|
}
|
||||||
if (option.id.length > 20){
|
if (option.id.length > 20){
|
||||||
createError("'"+path+"/id' | option id max lenght is 20")
|
createError("'"+path+"/id' | option id max lenght is 20!")
|
||||||
}
|
}
|
||||||
|
|
||||||
//name
|
//name
|
||||||
checkType(option.name,"string",path+"/name")
|
checkType(option.name,"string",path+"/name")
|
||||||
if (option.name.length > 100){
|
if (option.name.length > 100){
|
||||||
createWarn("'"+path+"/name' | if your name is too long it maybe doesn't look so good!")
|
createWarn("'"+path+"/name' | if your name is too long it maybe doesn't look so good!")
|
||||||
|
}else if (option.name.length < 1){
|
||||||
|
createError("'"+path+"/name' | there is no name!")
|
||||||
}
|
}
|
||||||
|
|
||||||
//description
|
//description
|
||||||
@@ -177,13 +188,19 @@ exports.checker = async () => {
|
|||||||
|
|
||||||
//category
|
//category
|
||||||
checkType(option.category,"string",path+"/category")
|
checkType(option.category,"string",path+"/category")
|
||||||
|
if (option.category.length > 0){
|
||||||
checkDiscord("categoryid",option.category,path+"/category")
|
checkDiscord("categoryid",option.category,path+"/category")
|
||||||
|
}
|
||||||
|
|
||||||
//message
|
//message
|
||||||
checkType(option.message,"string",path+"/message")
|
checkType(option.message,"string",path+"/message")
|
||||||
|
|
||||||
//enableDMmessage
|
//enableDMmessage
|
||||||
checkType(option.enableDMMessage,"boolean",path+"/enableDMMessage")
|
checkType(option.enableDMMessage,"boolean",path+"/enableDMMessage")
|
||||||
|
|
||||||
|
//ticketmessage
|
||||||
|
checkType(option.ticketmessage,"string",path+"/ticketmessage")
|
||||||
|
|
||||||
}else if (type == "website"){
|
}else if (type == "website"){
|
||||||
//url
|
//url
|
||||||
checkType(option.url,"string",path+"/url")
|
checkType(option.url,"string",path+"/url")
|
||||||
@@ -218,8 +235,17 @@ exports.checker = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//checker
|
const checkMessage = (input,path) => {
|
||||||
var configArray = ["bot_name","main_color","server_id","auth_token","main_adminroles","prefix","logs","languagefile","credits","status","system","options","messages"]
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------|
|
||||||
|
//--------------------------|
|
||||||
|
//checker => START HERE |
|
||||||
|
//--------------------------|
|
||||||
|
//--------------------------|
|
||||||
|
|
||||||
|
var configArray = ["bot_name","main_color","server_id","auth_token","main_adminroles","prefix","languagefile","credits","status","system","options","messages"]
|
||||||
configArray.forEach((item) => {
|
configArray.forEach((item) => {
|
||||||
if (config[item] == undefined){
|
if (config[item] == undefined){
|
||||||
throw new Error("\n\nMAIN ERROR: the item '"+item+"' doesn't exist in config.json")
|
throw new Error("\n\nMAIN ERROR: the item '"+item+"' doesn't exist in config.json")
|
||||||
@@ -229,13 +255,21 @@ exports.checker = async () => {
|
|||||||
|
|
||||||
|
|
||||||
checkType(config.bot_name,"string","bot_name")
|
checkType(config.bot_name,"string","bot_name")
|
||||||
checkColor(config.main_color,"main_color")
|
if (config.main_color.startsWith("#")){
|
||||||
|
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")
|
||||||
checkString(config.prefix,1,15,"prefix","prefix")
|
checkString(config.prefix,1,15,"prefix","prefix")
|
||||||
checkType(config.logs,"boolean","logs")
|
//languagefile
|
||||||
//languagefile (comming soon)
|
checkType(config.languagefile,"string","languagefile")
|
||||||
|
const lf = config.languagefile
|
||||||
|
if (!lf.startsWith("custom") && !lf.startsWith("english") && !lf.startsWith("dutch") && !lf.startsWith("romanian")){
|
||||||
|
createError("'languagefile' | invalid language, more info in the wiki")
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
checkType(config.credits,"boolean","credits")
|
checkType(config.credits,"boolean","credits")
|
||||||
@@ -263,6 +297,12 @@ exports.checker = async () => {
|
|||||||
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")
|
||||||
}
|
}
|
||||||
|
checkType(config.system.closeMode,"string","system/closeMode")
|
||||||
|
if (!["normal","adminonly"].includes(config.system.closeMode)){
|
||||||
|
createError("'system/closeMode' | the close mode must be adminonly or normal")
|
||||||
|
}
|
||||||
|
console.log("hoi")
|
||||||
|
|
||||||
checkType(config.system.enable_transcript,"boolean","system/enable_transcript")
|
checkType(config.system.enable_transcript,"boolean","system/enable_transcript")
|
||||||
checkType(config.system.enable_DM_transcript,"boolean","system/enable_DM_transcript")
|
checkType(config.system.enable_DM_transcript,"boolean","system/enable_DM_transcript")
|
||||||
if (config.system.enable_transcript){
|
if (config.system.enable_transcript){
|
||||||
|
|||||||
+66
-5
@@ -2,6 +2,7 @@ const discord = require('discord.js')
|
|||||||
const bot = require('../index')
|
const bot = require('../index')
|
||||||
const client = bot.client
|
const client = bot.client
|
||||||
const config = bot.config
|
const config = bot.config
|
||||||
|
const l = bot.language
|
||||||
|
|
||||||
|
|
||||||
module.exports = () => {
|
module.exports = () => {
|
||||||
@@ -58,7 +59,7 @@ module.exports = () => {
|
|||||||
.setCustomId("closeTicket")
|
.setCustomId("closeTicket")
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setStyle("SECONDARY")
|
.setStyle("SECONDARY")
|
||||||
.setLabel("Close Ticket")
|
.setLabel(l.buttons.close)
|
||||||
.setEmoji("🔒")
|
.setEmoji("🔒")
|
||||||
)
|
)
|
||||||
.addComponents(
|
.addComponents(
|
||||||
@@ -66,7 +67,7 @@ module.exports = () => {
|
|||||||
.setCustomId("deleteTicket")
|
.setCustomId("deleteTicket")
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setStyle("DANGER")
|
.setStyle("DANGER")
|
||||||
.setLabel("Delete Ticket")
|
.setLabel(l.buttons.delete)
|
||||||
.setEmoji("✖️")
|
.setEmoji("✖️")
|
||||||
)
|
)
|
||||||
var closeRowClosed = new discord.MessageActionRow()
|
var closeRowClosed = new discord.MessageActionRow()
|
||||||
@@ -75,7 +76,7 @@ module.exports = () => {
|
|||||||
.setCustomId("deleteTicket1")
|
.setCustomId("deleteTicket1")
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setStyle("DANGER")
|
.setStyle("DANGER")
|
||||||
.setLabel("Delete Ticket")
|
.setLabel(l.buttons.delete)
|
||||||
.setEmoji("✖️")
|
.setEmoji("✖️")
|
||||||
)
|
)
|
||||||
.addComponents(
|
.addComponents(
|
||||||
@@ -83,9 +84,35 @@ module.exports = () => {
|
|||||||
.setCustomId("sendTranscript")
|
.setCustomId("sendTranscript")
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setStyle("SECONDARY")
|
.setStyle("SECONDARY")
|
||||||
.setLabel("Send Transcript File")
|
.setLabel(l.buttons.sendTranscript)
|
||||||
.setEmoji("📄")
|
.setEmoji("📄")
|
||||||
)
|
)
|
||||||
|
.addComponents(
|
||||||
|
new discord.MessageButton()
|
||||||
|
.setCustomId("reopenTicket")
|
||||||
|
.setDisabled(false)
|
||||||
|
.setStyle("SUCCESS")
|
||||||
|
.setLabel(l.buttons.reopen)
|
||||||
|
.setEmoji("✔")
|
||||||
|
)
|
||||||
|
|
||||||
|
var closeRowDisabled = new discord.MessageActionRow()
|
||||||
|
.addComponents(
|
||||||
|
new discord.MessageButton()
|
||||||
|
.setCustomId("closeTicket")
|
||||||
|
.setDisabled(true)
|
||||||
|
.setStyle("SECONDARY")
|
||||||
|
.setLabel(l.buttons.close)
|
||||||
|
.setEmoji("🔒")
|
||||||
|
)
|
||||||
|
.addComponents(
|
||||||
|
new discord.MessageButton()
|
||||||
|
.setCustomId("deleteTicket")
|
||||||
|
.setDisabled(true)
|
||||||
|
.setStyle("DANGER")
|
||||||
|
.setLabel(l.buttons.delete)
|
||||||
|
.setEmoji("✖️")
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
//NORMAL CLOSE
|
//NORMAL CLOSE
|
||||||
@@ -109,7 +136,16 @@ module.exports = () => {
|
|||||||
if (interaction.customId != "closeTicketTrue") return
|
if (interaction.customId != "closeTicketTrue") return
|
||||||
|
|
||||||
interaction.deferUpdate()
|
interaction.deferUpdate()
|
||||||
interaction.message.edit({components:[closeRowClosed]})
|
|
||||||
|
if (config.system.closeMode == "adminonly"){
|
||||||
|
const permsmember = client.guilds.cache.find(g => g.id == interaction.guild.id).members.cache.find(m => m.id == interaction.member.id)
|
||||||
|
if (config.main_adminroles.some((item)=>{return permsmember.roles.cache.has(item)}) == false && !permsmember.permissions.has("ADMINISTRATOR") && !permsmember.permissions.has("MANAGE_GUILD")){
|
||||||
|
interaction.channel.send({embeds:[bot.errorLog.noPermsMessage]})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
interaction.message.edit({components:[closeRowDisabled]})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {String}
|
* @type {String}
|
||||||
@@ -131,6 +167,15 @@ module.exports = () => {
|
|||||||
if (interaction.customId != "closeTicketTrue1") return
|
if (interaction.customId != "closeTicketTrue1") return
|
||||||
|
|
||||||
interaction.deferUpdate()
|
interaction.deferUpdate()
|
||||||
|
|
||||||
|
if (config.system.closeMode == "adminonly"){
|
||||||
|
const permsmember = client.guilds.cache.find(g => g.id == interaction.guild.id).members.cache.find(m => m.id == interaction.member.id)
|
||||||
|
if (config.main_adminroles.some((item)=>{return permsmember.roles.cache.has(item)}) == false && !permsmember.permissions.has("ADMINISTRATOR") && !permsmember.permissions.has("MANAGE_GUILD")){
|
||||||
|
interaction.channel.send({embeds:[bot.errorLog.noPermsMessage]})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const closedButtonDisabled = new discord.MessageActionRow()
|
const closedButtonDisabled = new discord.MessageActionRow()
|
||||||
.addComponents([
|
.addComponents([
|
||||||
new discord.MessageButton()
|
new discord.MessageButton()
|
||||||
@@ -141,6 +186,10 @@ module.exports = () => {
|
|||||||
])
|
])
|
||||||
interaction.message.edit({components:[closedButtonDisabled]})
|
interaction.message.edit({components:[closedButtonDisabled]})
|
||||||
|
|
||||||
|
interaction.channel.messages.fetchPinned().then((messages) => {
|
||||||
|
messages.first().edit({components:[closeRowDisabled]})
|
||||||
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {String}
|
* @type {String}
|
||||||
*/
|
*/
|
||||||
@@ -179,6 +228,12 @@ module.exports = () => {
|
|||||||
|
|
||||||
interaction.deferUpdate()
|
interaction.deferUpdate()
|
||||||
|
|
||||||
|
const permsmember = client.guilds.cache.find(g => g.id == interaction.guild.id).members.cache.find(m => m.id == interaction.member.id)
|
||||||
|
if (config.main_adminroles.some((item)=>{return permsmember.roles.cache.has(item)}) == false && !permsmember.permissions.has("ADMINISTRATOR") && !permsmember.permissions.has("MANAGE_GUILD")){
|
||||||
|
interaction.channel.send({embeds:[bot.errorLog.noPermsMessage]})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {String}
|
* @type {String}
|
||||||
*/
|
*/
|
||||||
@@ -219,6 +274,12 @@ module.exports = () => {
|
|||||||
|
|
||||||
interaction.deferUpdate()
|
interaction.deferUpdate()
|
||||||
|
|
||||||
|
const permsmember = client.guilds.cache.find(g => g.id == interaction.guild.id).members.cache.find(m => m.id == interaction.member.id)
|
||||||
|
if (config.main_adminroles.some((item)=>{return permsmember.roles.cache.has(item)}) == false && !permsmember.permissions.has("ADMINISTRATOR") && !permsmember.permissions.has("MANAGE_GUILD")){
|
||||||
|
interaction.channel.send({embeds:[bot.errorLog.noPermsMessage]})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {String}
|
* @type {String}
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -23,14 +23,14 @@ ask()
|
|||||||
|
|
||||||
const runClear = async () => {
|
const runClear = async () => {
|
||||||
const chalk = await (await import("chalk")).default
|
const chalk = await (await import("chalk")).default
|
||||||
console.log(chalk.blue("You can get a node.js warning below, just ignore that, it's not important!"))
|
//console.log(chalk.blue("You can get a node.js warning below, just ignore that, it's not important!"))
|
||||||
const dataPaths = ["./storage/dynamicDB"]
|
const dataPaths = ["./storage/dynamicDB"]
|
||||||
|
|
||||||
var index = 0
|
var index = 0
|
||||||
|
|
||||||
dataPaths.forEach((path) => {
|
dataPaths.forEach((path) => {
|
||||||
try {
|
try {
|
||||||
fs.rmdirSync(path,{recursive:true,force:true})
|
fs.rmSync(path,{recursive:true,force:true})
|
||||||
}catch{
|
}catch{
|
||||||
//console.log(path,"doesn't exist")
|
//console.log(path,"doesn't exist")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,16 +17,16 @@ module.exports = db
|
|||||||
** NOT READY YET
|
** NOT READY YET
|
||||||
** must be dynamic
|
** must be dynamic
|
||||||
** =============================*/
|
** =============================*/
|
||||||
const LocalStorage = require("node-localstorage")
|
//const LocalStorage = require("node-localstorage")
|
||||||
|
//
|
||||||
const ticketStorage = new LocalStorage.LocalStorage("./storage/tickets")
|
//const ticketStorage = new LocalStorage.LocalStorage("./storage/tickets")
|
||||||
exports.ticketStorage = ticketStorage
|
//exports.ticketStorage = ticketStorage
|
||||||
|
//
|
||||||
const userTicketStorage = new LocalStorage.LocalStorage("./storage/userTickets")
|
//const userTicketStorage = new LocalStorage.LocalStorage("./storage/userTickets")
|
||||||
exports.userTicketStorage = userTicketStorage
|
//exports.userTicketStorage = userTicketStorage
|
||||||
|
//
|
||||||
const transcriptStorage = new LocalStorage.LocalStorage("./storage/transcripts")
|
//const transcriptStorage = new LocalStorage.LocalStorage("./storage/transcripts")
|
||||||
exports.transcriptStorage = transcriptStorage
|
//exports.transcriptStorage = transcriptStorage
|
||||||
|
|
||||||
//const ticketNumberStorage = new LocalStorage.LocalStorage("./storage/ticketNumbers")
|
//const ticketNumberStorage = new LocalStorage.LocalStorage("./storage/ticketNumbers")
|
||||||
//exports.ticketNumberStorage = ticketNumberStorage
|
//exports.ticketNumberStorage = ticketNumberStorage
|
||||||
|
|||||||
@@ -0,0 +1,117 @@
|
|||||||
|
const discord = require('discord.js')
|
||||||
|
const bot = require('../index')
|
||||||
|
const client = bot.client
|
||||||
|
const config = bot.config
|
||||||
|
const l = bot.language
|
||||||
|
|
||||||
|
const loadChalk = async () => {
|
||||||
|
return await (await import("chalk")).default
|
||||||
|
}
|
||||||
|
const embed = discord.MessageEmbed
|
||||||
|
|
||||||
|
exports.noPermsMessage = new embed()
|
||||||
|
.setColor("RED")
|
||||||
|
.setTitle(":x: "+l.errors.noPermsTitle+" :x:")
|
||||||
|
.setDescription(l.errors.noPermsDescription)
|
||||||
|
|
||||||
|
/**@param {String} message */
|
||||||
|
exports.invalidArgsMessage = (message) => {
|
||||||
|
var x = new embed()
|
||||||
|
.setColor("RED")
|
||||||
|
.setTitle(":x: "+l.errors.missingArgsTitle+" :x:")
|
||||||
|
.setDescription(message)
|
||||||
|
|
||||||
|
return x
|
||||||
|
}
|
||||||
|
|
||||||
|
/**@param {String} message */
|
||||||
|
exports.serverError = (message) => {
|
||||||
|
var x = new embed()
|
||||||
|
.setColor("ORANGE")
|
||||||
|
.setTitle(":warning: "+l.errors.boterror+" :warning:")
|
||||||
|
.setDescription(message)
|
||||||
|
|
||||||
|
return x
|
||||||
|
}
|
||||||
|
|
||||||
|
/**@param {String[]} list */
|
||||||
|
exports.invalidIdChooseFromList = (list) => {
|
||||||
|
var x = new embed()
|
||||||
|
.setColor("RED")
|
||||||
|
.setTitle(":x: "+l.errors.chooseFromListTitle+" :x:")
|
||||||
|
.setDescription(l.errors.chooseFromListDescription+"\n`"+list.join("`\n`")+"`")
|
||||||
|
return x
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.notInATicket = new embed()
|
||||||
|
.setColor("RED")
|
||||||
|
.setTitle(":x: "+l.errors.notInTicketTitle+" :x:")
|
||||||
|
.setDescription(l.errors.notInTicketDescription)
|
||||||
|
|
||||||
|
|
||||||
|
/**@param {String} message @param {String} title */
|
||||||
|
exports.success = (title,message) => {
|
||||||
|
var x = new embed()
|
||||||
|
.setColor(config.main_color)
|
||||||
|
.setTitle(":white_check_mark: "+title+" :white_check_mark:")
|
||||||
|
.setDescription(message)
|
||||||
|
|
||||||
|
return x
|
||||||
|
}
|
||||||
|
|
||||||
|
/**@param {String} message @param {String} title */
|
||||||
|
exports.warning = (title,message) => {
|
||||||
|
var x = new embed()
|
||||||
|
.setColor("ORANGE")
|
||||||
|
.setTitle(":warning: "+title+" :warning:")
|
||||||
|
.setDescription(message)
|
||||||
|
|
||||||
|
return x
|
||||||
|
}
|
||||||
|
|
||||||
|
/**@param {String} message the message @param {String} title the title @param {String} emoji an discord emoji @param {discord.ColorResolvable} color the embed color*/
|
||||||
|
exports.custom = (title,message,emoji,color) => {
|
||||||
|
var x = new embed()
|
||||||
|
.setColor(color)
|
||||||
|
.setTitle(emoji+" "+title+" "+emoji)
|
||||||
|
.setDescription(message)
|
||||||
|
|
||||||
|
return x
|
||||||
|
}
|
||||||
|
|
||||||
|
const normalLog = (debugString) => {
|
||||||
|
const fs = require("fs")
|
||||||
|
const content = fs.existsSync("./openticketdebug.txt") ? fs.readFileSync("./openticketdebug.txt").toString() : "==========================\n<OPEN TICKET DEBUG FILE:>\n=========================="
|
||||||
|
fs.writeFileSync("./openticketdebug.txt",content+"\nSYSTEM: "+debugString)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {"system"|"command"|"info"} type
|
||||||
|
* @param {String} message
|
||||||
|
* @param {[{key:String,value:String}]} params
|
||||||
|
*/
|
||||||
|
exports.log = async (type,message,params) => {
|
||||||
|
const chalk = await loadChalk()
|
||||||
|
var paramstring = ""
|
||||||
|
if (params){
|
||||||
|
if (params.length > 0){
|
||||||
|
params.forEach((p) => {
|
||||||
|
paramstring = paramstring+p.key+": "+p.value+" "
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const parameters = params ? "("+paramstring+")" : " "
|
||||||
|
|
||||||
|
if (type == "command"){
|
||||||
|
console.log(chalk.green("[command] ")+message+" "+chalk.yellow(parameters))
|
||||||
|
}else if (type == "info"){
|
||||||
|
console.log(chalk.blue("[info] ")+message+" "+chalk.yellow(parameters))
|
||||||
|
}else if (type == "system"){
|
||||||
|
console.log(chalk.green("[system] ")+message+" "+chalk.yellow(parameters))
|
||||||
|
}
|
||||||
|
|
||||||
|
const cd = new Date()
|
||||||
|
const months = ["January","February","March","April","May","June","July","August","September","October","November","December"]
|
||||||
|
normalLog("["+cd.getDate()+" "+months[cd.getMonth()-1]+" "+cd.getFullYear()+" - "+cd.getSeconds()+":"+cd.getMinutes()+":"+cd.getHours()+"] ["+type+"] "+message+" "+parameters)
|
||||||
|
}
|
||||||
+5
-3
@@ -3,7 +3,7 @@ const config = bot.config
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Number} index
|
* @param {Number} index
|
||||||
* @param {"id"|"name"|"description"|"icon"|"label"|"type"|"color"|"adminroles"|"channelprefix"|"category"|"message"|"enableDMMessage"} value
|
* @param {"id"|"name"|"description"|"icon"|"label"|"type"|"color"|"adminroles"|"channelprefix"|"category"|"message"|"enableDMMessage"|"ticketmessage"} value
|
||||||
*/
|
*/
|
||||||
exports.getTicketValue = (index,value) => {
|
exports.getTicketValue = (index,value) => {
|
||||||
if (value == "id"){
|
if (value == "id"){
|
||||||
@@ -29,7 +29,7 @@ exports.getRoleValue = (index,value) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {"id"|"name"|"description"|"icon"|"label"|"type"|"color"|"adminroles"|"channelprefix"|"category"|"message"|"enableDMMessage"} value
|
* @param {"id"|"name"|"description"|"icon"|"label"|"type"|"color"|"adminroles"|"channelprefix"|"category"|"message"|"enableDMMessage"|"ticketmessage"} value
|
||||||
*/
|
*/
|
||||||
exports.getTicketValues = (value) => {
|
exports.getTicketValues = (value) => {
|
||||||
var result = []
|
var result = []
|
||||||
@@ -55,7 +55,7 @@ exports.getRoleValue = (index,value) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {"id"|"name"|"description"|"icon"|"label"|"type"|"color"|"roles"|"mode"|"enableDMMessage"} value
|
* @param {"id"|"name"|"description"|"icon"|"label"|"type"|"color"|"roles"|"mode"|"enableDMMessage""} value
|
||||||
*/
|
*/
|
||||||
exports.getRoleValues = (value) => {
|
exports.getRoleValues = (value) => {
|
||||||
var result = []
|
var result = []
|
||||||
@@ -79,6 +79,7 @@ class TicketOptions {
|
|||||||
this.category = ""
|
this.category = ""
|
||||||
this.message = ""
|
this.message = ""
|
||||||
this.enableDMMessage = true
|
this.enableDMMessage = true
|
||||||
|
this.ticketmessage = ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -110,5 +111,6 @@ exports.exportedOptionClass = class {
|
|||||||
this.category = ""
|
this.category = ""
|
||||||
this.message = ""
|
this.message = ""
|
||||||
this.enableDMMessage = true
|
this.enableDMMessage = true
|
||||||
|
this.ticketmessage = ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
const index = require("../index")
|
||||||
|
|
||||||
|
if (index.developerMode){
|
||||||
|
var config = require("../devConfig.json")
|
||||||
|
}else{var config = require("../config.json")}
|
||||||
|
|
||||||
|
|
||||||
|
var localLanguage = require("../language/english.json")
|
||||||
|
if (config.languagefile.startsWith("custom")) localLanguage = require("../language/custom.json")
|
||||||
|
else if (config.languagefile.startsWith("dutch")) localLanguage = require("../language/dutch.json")
|
||||||
|
else if (config.languagefile.startsWith("english")) localLanguage = require("../language/english.json")
|
||||||
|
else if (config.languagefile.startsWith("deutsch")) localLanguage = require("../language/deutsch.json")
|
||||||
|
else if (config.languagefile.startsWith("french")) localLanguage = require("../language/french.json")
|
||||||
|
else if (config.languagefile.startsWith("romanian")) localLanguage = require("../language/romanian.json")
|
||||||
|
|
||||||
|
const errorLog = async () => {
|
||||||
|
const chalk = await (await import("chalk")).default
|
||||||
|
|
||||||
|
console.log(chalk.red("Something went wrong when loading the language!")+"\nCheck the config file or create a ticket in our server!")
|
||||||
|
}
|
||||||
|
|
||||||
|
const successLog = async (language) => {
|
||||||
|
const chalk = await (await import("chalk")).default
|
||||||
|
|
||||||
|
console.log(chalk.green("loaded language "+language+"..."))
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!localLanguage){
|
||||||
|
const runError = async () => {
|
||||||
|
await errorLog()
|
||||||
|
process.exit(1)
|
||||||
|
}
|
||||||
|
runError()
|
||||||
|
}else{
|
||||||
|
exports.language = localLanguage
|
||||||
|
successLog(config.languagefile)
|
||||||
|
}
|
||||||
+14
-8
@@ -2,7 +2,8 @@ const discord = require('discord.js')
|
|||||||
const bot = require('../index')
|
const bot = require('../index')
|
||||||
const client = bot.client
|
const client = bot.client
|
||||||
const config = bot.config
|
const config = bot.config
|
||||||
|
const log = bot.errorLog.log
|
||||||
|
const l = bot.language
|
||||||
const storage = bot.storage
|
const storage = bot.storage
|
||||||
|
|
||||||
module.exports = async () => {
|
module.exports = async () => {
|
||||||
@@ -14,12 +15,13 @@ module.exports = async () => {
|
|||||||
|
|
||||||
interaction.deferUpdate()
|
interaction.deferUpdate()
|
||||||
|
|
||||||
|
if (interaction.customId.startsWith("newR")){
|
||||||
const optionid = interaction.customId.split("newR")[1]
|
const optionid = interaction.customId.split("newR")[1]
|
||||||
if (!optionid){
|
if (!optionid){
|
||||||
interaction.reply({content:"This button doesn't exist anymore"})
|
interaction.reply({embeds:[bot.errorLog.serverError(l.errors.roleDoesntExist)]})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
|
|
||||||
const option = require("./utils/getButton").getOption(optionid)
|
const option = require("./utils/getButton").getOption(optionid)
|
||||||
@@ -30,27 +32,31 @@ module.exports = async () => {
|
|||||||
if (mode == "add"){
|
if (mode == "add"){
|
||||||
option.roles.forEach((role) => {
|
option.roles.forEach((role) => {
|
||||||
interaction.guild.members.cache.find(u => u.id == user.id).roles.add(role)
|
interaction.guild.members.cache.find(u => u.id == user.id).roles.add(role)
|
||||||
console.log("[system] added role",role,"to",user.user.tag)
|
|
||||||
|
log("system","added role (reaction roles)",[{key:"user",value:interaction.user.tag},{key:"role",value:role}])
|
||||||
})
|
})
|
||||||
}else if (mode == "remove"){
|
}else if (mode == "remove"){
|
||||||
option.roles.forEach((role) => {
|
option.roles.forEach((role) => {
|
||||||
interaction.guild.members.cache.find(u => u.id == user.id).roles.remove(role)
|
interaction.guild.members.cache.find(u => u.id == user.id).roles.remove(role)
|
||||||
console.log("[system] removed role",role,"from",user.user.tag)
|
|
||||||
|
log("system","removed role (reaction roles)",[{key:"user",value:interaction.user.tag},{key:"role",value:role}])
|
||||||
})
|
})
|
||||||
}else if (mode == "add&remove"){
|
}else if (mode == "add&remove"){
|
||||||
option.roles.forEach((role) => {
|
option.roles.forEach((role) => {
|
||||||
if (interaction.guild.members.cache.find(u => u.id == user.id).roles.cache.has(role)){
|
if (interaction.guild.members.cache.find(u => u.id == user.id).roles.cache.has(role)){
|
||||||
interaction.guild.members.cache.find(u => u.id == user.id).roles.remove(role)
|
interaction.guild.members.cache.find(u => u.id == user.id).roles.remove(role)
|
||||||
console.log("[system] removed role",role,"from",user.user.tag)
|
|
||||||
|
log("system","added role (reaction roles)",[{key:"user",value:interaction.user.tag},{key:"role",value:role}])
|
||||||
}else {
|
}else {
|
||||||
interaction.guild.members.cache.find(u => u.id == user.id).roles.add(role)
|
interaction.guild.members.cache.find(u => u.id == user.id).roles.add(role)
|
||||||
console.log("[system] added role",role,"to",user.user.tag)
|
|
||||||
|
log("system","removed role (reaction roles)",[{key:"user",value:interaction.user.tag},{key:"role",value:role}])
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}catch{
|
}catch{
|
||||||
interaction.reply({ephemeral:true,content:"Something went wrong! Contact the owner of this bot for more information"})
|
interaction.replyinteraction.channel.send({embeds:[bot.errorLog.serverError(l.errors.somethingWentWrong)]})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -13,7 +13,9 @@ module.exports = async () => {
|
|||||||
var choices = []
|
var choices = []
|
||||||
ids.forEach((id) => {
|
ids.forEach((id) => {
|
||||||
const option = getoptions.getOptionsById(id)
|
const option = getoptions.getOptionsById(id)
|
||||||
|
if (option.type == "ticket"){
|
||||||
choices.push({name:option.name,value:option.id})
|
choices.push({name:option.name,value:option.id})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
/**@type {[{name:String,value:String}]} */
|
/**@type {[{name:String,value:String}]} */
|
||||||
@@ -24,11 +26,11 @@ module.exports = async () => {
|
|||||||
|
|
||||||
var readystats = 0
|
var readystats = 0
|
||||||
|
|
||||||
process.stdout.write("[status] there are "+chalk.blue("0 out of 9")+" commands ready! (this can take up to 40 seconds)")
|
process.stdout.write("[status] there are "+chalk.blue("0 out of 10")+" commands ready! (this can take up to 40 seconds)")
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
process.stdout.cursorTo(0)
|
process.stdout.cursorTo(0)
|
||||||
process.stdout.write("[status] there are "+chalk.blue(readystats+" out of 9")+" commands ready! (this can take up to 40 seconds)")
|
process.stdout.write("[status] there are "+chalk.blue(readystats+" out of 9")+" commands ready! (this can take up to 40 seconds)")
|
||||||
if (readystats >= 9){
|
if (readystats >= 10){
|
||||||
console.log(chalk.green("\nready!"))
|
console.log(chalk.green("\nready!"))
|
||||||
console.log(chalk.bgBlue("you can now start the bot with 'npm start'!"))
|
console.log(chalk.bgBlue("you can now start the bot with 'npm start'!"))
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
@@ -179,4 +181,14 @@ module.exports = async () => {
|
|||||||
readystats++
|
readystats++
|
||||||
})
|
})
|
||||||
|
|
||||||
|
//reopen
|
||||||
|
client.application.commands.create({
|
||||||
|
name:"reopen",
|
||||||
|
description:"Reopen this ticket.",
|
||||||
|
defaultPermission:true,
|
||||||
|
type:"CHAT_INPUT"
|
||||||
|
},sid).then(() => {
|
||||||
|
readystats++
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
+110
-17
@@ -2,7 +2,8 @@ const discord = require('discord.js')
|
|||||||
const bot = require('../index')
|
const bot = require('../index')
|
||||||
const client = bot.client
|
const client = bot.client
|
||||||
const config = bot.config
|
const config = bot.config
|
||||||
|
const log = bot.errorLog.log
|
||||||
|
const l = bot.language
|
||||||
const storage = bot.storage
|
const storage = bot.storage
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -14,6 +15,7 @@ const storage = bot.storage
|
|||||||
exports.closeTicket = async (interaction,prefix,mode) => {
|
exports.closeTicket = async (interaction,prefix,mode) => {
|
||||||
const chalk = await (await import("chalk")).default
|
const chalk = await (await import("chalk")).default
|
||||||
const channelmessages = await interaction.channel.messages.fetch()
|
const channelmessages = await interaction.channel.messages.fetch()
|
||||||
|
const channel = interaction.channel
|
||||||
|
|
||||||
channelmessages.sweep((msgSweep) => {
|
channelmessages.sweep((msgSweep) => {
|
||||||
return msgSweep.author.id == client.user.id
|
return msgSweep.author.id == client.user.id
|
||||||
@@ -41,11 +43,46 @@ exports.closeTicket = async (interaction,prefix,mode) => {
|
|||||||
var enableTranscript = true
|
var enableTranscript = true
|
||||||
|
|
||||||
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)
|
||||||
|
if (config.main_adminroles.some((item)=>{return permsmember.roles.cache.has(item)}) == false && !permsmember.permissions.has("ADMINISTRATOR") && !permsmember.permissions.has("MANAGE_GUILD")){
|
||||||
|
interaction.channel.send({embeds:[bot.errorLog.noPermsMessage]})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
interaction.channel.delete()
|
interaction.channel.delete()
|
||||||
if (config.logs){console.log("[system] deleted a ticket (name:"+interaction.channel.name+",user:"+interaction.user.username+")")}
|
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)
|
||||||
|
|
||||||
|
//getID & send DM
|
||||||
|
interaction.channel.messages.fetchPinned().then(msglist => {
|
||||||
|
var firstmsg = msglist.last()
|
||||||
|
|
||||||
|
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return false
|
||||||
|
|
||||||
|
if (!firstmsg.embeds[0].author) return false
|
||||||
|
const id = firstmsg.embeds[0].author.name
|
||||||
|
|
||||||
|
if (!id) return false
|
||||||
|
|
||||||
|
try{
|
||||||
|
if (config.system.enable_DM_Messages){
|
||||||
|
interaction.member.send({embeds:[bot.errorLog.custom(l.messages.deletedTicketDmTitle,l.messages.deletedTicketDmDescription,":ticket:",config.main_color)]})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch{log("system","can't send DM to member, member doesn't allow dm's")}
|
||||||
|
})
|
||||||
|
|
||||||
}else if (mode == "close"){
|
}else if (mode == "close"){
|
||||||
|
|
||||||
|
if (config.system.closeMode == "adminonly"){
|
||||||
|
const permsmember = client.guilds.cache.find(g => g.id == interaction.guild.id).members.cache.find(m => m.id == interaction.member.id)
|
||||||
|
if (config.main_adminroles.some((item)=>{return permsmember.roles.cache.has(item)}) == false && !permsmember.permissions.has("ADMINISTRATOR") && !permsmember.permissions.has("MANAGE_GUILD")){
|
||||||
|
interaction.channel.send({embeds:[bot.errorLog.noPermsMessage]})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var permissionArray = []
|
var permissionArray = []
|
||||||
if (!isDatabaseError) permissionArray.push({
|
if (!isDatabaseError) permissionArray.push({
|
||||||
id:getusernameStep1.id,
|
id:getusernameStep1.id,
|
||||||
@@ -69,7 +106,7 @@ exports.closeTicket = async (interaction,prefix,mode) => {
|
|||||||
.setCustomId("deleteTicket1")
|
.setCustomId("deleteTicket1")
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setStyle("DANGER")
|
.setStyle("DANGER")
|
||||||
.setLabel("Delete Ticket")
|
.setLabel(l.buttons.delete)
|
||||||
.setEmoji("✖️")
|
.setEmoji("✖️")
|
||||||
)
|
)
|
||||||
.addComponents(
|
.addComponents(
|
||||||
@@ -77,36 +114,92 @@ exports.closeTicket = async (interaction,prefix,mode) => {
|
|||||||
.setCustomId("sendTranscript")
|
.setCustomId("sendTranscript")
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setStyle("SECONDARY")
|
.setStyle("SECONDARY")
|
||||||
.setLabel("Send Transcript File")
|
.setLabel(l.buttons.sendTranscript)
|
||||||
.setEmoji("📄")
|
.setEmoji("📄")
|
||||||
)
|
)
|
||||||
|
.addComponents(
|
||||||
|
new discord.MessageButton()
|
||||||
|
.setCustomId("reopenTicket")
|
||||||
|
.setDisabled(false)
|
||||||
|
.setStyle("SUCCESS")
|
||||||
|
.setLabel(l.buttons.reopen)
|
||||||
|
.setEmoji("✔")
|
||||||
|
)
|
||||||
|
|
||||||
const embed = new discord.MessageEmbed()
|
const embed = new discord.MessageEmbed()
|
||||||
.setColor(config.main_color)
|
.setColor(config.main_color)
|
||||||
.setTitle("Closed this ticket!")
|
.setTitle(":lock: "+l.messages.closedTitle+" :lock:")
|
||||||
.setDescription("Only admins can now talk in this ticket!\n\n*Click on the button below to delete this ticket*")
|
.setDescription(l.messages.closedDescription)
|
||||||
interaction.channel.send({embeds:[embed],components:[closeButtonRow]})
|
interaction.channel.send({embeds:[embed],components:[closeButtonRow]})
|
||||||
|
|
||||||
|
log("system","closed a ticket",[{key:"user",value:interaction.user.tag},{key:"ticket",value:interaction.channel.name}])
|
||||||
|
|
||||||
|
//getID & send DM
|
||||||
|
interaction.channel.messages.fetchPinned().then(msglist => {
|
||||||
|
var firstmsg = msglist.last()
|
||||||
|
|
||||||
|
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return false
|
||||||
|
|
||||||
|
const id = firstmsg.embeds[0].author.name
|
||||||
|
|
||||||
|
if (!id) return false
|
||||||
|
|
||||||
|
try{
|
||||||
|
if (config.system.enable_DM_Messages){
|
||||||
|
interaction.member.send({embeds:[bot.errorLog.custom(l.messages.closedTicketDmTitle,l.messages.closedTicketDmDescription,":ticket:",config.main_color)]})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch{log("system","can't send DM to member, member doesn't allow dm's")}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
}else if (mode == "deletenotranscript"){
|
}else if (mode == "deletenotranscript"){
|
||||||
|
|
||||||
|
const permsmember = client.guilds.cache.find(g => g.id == interaction.guild.id).members.cache.find(m => m.id == interaction.member.id)
|
||||||
|
if (config.main_adminroles.some((item)=>{return permsmember.roles.cache.has(item)}) == false && !permsmember.permissions.has("ADMINISTRATOR") && !permsmember.permissions.has("MANAGE_GUILD")){
|
||||||
|
interaction.channel.send({embeds:[bot.errorLog.noPermsMessage]})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
enableTranscript = false
|
enableTranscript = false
|
||||||
interaction.channel.delete()
|
interaction.channel.delete()
|
||||||
if (config.logs){console.log("[system] deleted a ticket (name:"+interaction.channel.name+",user:"+interaction.user.username+")")}
|
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)
|
||||||
|
|
||||||
|
//getID & send DM
|
||||||
|
interaction.channel.messages.fetchPinned().then(msglist => {
|
||||||
|
var firstmsg = msglist.last()
|
||||||
|
|
||||||
|
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return false
|
||||||
|
|
||||||
|
const id = firstmsg.embeds[0].author.name
|
||||||
|
|
||||||
|
if (!id) return false
|
||||||
|
|
||||||
|
try{
|
||||||
|
if (config.system.enable_DM_Messages){
|
||||||
|
interaction.member.send({embeds:[bot.errorLog.custom(l.messages.deletedTicketDmTitle,l.messages.deletedTicketDmDescription,":ticket:",config.main_color)]})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch{log("system","can't send DM to member, member doesn't allow dm's")}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
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){
|
||||||
var fileattachment = await require("./transcript").createTranscript(channelmessages)
|
var fileattachment = await require("./transcript").createTranscript(channelmessages,channel)
|
||||||
|
|
||||||
if (fileattachment == false){console.log("[transcript] internal error: no transcript is created!");return}
|
if (fileattachment == false){log("system","internal error: transcript is not created!");return}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.system.enable_transcript){
|
if (config.system.enable_transcript){
|
||||||
const transcriptEmbed = new discord.MessageEmbed()
|
const transcriptEmbed = new discord.MessageEmbed()
|
||||||
.setColor(config.main_color)
|
.setColor(config.main_color)
|
||||||
.setTitle("A new transcript is here!")
|
.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"})})
|
||||||
.setDescription("You can find the transcript in the text file above!")
|
.setDescription(l.messages.newTranscriptDescription)
|
||||||
.setFooter({text:"ticket: "+ticketuserarray})
|
.setFooter({text:"ticket: "+ticketuserarray})
|
||||||
|
|
||||||
interaction.guild.channels.cache.find(c => c.id == config.system.transcript_channel).send({
|
interaction.guild.channels.cache.find(c => c.id == config.system.transcript_channel).send({
|
||||||
@@ -118,8 +211,8 @@ 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.MessageEmbed()
|
||||||
.setColor(config.main_color)
|
.setColor(config.main_color)
|
||||||
.setTitle("Here is a transcript of your ticket!")
|
.setTitle(l.messages.newTranscriptTitle)
|
||||||
.setDescription("You can find the transcript in the text file above!")
|
.setDescription(l.messages.newTranscriptDescription)
|
||||||
.setFooter({text:"ticket: "+ticketuserarray})
|
.setFooter({text:"ticket: "+ticketuserarray})
|
||||||
|
|
||||||
if (!isDatabaseError) getusernameStep1.send({
|
if (!isDatabaseError) getusernameStep1.send({
|
||||||
@@ -143,14 +236,14 @@ exports.runThis = () => {
|
|||||||
return msgSweep.author.id == client.user.id
|
return msgSweep.author.id == client.user.id
|
||||||
})
|
})
|
||||||
|
|
||||||
var fileattachment = await require("./transcript").createTranscript(channelmessages)
|
var fileattachment = await require("./transcript").createTranscript(channelmessages,interaction.channel)
|
||||||
|
|
||||||
if (fileattachment == false){
|
if (fileattachment == false){
|
||||||
console.log("[transcript] internal error: no transcript is created!")
|
log("system","internal error: transcript is not created!")
|
||||||
interaction.channel.send({content:"**Something went wrong while making the transcript!**\nPlease try again another time!"})
|
interaction.channel.send({embeds:[bot.errorLog.serverError(l.errors.somethingWentWrongTranscript)]})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
interaction.channel.send({content:"**Here is the transcript:**",files:[fileattachment]})
|
interaction.channel.send({content:"**"+l.messages.hereIsTheTranscript+"**",files:[fileattachment]})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -3,6 +3,7 @@ const bot = require('../index')
|
|||||||
const client = bot.client
|
const client = bot.client
|
||||||
const config = bot.config
|
const config = bot.config
|
||||||
const getButton = require("./utils/getButton")
|
const getButton = require("./utils/getButton")
|
||||||
|
const l = bot.language
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -39,7 +40,7 @@ exports.createEmbed = (id) => {
|
|||||||
|
|
||||||
var description = data.description
|
var description = data.description
|
||||||
if (data.enableTicketExplaination){
|
if (data.enableTicketExplaination){
|
||||||
description = description+"\n\n__choose a category:__\n"
|
description = description+"\n\n__"+l.messages.chooseCategory+"__\n"
|
||||||
|
|
||||||
var ticketExplainations = []
|
var ticketExplainations = []
|
||||||
buttonData.forEach((button) => {
|
buttonData.forEach((button) => {
|
||||||
@@ -51,7 +52,7 @@ exports.createEmbed = (id) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (data.enableMaxTicketsWarning){
|
if (data.enableMaxTicketsWarning){
|
||||||
description = description+"\n\n**Warning:** _You can only create "+config.system.max_allowed_tickets+" ticket(s) at a time!_"
|
description = description+"\n\n"+l.commands.maxTicketWarning.replace("{0}",config.system.max_allowed_tickets)
|
||||||
}
|
}
|
||||||
|
|
||||||
embed.setDescription(description)
|
embed.setDescription(description)
|
||||||
|
|||||||
+29
-15
@@ -2,6 +2,8 @@ const discord = require('discord.js')
|
|||||||
const bot = require('../index')
|
const bot = require('../index')
|
||||||
const client = bot.client
|
const client = bot.client
|
||||||
const config = bot.config
|
const config = bot.config
|
||||||
|
const l = bot.language
|
||||||
|
const log = bot.errorLog.log
|
||||||
|
|
||||||
const getconfigoptions = require("./getoptions")
|
const getconfigoptions = require("./getoptions")
|
||||||
const storage = bot.storage
|
const storage = bot.storage
|
||||||
@@ -13,7 +15,7 @@ module.exports = () => {
|
|||||||
.setCustomId("closeTicket")
|
.setCustomId("closeTicket")
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setStyle("SECONDARY")
|
.setStyle("SECONDARY")
|
||||||
.setLabel("Close Ticket")
|
.setLabel(l.buttons.close)
|
||||||
.setEmoji("🔒")
|
.setEmoji("🔒")
|
||||||
)
|
)
|
||||||
.addComponents(
|
.addComponents(
|
||||||
@@ -21,7 +23,7 @@ module.exports = () => {
|
|||||||
.setCustomId("deleteTicket")
|
.setCustomId("deleteTicket")
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setStyle("DANGER")
|
.setStyle("DANGER")
|
||||||
.setLabel("Delete Ticket")
|
.setLabel(l.buttons.delete)
|
||||||
.setEmoji("✖️")
|
.setEmoji("✖️")
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -33,25 +35,35 @@ module.exports = () => {
|
|||||||
var customId = interaction.customId
|
var customId = interaction.customId
|
||||||
}else return
|
}else return
|
||||||
|
|
||||||
|
if (interaction.customId.startsWith("newT")){
|
||||||
|
const optionid = interaction.customId.split("newT")[1]
|
||||||
|
if (!optionid){
|
||||||
|
interaction.reply({embeds:[bot.errorLog.serverError(l.errors.ticketDoesntExist)]})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (getconfigoptions.getTicketValues("id").includes(customId)){
|
if (getconfigoptions.getTicketValues("id").includes(customId)){
|
||||||
|
|
||||||
|
//ticketoptions from config
|
||||||
|
const currentTicketOptions = getconfigoptions.getOptionsById(customId)
|
||||||
|
|
||||||
|
if (currentTicketOptions == false || currentTicketOptions.type != "ticket") return interaction.reply({embeds:[bot.errorLog.serverError(l.errors.anotherOption)]})
|
||||||
|
|
||||||
if (interaction.isButton()){
|
if (interaction.isButton()){
|
||||||
interaction.deferUpdate()
|
interaction.deferUpdate()
|
||||||
}else if (interaction.isCommand()){
|
}else if (interaction.isCommand()){
|
||||||
interaction.reply({content:"Your ticket is created!"})
|
interaction.reply({embeds:[bot.errorLog.success(l.messages.createdTitle,l.messages.createdDescription)]})
|
||||||
}
|
}
|
||||||
|
|
||||||
//ticketoptions from config
|
|
||||||
const currentTicketOptions = getconfigoptions.getOptionsById(customId)
|
|
||||||
|
|
||||||
if (storage.get("ticketStorage",interaction.member.id) == null || storage.get("ticketStorage",interaction.member.id) == "false"|| Number(storage.get("ticketStorage",interaction.member.id)) < config.system.max_allowed_tickets){
|
if (storage.get("ticketStorage",interaction.member.id) == null || storage.get("ticketStorage",interaction.member.id) == "false"|| Number(storage.get("ticketStorage",interaction.member.id)) < config.system.max_allowed_tickets){
|
||||||
|
|
||||||
try{
|
try{
|
||||||
if (config.system.enable_DM_Messages){
|
if (config.system.enable_DM_Messages){
|
||||||
interaction.member.send({content:currentTicketOptions.message})
|
interaction.member.send({embeds:[bot.errorLog.custom(l.messages.newTicketDmTitle,currentTicketOptions.message,":ticket:",config.main_color)]})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch{console.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")}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -132,34 +144,36 @@ module.exports = () => {
|
|||||||
interaction.guild.channels.create(ticketName,{
|
interaction.guild.channels.create(ticketName,{
|
||||||
type:"GUILD_TEXT",
|
type:"GUILD_TEXT",
|
||||||
parent:newTicketCategory,
|
parent:newTicketCategory,
|
||||||
reason:"A new ticket was created",
|
reason:"A new ticket is created",
|
||||||
permissionOverwrites:permissionsArray
|
permissionOverwrites:permissionsArray
|
||||||
|
|
||||||
}).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.MessageEmbed()
|
||||||
|
.setAuthor({name:interaction.user.id})
|
||||||
.setColor(config.main_color)
|
.setColor(config.main_color)
|
||||||
.setTitle("You created a ticket!")
|
.setTitle(currentTicketOptions.name)
|
||||||
.setDescription("The staff will help you soon!\n\n*Click on the button below to close the ticket!*")
|
if (currentTicketOptions.ticketmessage.length > 0) ticketEmbed.setDescription(currentTicketOptions.ticketmessage)
|
||||||
|
|
||||||
ticketChannel.send({
|
ticketChannel.send({
|
||||||
content:"<@"+interaction.member.id+"> @everyone",
|
content:"<@"+interaction.member.id+"> @here",
|
||||||
embeds:[ticketEmbed],
|
embeds:[ticketEmbed],
|
||||||
components:[closeButton]
|
components:[closeButton]
|
||||||
|
|
||||||
}).then(firstmsg => {
|
}).then(firstmsg => {
|
||||||
firstmsg.pin()
|
firstmsg.pin()
|
||||||
})
|
})
|
||||||
if (config.logs){console.log("[system] created a new ticket (name:"+logsname+",user:"+interaction.user.username+")")}
|
|
||||||
|
log("system","created new ticket",[{key:"ticket",value:ticketName},{key:"user",value:interaction.user.tag}])
|
||||||
})
|
})
|
||||||
}else{
|
}else{
|
||||||
try {
|
try {
|
||||||
if (config.system.enable_DM_Messages){
|
if (config.system.enable_DM_Messages){
|
||||||
interaction.member.send("you already have the maximum number of tickets allowed!")
|
interaction.member.send({embeds:[bot.errorLog.warning(l.errors.maxAmountTitle,l.errors.maxAmountDescription)]})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch{console.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")}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,245 @@
|
|||||||
|
const discord = require('discord.js')
|
||||||
|
const bot = require('../index')
|
||||||
|
const client = bot.client
|
||||||
|
const config = bot.config
|
||||||
|
const log = bot.errorLog.log
|
||||||
|
const l = bot.language
|
||||||
|
const storage = bot.storage
|
||||||
|
|
||||||
|
module.exports = () => {
|
||||||
|
var closeRowNormal = new discord.MessageActionRow()
|
||||||
|
.addComponents(
|
||||||
|
new discord.MessageButton()
|
||||||
|
.setCustomId("closeTicket")
|
||||||
|
.setDisabled(false)
|
||||||
|
.setStyle("SECONDARY")
|
||||||
|
.setLabel(l.buttons.close)
|
||||||
|
.setEmoji("🔒")
|
||||||
|
)
|
||||||
|
.addComponents(
|
||||||
|
new discord.MessageButton()
|
||||||
|
.setCustomId("deleteTicket")
|
||||||
|
.setDisabled(false)
|
||||||
|
.setStyle("DANGER")
|
||||||
|
.setLabel(l.buttons.delete)
|
||||||
|
.setEmoji("✖️")
|
||||||
|
)
|
||||||
|
|
||||||
|
var closeRowClosed = new discord.MessageActionRow()
|
||||||
|
.addComponents(
|
||||||
|
new discord.MessageButton()
|
||||||
|
.setCustomId("deleteTicket1")
|
||||||
|
.setDisabled(false)
|
||||||
|
.setStyle("DANGER")
|
||||||
|
.setLabel(l.buttons.delete)
|
||||||
|
.setEmoji("✖️")
|
||||||
|
)
|
||||||
|
.addComponents(
|
||||||
|
new discord.MessageButton()
|
||||||
|
.setCustomId("sendTranscript")
|
||||||
|
.setDisabled(false)
|
||||||
|
.setStyle("SECONDARY")
|
||||||
|
.setLabel(l.buttons.sendTranscript)
|
||||||
|
.setEmoji("📄")
|
||||||
|
)
|
||||||
|
.addComponents(
|
||||||
|
new discord.MessageButton()
|
||||||
|
.setCustomId("reopenTicket")
|
||||||
|
.setDisabled(false)
|
||||||
|
.setStyle("SUCCESS")
|
||||||
|
.setLabel(l.buttons.reopen)
|
||||||
|
.setEmoji("✔")
|
||||||
|
)
|
||||||
|
|
||||||
|
var reopenBar = new discord.MessageActionRow()
|
||||||
|
.addComponents(
|
||||||
|
new discord.MessageButton()
|
||||||
|
.setCustomId("reopenTicketTrue")
|
||||||
|
.setDisabled(false)
|
||||||
|
.setStyle("SECONDARY")
|
||||||
|
.setEmoji("✅")
|
||||||
|
)
|
||||||
|
.addComponents(
|
||||||
|
new discord.MessageButton()
|
||||||
|
.setCustomId("reopenTicketFalse")
|
||||||
|
.setDisabled(false)
|
||||||
|
.setStyle("SECONDARY")
|
||||||
|
.setEmoji("❌")
|
||||||
|
)
|
||||||
|
|
||||||
|
var reopenBar1 = new discord.MessageActionRow()
|
||||||
|
.addComponents(
|
||||||
|
new discord.MessageButton()
|
||||||
|
.setCustomId("reopenTicketTrue1")
|
||||||
|
.setDisabled(false)
|
||||||
|
.setStyle("SECONDARY")
|
||||||
|
.setEmoji("✅")
|
||||||
|
)
|
||||||
|
.addComponents(
|
||||||
|
new discord.MessageButton()
|
||||||
|
.setCustomId("reopenTicketFalse1")
|
||||||
|
.setDisabled(false)
|
||||||
|
.setStyle("SECONDARY")
|
||||||
|
.setEmoji("❌")
|
||||||
|
)
|
||||||
|
|
||||||
|
var reopenCommandBar = new discord.MessageActionRow()
|
||||||
|
.addComponents(
|
||||||
|
new discord.MessageButton()
|
||||||
|
.setCustomId("reopenTicket1")
|
||||||
|
.setDisabled(false)
|
||||||
|
.setStyle("SECONDARY")
|
||||||
|
.setEmoji("🔓")
|
||||||
|
)
|
||||||
|
|
||||||
|
//NORMAL WAY
|
||||||
|
client.on("interactionCreate",(interaction) => {
|
||||||
|
if (!interaction.isButton()) return
|
||||||
|
if (interaction.customId != "reopenTicket") return
|
||||||
|
|
||||||
|
interaction.deferUpdate()
|
||||||
|
interaction.message.edit({components:[reopenBar]})
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
client.on("interactionCreate",(interaction) => {
|
||||||
|
if (!interaction.isButton()) return
|
||||||
|
if (interaction.customId != "reopenTicketFalse") return
|
||||||
|
|
||||||
|
interaction.deferUpdate()
|
||||||
|
interaction.message.edit({components:[closeRowClosed]})
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
client.on("interactionCreate",(interaction) => {
|
||||||
|
if (!interaction.isButton()) return
|
||||||
|
if (interaction.customId != "reopenTicketTrue") return
|
||||||
|
|
||||||
|
interaction.deferUpdate()
|
||||||
|
|
||||||
|
const embed = new discord.MessageEmbed()
|
||||||
|
.setColor(config.main_color)
|
||||||
|
.setTitle(":unlock: "+l.messages.reopenTitle+" :unlock:")
|
||||||
|
.setDescription(l.messages.reopenDescription)
|
||||||
|
|
||||||
|
interaction.message.edit({embeds:[embed],components:[closeRowNormal]})
|
||||||
|
|
||||||
|
log("system","re-opened a ticket",[{key:"ticket",value:interaction.channel.name},{key:"user",value:interaction.user.tag}])
|
||||||
|
|
||||||
|
|
||||||
|
var permissionsArray = []
|
||||||
|
|
||||||
|
//set everyone allowed
|
||||||
|
if (config.system['has@everyoneaccess']){
|
||||||
|
var everyoneAllowPerms = ["ADD_REACTIONS","ATTACH_FILES","EMBED_LINKS","SEND_MESSAGES","VIEW_CHANNEL"]
|
||||||
|
var everyoneDenyPerms = []
|
||||||
|
}else{
|
||||||
|
var everyoneAllowPerms = []
|
||||||
|
var everyoneDenyPerms = ["VIEW_CHANNEL"]
|
||||||
|
}
|
||||||
|
permissionsArray.push({
|
||||||
|
id:interaction.guild.id,
|
||||||
|
type:"role",
|
||||||
|
allow:everyoneAllowPerms,
|
||||||
|
deny:everyoneDenyPerms
|
||||||
|
})
|
||||||
|
|
||||||
|
interaction.channel.permissionOverwrites.cache.forEach((p) => {
|
||||||
|
if (p.type == "member"){
|
||||||
|
permissionsArray.push({
|
||||||
|
id:p.id,
|
||||||
|
type:"member",
|
||||||
|
allow:["ADD_REACTIONS","ATTACH_FILES","EMBED_LINKS","SEND_MESSAGES","VIEW_CHANNEL"],
|
||||||
|
deny:[]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
interaction.channel.permissionOverwrites.set(permissionsArray)
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
//COMMAND WAY
|
||||||
|
client.on("interactionCreate",(interaction) => {
|
||||||
|
if (!interaction.isButton()) return
|
||||||
|
if (interaction.customId != "reopenTicket1") return
|
||||||
|
|
||||||
|
interaction.deferUpdate()
|
||||||
|
interaction.message.edit({components:[reopenBar1]})
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
client.on("interactionCreate",(interaction) => {
|
||||||
|
if (!interaction.isButton()) return
|
||||||
|
if (interaction.customId != "reopenTicketFalse1") return
|
||||||
|
|
||||||
|
interaction.deferUpdate()
|
||||||
|
interaction.message.edit({components:[reopenCommandBar]})
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
client.on("interactionCreate",(interaction) => {
|
||||||
|
if (!interaction.isButton()) return
|
||||||
|
if (interaction.customId != "reopenTicketTrue1") return
|
||||||
|
|
||||||
|
interaction.deferUpdate()
|
||||||
|
|
||||||
|
const embed = new discord.MessageEmbed()
|
||||||
|
.setColor(config.main_color)
|
||||||
|
.setTitle(":unlock: "+l.messages.reopenTitle+" :unlock:")
|
||||||
|
.setDescription(l.messages.reopenDescription)
|
||||||
|
|
||||||
|
interaction.message.edit({content:null,embeds:[embed],components:[closeRowNormal]})
|
||||||
|
|
||||||
|
log("system","re-opened a ticket",[{key:"ticket",value:interaction.channel.name},{key:"user",value:interaction.user.tag}])
|
||||||
|
|
||||||
|
|
||||||
|
var permissionsArray = []
|
||||||
|
|
||||||
|
//set everyone allowed
|
||||||
|
if (config.system['has@everyoneaccess']){
|
||||||
|
var everyoneAllowPerms = ["ADD_REACTIONS","ATTACH_FILES","EMBED_LINKS","SEND_MESSAGES","VIEW_CHANNEL"]
|
||||||
|
var everyoneDenyPerms = []
|
||||||
|
}else{
|
||||||
|
var everyoneAllowPerms = []
|
||||||
|
var everyoneDenyPerms = ["VIEW_CHANNEL"]
|
||||||
|
}
|
||||||
|
permissionsArray.push({
|
||||||
|
id:interaction.guild.id,
|
||||||
|
type:"role",
|
||||||
|
allow:everyoneAllowPerms,
|
||||||
|
deny:everyoneDenyPerms
|
||||||
|
})
|
||||||
|
|
||||||
|
interaction.channel.permissionOverwrites.cache.forEach((p) => {
|
||||||
|
if (p.type == "member"){
|
||||||
|
permissionsArray.push({
|
||||||
|
id:p.id,
|
||||||
|
type:"member",
|
||||||
|
allow:["ADD_REACTIONS","ATTACH_FILES","EMBED_LINKS","SEND_MESSAGES","VIEW_CHANNEL"],
|
||||||
|
deny:[]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
interaction.channel.permissionOverwrites.set(permissionsArray)
|
||||||
|
|
||||||
|
//getID & send DM
|
||||||
|
interaction.channel.messages.fetchPinned().then(msglist => {
|
||||||
|
var firstmsg = msglist.last()
|
||||||
|
|
||||||
|
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return false
|
||||||
|
|
||||||
|
const id = firstmsg.embeds[0].author.name
|
||||||
|
|
||||||
|
if (!id) return false
|
||||||
|
|
||||||
|
try{
|
||||||
|
if (config.system.enable_DM_Messages){
|
||||||
|
interaction.member.send({embeds:[bot.errorLog.custom(l.messages.reopenTicketDmTitle,l.messages.reopenTicketDmDescription,":ticket:",config.main_color)]})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch{log("system","can't send DM to member, member doesn't allow dm's")}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
+41
-5
@@ -2,20 +2,56 @@ const discord = require('discord.js')
|
|||||||
const bot = require('../index')
|
const bot = require('../index')
|
||||||
const client = bot.client
|
const client = bot.client
|
||||||
const config = bot.config
|
const config = bot.config
|
||||||
|
const l = bot.language
|
||||||
|
|
||||||
|
/** @param {discord.TextBasedChannel} channel @returns {Promise<{ticketname:String,ticketopener:{discordjsuser:discord.User,name:String,id:String}>} */
|
||||||
|
const getUserInfo = (channel) => {
|
||||||
|
return new Promise((promiseresolve,reject) => {
|
||||||
|
//getID
|
||||||
|
var result = {
|
||||||
|
ticketopener:{
|
||||||
|
discordjsuser:"",
|
||||||
|
id:"/",
|
||||||
|
name:"/"
|
||||||
|
},
|
||||||
|
ticketname:"/"
|
||||||
|
}
|
||||||
|
channel.messages.fetchPinned().then(msglist => {
|
||||||
|
var firstmsg = msglist.last()
|
||||||
|
|
||||||
|
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return false
|
||||||
|
|
||||||
|
const id = firstmsg.embeds[0].author.name ? firstmsg.embeds[0].author.name : false
|
||||||
|
|
||||||
|
result.ticketopener.id = id
|
||||||
|
|
||||||
|
const ticketopener = client.users.cache.find(u => u.id == id)
|
||||||
|
const name = ticketopener.tag
|
||||||
|
|
||||||
|
const channelname = channel.name
|
||||||
|
|
||||||
|
promiseresolve({ticketname:channelname,ticketopener:{discordjsuser:ticketopener,name:name,id:id}})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {discord.Message[]} messagecollection
|
* @param {discord.Message[]} messagecollection
|
||||||
|
* @param {discord.Channel} channel
|
||||||
* @returns new `discord.messageAttachment`
|
* @returns new `discord.messageAttachment`
|
||||||
*/
|
*/
|
||||||
|
|
||||||
exports.createTranscript = async (messagecollection) => {
|
exports.createTranscript = async (messagecollection,channel) => {
|
||||||
|
const ticketuserdata = await getUserInfo(channel)
|
||||||
try {
|
try {
|
||||||
const filearray = ["TRANSCRIPT START:"]
|
const cd = new Date()
|
||||||
|
const months = ["January","February","March","April","May","June","July","August","September","October","November","December"]
|
||||||
|
const dateString = cd.getDate()+" "+months[cd.getMonth()-1]+" "+cd.getFullYear()+" - "+cd.getSeconds()+":"+cd.getMinutes()+":"+cd.getHours()
|
||||||
|
const filearray = ["open ticket transcript:\ntranscript creation: "+dateString+"\nticket name: "+ticketuserdata.ticketname+"\nticket opener: "+ticketuserdata.ticketopener.name,"\nTRANSCRIPT START:"]
|
||||||
|
|
||||||
messagecollection.reverse()
|
messagecollection.reverse()
|
||||||
|
|
||||||
|
|
||||||
messagecollection.forEach((msg) => {
|
messagecollection.forEach((msg) => {
|
||||||
const timestamp = new Date(msg.createdTimestamp)
|
const timestamp = new Date(msg.createdTimestamp)
|
||||||
|
|
||||||
@@ -28,9 +64,9 @@ exports.createTranscript = async (messagecollection) => {
|
|||||||
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.txt")
|
return new discord.MessageAttachment(filebuff,"transcript_"+ticketuserdata.ticketname+".txt")
|
||||||
}catch(err){
|
}catch(err){
|
||||||
console.log(err)
|
console.log("[error] "+err)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,6 +2,7 @@ const discord = require("discord.js")
|
|||||||
const bot = require("../../index")
|
const bot = require("../../index")
|
||||||
const config = bot.config
|
const config = bot.config
|
||||||
const getoptions = require("../getoptions")
|
const getoptions = require("../getoptions")
|
||||||
|
const l = bot.language
|
||||||
|
|
||||||
/**@returns {"DANGER"|"SUCCESS"|"PRIMARY"|"SECONDARY"} */
|
/**@returns {"DANGER"|"SUCCESS"|"PRIMARY"|"SECONDARY"} */
|
||||||
const getColor = (color) => {
|
const getColor = (color) => {
|
||||||
@@ -87,6 +88,7 @@ exports.rawButtonData = class {
|
|||||||
this.channelprefix = ""
|
this.channelprefix = ""
|
||||||
this.category = ""
|
this.category = ""
|
||||||
this.message = ""
|
this.message = ""
|
||||||
|
this.ticketmessage = ""
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
const bot = require("../../index")
|
const bot = require("../../index")
|
||||||
const config = bot.config
|
const config = bot.config
|
||||||
|
const l = bot.language
|
||||||
|
|
||||||
exports.getTicketMessage = (input) => {
|
exports.getTicketMessage = (input) => {
|
||||||
var returned = config.messages.find(a => a.id == input)
|
var returned = config.messages.find(a => a.id == input)
|
||||||
if (returned){
|
if (returned){
|
||||||
|
|||||||
@@ -1,14 +1,33 @@
|
|||||||
|
// __________ __________ ___________ ____ ____
|
||||||
|
// / ____ \ / ______ \ / | | \ | |
|
||||||
|
// | / \ | | | | | | |_______| | \ | |
|
||||||
|
// | | | | | |____| | | | | |\ \ | |
|
||||||
|
// | | | | | ________/ | |______ | | \ \ | |
|
||||||
|
// | | | | | | | _____| | | \ \ | |
|
||||||
|
// | | | | | | | | | | \ \ | |
|
||||||
|
// | | | | | | | |________ | | \ \| |
|
||||||
|
// | \____/ | | | | | | | \ |
|
||||||
|
// \__________/ |__| \__________| |__| \___|
|
||||||
|
|
||||||
|
|
||||||
const discord = require('discord.js')
|
const discord = require('discord.js')
|
||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
const intents = discord.Intents
|
const intents = discord.Intents
|
||||||
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:[intents.FLAGS.GUILDS,intents.FLAGS.GUILD_MESSAGES,intents.FLAGS.GUILD_MEMBERS],partials:["CHANNEL"]})
|
||||||
exports.client = client
|
exports.client = client
|
||||||
|
|
||||||
client.setMaxListeners(20)
|
client.setMaxListeners(30)
|
||||||
|
|
||||||
//change to FALSE on release
|
if (process.argv[2]){
|
||||||
const isDev = false
|
if (process.argv[2].endsWith("d")){
|
||||||
//!!!!!!!!!!!
|
var isDev = true
|
||||||
|
console.log("starting in dev mode...")
|
||||||
|
}else{var isDev = false}
|
||||||
|
}else{var isDev = false}
|
||||||
|
|
||||||
|
exports.developerMode = isDev
|
||||||
|
const language = require("./core/languageManager").language
|
||||||
|
exports.language = language
|
||||||
|
|
||||||
if (isDev){
|
if (isDev){
|
||||||
try {
|
try {
|
||||||
@@ -19,15 +38,24 @@ if (isDev){
|
|||||||
}
|
}
|
||||||
}else{var config = require('./config.json')}
|
}else{var config = require('./config.json')}
|
||||||
exports.config = config
|
exports.config = config
|
||||||
|
exports.errorLog = require("./core/errorLogSystem")
|
||||||
|
const log = this.errorLog.log
|
||||||
|
|
||||||
client.on('ready',async () => {
|
client.on('ready',async () => {
|
||||||
const chalk = await (await import("chalk")).default
|
const chalk = await (await import("chalk")).default
|
||||||
if (process.argv[2] != "slash"){
|
|
||||||
console.log(chalk.green("open-ticket ready!"))
|
if (!process.argv[2].startsWith("slash")){
|
||||||
if (config.logs){console.log(chalk.white("\n\nlogs:\n============"))}
|
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}])
|
||||||
|
|
||||||
|
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})
|
client.user.setActivity(config.status.text,{type:config.status.type})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log("system","bot logged in!")
|
||||||
|
|
||||||
|
await client.guilds.cache.find((g) => g.id == config.server_id).members.fetch()
|
||||||
}else{
|
}else{
|
||||||
console.log(chalk.red("STARTING IN ")+chalk.blue("SLASH MODE")+chalk.red("..."))
|
console.log(chalk.red("STARTING IN ")+chalk.blue("SLASH MODE")+chalk.red("..."))
|
||||||
console.log("logs:\n================")
|
console.log("logs:\n================")
|
||||||
@@ -46,9 +74,11 @@ client.on('ready',async () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (!isDev){
|
||||||
require("./core/checker").checker()
|
require("./core/checker").checker()
|
||||||
|
}
|
||||||
|
|
||||||
if (process.argv[2] != "slash"){
|
if (process.argv[2] && !process.argv[2].startsWith("slash")){
|
||||||
var storage = require('./core/dynamicdatabase/storage')
|
var storage = require('./core/dynamicdatabase/storage')
|
||||||
exports.storage = storage
|
exports.storage = storage
|
||||||
|
|
||||||
@@ -60,38 +90,17 @@ if (process.argv[2] != "slash"){
|
|||||||
require("./commands/rename")()
|
require("./commands/rename")()
|
||||||
require("./commands/add")()
|
require("./commands/add")()
|
||||||
require("./commands/remove")()
|
require("./commands/remove")()
|
||||||
|
require("./commands/reopen")()
|
||||||
|
|
||||||
//core
|
//core
|
||||||
require('./core/ticketOpener')()
|
require('./core/ticketOpener')()
|
||||||
require("./core/ticketCloser").runThis()
|
require("./core/ticketCloser").runThis()
|
||||||
require("./core/closebuttons")()
|
require("./core/closebuttons")()
|
||||||
require("./core/reactionRoles")()
|
require("./core/reactionRoles")()
|
||||||
|
require("./core/ticketReopener")()
|
||||||
/**
|
|
||||||
* We need:
|
|
||||||
* - checker.js
|
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=====================================================================
|
|
||||||
//=====================================================================
|
|
||||||
//ERROR DEBUG MODE: turn not on exept when you know what you are doing!
|
|
||||||
var errorDebugMode = false
|
|
||||||
//ERROR DEBUG MODE: turn not on exept when you know what you are doing!
|
|
||||||
//=====================================================================
|
|
||||||
//=====================================================================
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (!errorDebugMode){
|
|
||||||
process.on("uncaughtException",async (error,origin) => {
|
|
||||||
const chalk = await (await import("chalk")).default
|
|
||||||
console.log(chalk.red("\nOPEN TICKET ERROR: ")+error+"\n"+chalk.green("\nCreate a ticket in our support server for more information!\nIf you do this, you might help us to avoid a future bug!\n"))
|
|
||||||
})
|
|
||||||
}
|
|
||||||
if (errorDebugMode) {
|
|
||||||
const debugLog = (debugString) => {
|
const debugLog = (debugString) => {
|
||||||
const content = fs.existsSync("./openticketdebug.txt") ? fs.readFileSync("./openticketdebug.txt").toString() : "==========================\n<OPEN TICKET DEBUG FILE:>\n=========================="
|
const content = fs.existsSync("./openticketdebug.txt") ? fs.readFileSync("./openticketdebug.txt").toString() : "==========================\n<OPEN TICKET DEBUG FILE:>\n=========================="
|
||||||
fs.writeFileSync("./openticketdebug.txt",content+"\nDEBUG: "+debugString)
|
fs.writeFileSync("./openticketdebug.txt",content+"\nDEBUG: "+debugString)
|
||||||
@@ -109,17 +118,10 @@ if (errorDebugMode) {
|
|||||||
debugLog(message)
|
debugLog(message)
|
||||||
});
|
});
|
||||||
|
|
||||||
const asyncfunction = async () => {
|
|
||||||
const chalk = await (await import("chalk")).default
|
|
||||||
console.log("\n\nopen-ticket debug:\n"+chalk.bgYellow("ENTERING DEBUG MODE:"))
|
|
||||||
}
|
|
||||||
asyncfunction()
|
|
||||||
|
|
||||||
process.on("uncaughtException",async (error,origin) => {
|
process.on("uncaughtException",async (error,origin) => {
|
||||||
const chalk = await (await import("chalk")).default
|
const chalk = await (await import("chalk")).default
|
||||||
console.log(chalk.red("\nMAIN ERROR: ")+"this error is saved in the debug file!")
|
console.log(chalk.red("\nOPEN TICKET ERROR: ")+error+"\n"+chalk.green("\nCreate a ticket in our support server for more information!\nIf you do this, you might help us to avoid a future bug!\n"))
|
||||||
errorLog(error.name+": "+error.message+" | origin: "+origin,error.stack)
|
errorLog(error.name+": "+error.message+" | origin: "+origin,error.stack)
|
||||||
})
|
})
|
||||||
}
|
|
||||||
|
|
||||||
client.login(config.auth_token)
|
client.login(config.auth_token)
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
{
|
||||||
|
"errors":{
|
||||||
|
"missingArgsTitle":"Invalid Arguments!",
|
||||||
|
"missingArgsDescription":"Missing Argument",
|
||||||
|
"noPermsTitle":"No Permissions!",
|
||||||
|
"noPermsDescription":"You don't have the correct roles to run this command!\nYou need the `ADMINISTRATOR` permission or be in the list of allowed roles!",
|
||||||
|
"chooseFromListTitle":"Invalid ID",
|
||||||
|
"chooseFromListDescription":"Choose one of the id's below:",
|
||||||
|
"boterror":"Bot Error!",
|
||||||
|
"notInTicketTitle":"You are not in a ticket!",
|
||||||
|
"notInTicketDescription":"This command doesn't work outside tickets!",
|
||||||
|
"ticketDoesntExist":"This ticket doesn't exist anymore!",
|
||||||
|
"roleDoesntExist":"This role doesn't exist anymore!",
|
||||||
|
"anotherOption":"This option is not a ticket but another type!",
|
||||||
|
"maxAmountTitle":"Max amount reached!",
|
||||||
|
"maxAmountDescription":"You reached the maximum number of tickets allowed!\nSo you can't create a new one!",
|
||||||
|
"somethingWentWrong":"Something went wrong!**\nPlease try again another time!",
|
||||||
|
"somethingWentWrongTranscript":"Something went wrong while making the transcript!**\nPlease try again another time!"
|
||||||
|
},
|
||||||
|
"commands":{
|
||||||
|
"userAddedTitle":"User Added!",
|
||||||
|
"userAddedDescription":"{0} is added to this ticket!",
|
||||||
|
"userRemovedTitle":"User Removed!",
|
||||||
|
"userRemovedDescription":"{0} is removed from this ticket!",
|
||||||
|
|
||||||
|
"renameTitle":"The name is changed!",
|
||||||
|
"renameWarning":"Warning: you can only change the channel name 2 times per minute!\n(this is due discord rate limits)",
|
||||||
|
|
||||||
|
"closeTitle":"Close this ticket!",
|
||||||
|
"closeDescription":"You can close this ticket by clicking on the button below!",
|
||||||
|
"deleteTitle":"Delete this ticket!",
|
||||||
|
"deleteDescription":"You can delete this ticket by clicking on the button below!",
|
||||||
|
"reopenTitle":"Re-Open this ticket!",
|
||||||
|
"reopenDescription":"You can re-open this ticket by clicking on the button below!",
|
||||||
|
|
||||||
|
"ticketWarning":"The embed is in the message below!",
|
||||||
|
"maxTicketWarning":"**Warning:** _You can only create {0} ticket(s) at a time!_"
|
||||||
|
},
|
||||||
|
"helpMenu":{
|
||||||
|
"title":"Help Menu:",
|
||||||
|
"header1":"**Go to {0} to create a ticket!**\n\n",
|
||||||
|
"header2":"**Run the command `/new` or `/ticket` to create a ticket!**\n\n",
|
||||||
|
|
||||||
|
"msgCmd":"Spawn an embed with buttons. (admins only)",
|
||||||
|
"renameCmd":"Rename a ticket. (no spaces)",
|
||||||
|
"closeCmd":"Close a ticket.",
|
||||||
|
"deleteCmd":"Delete a ticket.",
|
||||||
|
"addCmd":"Add a user to the ticket.",
|
||||||
|
"removeCmd":"Remove a user from the ticket.",
|
||||||
|
"reopenCmd":"Re-Open a ticket after it was closed."
|
||||||
|
},
|
||||||
|
"buttons":{
|
||||||
|
"close":"Close Ticket",
|
||||||
|
"delete":"Delete Ticket",
|
||||||
|
"reopen":"Re-Open Ticket",
|
||||||
|
"sendTranscript":"Send Transcript File"
|
||||||
|
},
|
||||||
|
"messages":{
|
||||||
|
"reopenTitle":"Re-Opened this ticket!",
|
||||||
|
"reopenDescription":"Feel free to talk again!",
|
||||||
|
"closedTitle":"Closed this ticket!",
|
||||||
|
"closedDescription":"Only admins can talk in this ticket now!\n\n*Click on the button below to delete or to re-open this ticket!*",
|
||||||
|
"createdTitle":"Ticket Created!",
|
||||||
|
"createdDescription":"Your ticket is created, you can detect it by a ping!",
|
||||||
|
|
||||||
|
"newTicketDmTitle":"New Ticket!",
|
||||||
|
"closedTicketDmTitle":"Ticket Closed!",
|
||||||
|
"deletedTicketDmTitle":"Ticket Deleted!",
|
||||||
|
"closedTicketDmDescription":"Your ticket is closed!",
|
||||||
|
"deletedTicketDmDescription":"Your ticket is deleted!",
|
||||||
|
"newTranscriptTitle":"A new transcript is here!",
|
||||||
|
"newTranscriptDescription":"You can find the transcript in the text file above!",
|
||||||
|
"hereIsTheTranscript":"Here is the transcript:",
|
||||||
|
|
||||||
|
"chooseCategory":"choose a category:"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
{
|
||||||
|
"errors":{
|
||||||
|
"missingArgsTitle":"Ongeldige Argumenten!",
|
||||||
|
"missingArgsDescription":"Geen Argument",
|
||||||
|
"noPermsTitle":"Geen permissies!",
|
||||||
|
"noPermsDescription":"Je hebt niet de juiste rollen om deze command uit te voeren!\nJe hebt de `ADMINISTRATOR` permissie nodig of je moet in de lijst van toegestane rollen zitten!",
|
||||||
|
"chooseFromListTitle":"Ongeldig ID",
|
||||||
|
"chooseFromListDescription":"Kies een van deze id's:",
|
||||||
|
"boterror":"Bot Error!",
|
||||||
|
"notInTicketTitle":"Je bent niet in een ticket!",
|
||||||
|
"notInTicketDescription":"Deze command werkt niet buiten tickets!",
|
||||||
|
"ticketDoesntExist":"Dit ticket bestaat niet meer!",
|
||||||
|
"roleDoesntExist":"Deze rol bestaat niet meer!",
|
||||||
|
"anotherOption":"Deze optie is geen ticket maar een ander type!",
|
||||||
|
"maxAmountTitle":"Max aantal bereikt!",
|
||||||
|
"maxAmountDescription":"Je hebt het maximum aantal openstaande ticket bereikt!\nDus je kan er geen nieuwe maken!",
|
||||||
|
"somethingWentWrong":"Iets ging fout!**\nProbeer een andere keer opnieuw!",
|
||||||
|
"somethingWentWrongTranscript":"Iets ging fout bij het maken van het transcript!**\nProbeer een andere keer opnieuw!"
|
||||||
|
},
|
||||||
|
"commands":{
|
||||||
|
"userAddedTitle":"User Toegevoegd!",
|
||||||
|
"userAddedDescription":"{0} is toegevoegd aan dit ticket!",
|
||||||
|
"userRemovedTitle":"User Verwijderd!",
|
||||||
|
"userRemovedDescription":"{0} is verwijderd van dit ticket!",
|
||||||
|
|
||||||
|
"renameTitle":"De naam is veranderd!",
|
||||||
|
"renameWarning":"Waarschuwing: je kan de kanaalnaam maar 2 keer per minuut veranderen!\n(dit heeft te maken met discord rate limits)",
|
||||||
|
|
||||||
|
"closeTitle":"Sluit dit ticket!",
|
||||||
|
"closeDescription":"Je kan dit ticket sluiten door op de knop hier onder te duwen!",
|
||||||
|
"deleteTitle":"Verwijder dit ticket!",
|
||||||
|
"deleteDescription":"Je kan dit ticket verwijderen door op de knop hier onder te duwen!",
|
||||||
|
"reopenTitle":"Heropen dit ticket!",
|
||||||
|
"reopenDescription":"Je kan dit ticket heropenen door op de knop hier onder te duwen!",
|
||||||
|
|
||||||
|
"ticketWarning":"De embed is in het bericht hier onder!",
|
||||||
|
"maxTicketWarning":"**Waarschuwing:** _Je kan maar {0} ticket(s) tegelijkertijd aanmaken!_"
|
||||||
|
},
|
||||||
|
"helpMenu":{
|
||||||
|
"title":"Help Menu:",
|
||||||
|
"header1":"**Ga naar {0} om een ticket te maken!**\n\n",
|
||||||
|
"header2":"**Run de command `/new` of `/ticket` om een ticket te maken!**\n\n",
|
||||||
|
|
||||||
|
"msgCmd":"Spawn een embed met knoppen. (admins only)",
|
||||||
|
"renameCmd":"Hernoem een ticket. (geen spaties)",
|
||||||
|
"closeCmd":"Sluit een ticket.",
|
||||||
|
"deleteCmd":"Verwijder een ticket.",
|
||||||
|
"addCmd":"Voeg een user toe aan een ticket.",
|
||||||
|
"removeCmd":"Verwijder een user van een ticket.",
|
||||||
|
"reopenCmd":"Heropen een ticket nadat het gesloten wordt."
|
||||||
|
},
|
||||||
|
"buttons":{
|
||||||
|
"close":"Sluit Ticket",
|
||||||
|
"delete":"Verwijder Ticket",
|
||||||
|
"reopen":"Heropen Ticket",
|
||||||
|
"sendTranscript":"Stuur Transcript Bestand"
|
||||||
|
},
|
||||||
|
"messages":{
|
||||||
|
"reopenTitle":"Dit ticket is terug geopend!",
|
||||||
|
"reopenDescription":"Voel vrij om terug te praten!",
|
||||||
|
"closedTitle":"Dit ticket is gesloten!",
|
||||||
|
"closedDescription":"Nu kunnen alleen nog admins praten in dit ticket!\n\n*Klik op de knop hier onder om het ticket terug te openen of te verwijderen!*",
|
||||||
|
"createdTitle":"Ticket Gemaakt!",
|
||||||
|
"createdDescription":"Je ticket is gemaakt, je kan het detecteren bij een ping!",
|
||||||
|
|
||||||
|
"newTicketDmTitle":"Nieuw Ticket!",
|
||||||
|
"closedTicketDmTitle":"Ticket Gesloten!",
|
||||||
|
"deletedTicketDmTitle":"Ticket Verwijderd!",
|
||||||
|
"closedTicketDmDescription":"Je ticket is gesloten!",
|
||||||
|
"deletedTicketDmDescription":"Je ticket is verwijderd!",
|
||||||
|
"reopenTicketDmTitle":"Ticket Heropend!",
|
||||||
|
"reopenTicketDmDescription":"Je ticket is heropend!",
|
||||||
|
"newTranscriptTitle":"Een nieuw transcript is hier!",
|
||||||
|
"newTranscriptDescription":"Je kan het transcript vinden in het bestand hierboven!",
|
||||||
|
"hereIsTheTranscript":"Hier is het transcript:",
|
||||||
|
|
||||||
|
"chooseCategory":"kies een categorie:"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
{
|
||||||
|
"errors":{
|
||||||
|
"missingArgsTitle":"Invalid Arguments!",
|
||||||
|
"missingArgsDescription":"Missing Argument",
|
||||||
|
"noPermsTitle":"No Permissions!",
|
||||||
|
"noPermsDescription":"You don't have the correct roles to run this command!\nYou need the `ADMINISTRATOR` permission or be in the list of allowed roles!",
|
||||||
|
"chooseFromListTitle":"Invalid ID",
|
||||||
|
"chooseFromListDescription":"Choose one of the id's below:",
|
||||||
|
"boterror":"Bot Error!",
|
||||||
|
"notInTicketTitle":"You are not in a ticket!",
|
||||||
|
"notInTicketDescription":"This command doesn't work outside tickets!",
|
||||||
|
"ticketDoesntExist":"This ticket doesn't exist anymore!",
|
||||||
|
"roleDoesntExist":"This role doesn't exist anymore!",
|
||||||
|
"anotherOption":"This option is not a ticket but another type!",
|
||||||
|
"maxAmountTitle":"Max amount reached!",
|
||||||
|
"maxAmountDescription":"You reached the maximum number of tickets allowed!\nSo you can't create a new one!",
|
||||||
|
"somethingWentWrong":"Something went wrong!**\nPlease try again another time!",
|
||||||
|
"somethingWentWrongTranscript":"Something went wrong while making the transcript!**\nPlease try again another time!"
|
||||||
|
},
|
||||||
|
"commands":{
|
||||||
|
"userAddedTitle":"User Added!",
|
||||||
|
"userAddedDescription":"{0} is added to this ticket!",
|
||||||
|
"userRemovedTitle":"User Removed!",
|
||||||
|
"userRemovedDescription":"{0} is removed from this ticket!",
|
||||||
|
|
||||||
|
"renameTitle":"The name is changed!",
|
||||||
|
"renameWarning":"Warning: you can only change the channel name 2 times per minute!\n(this is due discord rate limits)",
|
||||||
|
|
||||||
|
"closeTitle":"Close this ticket!",
|
||||||
|
"closeDescription":"You can close this ticket by clicking on the button below!",
|
||||||
|
"deleteTitle":"Delete this ticket!",
|
||||||
|
"deleteDescription":"You can delete this ticket by clicking on the button below!",
|
||||||
|
"reopenTitle":"Re-Open this ticket!",
|
||||||
|
"reopenDescription":"You can re-open this ticket by clicking on the button below!",
|
||||||
|
|
||||||
|
"ticketWarning":"The embed is in the message below!",
|
||||||
|
"maxTicketWarning":"**Warning:** _You can only create {0} ticket(s) at a time!_"
|
||||||
|
},
|
||||||
|
"helpMenu":{
|
||||||
|
"title":"Help Menu:",
|
||||||
|
"header1":"**Go to {0} to create a ticket!**\n\n",
|
||||||
|
"header2":"**Run the command `/new` or `/ticket` to create a ticket!**\n\n",
|
||||||
|
|
||||||
|
"msgCmd":"Spawn an embed with buttons. (admins only)",
|
||||||
|
"renameCmd":"Rename a ticket. (no spaces)",
|
||||||
|
"closeCmd":"Close a ticket.",
|
||||||
|
"deleteCmd":"Delete a ticket.",
|
||||||
|
"addCmd":"Add a user to the ticket.",
|
||||||
|
"removeCmd":"Remove a user from the ticket.",
|
||||||
|
"reopenCmd":"Re-Open a ticket after it was closed."
|
||||||
|
},
|
||||||
|
"buttons":{
|
||||||
|
"close":"Close Ticket",
|
||||||
|
"delete":"Delete Ticket",
|
||||||
|
"reopen":"Re-Open Ticket",
|
||||||
|
"sendTranscript":"Send Transcript File"
|
||||||
|
},
|
||||||
|
"messages":{
|
||||||
|
"reopenTitle":"Re-Opened this ticket!",
|
||||||
|
"reopenDescription":"Feel free to talk again!",
|
||||||
|
"closedTitle":"Closed this ticket!",
|
||||||
|
"closedDescription":"Only admins can talk in this ticket now!\n\n*Click on the button below to delete or to re-open this ticket!*",
|
||||||
|
"createdTitle":"Ticket Created!",
|
||||||
|
"createdDescription":"Your ticket is created, you can detect it by a ping!",
|
||||||
|
|
||||||
|
"newTicketDmTitle":"New Ticket!",
|
||||||
|
"closedTicketDmTitle":"Ticket Closed!",
|
||||||
|
"deletedTicketDmTitle":"Ticket Deleted!",
|
||||||
|
"closedTicketDmDescription":"Your ticket is closed!",
|
||||||
|
"deletedTicketDmDescription":"Your ticket is deleted!",
|
||||||
|
"reopenTicketDmTitle":"Ticket Re-opened!",
|
||||||
|
"reopenTicketDmDescription":"Your ticket is re-opened!",
|
||||||
|
"newTranscriptTitle":"A new transcript is here!",
|
||||||
|
"newTranscriptDescription":"You can find the transcript in the text file above!",
|
||||||
|
"hereIsTheTranscript":"Here is the transcript:",
|
||||||
|
|
||||||
|
"chooseCategory":"choose a category:"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
{
|
||||||
|
"errors":{
|
||||||
|
"missingArgsTitle":"Argumente invalide!",
|
||||||
|
"missingArgsDescription":"Argument lipsa",
|
||||||
|
"noPermsTitle":"Nu ai permisiunile necesare!",
|
||||||
|
"noPermsDescription":"Nu ai rolurile necesare!\nAi nevoie de permisiunea `ADMINISTRATOR` sau sa fii in lista rolurilor permise!",
|
||||||
|
"chooseFromListTitle":"ID invalid",
|
||||||
|
"chooseFromListDescription":"Alege unul dintre id-urile urmatoare:",
|
||||||
|
"boterror":"Eroare bot!",
|
||||||
|
"notInTicketTitle":"Nu esti intr-un ticket!",
|
||||||
|
"notInTicketDescription":"Aceasta comanda nu functioneaza in afara ticket-urilor!",
|
||||||
|
"ticketDoesntExist":"Acest ticket nu mai exista!",
|
||||||
|
"roleDoesntExist":"Acest rol nu mai exista",
|
||||||
|
"anotherOption":"Aceasta optiune nu este un ticket ci doar alt tip!",
|
||||||
|
"maxAmountTitle":"Limita a fost atinsa",
|
||||||
|
"maxAmountDescription":"Ai atins limita maxima de tickete\nNu mai poti creea altele!",
|
||||||
|
"somethingWentWrong":"**Ceva nu a mers bine :(**\nTe rugam sa incerci din nou mai tarziu",
|
||||||
|
"somethingWentWrongTranscript":"**Ceva nu a mers bine in timpul creerii copiei a ticket-ului!**\nTe rugam sa incerci din nou mai tarziu!"
|
||||||
|
},
|
||||||
|
"commands":{
|
||||||
|
"userAddedTitle":"Utilizator adaugat!",
|
||||||
|
"userAddedDescription":"{0} este adaugat la acest ticket!",
|
||||||
|
"userRemovedTitle":"Utilizator eliminat!",
|
||||||
|
"userRemovedDescription":"{0} este eliminat din acest ticket!",
|
||||||
|
|
||||||
|
"renameTitle":"Numele este schimbat!",
|
||||||
|
"renameWarning":"ATENTIE: poti schimba numele acestui ticket doar de 2 ori pe minut!\n(se datoreaza limitarii discord-ului)",
|
||||||
|
|
||||||
|
"closeTitle":"Inchide acest ticket",
|
||||||
|
"closeDescription":"Poti inchide acest ticket doar apasand butonul de mai jos!",
|
||||||
|
"deleteTitle":"Sterge acest ticket!",
|
||||||
|
"deleteDescription":"Poti sterge acest ticket doar apasand butonul de mai jos",
|
||||||
|
"reopenTitle":"Re-deschide acest ticket!",
|
||||||
|
"reopenDescription":"Poti redeschide acest ticket doar apasand butonul de mai jos!",
|
||||||
|
|
||||||
|
"ticketWarning":"Embed-ul se afla in mesajul de mai jos:",
|
||||||
|
"maxTicketWarning":"**ATENTIE:** _Poti creea doar {0} ticket-e odata!_"
|
||||||
|
},
|
||||||
|
"helpMenu":{
|
||||||
|
"title":"Meniu de ajutor:",
|
||||||
|
"header1":"**Deschide {0} pentru a creea un ticket!**\n\n",
|
||||||
|
"header2":"**Ruleaza comanda `/new` ori `/ticket` pentru a creea un ticket!**\n\n",
|
||||||
|
|
||||||
|
"msgCmd":"Afiseaza embed-ul cu tickete. (doar administratorii)",
|
||||||
|
"renameCmd":"Redenumeste un ticket. (fara spatii)",
|
||||||
|
"closeCmd":"Redenumeste un ticket ticket.",
|
||||||
|
"deleteCmd":"Sterge un ticket a ticket.",
|
||||||
|
"addCmd":"adauga un utilizator la ticket.",
|
||||||
|
"removeCmd":"Elimina un utilizator de la ticket.",
|
||||||
|
"reopenCmd":"Re-deschide un ticket dupa ce a fost inchis."
|
||||||
|
},
|
||||||
|
"buttons":{
|
||||||
|
"close":"Inchide Ticket-ul",
|
||||||
|
"delete":"Sterge Ticket-ul",
|
||||||
|
"reopen":"Re-deschide Ticket-ul",
|
||||||
|
"sendTranscript":"Trimite copia chat-ului ticket-ului"
|
||||||
|
},
|
||||||
|
"messages":{
|
||||||
|
"reopenTitle":"Ticket re-deschis",
|
||||||
|
"reopenDescription":"Simte-te comfortabil sa vorbesti din nou!",
|
||||||
|
"closedTitle":"Inchide acest ticket ticket!",
|
||||||
|
"closedDescription":"Doar administratorii pot vorbi in acest ticket de acum!\n\n*Apasa pe butonele de mai jos pentru a inchide/deschide ticket-ul!*",
|
||||||
|
"createdTitle":"Ticket Creat!",
|
||||||
|
"createdDescription":"Ticket-ul tau a fost creat, il poti vedea dupa mentionarea ta!",
|
||||||
|
|
||||||
|
"newTicketDmTitle":"Ticket Nou!",
|
||||||
|
"closedTicketDmTitle":"Ticket închis!",
|
||||||
|
"deletedTicketDmTitle":"Ticket șters!",
|
||||||
|
"closedTicketDmDescription":"Ticket-ul tau este închis!",
|
||||||
|
"deletedTicketDmDescription":"Ticket-ul tau este șters!",
|
||||||
|
"reopenTicketDmTitle":"Ticket Re-deschis!",
|
||||||
|
"reopenTicketDmDescription":"Ticket-ul tau este re-deschis!",
|
||||||
|
"newTranscriptTitle":"O noua copie a ticket-ului este aici!",
|
||||||
|
"newTranscriptDescription":"Poti vedea copia ticket-ului in fisierul .txt de mai sus!",
|
||||||
|
"hereIsTheTranscript":"Aceasta este copia ticket-ului:",
|
||||||
|
|
||||||
|
"chooseCategory":"Alege o categorie:"
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 161 KiB |
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "open-ticket",
|
"name": "open-ticket",
|
||||||
"version": "2.0.0",
|
"version": "2.1.0",
|
||||||
"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": {
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chalk": "^5.0.1",
|
"chalk": "^5.0.1",
|
||||||
"discord.js": "^13.6.0",
|
"discord.js": "^13.8.0",
|
||||||
"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"
|
||||||
|
|||||||
Vendored
BIN
Binary file not shown.
Reference in New Issue
Block a user