Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4b8074c520 | ||
|
|
1d5830975f | ||
|
|
95bc1f4fbf | ||
|
|
bfc02611c7 | ||
|
|
e4c1e2559e | ||
|
|
69b669956e | ||
|
|
893a7c5b1f | ||
|
|
ed9c98e2f0 | ||
|
|
62d950b1a6 | ||
|
|
69de612d1e | ||
|
|
5494e112c0 | ||
|
|
cd2c08303e | ||
|
|
a8619e448a | ||
|
|
c990257c02 | ||
|
|
e7f05b4ed5 | ||
|
|
697594b311 | ||
|
|
6823b96114 | ||
|
|
0845390569 | ||
|
|
568b2c9bee | ||
|
|
034247ea99 | ||
|
|
ad10a98f33 | ||
|
|
8aee358081 | ||
|
|
e2f237e7b6 | ||
|
|
210923d29e | ||
|
|
a69f2ee5a1 | ||
|
|
ffa075d177 | ||
|
|
e7a331b969 | ||
|
|
6b32fc9d5d | ||
|
|
7603dbcc47 | ||
|
|
512e564c60 | ||
|
|
5a731e6336 | ||
|
|
d02bf2b826 | ||
|
|
2603a7bdd0 | ||
|
|
c1ba677b82 | ||
|
|
7e6ac6a4b9 | ||
|
|
0ee9a312eb | ||
|
|
d282a516e6 | ||
|
|
9638179d45 | ||
|
|
30d45ddc39 | ||
|
|
2c08ca7245 | ||
|
|
3d5b1f6e8d | ||
|
|
edc8d4bc44 | ||
|
|
c57507cea9 | ||
|
|
ace46deb52 | ||
|
|
fc09858f92 | ||
|
|
1b7767641e | ||
|
|
76d491d27c | ||
|
|
06b57f18f1 | ||
|
|
5f5699f160 | ||
|
|
702f225983 | ||
|
|
aab5a9c241 | ||
|
|
59e756210e | ||
|
|
a8bb210eca | ||
|
|
e3ee51d9fb | ||
|
|
a6e107c12a | ||
|
|
a49b53e2d6 | ||
|
|
0bbde2018c | ||
|
|
15825d0da6 | ||
|
|
9d19c7053b | ||
|
|
09f9944cf7 | ||
|
|
6cd6799712 | ||
|
|
44515fc6b4 | ||
|
|
4c947b138f | ||
|
|
428f4a9e92 | ||
|
|
a274576589 | ||
|
|
2410743a46 | ||
|
|
89a44f3f2f | ||
|
|
1728c3653a | ||
|
|
62a1f0f8c1 |
+12
@@ -1,4 +1,16 @@
|
||||
node_modules/
|
||||
package-lock.json
|
||||
devConfig.json
|
||||
devConfig1.json
|
||||
devConfig2.json
|
||||
devConfig3.json
|
||||
devConfig4.json
|
||||
devConfig5.json
|
||||
.DS_Store
|
||||
openticketdebug.txt
|
||||
developerChangelog.md
|
||||
storage/dynamicDB/
|
||||
storage/.DS_Store
|
||||
.vscode/
|
||||
livestatus.json
|
||||
test.js
|
||||
@@ -0,0 +1,128 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
We as members, contributors, and leaders pledge to make participation in our
|
||||
community a harassment-free experience for everyone, regardless of age, body
|
||||
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
||||
identity and expression, level of experience, education, socio-economic status,
|
||||
nationality, personal appearance, race, religion, or sexual identity
|
||||
and orientation.
|
||||
|
||||
We pledge to act and interact in ways that contribute to an open, welcoming,
|
||||
diverse, inclusive, and healthy community.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to a positive environment for our
|
||||
community include:
|
||||
|
||||
* Demonstrating empathy and kindness toward other people
|
||||
* Being respectful of differing opinions, viewpoints, and experiences
|
||||
* Giving and gracefully accepting constructive feedback
|
||||
* Accepting responsibility and apologizing to those affected by our mistakes,
|
||||
and learning from the experience
|
||||
* Focusing on what is best not just for us as individuals, but for the
|
||||
overall community
|
||||
|
||||
Examples of unacceptable behavior include:
|
||||
|
||||
* The use of sexualized language or imagery, and sexual attention or
|
||||
advances of any kind
|
||||
* Trolling, insulting or derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or email
|
||||
address, without their explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Enforcement Responsibilities
|
||||
|
||||
Community leaders are responsible for clarifying and enforcing our standards of
|
||||
acceptable behavior and will take appropriate and fair corrective action in
|
||||
response to any behavior that they deem inappropriate, threatening, offensive,
|
||||
or harmful.
|
||||
|
||||
Community leaders have the right and responsibility to remove, edit, or reject
|
||||
comments, commits, code, wiki edits, issues, and other contributions that are
|
||||
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
||||
decisions when appropriate.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies within all community spaces, and also applies when
|
||||
an individual is officially representing the community in public spaces.
|
||||
Examples of representing our community include using an official e-mail address,
|
||||
posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported to the community leaders responsible for enforcement at
|
||||
support@dj-dj.be.
|
||||
All complaints will be reviewed and investigated promptly and fairly.
|
||||
|
||||
All community leaders are obligated to respect the privacy and security of the
|
||||
reporter of any incident.
|
||||
|
||||
## Enforcement Guidelines
|
||||
|
||||
Community leaders will follow these Community Impact Guidelines in determining
|
||||
the consequences for any action they deem in violation of this Code of Conduct:
|
||||
|
||||
### 1. Correction
|
||||
|
||||
**Community Impact**: Use of inappropriate language or other behavior deemed
|
||||
unprofessional or unwelcome in the community.
|
||||
|
||||
**Consequence**: A private, written warning from community leaders, providing
|
||||
clarity around the nature of the violation and an explanation of why the
|
||||
behavior was inappropriate. A public apology may be requested.
|
||||
|
||||
### 2. Warning
|
||||
|
||||
**Community Impact**: A violation through a single incident or series
|
||||
of actions.
|
||||
|
||||
**Consequence**: A warning with consequences for continued behavior. No
|
||||
interaction with the people involved, including unsolicited interaction with
|
||||
those enforcing the Code of Conduct, for a specified period of time. This
|
||||
includes avoiding interactions in community spaces as well as external channels
|
||||
like social media. Violating these terms may lead to a temporary or
|
||||
permanent ban.
|
||||
|
||||
### 3. Temporary Ban
|
||||
|
||||
**Community Impact**: A serious violation of community standards, including
|
||||
sustained inappropriate behavior.
|
||||
|
||||
**Consequence**: A temporary ban from any sort of interaction or public
|
||||
communication with the community for a specified period of time. No public or
|
||||
private interaction with the people involved, including unsolicited interaction
|
||||
with those enforcing the Code of Conduct, is allowed during this period.
|
||||
Violating these terms may lead to a permanent ban.
|
||||
|
||||
### 4. Permanent Ban
|
||||
|
||||
**Community Impact**: Demonstrating a pattern of violation of community
|
||||
standards, including sustained inappropriate behavior, harassment of an
|
||||
individual, or aggression toward or disparagement of classes of individuals.
|
||||
|
||||
**Consequence**: A permanent ban from any sort of public interaction within
|
||||
the community.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||
version 2.0, available at
|
||||
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
||||
|
||||
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
||||
enforcement ladder](https://github.com/mozilla/diversity).
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
|
||||
For answers to common questions about this code of conduct, see the FAQ at
|
||||
https://www.contributor-covenant.org/faq. Translations are available at
|
||||
https://www.contributor-covenant.org/translations.
|
||||
@@ -0,0 +1,3 @@
|
||||
# comming soon
|
||||
For now on, you can create a ticket in our server:
|
||||
https://discord.dj-dj.be
|
||||
@@ -1,63 +1,59 @@
|
||||
# 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)
|
||||
# Open Ticket
|
||||
[](https://discord.com/invite/26vT9wt3n3) [](https://github.com/DJj123dj/open-ticket/releases/tag/v3.0.0) []() [](https://github.com/DJj123dj/open-ticket/blob/main/LICENSE) [](https://docs.openticket.dj-dj.be)
|
||||
|
||||
This is an open-source discord ticket bot, you can configure it and it comes with cool features like transcripts & custom options!
|
||||
Open ticket is the most configurable open-source ticket bot for discord! Made with the newest technologies. Like: Slash commands, transcripts, multiple ticket types, buttons & dropdowns!
|
||||
Start using it now, you can do anything!
|
||||
|
||||
*We love to hear suggestions for more features!*
|
||||
|
||||
<img src="logo.png" alt="Open Ticket logo" style="height: 200px; width:200px;"/>
|
||||
|
||||
[](https://www.github.com/DJj123dj/open-ticket/wiki/q&a)
|
||||
[](https://www.github.com/DJj123dj/open-ticket/wiki)
|
||||
|
||||
### Thanks to these people:
|
||||
- DJ-Lite: for doing the administration
|
||||
- Sanke: for translation & new ideas
|
||||
- Everyone that reported a bug
|
||||
#### And our translators!
|
||||
- ExothDE
|
||||
- 1x1
|
||||
- Redactado
|
||||
- t0miiis
|
||||
- josuens14
|
||||
- M4
|
||||
- David.
|
||||
- Maurizio
|
||||
|
||||
## features
|
||||
- discord interaction buttons
|
||||
- slash & text commands
|
||||
- close or delete tickets
|
||||
- translation possible
|
||||
- dynamic database system
|
||||
- close, delete & re-open tickets
|
||||
- translation in 10 different languages
|
||||
- transcripts
|
||||
- add/remove users from ticket
|
||||
- custom colors & name
|
||||
- create custom ticket names, icons & colors
|
||||
- create url buttons for websites
|
||||
- uses discord.js 13
|
||||
- configure your own ticket options
|
||||
- remove credits if you want
|
||||
- unlimited tickets at the same time
|
||||
- localisation in +5 languages (soon™)
|
||||
- add/remove users from a ticket
|
||||
- a lot of customisation options.
|
||||
- tickets, reaction roles & links are all possible!
|
||||
- choose between buttons or dropdowns!
|
||||
- discord.js v14
|
||||
- everyting is configurable
|
||||
- custom API + plugins
|
||||
- unlimited tickets spread over multiple messages
|
||||
- close with reason
|
||||
|
||||
## installation
|
||||
**You need `node.js 16` to run this project!**
|
||||
*comming soon*
|
||||
- share transcripts
|
||||
- view transcripts in html
|
||||
|
||||
You can clone or download this project.
|
||||
## quick start
|
||||
[Click here to start your adventure!](https://docs.openticket.dj-dj.be/quick-start)
|
||||
|
||||
### packages
|
||||
- chalk => version `latest`
|
||||
- discord.js => version `latest`
|
||||
- express => version `latest`
|
||||
- node-localstorage => version `latest`
|
||||
|
||||
You can install all of them by running `npm install`
|
||||
|
||||
## running
|
||||
you can run `node index.js` but i would recommend you to use `npm start`
|
||||
|
||||
if there are any errors, you can open an **issue on github** or **contact me in the discord server**.
|
||||
|
||||
### config
|
||||
Our config documentation is moved to another file:
|
||||
[click here to view](https://www.github.com/DJj123dj/open-ticket/wiki/config-v2.0.0)
|
||||
|
||||
### 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
|
||||
- `SERVER MEMBERS INTENT`
|
||||
- `MESSAGE CONTENT INTENT`
|
||||
|
||||
To work the best, the bot needs `ADMINISTRATOR` permissions.
|
||||
You can also configure your own permissions
|
||||
## documentation
|
||||
[Official Documentation](https://docs.openticket.dj-dj.be)
|
||||
|
||||
## information
|
||||
|
||||
_v2.0.0 unstable_
|
||||
_v3.0.0_
|
||||
|
||||
changelog: [click here](https://www.github.com/DJj123dj/open-ticket/wiki/Changelog)
|
||||
changelog: [click here](https://docs.openticket.dj-dj.be/other/changelog)
|
||||
|
||||
© 2022 - DJdj Development | [website](https://www.dj-dj.be) | [discord](https://discord.com/invite/26vT9wt3n3)
|
||||
© 2022 - DJdj Development | [website](https://www.dj-dj.be) | [discord](https://discord.dj-dj.be) | [terms of service](https://www.dj-dj.be/terms)
|
||||
@@ -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!
|
||||
+44
-30
@@ -2,62 +2,76 @@ 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 permsChecker = require("../core/utils/permisssionChecker")
|
||||
|
||||
const APIEvents = require("../core/api/modules/events")
|
||||
const DISABLE = require("../core/api/api.json").disable
|
||||
|
||||
module.exports = () => {
|
||||
client.on("messageCreate",msg => {
|
||||
bot.errorLog.log("debug","COMMANDS: loaded add.js")
|
||||
|
||||
if (!DISABLE.commands.text.add) client.on("messageCreate",msg => {
|
||||
if (!msg.content.startsWith(config.prefix+"add")) return
|
||||
var user = msg.mentions.users.first()
|
||||
if (!user){
|
||||
return msg.channel.send({content:"**There is no user to add:**\nuse: `"+config.prefix+"add <user>`"})
|
||||
}
|
||||
if (!user) return msg.channel.send({embeds:[bot.errorLog.invalidArgsMessage(l.errors.missingArgsDescription+" `<user>`:\n`"+config.prefix+"add <user>`")]})
|
||||
|
||||
if (!msg.member.permissions.has("MANAGE_CHANNELS") && !msg.member.permissions.has("ADMINISTRATOR")){
|
||||
return msg.channel.send({content:"You have no permissions to add someone to the channel!\nYou need the `ADMINISTRATOR` or `MANAGE_CHANNELS` permission"})
|
||||
if (!msg.guild) return
|
||||
if (!permsChecker.command(msg.author.id,msg.guild.id)){
|
||||
permsChecker.sendUserNoPerms(msg.author)
|
||||
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]})
|
||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
||||
|
||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id){
|
||||
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.send({content:"Added "+user.tag+" to the ticket"})
|
||||
if (config.logs){console.log("[system] added user to ticket (name:"+user.username+",ticket:"+msg.channel.name+")")}
|
||||
msg.channel.permissionOverwrites.create(user.id, { ViewChannel:true, AddReactions:true,AttachFiles:true, EmbedLinks:true, SendMessages:true})
|
||||
msg.channel.send({embeds:[bot.embeds.commands.addEmbed(user,msg.author)]})
|
||||
|
||||
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}])
|
||||
|
||||
const ticketData = require("../core/utils/configParser").getTicketById(ticketId,true)
|
||||
APIEvents.onTicketAdd(msg.author,loguser,msg.channel,msg.guild,new Date(),{status:"open",name:msg.channel.name,ticketOptions:ticketData})
|
||||
|
||||
APIEvents.onCommand("add",permsChecker.command(msg.author.id,msg.guild.id),msg.author,msg.channel,msg.guild,new Date())
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
client.on("interactionCreate",(interaction) => {
|
||||
if (!interaction.isCommand()) return
|
||||
if (!DISABLE.commands.slash.add) client.on("interactionCreate",(interaction) => {
|
||||
if (!interaction.isChatInputCommand()) return
|
||||
if (interaction.commandName != "add") return
|
||||
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")){
|
||||
return interaction.reply({content:"You have no permissions to add someone to the channel!\nYou need the `ADMINISTRATOR` or `MANAGE_CHANNELS` permission"})
|
||||
if (!interaction.guild) return
|
||||
if (!permsChecker.command(interaction.user.id,interaction.guild.id)){
|
||||
permsChecker.sendUserNoPerms(interaction.user)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
interaction.channel.messages.fetchPinned().then(msglist => {
|
||||
var firstmsg = msglist.last()
|
||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return interaction.reply({embeds:[bot.errorLog.notInATicket]})
|
||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
||||
|
||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id){
|
||||
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.reply({content:"Added "+user.tag+" to the ticket"})
|
||||
if (config.logs){console.log("[system] added user to ticket (name:"+user.username+",ticket:"+interaction.channel.name+")")}
|
||||
interaction.channel.permissionOverwrites.create(user.id, { ViewChannel:true, AddReactions:true,AttachFiles:true, EmbedLinks:true, SendMessages:true})
|
||||
interaction.reply({embeds:[bot.embeds.commands.addEmbed(user,interaction.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}])
|
||||
|
||||
const ticketData = require("../core/utils/configParser").getTicketById(ticketId,true)
|
||||
APIEvents.onTicketAdd(interaction.user,loguser,interaction.channel,interaction.guild,new Date(),{status:"open",name:interaction.channel.name,ticketOptions:ticketData})
|
||||
APIEvents.onCommand("add",permsChecker.command(interaction.user.id,interaction.guild.id),interaction.user,interaction.channel,interaction.guild,new Date())
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
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 permsChecker = require("../core/utils/permisssionChecker")
|
||||
|
||||
const APIEvents = require("../core/api/modules/events")
|
||||
const DISABLE = require("../core/api/api.json").disable
|
||||
|
||||
module.exports = () => {
|
||||
bot.errorLog.log("debug","COMMANDS: loaded claim.js")
|
||||
|
||||
if (!DISABLE.commands.text.claim) client.on("messageCreate",msg => {
|
||||
if (!msg.content.startsWith(config.prefix+"claim")) return
|
||||
var user = msg.mentions.users.first()
|
||||
|
||||
const claimingUser = user ? user : msg.author
|
||||
|
||||
if (!msg.guild) return
|
||||
if (!permsChecker.command(msg.author.id,msg.guild.id)){
|
||||
permsChecker.sendUserNoPerms(msg.author)
|
||||
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]})
|
||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
||||
|
||||
|
||||
//msg.channel.send({embeds:[bot.embeds.commands.claimEmbed(claimingUser,msg.author)]})
|
||||
msg.channel.send({embeds:[bot.errorLog.warning("Coming soon!","This feature isn't ready yet!\nIt will become active in the next update!")]})
|
||||
|
||||
var loguser = claimingUser
|
||||
log("command","someone used the 'claim' command",[{key:"user",value:msg.author.tag}])
|
||||
log("system","user claimed to ticket",[{key:"user",value:msg.author.tag},{key:"ticket",value:msg.channel.name},{key:"claimed_user",value:claimingUser.tag}])
|
||||
|
||||
const ticketData = require("../core/utils/configParser").getTicketById(ticketId,true)
|
||||
//APIEvents.onTicketAdd(msg.author,loguser,msg.channel,msg.guild,new Date(),{status:"open",name:msg.channel.name,ticketOptions:ticketData})
|
||||
//APIEvents.onCommand("add",permsChecker.command(msg.author.id,msg.guild.id),msg.author,msg.channel,msg.guild,new Date())
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
if (!DISABLE.commands.slash.claim) client.on("interactionCreate",(interaction) => {
|
||||
if (!interaction.isChatInputCommand()) return
|
||||
if (interaction.commandName != "claim") return
|
||||
const user = interaction.options.getUser("user",false) ? interaction.options.getUser("user",true) : interaction.user
|
||||
|
||||
if (!interaction.guild) return
|
||||
if (!permsChecker.command(interaction.user.id,interaction.guild.id)){
|
||||
permsChecker.sendUserNoPerms(interaction.user)
|
||||
return
|
||||
}
|
||||
|
||||
interaction.channel.messages.fetchPinned().then(msglist => {
|
||||
var firstmsg = msglist.last()
|
||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return interaction.reply({embeds:[bot.errorLog.notInATicket]})
|
||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
||||
|
||||
//interaction.reply({embeds:[bot.embeds.commands.claimEmbed(user,interaction.user)]})
|
||||
interaction.reply({embeds:[bot.errorLog.warning("Coming soon!","This feature isn't ready yet!\nIt will become active in the next update!")]})
|
||||
|
||||
var loguser = user
|
||||
log("command","someone used the 'claim' command",[{key:"user",value:interaction.user.tag}])
|
||||
log("system","user claimed to ticket",[{key:"user",value:interaction.user.tag},{key:"ticket",value:interaction.channel.name},{key:"claimed_user",value:loguser.tag}])
|
||||
|
||||
const ticketData = require("../core/utils/configParser").getTicketById(ticketId,true)
|
||||
//APIEvents.onTicketAdd(interaction.user,loguser,interaction.channel,interaction.guild,new Date(),{status:"open",name:interaction.channel.name,ticketOptions:ticketData})
|
||||
//APIEvents.onCommand("add",permsChecker.command(interaction.user.id,interaction.guild.id),interaction.user,interaction.channel,interaction.guild,new Date())
|
||||
|
||||
})
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
+59
-31
@@ -2,62 +2,90 @@ 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 permsChecker = require("../core/utils/permisssionChecker")
|
||||
|
||||
const APIEvents = require("../core/api/modules/events")
|
||||
const DISABLE = require("../core/api/api.json").disable
|
||||
|
||||
module.exports = () => {
|
||||
client.on("messageCreate",msg => {
|
||||
bot.errorLog.log("debug","COMMANDS: loaded close.js")
|
||||
|
||||
if (!DISABLE.commands.text.close) client.on("messageCreate",msg => {
|
||||
if (!msg.content.startsWith(config.prefix+"close")) return
|
||||
|
||||
const args = msg.content.substring((config.prefix+"close").length).split(" ")
|
||||
args.shift()
|
||||
/**@type {String|false} */
|
||||
var tempreason = args.join(" ")
|
||||
if (!tempreason || tempreason == " " || tempreason == " "){
|
||||
tempreason = false
|
||||
}
|
||||
const reason = tempreason
|
||||
|
||||
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]})
|
||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
||||
|
||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id){
|
||||
msg.channel.send({content:"You are not in a ticket!"})
|
||||
return
|
||||
}
|
||||
if (hiddendata.data.find(h => h.key == "pendingdelete")) return msg.channel.send({embeds:[bot.errorLog.warning("Warning!","You can't close a ticket while it's being deleted!")]})
|
||||
|
||||
const closebutton = new discord.MessageActionRow()
|
||||
.addComponents([
|
||||
new discord.MessageButton()
|
||||
.setCustomId("closeTicketTrue1")
|
||||
.setDisabled(false)
|
||||
.setStyle("SECONDARY")
|
||||
.setEmoji("🔒")
|
||||
])
|
||||
const descriptionReason = reason ? "**"+l.messages.reason+":** "+reason : false
|
||||
msg.channel.send({embeds:[bot.embeds.commands.closeEmbed(msg.author,descriptionReason)],components:[bot.buttons.close.closeCommandRow]})
|
||||
|
||||
msg.channel.send({content:"**Click on the button below to close this ticket!**",components:[closebutton]})
|
||||
var name = msg.channel.name
|
||||
var prefix = ""
|
||||
const tickets = config.options
|
||||
tickets.forEach((ticket) => {
|
||||
if (name.startsWith(ticket.channelprefix)){
|
||||
prefix = ticket.channelprefix
|
||||
}
|
||||
})
|
||||
|
||||
console.log("[system] closed a ticket via command")
|
||||
require("../core/ticketActions/ticketCloser").NEWcloseTicket(msg.member,msg.channel,prefix,"close",reason,true)
|
||||
|
||||
log("command","someone used the 'close' command",[{key:"user",value:msg.author.tag}])
|
||||
APIEvents.onCommand("close",true,msg.author,msg.channel,msg.guild,new Date())
|
||||
|
||||
})
|
||||
|
||||
|
||||
})
|
||||
|
||||
client.on("interactionCreate",(interaction) => {
|
||||
if (!interaction.isCommand()) return
|
||||
if (!DISABLE.commands.slash.close) client.on("interactionCreate",(interaction) => {
|
||||
if (!interaction.isChatInputCommand()) return
|
||||
if (interaction.commandName != "close") return
|
||||
|
||||
//interaction.deferReply()
|
||||
|
||||
const reason = interaction.options.getString("reason") ? interaction.options.getString("reason") : false
|
||||
|
||||
interaction.channel.messages.fetchPinned().then(msglist => {
|
||||
var firstmsg = msglist.last()
|
||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return interaction.reply({embeds:[bot.errorLog.notInATicket]})
|
||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
||||
|
||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id){
|
||||
interaction.reply({content:"You are not in a ticket!"})
|
||||
return
|
||||
}
|
||||
if (hiddendata.data.find(h => h.key == "pendingdelete")) return interaction.reply({embeds:[bot.errorLog.warning("Warning!","You can't close a ticket while it's being deleted!")]})
|
||||
|
||||
const closebutton = new discord.MessageActionRow()
|
||||
.addComponents([
|
||||
new discord.MessageButton()
|
||||
.setCustomId("closeTicketTrue1")
|
||||
.setDisabled(false)
|
||||
.setStyle("SECONDARY")
|
||||
.setEmoji("🔒")
|
||||
])
|
||||
const descriptionReason = reason ? "**"+l.messages.reason+":** "+reason : false
|
||||
interaction.reply({embeds:[bot.embeds.commands.closeEmbed(interaction.user,descriptionReason)],components:[bot.buttons.close.closeCommandRow]})
|
||||
|
||||
interaction.reply({content:"**Click on the button below to close this ticket!**",components:[closebutton]})
|
||||
var name = interaction.channel.name
|
||||
var prefix = ""
|
||||
const tickets = config.options
|
||||
tickets.forEach((ticket) => {
|
||||
if (name.startsWith(ticket.channelprefix)){
|
||||
prefix = ticket.channelprefix
|
||||
}
|
||||
})
|
||||
|
||||
console.log("[system] closed a ticket via command")
|
||||
require("../core/ticketActions/ticketCloser").NEWcloseTicket(interaction.member,interaction.channel,prefix,"close",false,true)
|
||||
|
||||
log("command","someone used the 'close' command",[{key:"user",value:interaction.user.tag}])
|
||||
APIEvents.onCommand("close",true,interaction.user,interaction.channel,interaction.guild,new Date())
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
+55
-33
@@ -2,62 +2,84 @@ 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 permsChecker = require("../core/utils/permisssionChecker")
|
||||
|
||||
const APIEvents = require("../core/api/modules/events")
|
||||
const DISABLE = require("../core/api/api.json").disable
|
||||
|
||||
module.exports = () => {
|
||||
client.on("messageCreate",msg => {
|
||||
bot.errorLog.log("debug","COMMANDS: loaded delete.js")
|
||||
|
||||
if (!DISABLE.commands.text.delete) client.on("messageCreate",msg => {
|
||||
if (!msg.content.startsWith(config.prefix+"delete")) return
|
||||
|
||||
if (!msg.guild) return
|
||||
if (!permsChecker.command(msg.author.id,msg.guild.id)){
|
||||
permsChecker.sendUserNoPerms(msg.author)
|
||||
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]})
|
||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
||||
|
||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id){
|
||||
msg.channel.send({content:"You are not in a ticket!"})
|
||||
return
|
||||
}
|
||||
msg.channel.send({embeds:[bot.embeds.commands.deleteEmbed(msg.author)]})
|
||||
|
||||
const closebutton = new discord.MessageActionRow()
|
||||
.addComponents([
|
||||
new discord.MessageButton()
|
||||
.setCustomId("deleteTicketTrue")
|
||||
.setDisabled(false)
|
||||
.setStyle("SECONDARY")
|
||||
.setEmoji("❌")
|
||||
])
|
||||
var name = msg.channel.name
|
||||
var prefix = ""
|
||||
const tickets = config.options
|
||||
tickets.forEach((ticket) => {
|
||||
if (name.startsWith(ticket.channelprefix)){
|
||||
prefix = ticket.channelprefix
|
||||
}
|
||||
})
|
||||
|
||||
msg.channel.send({content:"**Click on the button below to delete this ticket!**",components:[closebutton]})
|
||||
|
||||
console.log("[system] deleted a ticket via command")
|
||||
require("../core/ticketActions/ticketCloser").NEWcloseTicket(msg.member,msg.channel,prefix,"delete",false,true)
|
||||
|
||||
log("command","someone used the 'delete' command",[{key:"user",value:msg.author.tag}])
|
||||
APIEvents.onCommand("delete",permsChecker.command(msg.author.id,msg.guild.id),msg.author,msg.channel,msg.guild,new Date())
|
||||
})
|
||||
|
||||
|
||||
})
|
||||
|
||||
client.on("interactionCreate",(interaction) => {
|
||||
if (!interaction.isCommand()) return
|
||||
if (!DISABLE.commands.slash.delete) client.on("interactionCreate",(interaction) => {
|
||||
if (!interaction.isChatInputCommand()) return
|
||||
if (interaction.commandName != "delete") return
|
||||
|
||||
interaction.channel.messages.fetchPinned().then(msglist => {
|
||||
//interaction.deferReply()
|
||||
|
||||
if (!interaction.guild) return
|
||||
if (!permsChecker.command(interaction.user.id,interaction.guild.id)){
|
||||
permsChecker.sendUserNoPerms(interaction.user)
|
||||
return interaction.reply({embeds:[bot.errorLog.noPermsDelete(interaction.user)]})
|
||||
}
|
||||
|
||||
interaction.channel.messages.fetchPinned().then(msglist => {
|
||||
var firstmsg = msglist.last()
|
||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return interaction.reply({embeds:[bot.errorLog.notInATicket]})
|
||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
||||
|
||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id){
|
||||
interaction.reply({content:"You are not in a ticket!"})
|
||||
return
|
||||
}
|
||||
interaction.reply({embeds:[bot.embeds.commands.deleteEmbed(interaction.user)]})
|
||||
|
||||
const closebutton = new discord.MessageActionRow()
|
||||
.addComponents([
|
||||
new discord.MessageButton()
|
||||
.setCustomId("deleteTicketTrue")
|
||||
.setDisabled(false)
|
||||
.setStyle("SECONDARY")
|
||||
.setEmoji("❌")
|
||||
])
|
||||
var name = interaction.channel.name
|
||||
var prefix = ""
|
||||
const tickets = config.options
|
||||
tickets.forEach((ticket) => {
|
||||
if (name.startsWith(ticket.channelprefix)){
|
||||
prefix = ticket.channelprefix
|
||||
}
|
||||
})
|
||||
|
||||
interaction.reply({content:"**Click on the button below to delete this ticket!**",components:[closebutton]})
|
||||
require("../core/ticketActions/ticketCloser").NEWcloseTicket(interaction.member,interaction.channel,prefix,"delete",false,true)
|
||||
|
||||
console.log("[system] deleted a ticket via command")
|
||||
log("command","someone used the 'delete' command",[{key:"user",value:interaction.user.tag}])
|
||||
APIEvents.onCommand("delete",permsChecker.command(interaction.user.id,interaction.guild.id),interaction.user,interaction.channel,interaction.guild,new Date())
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
+33
-12
@@ -2,34 +2,55 @@ 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 APIEvents = require("../core/api/modules/events")
|
||||
const DISABLE = require("../core/api/api.json").disable
|
||||
|
||||
module.exports = () => {
|
||||
const helpEmbed = new discord.MessageEmbed()
|
||||
bot.errorLog.log("debug","COMMANDS: loaded help.js")
|
||||
|
||||
const msgName = config.system.showSlashcmdsInHelp ? "message" : "msg"
|
||||
const prefix = config.system.showSlashcmdsInHelp ? "/" : config.prefix
|
||||
|
||||
const helpEmbed = new discord.EmbedBuilder()
|
||||
.setColor(config.main_color)
|
||||
.setTitle("Help Menu:")
|
||||
.setTitle("❔ "+l.helpMenu.title)
|
||||
|
||||
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"
|
||||
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._`")
|
||||
const header = config.system.ticket_channel ? l.helpMenu.header1.replace("{0}","<#"+config.system.ticket_channel+">") : l.helpMenu.header2
|
||||
helpEmbed.setDescription(header+"`"+prefix+msgName+" <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"})
|
||||
|
||||
var otherprefix = prefix.endsWith(" ") ? prefix.substring(0,prefix.length-1) : prefix
|
||||
|
||||
client.on("messageCreate",msg => {
|
||||
if (!DISABLE.commands.text.help) client.on("messageCreate",msg => {
|
||||
if (!msg.content.startsWith(config.prefix)) return
|
||||
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 (msg.content == config.prefix || msg.content == config.prefix+" " || msg.content == otherprefix){
|
||||
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}])
|
||||
APIEvents.onCommand("help",true,msg.author,msg.channel,msg.guild,new Date())
|
||||
return
|
||||
}
|
||||
|
||||
if (args[1]){
|
||||
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]})
|
||||
log("command","someone used the 'help' command",[{key:"user",value:msg.author.tag}])
|
||||
APIEvents.onCommand("help",true,msg.author,msg.channel,msg.guild,new Date())
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
client.on("interactionCreate",(interaction) => {
|
||||
if (!interaction.isCommand()) return
|
||||
if (!DISABLE.commands.slash.help) client.on("interactionCreate",(interaction) => {
|
||||
if (!interaction.isChatInputCommand()) return
|
||||
if (interaction.commandName != "help") return
|
||||
|
||||
interaction.reply({embeds:[helpEmbed]})
|
||||
log("command","someone used the 'help' command",[{key:"user",value:interaction.user.tag}])
|
||||
APIEvents.onCommand("help",true,interaction.user,interaction.channel,interaction.guild,new Date())
|
||||
})
|
||||
}
|
||||
+43
-31
@@ -2,64 +2,76 @@ 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 permsChecker = require("../core/utils/permisssionChecker")
|
||||
|
||||
const APIEvents = require("../core/api/modules/events")
|
||||
const DISABLE = require("../core/api/api.json").disable
|
||||
|
||||
module.exports = () => {
|
||||
client.on("messageCreate",msg => {
|
||||
bot.errorLog.log("debug","COMMANDS: loaded remove.js")
|
||||
|
||||
if (!DISABLE.commands.text.remove) client.on("messageCreate",msg => {
|
||||
if (!msg.content.startsWith(config.prefix+"remove")) return
|
||||
var user = msg.mentions.users.first()
|
||||
if (!user){
|
||||
return msg.channel.send({content:"**There is no user to remove:**\nuse: `"+config.prefix+"remove <user>`"})
|
||||
}
|
||||
if (!user) return msg.channel.send({embeds:[bot.errorLog.invalidArgsMessage(l.errors.missingArgsDescription+" `<user>`:\n`"+config.prefix+"remove <user>`")]})
|
||||
|
||||
if (!msg.member.permissions.has("MANAGE_CHANNELS") && !msg.member.permissions.has("ADMINISTRATOR")){
|
||||
return msg.channel.send({content:"You have no permissions to remove someone from the channel!\nYou need the `ADMINISTRATOR` or `MANAGE_CHANNELS` permission"})
|
||||
if (!msg.guild) return
|
||||
if (!permsChecker.command(msg.author.id,msg.guild.id)){
|
||||
permsChecker.sendUserNoPerms(msg.author)
|
||||
return
|
||||
}
|
||||
|
||||
msg.channel.messages.fetchPinned().then(msglist => {
|
||||
var firstmsg = msglist.last()
|
||||
|
||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id){
|
||||
msg.channel.send({content:"You are not in a ticket!"})
|
||||
return
|
||||
}
|
||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return msg.channel.send({embeds:[bot.errorLog.notInATicket]})
|
||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
||||
|
||||
msg.channel.permissionOverwrites.delete(user.id)
|
||||
msg.channel.send({content:"Deleted "+user.tag+" from the ticket"})
|
||||
if (config.logs){console.log("[system] deleted user from ticket (name:"+user.username+",ticket:"+msg.channel.name+")")}
|
||||
msg.channel.send({embeds:[bot.embeds.commands.removeEmbed(user,msg.author)]})
|
||||
|
||||
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}])
|
||||
|
||||
const ticketData = require("../core/utils/configParser").getTicketById(ticketId,true)
|
||||
APIEvents.onTicketRemove(msg.author,loguser,msg.channel,msg.guild,new Date(),{status:"open",name:msg.channel.name,ticketOptions:ticketData})
|
||||
APIEvents.onCommand("remove",permsChecker.command(msg.author.id,msg.guild.id),msg.author,msg.channel,msg.guild,new Date())
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
client.on("interactionCreate",(interaction) => {
|
||||
if (!interaction.isCommand()) return
|
||||
if (!DISABLE.commands.slash.remove) client.on("interactionCreate",async (interaction) => {
|
||||
if (!interaction.isChatInputCommand()) return
|
||||
if (interaction.commandName != "remove") return
|
||||
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")){
|
||||
return interaction.reply({content:"You have no permissions to remove someone from the channel!\nYou need the `ADMINISTRATOR` or `MANAGE_CHANNELS` permission"})
|
||||
if (!interaction.guild) return
|
||||
if (!permsChecker.command(interaction.user.id,interaction.guild.id)){
|
||||
permsChecker.sendUserNoPerms(interaction.user)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
interaction.channel.messages.fetchPinned().then(msglist => {
|
||||
await interaction.channel.messages.fetchPinned().then(msglist => {
|
||||
var firstmsg = msglist.last()
|
||||
|
||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id){
|
||||
interaction.reply({content:"You are not in a ticket!"})
|
||||
return
|
||||
}
|
||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return interaction.reply({embeds:[bot.errorLog.notInATicket]})
|
||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
||||
|
||||
interaction.channel.permissionOverwrites.delete(user.id)
|
||||
interaction.reply({content:"Deleted "+user.tag+" from the ticket"})
|
||||
if (config.logs){console.log("[system] removed user from ticket (name:"+user.username+",ticket:"+interaction.channel.name+")")}
|
||||
interaction.reply({embeds:[bot.embeds.commands.removeEmbed(user,interaction.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}])
|
||||
|
||||
const ticketData = require("../core/utils/configParser").getTicketById(ticketId,true)
|
||||
APIEvents.onTicketRemove(interaction.user,loguser,interaction.channel,interaction.guild,new Date(),{status:"open",name:interaction.channel.name,ticketOptions:ticketData})
|
||||
APIEvents.onCommand("remove",permsChecker.command(interaction.user.id,interaction.guild.id),interaction.user,interaction.channel,interaction.guild,new Date())
|
||||
})
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
+42
-28
@@ -2,25 +2,35 @@ 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 permsChecker = require("../core/utils/permisssionChecker")
|
||||
|
||||
const APIEvents = require("../core/api/modules/events")
|
||||
const DISABLE = require("../core/api/api.json").disable
|
||||
|
||||
module.exports = () => {
|
||||
client.on("messageCreate",msg => {
|
||||
bot.errorLog.log("debug","COMMANDS: loaded rename.js")
|
||||
|
||||
if (!DISABLE.commands.text.rename) client.on("messageCreate",msg => {
|
||||
if (!msg.content.startsWith(config.prefix+"rename")) return
|
||||
|
||||
if (!msg.guild) return
|
||||
if (!permsChecker.command(msg.author.id,msg.guild.id)){
|
||||
permsChecker.sendUserNoPerms(msg.author)
|
||||
return
|
||||
}
|
||||
|
||||
msg.channel.messages.fetchPinned().then(msglist => {
|
||||
var firstmsg = msglist.last()
|
||||
|
||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id){
|
||||
msg.channel.send({content:"You are not in a ticket!"})
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
if (!msg.member.permissions.has("MANAGE_CHANNELS") && !msg.member.permissions.has("ADMINISTRATOR")){
|
||||
return msg.channel.send({content:"You have no permissions to change the channel name!\nYou need the `ADMINISTRATOR` or `MANAGE_CHANNELS` permission"})
|
||||
}
|
||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return msg.channel.send({embeds:[bot.errorLog.notInATicket]})
|
||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
||||
|
||||
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 prefix = ""
|
||||
const tickets = config.options
|
||||
@@ -33,31 +43,33 @@ module.exports = () => {
|
||||
if (!prefix) prefix = "noprefix-"
|
||||
|
||||
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)"})
|
||||
|
||||
console.log("[system] renamed a ticket via command")
|
||||
msg.channel.send({embeds:[bot.embeds.commands.renameEmbed(msg.author,prefix+newname)]})
|
||||
|
||||
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}])
|
||||
APIEvents.onCommand("rename",permsChecker.command(msg.author.id,msg.guild.id),msg.author,msg.channel,msg.guild,new Date())
|
||||
})
|
||||
|
||||
|
||||
})
|
||||
|
||||
client.on("interactionCreate",(interaction) => {
|
||||
if (!interaction.isCommand()) return
|
||||
if (!DISABLE.commands.slash.rename) client.on("interactionCreate",(interaction) => {
|
||||
if (!interaction.isChatInputCommand()) return
|
||||
if (interaction.commandName != "rename") return
|
||||
|
||||
if (!interaction.guild) return
|
||||
if (!permsChecker.command(interaction.user.id,interaction.guild.id)){
|
||||
permsChecker.sendUserNoPerms(interaction.user)
|
||||
return
|
||||
}
|
||||
|
||||
//interaction.deferReply()
|
||||
|
||||
interaction.channel.messages.fetchPinned().then(msglist => {
|
||||
var firstmsg = msglist.last()
|
||||
|
||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id){
|
||||
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)
|
||||
if (!member.permissions.has("MANAGE_CHANNELS") && !member.permissions.has("ADMINISTRATOR")){
|
||||
return interaction.reply({content:"You have no permissions to change the channel name!\nYou need the `ADMINISTRATOR` or `MANAGE_CHANNELS` permission"})
|
||||
}
|
||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return interaction.reply({embeds:[bot.errorLog.notInATicket]})
|
||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
||||
|
||||
var newname = interaction.options.getString("name")
|
||||
var name = interaction.channel.name
|
||||
@@ -72,10 +84,12 @@ module.exports = () => {
|
||||
if (!prefix) prefix = "noprefix-"
|
||||
|
||||
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.embeds.commands.renameEmbed(interaction.user,prefix+newname)]})
|
||||
|
||||
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}])
|
||||
|
||||
APIEvents.onCommand("rename",permsChecker.command(interaction.user.id,interaction.guild.id),interaction.user,interaction.channel,interaction.guild,new Date())
|
||||
})
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
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 permsChecker = require("../core/utils/permisssionChecker")
|
||||
|
||||
const APIEvents = require("../core/api/modules/events")
|
||||
const DISABLE = require("../core/api/api.json").disable
|
||||
|
||||
module.exports = () => {
|
||||
bot.errorLog.log("debug","COMMANDS: loaded reopen.js")
|
||||
|
||||
if (!DISABLE.commands.text.reopen) 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]})
|
||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
||||
|
||||
if (hiddendata.data.find(h => h.key == "pendingdelete")) return msg.channel.send({embeds:[bot.errorLog.warning("Warning!","You can't re-open a ticket while it's being deleted!")]})
|
||||
|
||||
msg.channel.send({embeds:[bot.embeds.commands.reopenEmbed(msg.author)],components:[bot.buttons.close.openRowNormal]})
|
||||
|
||||
require("../core/ticketActions/ticketReopener").reopenTicket(msg.guild,msg.channel,msg.author)
|
||||
|
||||
log("command","someone used the 'reopen' command",[{key:"user",value:msg.author.tag}])
|
||||
APIEvents.onCommand("reopen",true,msg.author,msg.channel,msg.guild,new Date())
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
if (!DISABLE.commands.slash.reopen) client.on("interactionCreate",async (interaction) => {
|
||||
if (!interaction.isChatInputCommand()) return
|
||||
if (interaction.commandName != "reopen") return
|
||||
|
||||
//interaction.deferReply()
|
||||
|
||||
interaction.channel.messages.fetchPinned().then(async msglist => {
|
||||
var firstmsg = msglist.last()
|
||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return interaction.reply({embeds:[bot.errorLog.notInATicket]})
|
||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
||||
|
||||
if (hiddendata.data.find(h => h.key == "pendingdelete")) return interaction.reply({embeds:[bot.errorLog.warning("Warning!","You can't re-open a ticket while it's being deleted!")]})
|
||||
|
||||
await interaction.reply({embeds:[bot.embeds.commands.reopenEmbed(interaction.user)],components:[bot.buttons.close.openRowNormal]})
|
||||
|
||||
require("../core/ticketActions/ticketReopener").reopenTicket(interaction.guild,interaction.channel,interaction.user)
|
||||
|
||||
log("command","someone used the 'reopen' command",[{key:"user",value:interaction.user.tag}])
|
||||
APIEvents.onCommand("reopen",true,interaction.user,interaction.channel,interaction.guild,new Date())
|
||||
})
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
+29
-21
@@ -2,12 +2,16 @@ 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 permsChecker = require("../core/utils/permisssionChecker")
|
||||
|
||||
/** =============================
|
||||
** NOT READY YET
|
||||
** =============================*/
|
||||
const APIEvents = require("../core/api/modules/events")
|
||||
const DISABLE = require("../core/api/api.json").disable
|
||||
|
||||
module.exports = () => {
|
||||
bot.errorLog.log("debug","COMMANDS: loaded ticket.js")
|
||||
|
||||
/**@type {String[]} */
|
||||
var msgIds = []
|
||||
config.messages.forEach((msg) => {
|
||||
@@ -15,48 +19,52 @@ module.exports = () => {
|
||||
})
|
||||
|
||||
|
||||
client.on("messageCreate", msg => {
|
||||
if (msg.content.startsWith(config.prefix+"msg")){
|
||||
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 (!DISABLE.commands.text.msg) client.on("messageCreate", msg => {
|
||||
if (msg.content.startsWith(config.prefix+"msg"||config.prefix+"message")){
|
||||
|
||||
if (!msg.guild) return
|
||||
if (!permsChecker.command(msg.author.id,msg.guild.id)){
|
||||
permsChecker.sendUserNoPerms(msg.author)
|
||||
return
|
||||
}
|
||||
|
||||
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 (!msgIds.includes(id)) return msg.channel.send({content:"**Invalid id!**\nChoose from this list:\n_"+msgIds.join("_\n_")+"_"})
|
||||
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({embeds:[bot.errorLog.invalidIdChooseFromList(msgIds)]})
|
||||
|
||||
|
||||
const {embed,componentRows} = require("../core/ticketMessageEmbed").createEmbed(id)
|
||||
const {embed,componentRows} = require("../core/utils/getEmbed").createEmbed(id)
|
||||
|
||||
msg.channel.send({embeds:[embed],components:componentRows})
|
||||
|
||||
if (config.logs){console.log("[command] "+config.prefix+"ticket msg (user:"+msg.author.username+")")}
|
||||
if (config.logs){console.log("[system] created ticket message")}
|
||||
log("command","someone used the 'message' command",[{key:"user",value:msg.author.tag},{key:"id",value:id}])
|
||||
APIEvents.onCommand("message",permsChecker.command(msg.author.id,msg.guild.id),msg.author,msg.channel,msg.guild,new Date())
|
||||
}
|
||||
})
|
||||
|
||||
client.on("interactionCreate", (interaction) => {
|
||||
if (!interaction.isCommand()) return
|
||||
if (!DISABLE.commands.slash.msg) client.on("interactionCreate", (interaction) => {
|
||||
if (!interaction.isChatInputCommand()) 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){
|
||||
interaction.reply({content:"You have no permission to run this command!"})
|
||||
if (!interaction.guild) return
|
||||
if (!permsChecker.command(interaction.user.id,interaction.guild.id)){
|
||||
permsChecker.sendUserNoPerms(interaction.user)
|
||||
return
|
||||
}
|
||||
|
||||
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/utils/getEmbed").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})
|
||||
|
||||
if (config.logs){console.log("[command] "+config.prefix+"ticket msg (user:"+interaction.member.user.username+")")}
|
||||
if (config.logs){console.log("[system] created ticket message")}
|
||||
log("command","someone used the 'message' command",[{key:"user",value:interaction.user.tag},{key:"id",value:id}])
|
||||
|
||||
APIEvents.onCommand("message",permsChecker.command(interaction.user.id,interaction.guild.id),interaction.user,interaction.channel,interaction.guild,new Date())
|
||||
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
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 permsChecker = require("../core/utils/permisssionChecker")
|
||||
|
||||
const APIEvents = require("../core/api/modules/events")
|
||||
const DISABLE = require("../core/api/api.json").disable
|
||||
|
||||
module.exports = () => {
|
||||
bot.errorLog.log("debug","COMMANDS: loaded unclaim.js")
|
||||
|
||||
if (!DISABLE.commands.text.unclaim) client.on("messageCreate",msg => {
|
||||
if (!msg.content.startsWith(config.prefix+"unclaim")) return
|
||||
|
||||
if (!msg.guild) return
|
||||
if (!permsChecker.command(msg.author.id,msg.guild.id)){
|
||||
permsChecker.sendUserNoPerms(msg.author)
|
||||
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]})
|
||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
||||
|
||||
|
||||
//msg.channel.send({embeds:[bot.embeds.commands.unclaimEmbed(msg.author)]})
|
||||
msg.channel.send({embeds:[bot.errorLog.warning("Coming soon!","This feature isn't ready yet!\nIt will become active in the next update!")]})
|
||||
|
||||
var loguser = msg.author
|
||||
log("command","someone used the 'unclaim' command",[{key:"user",value:msg.author.tag}])
|
||||
log("system","user unclaimed from ticket",[{key:"user",value:msg.author.tag},{key:"ticket",value:msg.channel.name},{key:"unclaimed_user",value:msg.author.tag}])
|
||||
|
||||
const ticketData = require("../core/utils/configParser").getTicketById(ticketId,true)
|
||||
//APIEvents.onTicketAdd(msg.author,loguser,msg.channel,msg.guild,new Date(),{status:"open",name:msg.channel.name,ticketOptions:ticketData})
|
||||
//APIEvents.onCommand("add",permsChecker.command(msg.author.id,msg.guild.id),msg.author,msg.channel,msg.guild,new Date())
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
if (!DISABLE.commands.slash.unclaim) client.on("interactionCreate",(interaction) => {
|
||||
if (!interaction.isChatInputCommand()) return
|
||||
if (interaction.commandName != "unclaim") return
|
||||
const user = interaction.user
|
||||
|
||||
if (!interaction.guild) return
|
||||
if (!permsChecker.command(interaction.user.id,interaction.guild.id)){
|
||||
permsChecker.sendUserNoPerms(interaction.user)
|
||||
return
|
||||
}
|
||||
|
||||
interaction.channel.messages.fetchPinned().then(msglist => {
|
||||
var firstmsg = msglist.last()
|
||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return interaction.reply({embeds:[bot.errorLog.notInATicket]})
|
||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
||||
|
||||
//interaction.reply({embeds:[bot.embeds.commands.unclaimEmbed(interaction.user)]})
|
||||
interaction.reply({embeds:[bot.errorLog.warning("Coming soon!","This feature isn't ready yet!\nIt will become active in the next update!")]})
|
||||
|
||||
var loguser = user
|
||||
log("command","someone used the 'unclaim' command",[{key:"user",value:interaction.user.tag}])
|
||||
log("system","user unclaimed from ticket",[{key:"user",value:interaction.user.tag},{key:"ticket",value:interaction.channel.name},{key:"unclaimed_user",value:loguser.tag}])
|
||||
|
||||
const ticketData = require("../core/utils/configParser").getTicketById(ticketId,true)
|
||||
//APIEvents.onTicketAdd(interaction.user,loguser,interaction.channel,interaction.guild,new Date(),{status:"open",name:interaction.channel.name,ticketOptions:ticketData})
|
||||
//APIEvents.onCommand("add",permsChecker.command(interaction.user.id,interaction.guild.id),interaction.user,interaction.channel,interaction.guild,new Date())
|
||||
|
||||
})
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
+30
-12
@@ -1,18 +1,16 @@
|
||||
{
|
||||
"bot_name":"Wumpus",
|
||||
"main_color":"#fffff",
|
||||
"main_color":"#ffffff",
|
||||
"server_id":"server id (for slash cmds)",
|
||||
"auth_token":"auth token",
|
||||
"main_adminroles":["discord role id"],
|
||||
"prefix":"!ticket ",
|
||||
"logs":true,
|
||||
"languagefile":"english.json (currently not working)",
|
||||
"languagefile":"english",
|
||||
|
||||
"credits":true,
|
||||
"status":{
|
||||
"enabled":true,
|
||||
"type":"PLAYING",
|
||||
"text":"!ticket"
|
||||
"text":"!ticket help"
|
||||
},
|
||||
|
||||
"system":{
|
||||
@@ -22,10 +20,13 @@
|
||||
|
||||
"has@everyoneaccess":false,
|
||||
"member_role":"member role (doesn't have access to tickets)",
|
||||
"closeMode":"adminonly|normal",
|
||||
|
||||
"enable_transcript":false,
|
||||
"enable_DM_transcript":false,
|
||||
"transcript_channel":"channel id"
|
||||
"transcript_channel":"channel id",
|
||||
|
||||
"showSlashcmdsInHelp":false
|
||||
},
|
||||
|
||||
"options":[
|
||||
@@ -42,7 +43,18 @@
|
||||
"channelprefix":"question-",
|
||||
"category":"category id",
|
||||
"message":"You created a ticket!",
|
||||
"enableDMMessage":true
|
||||
"enableDmOnOpen":true,
|
||||
"ticketmessage":"The staff will help you soon!\n\n*Click on the button below to close the ticket!*",
|
||||
|
||||
"thumbnail":{
|
||||
"enable":false,
|
||||
"url":"https://www.example.com/catmemes/cat.png"
|
||||
},
|
||||
|
||||
"closedCategory":{
|
||||
"enable":false,
|
||||
"id":"category id"
|
||||
}
|
||||
|
||||
},
|
||||
{
|
||||
@@ -67,7 +79,7 @@
|
||||
"color":"red",
|
||||
"roles":["discord role id"],
|
||||
"mode":"add&remove|remove|add",
|
||||
"enableDMMessage":true
|
||||
"enableDmOnOpen":true
|
||||
|
||||
}
|
||||
],
|
||||
@@ -76,12 +88,18 @@
|
||||
{
|
||||
"id":"1",
|
||||
"name":"Choose Your Ticket",
|
||||
"description":"You can click one of the buttons below!\nYou can also customize all the embeds now!",
|
||||
"enableFooter":true,
|
||||
"footer":"Open Ticket v2.0.0 beta - sneakpeak",
|
||||
"description":"You can click one of the buttons below!",
|
||||
"dropdown":false,
|
||||
|
||||
"enableFooter":false,
|
||||
"footer":"Open Ticket v3.0.0 - I'm a footer!",
|
||||
|
||||
"enableThumbnail":false,
|
||||
"thumbnail":"https://www.example.com/catmemes/cat.png",
|
||||
"color":"#0075e9",
|
||||
|
||||
"enableCustomColor":false,
|
||||
"color":"#ffffff",
|
||||
|
||||
"options":["general","apply"],
|
||||
"enableTicketExplaination":true,
|
||||
"enableMaxTicketsWarning":true
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
//base
|
||||
const bot = require("../../index")
|
||||
|
||||
exports.client = bot.client
|
||||
exports.config = bot.config
|
||||
exports.utils = {
|
||||
log:bot.errorLog.log(),
|
||||
storage:bot.storage
|
||||
}
|
||||
|
||||
//events
|
||||
const events = require("./modules/events").events
|
||||
exports.events = events
|
||||
|
||||
//actions
|
||||
const actions = require("./modules/actions").actions
|
||||
//comming soon
|
||||
//exports.actions = actions
|
||||
@@ -0,0 +1,57 @@
|
||||
{
|
||||
"version":"1.0.0",
|
||||
"enableAPIdebug":false,
|
||||
"enableAPIconsolelogs":false,
|
||||
|
||||
"info":"If you turn these switches to true, then the feature will be turned OFF!",
|
||||
"info2":"You can use this to disable some features you don't want!",
|
||||
"disable":{
|
||||
"messages":{
|
||||
"DISCLAIMER":"the messages part doesn't work yet!",
|
||||
"ticketCreated":false,
|
||||
"ticketClosed":false,
|
||||
"ticketDeleted":false,
|
||||
"ticketReopened":false
|
||||
},
|
||||
"transcripts":{
|
||||
"server":false,
|
||||
"dm":false
|
||||
},
|
||||
"commands":{
|
||||
"text":{
|
||||
"help":false,
|
||||
"msg":false,
|
||||
"close":false,
|
||||
"delete":false,
|
||||
"reopen":false,
|
||||
"new":false,
|
||||
"add":false,
|
||||
"remove":false,
|
||||
"rename":false,
|
||||
"claim":false,
|
||||
"unclaim":false
|
||||
},
|
||||
"slash":{
|
||||
"help":false,
|
||||
"msg":false,
|
||||
"close":false,
|
||||
"delete":false,
|
||||
"reopen":false,
|
||||
"new":false,
|
||||
"add":false,
|
||||
"remove":false,
|
||||
"rename":false,
|
||||
"claim":false,
|
||||
"unclaim":false
|
||||
}
|
||||
},
|
||||
"checkerjs":{
|
||||
"token":false,
|
||||
"all":false
|
||||
},
|
||||
"debug":{
|
||||
"all":false,
|
||||
"debuglogs":false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
//ACTIONS:
|
||||
|
||||
|
||||
//EXPORT ACTIONS:
|
||||
exports.actions = {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
/** FOR DEVELOPERS ONLY!!
|
||||
* Don't change anything in this file before reading the documentation!
|
||||
* visit the api documentation at https://docs.openticket.dj-dj.be
|
||||
*/
|
||||
|
||||
|
||||
exports.embeddedMode = false
|
||||
exports.clientLocation = require("../../../index").client
|
||||
@@ -0,0 +1,361 @@
|
||||
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
|
||||
|
||||
|
||||
//EVENT API:
|
||||
const ticketOpenListeners = []
|
||||
const ticketCloseListeners = []
|
||||
const ticketDeleteListeners = []
|
||||
const ticketReopenListeners = []
|
||||
|
||||
const ticketAddListeners = []
|
||||
const ticketRemoveListeners = []
|
||||
|
||||
|
||||
const transcriptCreationListeners = []
|
||||
const commandListeners = []
|
||||
const reactionRoleListeners = []
|
||||
const errorListeners = []
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {discord.User} user
|
||||
* @param {discord.TextChannel} channel
|
||||
* @param {discord.Guild} guild
|
||||
* @param {Date} date
|
||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
||||
*/
|
||||
exports.onTicketOpen = (user,channel,guild,date,ticketdata) => {
|
||||
//system
|
||||
bot.errorLog.log("api","new ticket created",[{key:"userid",value:user.id},{key:"channelid",value:channel.id},{key:"guildid",value:guild.id},{key:"ticketdata",value:JSON.stringify(ticketdata)}])
|
||||
|
||||
ticketOpenListeners.forEach((func) => {
|
||||
try {
|
||||
func(user,channel,guild,date,ticketdata)
|
||||
}catch{}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {discord.User} user
|
||||
* @param {discord.TextChannel} channel
|
||||
* @param {discord.Guild} guild
|
||||
* @param {Date} date
|
||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
||||
* @param {String} reason
|
||||
*/
|
||||
exports.onTicketClose = (user,channel,guild,date,ticketdata,reason) => {
|
||||
//system
|
||||
bot.errorLog.log("api","ticket closed",[{key:"userid",value:user.id},{key:"channelid",value:channel.id},{key:"guildid",value:guild.id},{key:"ticketdata",value:JSON.stringify(ticketdata)},{key:"reason",value:reason}])
|
||||
|
||||
ticketCloseListeners.forEach((func) => {
|
||||
try {
|
||||
func(user,channel,guild,date,ticketdata,reason)
|
||||
}catch{}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {discord.User} user
|
||||
* @param {discord.TextChannel} channel
|
||||
* @param {discord.Guild} guild
|
||||
* @param {Date} date
|
||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
||||
*/
|
||||
exports.onTicketDelete = (user,channel,guild,date,ticketdata) => {
|
||||
//system
|
||||
bot.errorLog.log("api","ticket deleted",[{key:"userid",value:user.id},{key:"channelid",value:channel.id},{key:"guildid",value:guild.id},{key:"ticketdata",value:JSON.stringify(ticketdata)}])
|
||||
|
||||
ticketDeleteListeners.forEach((func) => {
|
||||
try {
|
||||
func(user,channel,guild,date,ticketdata)
|
||||
}catch{}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {discord.User} user
|
||||
* @param {discord.TextChannel} channel
|
||||
* @param {discord.Guild} guild
|
||||
* @param {Date} date
|
||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
||||
*/
|
||||
exports.onTicketReopen = (user,channel,guild,date,ticketdata) => {
|
||||
//system
|
||||
bot.errorLog.log("api","ticket reopened",[{key:"userid",value:user.id},{key:"channelid",value:channel.id},{key:"guildid",value:guild.id},{key:"ticketdata",value:JSON.stringify(ticketdata)}])
|
||||
|
||||
ticketReopenListeners.forEach((func) => {
|
||||
try {
|
||||
func(user,channel,guild,date,ticketdata)
|
||||
}catch{}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {discord.User} user
|
||||
* @param {discord.User} editeduser
|
||||
* @param {discord.TextChannel} channel
|
||||
* @param {discord.Guild} guild
|
||||
* @param {Date} date
|
||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
||||
*/
|
||||
exports.onTicketAdd = (user,editeduser,channel,guild,date,ticketdata) => {
|
||||
//system
|
||||
bot.errorLog.log("api","user added to ticket",[{key:"userid",value:user.id},{key:"editeduser",value:editeduser.id},{key:"channelid",value:channel.id},{key:"guildid",value:guild.id},{key:"ticketdata",value:JSON.stringify(ticketdata)}])
|
||||
|
||||
ticketAddListeners.forEach((func) => {
|
||||
try {
|
||||
func(user,editeduser,channel,guild,date,ticketdata)
|
||||
}catch{}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {discord.User} user
|
||||
* @param {discord.User} editeduser
|
||||
* @param {discord.TextChannel} channel
|
||||
* @param {discord.Guild} guild
|
||||
* @param {Date} date
|
||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
||||
*/
|
||||
exports.onTicketRemove = (user,editeduser,channel,guild,date,ticketdata) => {
|
||||
//system
|
||||
bot.errorLog.log("api","user removed from ticket",[{key:"userid",value:user.id},{key:"editeduser",value:editeduser.id},{key:"channelid",value:channel.id},{key:"guildid",value:guild.id},{key:"ticketdata",value:JSON.stringify(ticketdata)}])
|
||||
|
||||
ticketRemoveListeners.forEach((func) => {
|
||||
try {
|
||||
func(user,editeduser,channel,guild,date,ticketdata)
|
||||
}catch{}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {discord.Message[]} messages
|
||||
* @param {discord.TextChannel} channel
|
||||
* @param {discord.Guild} guild
|
||||
* @param {Date} date
|
||||
*/
|
||||
exports.onTranscriptCreation = (messages,channel,guild,date) => {
|
||||
//system
|
||||
bot.errorLog.log("api","transcript created",[{key:"messages",value:JSON.stringify(messages)},{key:"channelid",value:channel.id},{key:"guildid",value:guild.id}])
|
||||
|
||||
transcriptCreationListeners.forEach((func) => {
|
||||
try {
|
||||
func(messages,channel,guild,date)
|
||||
}catch{}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
/**@typedef {"help"|"message"|"close"|"delete"|"reopen"|"rename"|"add"|"remove"} OTCommandType */
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {OTCommandType} type
|
||||
* @param {Boolean} hasPerms
|
||||
* @param {discord.User} user
|
||||
* @param {discord.TextChannel} channel
|
||||
* @param {discord.Guild} guild
|
||||
* @param {Date} date
|
||||
*/
|
||||
exports.onCommand = (type,hasPerms,user,channel,guild,date) => {
|
||||
|
||||
const newguild = guild ? guild : false
|
||||
//system
|
||||
bot.errorLog.log("api","someone used a command",[{key:"type",value:type},{key:"hasPerms",value:hasPerms},{key:"userid",value:user},{key:"channelid",value:channel.id},{key:"guildid",value:newguild.id}])
|
||||
|
||||
commandListeners.forEach((func) => {
|
||||
try {
|
||||
func(type,hasPerms,user,channel,newguild,date)
|
||||
}catch{}
|
||||
})
|
||||
}
|
||||
|
||||
/**@typedef {"add"|"remove"|"add&remove"} OTReactionRoleType */
|
||||
/**@typedef {"add"|"remove"} OTReactionRoleMode */
|
||||
|
||||
/**
|
||||
* @param {OTReactionRoleMode} mode
|
||||
* @param {OTReactionRoleType} type
|
||||
* @param {discord.Role} role
|
||||
* @param {discord.User} user
|
||||
* @param {discord.TextChannel} channel
|
||||
* @param {discord.Guild} guild
|
||||
* @param {Date} date
|
||||
*/
|
||||
exports.onReactionRole = (mode,type,role,user,channel,guild,date) => {
|
||||
//system
|
||||
bot.errorLog.log("api","someone used a reaction role",[{key:"mode",value:mode},{key:"type",value:type},{key:"roleid",value:role.id},{key:"userid",value:user},{key:"channelid",value:channel.id},{key:"guildid",value:guild.id}])
|
||||
|
||||
reactionRoleListeners.forEach((func) => {
|
||||
try {
|
||||
func(mode,type,role,user,channel,guild,date)
|
||||
}catch{}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {String} err
|
||||
* @param {Date} date
|
||||
*/
|
||||
exports.onError = (err,date) => {
|
||||
//system
|
||||
bot.errorLog.log("api","there is an error",[{key:"error",value:err}])
|
||||
|
||||
errorListeners.forEach((func) => {
|
||||
try {
|
||||
func(err,date)
|
||||
}catch{}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
//EVENT CALLBACKS:
|
||||
|
||||
/**
|
||||
* @callback TicketActionEvent
|
||||
* @param {discord.User} user
|
||||
* @param {discord.TextChannel} channel
|
||||
* @param {discord.Guild} guild
|
||||
* @param {Date} date
|
||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
||||
*/
|
||||
|
||||
/**
|
||||
* @callback TicketCloseEvent
|
||||
* @param {discord.User} user
|
||||
* @param {discord.TextChannel} channel
|
||||
* @param {discord.Guild} guild
|
||||
* @param {Date} date
|
||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
||||
* @param {String} reason
|
||||
*/
|
||||
|
||||
/**
|
||||
* @callback TranscriptCreationEvent
|
||||
* @param {discord.Message[]} messages
|
||||
* @param {discord.TextChannel} channel
|
||||
* @param {discord.Guild} guild
|
||||
* @param {Date} date
|
||||
*/
|
||||
|
||||
/**
|
||||
* @callback TicketUserChangeEvent
|
||||
* @param {discord.User} user
|
||||
* @param {discord.User} editeduser
|
||||
* @param {discord.TextChannel} channel
|
||||
* @param {discord.Guild} guild
|
||||
* @param {Date} date
|
||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
||||
*/
|
||||
|
||||
/**
|
||||
* @callback CommandEvent
|
||||
* @param {OTCommandType} type
|
||||
* @param {Boolean} hasPerms
|
||||
* @param {discord.User} user
|
||||
* @param {discord.TextChannel} channel
|
||||
* @param {discord.Guild|false} guild
|
||||
* @param {Date} date
|
||||
*/
|
||||
|
||||
/**
|
||||
* @callback ReactionRoleEvent
|
||||
* @param {OTReactionRoleMode} mode
|
||||
* @param {OTReactionRoleType} type
|
||||
* @param {discord.Role} role
|
||||
* @param {discord.User} user
|
||||
* @param {discord.TextChannel} channel
|
||||
* @param {discord.Guild} guild
|
||||
* @param {Date} date
|
||||
*/
|
||||
|
||||
/**
|
||||
* @callback ErrorEvent
|
||||
* @param {String} error
|
||||
* @param {Date} date
|
||||
*/
|
||||
|
||||
//EVENT EXPORT:
|
||||
|
||||
/**@param {TicketActionEvent} callback */
|
||||
const onTicketOpen = (callback) => {
|
||||
ticketOpenListeners.push(callback)
|
||||
}
|
||||
|
||||
/**@param {TicketCloseEvent} callback */
|
||||
const onTicketClose = (callback) => {
|
||||
ticketCloseListeners.push(callback)
|
||||
}
|
||||
|
||||
/**@param {TicketActionEvent} callback */
|
||||
const onTicketDelete = (callback) => {
|
||||
ticketDeleteListeners.push(callback)
|
||||
}
|
||||
|
||||
/**@param {TicketActionEvent} callback */
|
||||
const onTicketReopen = (callback) => {
|
||||
ticketReopenListeners.push(callback)
|
||||
}
|
||||
|
||||
/**@param {TicketUserChangeEvent} callback */
|
||||
const onTicketAdd = (callback) => {
|
||||
ticketAddListeners.push(callback)
|
||||
}
|
||||
|
||||
/**@param {TicketUserChangeEvent} callback */
|
||||
const onTicketRemove = (callback) => {
|
||||
ticketRemoveListeners.push(callback)
|
||||
}
|
||||
|
||||
/**@param {TranscriptCreationEvent} callback */
|
||||
const onTranscriptCreation = (callback) => {
|
||||
transcriptCreationListeners.push(callback)
|
||||
}
|
||||
|
||||
/**@param {CommandEvent} callback */
|
||||
const onCommand = (callback) => {
|
||||
commandListeners.push(callback)
|
||||
}
|
||||
|
||||
/**@param {ReactionRoleEvent} callback */
|
||||
const onReactionRole = (callback) => {
|
||||
commandListeners.push(callback)
|
||||
}
|
||||
|
||||
/**@param {ErrorEvent} callback */
|
||||
const onError = (callback) => {
|
||||
errorListeners.push(callback)
|
||||
}
|
||||
|
||||
exports.events = {
|
||||
onTicketOpen,
|
||||
onTicketClose,
|
||||
onTicketDelete,
|
||||
onTicketReopen,
|
||||
onTicketAdd,
|
||||
onTicketRemove,
|
||||
onTranscriptCreation,
|
||||
onCommand,
|
||||
onReactionRole,
|
||||
onError
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
const fs = require("fs")
|
||||
const bot = require("../../index")
|
||||
const log = bot.errorLog.log
|
||||
|
||||
module.exports = () => {
|
||||
const files = fs.readdirSync("./plugins")
|
||||
const api = require("./api.json")
|
||||
var totalcount = 0
|
||||
var successcount = 0
|
||||
var failcount = 0
|
||||
files.forEach((file) => {
|
||||
if (file.endsWith(".plugin.js")){
|
||||
try {
|
||||
require("../../plugins/"+file)()
|
||||
|
||||
successcount++
|
||||
totalcount++
|
||||
}catch(err){
|
||||
/**@type {Error} */
|
||||
const theError = err
|
||||
if (api.enableAPIdebug){
|
||||
const data = fs.readFileSync("./apiDebug.txt")
|
||||
const newData = data ? data.toString() : ""
|
||||
fs.writeFileSync("./apiDebug.txt",newData+"ERROR: "+theError.name+": "+theError.message+"\n"+theError.stack+"\n\n")
|
||||
}
|
||||
failcount++
|
||||
totalcount++
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
log("info","loaded plugins",[{key:"success",value:successcount},{key:"error",value:failcount},{key:"total",value:totalcount}])
|
||||
}
|
||||
+180
-29
@@ -1,6 +1,17 @@
|
||||
exports.checker = async () => {
|
||||
const chalk = await (await import("chalk")).default
|
||||
const config = require("../config.json")
|
||||
|
||||
if (process.argv.some((v) => v == "--nochecker")) return
|
||||
if (process.argv.some((v) => v == "--devconfig")){
|
||||
//console.log(chalk.blue("=> used dev config instead of normal config"))
|
||||
try{
|
||||
var tempconfig = require("../devConfig.json")
|
||||
}catch(err){console.log(err);var tempconfig = require("../config.json")}
|
||||
}else{
|
||||
var tempconfig = require("../config.json")
|
||||
}
|
||||
|
||||
const config = tempconfig
|
||||
var errorList = []
|
||||
var isError = false
|
||||
var warnList = []
|
||||
@@ -41,15 +52,25 @@ exports.checker = async () => {
|
||||
}
|
||||
/**@param {String} value */
|
||||
const checkToken = (value) => {
|
||||
if (value.includes(" ") || value.length < 40 || value.length > 70){
|
||||
if (value.length < 40){
|
||||
createError("'auth_token' | your token is invalid")
|
||||
}
|
||||
if (value.includes(" ")) createError("'auth_token' | your token includes spaces!")
|
||||
}
|
||||
|
||||
/**@param {String} value @param {String} path */
|
||||
const checkHexColor = (value,path) => {
|
||||
if (!/^#[a-fA-F0-9]{3,6}$/.test(value)){
|
||||
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 checkColor = (value,path) => {
|
||||
if (!/^#[a-f0-9]{6}$/.test(value)){
|
||||
createError("'"+path+"' | invalid color!")
|
||||
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)")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,8 +134,12 @@ exports.checker = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
const getButtonClass = require("./utils/getButton").rawButtonData
|
||||
/**@param {getButtonClass} option */
|
||||
const configParser = require("./utils/configParser")
|
||||
/**
|
||||
* @param {configParser.OTAllOptions} option
|
||||
* @param {String} path
|
||||
*/
|
||||
|
||||
const checkOption = (option,path) => {
|
||||
|
||||
//id
|
||||
@@ -123,13 +148,15 @@ exports.checker = async () => {
|
||||
createError("'"+path+"/id' | option id can't contain space characters!")
|
||||
}
|
||||
if (option.id.length > 20){
|
||||
createError("'"+path+"/id' | option id max lenght is 20")
|
||||
createError("'"+path+"/id' | option id max lenght is 20!")
|
||||
}
|
||||
|
||||
//name
|
||||
checkType(option.name,"string",path+"/name")
|
||||
if (option.name.length > 100){
|
||||
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
|
||||
@@ -177,13 +204,30 @@ exports.checker = async () => {
|
||||
|
||||
//category
|
||||
checkType(option.category,"string",path+"/category")
|
||||
checkDiscord("categoryid",option.category,path+"/category")
|
||||
if (option.category.length > 0){
|
||||
checkDiscord("categoryid",option.category,path+"/category")
|
||||
}
|
||||
|
||||
//message
|
||||
checkType(option.message,"string",path+"/message")
|
||||
|
||||
//enableDMmessage
|
||||
checkType(option.enableDMMessage,"boolean",path+"/enableDMMessage")
|
||||
//enableDmOnOpen
|
||||
checkType(option.enableDmOnOpen,"boolean",path+"/enableDmOnOpen")
|
||||
|
||||
//ticketmessage
|
||||
checkType(option.ticketmessage,"string",path+"/ticketmessage")
|
||||
|
||||
//thumbnail
|
||||
checkType(option.thumbnail.enable,"boolean",path/"/thumbnail/enable")
|
||||
checkType(option.thumbnail.url,"string",path/"/thumbnail/url")
|
||||
|
||||
//closedCategory
|
||||
checkType(option.closedCategory.enable,"boolean",path/"/closedCategory/enable")
|
||||
checkType(option.closedCategory.id,"string",path/"/closedCategory/id")
|
||||
if (option.closedCategory.enable){
|
||||
checkDiscord("roleid",option.closedCategory.id,path+"/closedCategory/id")
|
||||
}
|
||||
|
||||
}else if (type == "website"){
|
||||
//url
|
||||
checkType(option.url,"string",path+"/url")
|
||||
@@ -191,13 +235,13 @@ exports.checker = async () => {
|
||||
createWarn("'"+path+"/url' | a url can't contain spaces")
|
||||
}
|
||||
if (option.url.length < 1){
|
||||
createError("'"+path+"/url' | you have no url in this button")
|
||||
createError("'"+path+"/url' | there is no url!")
|
||||
}
|
||||
if (!option.url.startsWith("https://") && !option.url.startsWith("http://") && !option.url.startsWith("discord://")){
|
||||
createWarn("'"+path+"/url' | your url doesn't start with https or http!")
|
||||
}
|
||||
if (option.url.startsWith("http://")){
|
||||
createWarn("'"+path+"/url' | your url is not a HTTPS link! discord maybe blocks this url!")
|
||||
createWarn("'"+path+"/url' | your url is not a HTTPS link! discord can block this url!")
|
||||
}
|
||||
}else if (type == "role"){
|
||||
//color
|
||||
@@ -213,41 +257,115 @@ exports.checker = async () => {
|
||||
createError("'"+path+"/mode' | mode must be one of these: add, remove, add&remove")
|
||||
}
|
||||
|
||||
//enableDMmessage
|
||||
checkType(option.enableDMMessage,"boolean",path+"/enableDMMessage")
|
||||
//enableDmOnOpen
|
||||
checkType(option.enableDmOnOpen,"boolean",path+"/enableDmOnOpen")
|
||||
}
|
||||
}
|
||||
|
||||
//checker
|
||||
var configArray = ["bot_name","main_color","server_id","auth_token","main_adminroles","prefix","logs","languagefile","credits","status","system","options","messages"]
|
||||
/**
|
||||
*
|
||||
* @param {configParser.OTConfigMessage} input
|
||||
* @param {String} path
|
||||
*/
|
||||
const checkMessage = (input,path) => {
|
||||
//id
|
||||
if (!input.id) createError("'"+path+"/id' | this embed doesn't have an id!")
|
||||
if (input.id.length > 50) createError("'"+path+"/id' | the id can't be longer than 50")
|
||||
if (input.id.includes(" ") || input.id.includes("\n")) createError("'"+path+"/id' | the id can't contain spaces!")
|
||||
|
||||
//name
|
||||
if (input.name.length < 1){
|
||||
createWarn("'"+path+"/name' | this embed has no name!")
|
||||
}else if (input.name.length > 99) {
|
||||
createError("'"+path+"/name' | the name can't be longer than 100")
|
||||
}
|
||||
|
||||
//description
|
||||
if (input.description.length < 0){
|
||||
createWarn("'"+path+"/description' | this embed doesn't have a description!")
|
||||
}
|
||||
|
||||
//dropdown
|
||||
checkType(input.dropdown,"boolean",path+"/dropdown")
|
||||
|
||||
//footer
|
||||
checkType(input.enableFooter,"boolean",path+"/enableFooter")
|
||||
if (input.enableFooter){
|
||||
if (input.footer.length < 1) createError("'"+path+"/footer' | no footer!")
|
||||
if (input.footer.length > 200) createError("'"+path+"/footer' | footer length can't be more than 200!")
|
||||
}
|
||||
|
||||
//thumbnail
|
||||
checkType(input.enableThumbnail,"boolean",path+"/enableThumbnail")
|
||||
if (input.enableThumbnail){
|
||||
if (input.thumbnail.length < 1) createError("'"+path+"/thumbnail' | no thumbnail url!")
|
||||
}
|
||||
|
||||
//customColor
|
||||
checkType(input.enableCustomColor,"boolean",path+"/enableCustomColor")
|
||||
if (input.enableCustomColor){
|
||||
if (input.color.length < 1) createError("'"+path+"/color' | no color!")
|
||||
checkHexColor(input.color,path+"/color")
|
||||
}
|
||||
|
||||
//ticket explaination & max tickets warning
|
||||
checkType(input.enableTicketExplaination,"boolean",path+"/enableTicketExplaination")
|
||||
checkType(input.enableMaxTicketsWarning,"boolean",path+"/enableMaxTicketsWarning")
|
||||
|
||||
//OPTIONS!!!
|
||||
var counter = 0
|
||||
input.options.forEach((option) => {if (!configParser.optionExists(option)){counter++}})
|
||||
|
||||
if (counter == input.options.length){
|
||||
createWarn("'"+path+"/options' | insert the option ids here!")
|
||||
}else{
|
||||
input.options.forEach((option,index) => {
|
||||
if (!configParser.optionExists(option)){
|
||||
createWarn("'"+path+"/options:"+index+"' | this option doesnt exist!")
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------|
|
||||
//--------------------------|
|
||||
//checker => START HERE |
|
||||
//--------------------------|
|
||||
//--------------------------|
|
||||
|
||||
var configArray = ["main_color","server_id","auth_token","main_adminroles","prefix","languagefile","credits","status","system","options","messages"]
|
||||
configArray.forEach((item) => {
|
||||
if (config[item] == undefined){
|
||||
throw new Error("\n\nMAIN ERROR: the item '"+item+"' doesn't exist in config.json")
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
checkType(config.bot_name,"string","bot_name")
|
||||
checkColor(config.main_color,"main_color")
|
||||
checkHexColor(config.main_color,"main_color")
|
||||
checkDiscord("serverid",config.server_id,"server_id")
|
||||
checkToken(config.auth_token)
|
||||
|
||||
if (!require("./api/api.json").disable.checkerjs.token) checkToken(config.auth_token)
|
||||
|
||||
checkDiscordArray("roleid",config.main_adminroles,"main_adminroles")
|
||||
checkString(config.prefix,1,15,"prefix","prefix")
|
||||
checkType(config.logs,"boolean","logs")
|
||||
//languagefile (comming soon)
|
||||
//languagefile
|
||||
checkType(config.languagefile,"string","languagefile")
|
||||
const lf = config.languagefile
|
||||
|
||||
if (!lf.startsWith("custom") && !lf.startsWith("english") && !lf.startsWith("dutch") && !lf.startsWith("romanian") && !lf.startsWith("german") && !lf.startsWith("arabic") && !lf.startsWith("spanish") && !lf.startsWith("portuguese") && !lf.startsWith("french") && !lf.startsWith("italian")){
|
||||
createError("'languagefile' | invalid language, more info in the wiki")
|
||||
}
|
||||
|
||||
checkType(config.credits,"boolean","credits")
|
||||
//status:
|
||||
checkType(config.status.enabled,"boolean","status/enabled")
|
||||
if (config.status.enabled){
|
||||
if (config.status.type != "PLAYING" && config.status.type != "LISTENING" && config.status.type != "WATCHING"){
|
||||
createError("'status/type' | not a valid status type!")
|
||||
createError("'status/type' | not a valid status type! (LISTENING,WATCHING,PLAYING)")
|
||||
}
|
||||
if (config.status.text.length < 1 || config.status.text.length > 40){
|
||||
createError("'status/text' | text too long or short!")
|
||||
if (config.status.text.length < 1){
|
||||
createError("'status/text' | there is no status text!")
|
||||
}
|
||||
if (config.status.text.length > 50) createError("'status/text' | text too long!")
|
||||
}
|
||||
|
||||
|
||||
@@ -262,12 +380,20 @@ exports.checker = async () => {
|
||||
checkType(config.system["has@everyoneaccess"],"boolean","system/has@everyoneaccess")
|
||||
if (config.system.member_role != "" && config.system.member_role != " " && config.system.member_role != "false" && config.system.member_role != "null" && config.system.member_role != "0"){
|
||||
checkDiscord("roleid",config.system.member_role,"system/member_role")
|
||||
}else{
|
||||
createWarn("'system/member_role' | You don't have a member role, but it's recommended!")
|
||||
}
|
||||
checkType(config.system.closeMode,"string","system/closeMode")
|
||||
if (!["normal","adminonly"].includes(config.system.closeMode)){
|
||||
createError("'system/closeMode' | the close mode must be adminonly or normal")
|
||||
}
|
||||
|
||||
checkType(config.system.enable_transcript,"boolean","system/enable_transcript")
|
||||
checkType(config.system.enable_DM_transcript,"boolean","system/enable_DM_transcript")
|
||||
if (config.system.enable_transcript){
|
||||
checkDiscord("channelid",config.system.transcript_channel,"system/transcript_channel")
|
||||
}
|
||||
checkType(config.system.showSlashcmdsInHelp,"boolean","system/showSlashcmdsInHelp")
|
||||
|
||||
//options
|
||||
|
||||
@@ -275,6 +401,33 @@ exports.checker = async () => {
|
||||
checkOption(option,"options/"+index)
|
||||
})
|
||||
|
||||
//messages
|
||||
config.messages.forEach((message,index) => {
|
||||
checkMessage(message,"messages/"+index)
|
||||
})
|
||||
|
||||
|
||||
//discord check
|
||||
/**
|
||||
const discord = require("discord.js")
|
||||
const {GatewayIntentBits,Partials} = discord
|
||||
const client = new discord.Client({
|
||||
intents:[
|
||||
GatewayIntentBits.DirectMessages,
|
||||
GatewayIntentBits.GuildInvites,
|
||||
GatewayIntentBits.GuildMembers,
|
||||
GatewayIntentBits.GuildMessages,
|
||||
GatewayIntentBits.Guilds,
|
||||
GatewayIntentBits.MessageContent
|
||||
],
|
||||
partials:[Partials.Channel,Partials.Message]
|
||||
})
|
||||
await client.guilds.fetch()
|
||||
if (!client.guilds.cache.find(g => g.id == config.server_id)){
|
||||
createError("'server_id' | i'm not in a server with this id!")
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
//the end
|
||||
@@ -308,5 +461,3 @@ exports.checker = async () => {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
this.checker()
|
||||
@@ -1,236 +0,0 @@
|
||||
const discord = require('discord.js')
|
||||
const bot = require('../index')
|
||||
const client = bot.client
|
||||
const config = bot.config
|
||||
|
||||
|
||||
module.exports = () => {
|
||||
//closebar
|
||||
var closeBar = new discord.MessageActionRow()
|
||||
.addComponents(
|
||||
new discord.MessageButton()
|
||||
.setCustomId("closeTicketTrue")
|
||||
.setDisabled(false)
|
||||
.setStyle("SECONDARY")
|
||||
.setEmoji("✅")
|
||||
)
|
||||
.addComponents(
|
||||
new discord.MessageButton()
|
||||
.setCustomId("closeTicketFalse")
|
||||
.setDisabled(false)
|
||||
.setStyle("SECONDARY")
|
||||
.setEmoji("❌")
|
||||
)
|
||||
var deleteBar = new discord.MessageActionRow()
|
||||
.addComponents(
|
||||
new discord.MessageButton()
|
||||
.setCustomId("deleteTicketTrue")
|
||||
.setDisabled(false)
|
||||
.setStyle("SECONDARY")
|
||||
.setEmoji("✅")
|
||||
)
|
||||
.addComponents(
|
||||
new discord.MessageButton()
|
||||
.setCustomId("deleteTicketFalse")
|
||||
.setDisabled(false)
|
||||
.setStyle("SECONDARY")
|
||||
.setEmoji("❌")
|
||||
)
|
||||
var deleteBar1 = new discord.MessageActionRow()
|
||||
.addComponents(
|
||||
new discord.MessageButton()
|
||||
.setCustomId("deleteTicketTrue1")
|
||||
.setDisabled(false)
|
||||
.setStyle("SECONDARY")
|
||||
.setEmoji("✅")
|
||||
)
|
||||
.addComponents(
|
||||
new discord.MessageButton()
|
||||
.setCustomId("deleteTicketFalse1")
|
||||
.setDisabled(false)
|
||||
.setStyle("SECONDARY")
|
||||
.setEmoji("❌")
|
||||
)
|
||||
//closebutton
|
||||
var closeRowNormal = new discord.MessageActionRow()
|
||||
.addComponents(
|
||||
new discord.MessageButton()
|
||||
.setCustomId("closeTicket")
|
||||
.setDisabled(false)
|
||||
.setStyle("SECONDARY")
|
||||
.setLabel("Close Ticket")
|
||||
.setEmoji("🔒")
|
||||
)
|
||||
.addComponents(
|
||||
new discord.MessageButton()
|
||||
.setCustomId("deleteTicket")
|
||||
.setDisabled(false)
|
||||
.setStyle("DANGER")
|
||||
.setLabel("Delete Ticket")
|
||||
.setEmoji("✖️")
|
||||
)
|
||||
var closeRowClosed = new discord.MessageActionRow()
|
||||
.addComponents(
|
||||
new discord.MessageButton()
|
||||
.setCustomId("deleteTicket1")
|
||||
.setDisabled(false)
|
||||
.setStyle("DANGER")
|
||||
.setLabel("Delete Ticket")
|
||||
.setEmoji("✖️")
|
||||
)
|
||||
.addComponents(
|
||||
new discord.MessageButton()
|
||||
.setCustomId("sendTranscript")
|
||||
.setDisabled(false)
|
||||
.setStyle("SECONDARY")
|
||||
.setLabel("Send Transcript File")
|
||||
.setEmoji("📄")
|
||||
)
|
||||
|
||||
|
||||
//NORMAL CLOSE
|
||||
client.on("interactionCreate",interaction => {
|
||||
if (!interaction.isButton()) return
|
||||
if (interaction.customId != "closeTicket") return
|
||||
|
||||
interaction.deferUpdate()
|
||||
interaction.message.edit({components:[closeBar]})
|
||||
|
||||
})
|
||||
client.on("interactionCreate",interaction => {
|
||||
if (!interaction.isButton()) return
|
||||
if (interaction.customId != "closeTicketFalse") return
|
||||
|
||||
interaction.deferUpdate()
|
||||
interaction.message.edit({components:[closeRowNormal]})
|
||||
})
|
||||
client.on("interactionCreate",interaction => {
|
||||
if (!interaction.isButton()) return
|
||||
if (interaction.customId != "closeTicketTrue") return
|
||||
|
||||
interaction.deferUpdate()
|
||||
interaction.message.edit({components:[closeRowClosed]})
|
||||
|
||||
/**
|
||||
* @type {String}
|
||||
*/
|
||||
const name = interaction.channel.name
|
||||
var prefix = ""
|
||||
const tickets = config.options
|
||||
tickets.forEach((ticket) => {
|
||||
if (name.startsWith(ticket.channelprefix)){
|
||||
prefix = ticket.channelprefix
|
||||
}
|
||||
})
|
||||
|
||||
require("./ticketCloser").closeTicket(interaction,prefix,"close")
|
||||
})
|
||||
|
||||
client.on("interactionCreate",interaction => {
|
||||
if (!interaction.isButton()) return
|
||||
if (interaction.customId != "closeTicketTrue1") return
|
||||
|
||||
interaction.deferUpdate()
|
||||
const closedButtonDisabled = new discord.MessageActionRow()
|
||||
.addComponents([
|
||||
new discord.MessageButton()
|
||||
.setCustomId("closeTicketTrue1")
|
||||
.setDisabled(true)
|
||||
.setStyle("SECONDARY")
|
||||
.setEmoji("🔒")
|
||||
])
|
||||
interaction.message.edit({components:[closedButtonDisabled]})
|
||||
|
||||
/**
|
||||
* @type {String}
|
||||
*/
|
||||
const name = interaction.channel.name
|
||||
var prefix = ""
|
||||
const tickets = config.options
|
||||
tickets.forEach((ticket) => {
|
||||
if (name.startsWith(ticket.channelprefix)){
|
||||
prefix = ticket.channelprefix
|
||||
}
|
||||
})
|
||||
|
||||
require("./ticketCloser").closeTicket(interaction,prefix,"close")
|
||||
})
|
||||
|
||||
|
||||
//NORMAL DELETE
|
||||
client.on("interactionCreate",interaction => {
|
||||
if (!interaction.isButton()) return
|
||||
if (interaction.customId != "deleteTicket") return
|
||||
|
||||
interaction.deferUpdate()
|
||||
interaction.message.edit({components:[deleteBar]})
|
||||
|
||||
})
|
||||
client.on("interactionCreate",interaction => {
|
||||
if (!interaction.isButton()) return
|
||||
if (interaction.customId != "deleteTicketFalse") return
|
||||
|
||||
interaction.deferUpdate()
|
||||
interaction.message.edit({components:[closeRowNormal]})
|
||||
})
|
||||
client.on("interactionCreate",interaction => {
|
||||
if (!interaction.isButton()) return
|
||||
if (interaction.customId != "deleteTicketTrue") return
|
||||
|
||||
interaction.deferUpdate()
|
||||
|
||||
/**
|
||||
* @type {String}
|
||||
*/
|
||||
const name = interaction.channel.name
|
||||
var prefix = ""
|
||||
const tickets = config.options
|
||||
tickets.forEach((ticket) => {
|
||||
if (name.startsWith(ticket.channelprefix)){
|
||||
prefix = ticket.channelprefix
|
||||
}
|
||||
})
|
||||
|
||||
require("./ticketCloser").closeTicket(interaction,prefix,"delete")
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
//CLOSED DELETE
|
||||
client.on("interactionCreate",interaction => {
|
||||
if (!interaction.isButton()) return
|
||||
if (interaction.customId != "deleteTicket1") return
|
||||
|
||||
interaction.deferUpdate()
|
||||
interaction.message.edit({components:[deleteBar1]})
|
||||
|
||||
})
|
||||
client.on("interactionCreate",interaction => {
|
||||
if (!interaction.isButton()) return
|
||||
if (interaction.customId != "deleteTicketFalse1") return
|
||||
|
||||
interaction.deferUpdate()
|
||||
interaction.message.edit({components:[closeRowClosed]})
|
||||
})
|
||||
client.on("interactionCreate",interaction => {
|
||||
if (!interaction.isButton()) return
|
||||
if (interaction.customId != "deleteTicketTrue1") return
|
||||
|
||||
interaction.deferUpdate()
|
||||
|
||||
/**
|
||||
* @type {String}
|
||||
*/
|
||||
const name = interaction.channel.name
|
||||
var prefix = ""
|
||||
const tickets = config.options
|
||||
tickets.forEach((ticket) => {
|
||||
if (name.startsWith(ticket.channelprefix)){
|
||||
prefix = ticket.channelprefix
|
||||
}
|
||||
})
|
||||
|
||||
require("./ticketCloser").closeTicket(interaction,prefix,"deletenotranscript")
|
||||
})
|
||||
}
|
||||
@@ -23,14 +23,14 @@ ask()
|
||||
|
||||
const runClear = async () => {
|
||||
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"]
|
||||
|
||||
var index = 0
|
||||
|
||||
dataPaths.forEach((path) => {
|
||||
try {
|
||||
fs.rmdirSync(path,{recursive:true,force:true})
|
||||
fs.rmSync(path,{recursive:true,force:true})
|
||||
}catch{
|
||||
//console.log(path,"doesn't exist")
|
||||
}
|
||||
|
||||
@@ -11,23 +11,3 @@ try {
|
||||
}
|
||||
|
||||
module.exports = db
|
||||
|
||||
|
||||
/** =============================
|
||||
** NOT READY YET
|
||||
** must be dynamic
|
||||
** =============================*/
|
||||
const LocalStorage = require("node-localstorage")
|
||||
|
||||
const ticketStorage = new LocalStorage.LocalStorage("./storage/tickets")
|
||||
exports.ticketStorage = ticketStorage
|
||||
|
||||
const userTicketStorage = new LocalStorage.LocalStorage("./storage/userTickets")
|
||||
exports.userTicketStorage = userTicketStorage
|
||||
|
||||
const transcriptStorage = new LocalStorage.LocalStorage("./storage/transcripts")
|
||||
exports.transcriptStorage = transcriptStorage
|
||||
|
||||
//const ticketNumberStorage = new LocalStorage.LocalStorage("./storage/ticketNumbers")
|
||||
//exports.ticketNumberStorage = ticketNumberStorage
|
||||
|
||||
|
||||
@@ -0,0 +1,140 @@
|
||||
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.EmbedBuilder
|
||||
const c = discord.Colors
|
||||
|
||||
/**@param {discord.User} user*/
|
||||
exports.noPermsMessage = (user) => {
|
||||
return new embed()
|
||||
.setColor(c.Red)
|
||||
.setTitle(":x: "+l.errors.noPermsTitle)
|
||||
.setDescription(l.errors.noPermsDescription)
|
||||
.setFooter({iconURL:user.displayAvatarURL(),text:user.tag})
|
||||
}
|
||||
|
||||
/**@param {discord.User} user*/
|
||||
exports.noPermsDelete = (user) => {
|
||||
return new embed()
|
||||
.setColor(c.Red)
|
||||
.setTitle(":x: "+l.errors.noPermsTitle)
|
||||
.setDescription(l.errors.noPermsDelete)
|
||||
.setFooter({iconURL:user.displayAvatarURL(),text:user.tag})
|
||||
}
|
||||
|
||||
/**@param {String} message */
|
||||
exports.invalidArgsMessage = (message) => {
|
||||
var x = new embed()
|
||||
.setColor(c.Red)
|
||||
.setTitle(":x: "+l.errors.missingArgsTitle)
|
||||
.setDescription(message)
|
||||
|
||||
return x
|
||||
}
|
||||
|
||||
/**@param {String} message */
|
||||
exports.serverError = (message) => {
|
||||
var x = new embed()
|
||||
.setColor(c.Orange)
|
||||
.setTitle(":warning: "+l.errors.boterror)
|
||||
.setDescription(message)
|
||||
|
||||
return x
|
||||
}
|
||||
|
||||
/**@param {String[]} list */
|
||||
exports.invalidIdChooseFromList = (list) => {
|
||||
var x = new embed()
|
||||
.setColor(c.Red)
|
||||
.setTitle(":x: "+l.errors.chooseFromListTitle)
|
||||
.setDescription(l.errors.chooseFromListDescription+"\n`"+list.join("`\n`")+"`")
|
||||
return x
|
||||
}
|
||||
|
||||
exports.notInATicket = new embed()
|
||||
.setColor(c.Red)
|
||||
.setTitle(":x: "+l.errors.notInTicketTitle)
|
||||
.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)
|
||||
.setDescription(message)
|
||||
|
||||
return x
|
||||
}
|
||||
|
||||
/**@param {String} message @param {String} title */
|
||||
exports.warning = (title,message) => {
|
||||
var x = new embed()
|
||||
.setColor(c.Orange)
|
||||
.setTitle(":warning: "+title)
|
||||
.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)
|
||||
.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"|"api"|"debug"} type
|
||||
* @param {String} message
|
||||
* @param {[{key:String,value:String}]} params
|
||||
*/
|
||||
exports.log = async (type,message,params) => {
|
||||
var ptype = type
|
||||
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 (ptype == "command"){
|
||||
console.log(chalk.green("[command] ")+message+" "+chalk.yellow(parameters))
|
||||
}else if (ptype == "info"){
|
||||
console.log(chalk.blue("[info] ")+message+" "+chalk.yellow(parameters))
|
||||
}else if (ptype == "system"){
|
||||
console.log(chalk.green("[system] ")+message+" "+chalk.yellow(parameters))
|
||||
}else if (ptype == "api"){
|
||||
if (require("./api/api.json").enableAPIconsolelogs == true){
|
||||
console.log(chalk.red("[api v"+require("./api/api.json").version+"] ")+message+" "+chalk.yellow(parameters))
|
||||
}
|
||||
ptype = "api v"+require("./api/api.json").version
|
||||
}else if (ptype == "debug"){
|
||||
if (!process.argv.some((v) => v == "--debug")) return
|
||||
console.log(chalk.redBright("[DEBUG] ")+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()+"] ["+ptype+"] "+message+" "+parameters)
|
||||
}
|
||||
@@ -1,114 +0,0 @@
|
||||
const bot = require("../index")
|
||||
const config = bot.config
|
||||
|
||||
/**
|
||||
* @param {Number} index
|
||||
* @param {"id"|"name"|"description"|"icon"|"label"|"type"|"color"|"adminroles"|"channelprefix"|"category"|"message"|"enableDMMessage"} value
|
||||
*/
|
||||
exports.getTicketValue = (index,value) => {
|
||||
if (value == "id"){
|
||||
return "newT"+config.options[index][value]
|
||||
}
|
||||
return config.options[index][value]
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Number} index
|
||||
* @param {"id"|"name"|"description"|"icon"|"label"|"type"|"url"} value
|
||||
*/
|
||||
exports.getWebsiteValue = (index,value) => {
|
||||
return config.options[index][value]
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Number} index
|
||||
* @param {"id"|"name"|"description"|"icon"|"label"|"type"|"color"|"roles"|"mode"|"enableDMMessage"} value
|
||||
*/
|
||||
exports.getRoleValue = (index,value) => {
|
||||
return config.options[index][value]
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {"id"|"name"|"description"|"icon"|"label"|"type"|"color"|"adminroles"|"channelprefix"|"category"|"message"|"enableDMMessage"} value
|
||||
*/
|
||||
exports.getTicketValues = (value) => {
|
||||
var result = []
|
||||
config.options.forEach((o) => {
|
||||
if (value == "id"){
|
||||
result.push("newT"+o[value])
|
||||
}else{
|
||||
result.push(o[value])
|
||||
}
|
||||
})
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {"id"|"name"|"description"|"icon"|"label"|"type"|"url"} value
|
||||
*/
|
||||
exports.getWebsiteValues = (value) => {
|
||||
var result = []
|
||||
config.options.forEach((o) => {
|
||||
result.push(o[value])
|
||||
})
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {"id"|"name"|"description"|"icon"|"label"|"type"|"color"|"roles"|"mode"|"enableDMMessage"} value
|
||||
*/
|
||||
exports.getRoleValues = (value) => {
|
||||
var result = []
|
||||
config.options.forEach((o) => {
|
||||
result.push(o[value])
|
||||
})
|
||||
return result
|
||||
}
|
||||
|
||||
class TicketOptions {
|
||||
constructor() {
|
||||
this.id = ""
|
||||
this.name = ""
|
||||
this.description = ""
|
||||
this.icon = ""
|
||||
this.label = ""
|
||||
this.type = ""
|
||||
this.color = ""
|
||||
this.adminroles = ["",""]
|
||||
this.channelprefix = ""
|
||||
this.category = ""
|
||||
this.message = ""
|
||||
this.enableDMMessage = true
|
||||
}
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param {String} id
|
||||
* @returns {TicketOptions|false}
|
||||
*/
|
||||
exports.getOptionsById = (id) => {
|
||||
var result = false
|
||||
config.options.forEach((option) => {
|
||||
if ("newT"+option.id == id){
|
||||
result = option
|
||||
}
|
||||
})
|
||||
return result
|
||||
}
|
||||
|
||||
exports.exportedOptionClass = class {
|
||||
constructor() {
|
||||
this.id = ""
|
||||
this.name = ""
|
||||
this.description = ""
|
||||
this.icon = ""
|
||||
this.label = ""
|
||||
this.type = ""
|
||||
this.color = ""
|
||||
this.adminroles = ["",""]
|
||||
this.channelprefix = ""
|
||||
this.category = ""
|
||||
this.message = ""
|
||||
this.enableDMMessage = true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
const discord = require('discord.js')
|
||||
const bot = require('../../../index')
|
||||
const client = bot.client
|
||||
const config = bot.config
|
||||
const l = bot.language
|
||||
const log = bot.errorLog.log
|
||||
|
||||
const hiddendata = bot.hiddenData
|
||||
const embed = discord.EmbedBuilder
|
||||
const mc = config.main_color
|
||||
|
||||
const button = discord.ButtonBuilder
|
||||
const arb = discord.ActionRowBuilder
|
||||
const bs = discord.ButtonStyle
|
||||
|
||||
|
||||
exports.closeCommandRow = new arb()
|
||||
.addComponents(
|
||||
new button()
|
||||
.setCustomId("OTdeleteTicket1")
|
||||
.setDisabled(false)
|
||||
.setStyle(bs.Danger)
|
||||
.setLabel(l.buttons.delete)
|
||||
.setEmoji("✖️")
|
||||
)
|
||||
.addComponents(
|
||||
new button()
|
||||
.setCustomId("OTsendTranscript")
|
||||
.setDisabled(false)
|
||||
.setStyle(bs.Secondary)
|
||||
.setLabel(l.buttons.sendTranscript)
|
||||
.setEmoji("📄")
|
||||
)
|
||||
.addComponents(
|
||||
new button()
|
||||
.setCustomId("OTreopenTicket")
|
||||
.setDisabled(false)
|
||||
.setStyle(bs.Success)
|
||||
.setLabel(l.buttons.reopen)
|
||||
.setEmoji("✔")
|
||||
)
|
||||
|
||||
exports.openRowNormal = new arb()
|
||||
.addComponents(
|
||||
new button()
|
||||
.setCustomId("OTcloseTicket")
|
||||
.setDisabled(false)
|
||||
.setStyle(bs.Secondary)
|
||||
.setLabel(l.buttons.close)
|
||||
.setEmoji("🔒")
|
||||
)
|
||||
.addComponents(
|
||||
new button()
|
||||
.setCustomId("OTdeleteTicket")
|
||||
.setDisabled(false)
|
||||
.setStyle(bs.Danger)
|
||||
.setLabel(l.buttons.delete)
|
||||
.setEmoji("✖️")
|
||||
)
|
||||
|
||||
exports.openRowDisabled = new arb()
|
||||
.addComponents(
|
||||
new button()
|
||||
.setCustomId("OTcloseTicket")
|
||||
.setDisabled(true)
|
||||
.setStyle(bs.Secondary)
|
||||
.setLabel(l.buttons.close)
|
||||
.setEmoji("🔒")
|
||||
)
|
||||
.addComponents(
|
||||
new button()
|
||||
.setCustomId("OTdeleteTicket")
|
||||
.setDisabled(true)
|
||||
.setStyle(bs.Danger)
|
||||
.setLabel(l.buttons.delete)
|
||||
.setEmoji("✖️")
|
||||
)
|
||||
@@ -0,0 +1,51 @@
|
||||
const discord = require('discord.js')
|
||||
const bot = require('../../../index')
|
||||
const client = bot.client
|
||||
const config = bot.config
|
||||
const l = bot.language
|
||||
const log = bot.errorLog.log
|
||||
|
||||
const hiddendata = bot.hiddenData
|
||||
const embed = discord.EmbedBuilder
|
||||
const mc = config.main_color
|
||||
|
||||
const button = discord.ButtonBuilder
|
||||
const arb = discord.ActionRowBuilder
|
||||
const bs = discord.ButtonStyle
|
||||
|
||||
|
||||
exports.firstmsgRowNormal = new arb()
|
||||
.addComponents(
|
||||
new button()
|
||||
.setCustomId("OTcloseTicket")
|
||||
.setDisabled(false)
|
||||
.setStyle(bs.Secondary)
|
||||
.setLabel(l.buttons.close)
|
||||
.setEmoji("🔒")
|
||||
)
|
||||
.addComponents(
|
||||
new button()
|
||||
.setCustomId("OTdeleteTicket")
|
||||
.setDisabled(false)
|
||||
.setStyle(bs.Danger)
|
||||
.setLabel(l.buttons.delete)
|
||||
.setEmoji("✖️")
|
||||
)
|
||||
|
||||
exports.firstmsgRowDisabled = new arb()
|
||||
.addComponents(
|
||||
new button()
|
||||
.setCustomId("OTcloseTicket")
|
||||
.setDisabled(true)
|
||||
.setStyle(bs.Secondary)
|
||||
.setLabel(l.buttons.close)
|
||||
.setEmoji("🔒")
|
||||
)
|
||||
.addComponents(
|
||||
new button()
|
||||
.setCustomId("OTdeleteTicket")
|
||||
.setDisabled(true)
|
||||
.setStyle(bs.Danger)
|
||||
.setLabel(l.buttons.delete)
|
||||
.setEmoji("✖️")
|
||||
)
|
||||
@@ -0,0 +1,71 @@
|
||||
const discord = require('discord.js')
|
||||
const bot = require('../../../index')
|
||||
const client = bot.client
|
||||
const config = bot.config
|
||||
const l = bot.language
|
||||
const log = bot.errorLog.log
|
||||
|
||||
|
||||
const hiddendata = bot.hiddenData
|
||||
const embed = discord.EmbedBuilder
|
||||
const mc = config.main_color
|
||||
|
||||
const button = discord.ButtonBuilder
|
||||
const arb = discord.ActionRowBuilder
|
||||
const bs = discord.ButtonStyle
|
||||
|
||||
exports.closeVerifyBar = new arb()
|
||||
.addComponents(
|
||||
new button()
|
||||
.setCustomId("OTcloseTicketReason")
|
||||
.setDisabled(false)
|
||||
.setStyle(bs.Primary)
|
||||
.setEmoji("💬")
|
||||
.setLabel(l.buttons.closeWithReason)
|
||||
)
|
||||
.addComponents(
|
||||
new button()
|
||||
.setCustomId("OTcloseTicketTrue")
|
||||
.setDisabled(false)
|
||||
.setStyle(bs.Secondary)
|
||||
.setEmoji("✅")
|
||||
)
|
||||
.addComponents(
|
||||
new button()
|
||||
.setCustomId("OTcloseTicketFalse")
|
||||
.setDisabled(false)
|
||||
.setStyle(bs.Secondary)
|
||||
.setEmoji("❌")
|
||||
)
|
||||
|
||||
exports.deleteVerifyBar = new arb()
|
||||
.addComponents(
|
||||
new button()
|
||||
.setCustomId("OTdeleteTicketTrue")
|
||||
.setDisabled(false)
|
||||
.setStyle(bs.Secondary)
|
||||
.setEmoji("✅")
|
||||
)
|
||||
.addComponents(
|
||||
new button()
|
||||
.setCustomId("OTdeleteTicketFalse")
|
||||
.setDisabled(false)
|
||||
.setStyle(bs.Secondary)
|
||||
.setEmoji("❌")
|
||||
)
|
||||
|
||||
exports.delete1VerifyBar = new arb()
|
||||
.addComponents(
|
||||
new button()
|
||||
.setCustomId("OTdeleteTicketTrue1")
|
||||
.setDisabled(false)
|
||||
.setStyle(bs.Secondary)
|
||||
.setEmoji("✅")
|
||||
)
|
||||
.addComponents(
|
||||
new button()
|
||||
.setCustomId("OTdeleteTicketFalse1")
|
||||
.setDisabled(false)
|
||||
.setStyle(bs.Secondary)
|
||||
.setEmoji("❌")
|
||||
)
|
||||
@@ -0,0 +1,139 @@
|
||||
const discord = require('discord.js')
|
||||
const bot = require('../../../index')
|
||||
const client = bot.client
|
||||
const config = bot.config
|
||||
const l = bot.language
|
||||
const log = bot.errorLog.log
|
||||
|
||||
const hiddendata = bot.hiddenData
|
||||
const embed = discord.EmbedBuilder
|
||||
const mc = config.main_color
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {discord.User} addedUser
|
||||
* @param {discord.User} adder
|
||||
* @returns {discord.EmbedBuilder}
|
||||
*/
|
||||
exports.addEmbed = (addedUser,adder) => {
|
||||
return new embed()
|
||||
.setTitle("⬆️ "+l.commands.userAddedTitle.replace("{0}",addedUser.username))
|
||||
.setColor(mc)
|
||||
.setFooter({text:adder.tag,iconURL:adder.displayAvatarURL()})
|
||||
.setThumbnail(addedUser.displayAvatarURL({extension:"png"}))
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {discord.User} removedUser
|
||||
* @param {discord.User} remover
|
||||
* @returns {discord.EmbedBuilder}
|
||||
*/
|
||||
exports.removeEmbed = (removedUser,remover) => {
|
||||
return new embed()
|
||||
.setTitle("⬇️ "+l.commands.userRemovedTitle.replace("{0}",removedUser.username))
|
||||
.setColor(mc)
|
||||
.setFooter({text:remover.tag,iconURL:remover.displayAvatarURL()})
|
||||
.setThumbnail(removedUser.displayAvatarURL({extension:"png"}))
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {discord.User} closer
|
||||
* @param {String} description
|
||||
* @returns {discord.EmbedBuilder}
|
||||
*/
|
||||
exports.closeEmbed = (closer,description) => {
|
||||
const embd = new embed()
|
||||
.setTitle("🔒 "+l.commands.closeTitle)
|
||||
.setColor(mc)
|
||||
.setFooter({text:closer.tag,iconURL:closer.displayAvatarURL()})
|
||||
|
||||
if (description) embd.setDescription(description)
|
||||
return embd
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {discord.User} deleter
|
||||
* @returns {discord.EmbedBuilder}
|
||||
*/
|
||||
exports.deleteEmbed = (deleter) => {
|
||||
return new embed()
|
||||
.setTitle("❌ "+l.commands.deleteTitle)
|
||||
.setColor(mc)
|
||||
.setFooter({text:deleter.tag,iconURL:deleter.displayAvatarURL()})
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {discord.User} renamer
|
||||
* @param {String} newname
|
||||
* @returns {discord.EmbedBuilder}
|
||||
*/
|
||||
exports.renameEmbed = (renamer,newname) => {
|
||||
return new embed()
|
||||
.setTitle("🔄 "+l.commands.renameTitle.replace("{0}",newname))
|
||||
.setColor(mc)
|
||||
.setFooter({text:renamer.tag,iconURL:renamer.displayAvatarURL()})
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {discord.User} reopener
|
||||
* @returns {discord.EmbedBuilder}
|
||||
*/
|
||||
exports.reopenEmbed = (reopener) => {
|
||||
return new embed()
|
||||
.setTitle("🔓 "+l.commands.reopenTitle)
|
||||
.setColor(mc)
|
||||
.setFooter({text:reopener.tag,iconURL:reopener.displayAvatarURL()})
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {discord.User} claimer
|
||||
* @param {discord.User} user
|
||||
* @returns {discord.EmbedBuilder}
|
||||
*/
|
||||
exports.claimEmbed = (claimer,user) => {
|
||||
return new embed()
|
||||
.setTitle("📌 "+l.commands.claimTitle.replace("{0}",claimer.username))
|
||||
.setColor(mc)
|
||||
.setFooter({text:user.tag,iconURL:user.displayAvatarURL()})
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {discord.User} unclaimer
|
||||
* @returns {discord.EmbedBuilder}
|
||||
*/
|
||||
exports.unclaimEmbed = (unclaimer) => {
|
||||
return new embed()
|
||||
.setTitle("🆓 "+l.commands.unclaimTitle)
|
||||
.setColor(mc)
|
||||
.setFooter({text:unclaimer.tag,iconURL:unclaimer.displayAvatarURL()})
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {Boolean} done
|
||||
* @param {discord.TextChannel} channel
|
||||
* @param {discord.User} author
|
||||
* @returns {discord.EmbedBuilder}
|
||||
*/
|
||||
exports.sendTranscriptEmbed = (done,channel,author) => {
|
||||
if (done){
|
||||
return new embed()
|
||||
.setTitle("📄 "+l.messages.hereIsTheTranscript)
|
||||
.setColor(mc)
|
||||
.setDescription("Ticket: "+channel.name)
|
||||
.setFooter({text:author.tag,iconURL:author.displayAvatarURL()})
|
||||
}else{
|
||||
return new embed()
|
||||
.setTitle("📄 "+l.messages.hereIsTheTranscript)
|
||||
.setColor(mc)
|
||||
.setDescription("Loading...")
|
||||
.setFooter({text:author.tag,iconURL:author.displayAvatarURL()})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
const discord = require('discord.js')
|
||||
const bot = require('../../../../index')
|
||||
const client = bot.client
|
||||
const config = bot.config
|
||||
const l = bot.language
|
||||
const log = bot.errorLog.log
|
||||
|
||||
const permissionChecker = require("../../../utils/permisssionChecker")
|
||||
const storage = bot.storage
|
||||
const hiddendata = bot.hiddenData
|
||||
const embed = discord.EmbedBuilder
|
||||
const mc = config.main_color
|
||||
|
||||
const button = discord.ButtonBuilder
|
||||
const arb = discord.ActionRowBuilder
|
||||
const bs = discord.ButtonStyle
|
||||
|
||||
module.exports = () => {
|
||||
//CLOSE
|
||||
var closeTicketButtonChecker = false
|
||||
client.on("interactionCreate",async interaction => {
|
||||
if (!interaction.isButton()) return
|
||||
if (interaction.customId != "OTcloseTicketTrue") return
|
||||
|
||||
interaction.deferUpdate()
|
||||
|
||||
if (closeTicketButtonChecker == true) return
|
||||
closeTicketButtonChecker = true
|
||||
|
||||
const firstcomponents = interaction.message.components
|
||||
|
||||
if (config.system.closeMode == "adminonly"){
|
||||
if (!permissionChecker.command(interaction.user.id,interaction.guild.id)){
|
||||
if (!permissionChecker.sendUserNoPerms(interaction.user)){
|
||||
permissionChecker.sendChannelNoPerms(interaction.channel,interaction.user)
|
||||
}
|
||||
interaction.message.edit({components:[firstcomponents]})
|
||||
closeTicketButtonChecker = false
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
interaction.message.edit({components:[bot.buttons.close.openRowDisabled]})
|
||||
|
||||
/**
|
||||
* @type {String}
|
||||
*/
|
||||
const name = interaction.channel.name
|
||||
var prefix = ""
|
||||
const tickets = config.options
|
||||
tickets.forEach((ticket) => {
|
||||
if (name.startsWith(ticket.channelprefix)){
|
||||
prefix = ticket.channelprefix
|
||||
}
|
||||
})
|
||||
|
||||
interaction.channel.send({embeds:[bot.embeds.commands.closeEmbed(interaction.user)],components:[bot.buttons.close.closeCommandRow]})
|
||||
await require("../../../ticketActions/ticketCloser").NEWcloseTicket(interaction.member,interaction.channel,prefix,"close",false,true)
|
||||
closeTicketButtonChecker = false
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
const discord = require('discord.js')
|
||||
const bot = require('../../../../index')
|
||||
const client = bot.client
|
||||
const config = bot.config
|
||||
const l = bot.language
|
||||
const log = bot.errorLog.log
|
||||
|
||||
const permissionChecker = require("../../../utils/permisssionChecker")
|
||||
const storage = bot.storage
|
||||
const hiddendata = bot.hiddenData
|
||||
const embed = discord.EmbedBuilder
|
||||
const mc = config.main_color
|
||||
|
||||
const button = discord.ButtonBuilder
|
||||
const arb = discord.ActionRowBuilder
|
||||
const bs = discord.ButtonStyle
|
||||
|
||||
const modal = discord.ModalBuilder
|
||||
const tis = discord.TextInputStyle
|
||||
const tib = discord.TextInputBuilder
|
||||
|
||||
module.exports = () => {
|
||||
//theModal
|
||||
const reasonModal = new modal()
|
||||
.setTitle(l.buttons.closeWithReason)
|
||||
.setCustomId("OTCloseReasonModal")
|
||||
|
||||
const reasonInput = new arb()
|
||||
.addComponents([
|
||||
new tib()
|
||||
.setCustomId('OTreasonInput')
|
||||
.setLabel(l.messages.modalreason)
|
||||
.setStyle(tis.Short)
|
||||
.setMaxLength(100)
|
||||
.setRequired(true)
|
||||
.setValue("")
|
||||
.setPlaceholder("reason")
|
||||
])
|
||||
|
||||
reasonModal.addComponents(reasonInput)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//CLOSE WITH REASON
|
||||
var closeTicketButtonChecker = false
|
||||
|
||||
client.on("interactionCreate",async interaction => {
|
||||
if (!interaction.isButton()) return
|
||||
if (interaction.customId != "OTcloseTicketReason") return
|
||||
|
||||
if (closeTicketButtonChecker == true) return interaction.deferUpdate()
|
||||
closeTicketButtonChecker = true
|
||||
|
||||
const firstcomponents = interaction.message.components
|
||||
|
||||
if (config.system.closeMode == "adminonly"){
|
||||
if (!permissionChecker.command(interaction.user.id,interaction.guild.id)){
|
||||
if (!permissionChecker.sendUserNoPerms(interaction.user)){
|
||||
permissionChecker.sendChannelNoPerms(interaction.channel,interaction.user)
|
||||
}
|
||||
interaction.message.edit({components:[firstcomponents]})
|
||||
closeTicketButtonChecker = false
|
||||
return interaction.deferUpdate()
|
||||
}
|
||||
}
|
||||
|
||||
interaction.message.edit({components:[bot.buttons.close.openRowDisabled]})
|
||||
await interaction.showModal(reasonModal)
|
||||
|
||||
})
|
||||
|
||||
client.on("interactionCreate",async (interaction) => {
|
||||
if (interaction.type != discord.InteractionType.ModalSubmit) return
|
||||
if (interaction.customId != "OTCloseReasonModal") return
|
||||
|
||||
interaction.reply({embeds:[bot.embeds.commands.closeEmbed(interaction.user)],components:[bot.buttons.close.closeCommandRow]})
|
||||
|
||||
const reason = interaction.fields.getTextInputValue("OTreasonInput")
|
||||
|
||||
/**
|
||||
* @type {String}
|
||||
*/
|
||||
const name = interaction.channel.name
|
||||
var prefix = ""
|
||||
const tickets = config.options
|
||||
tickets.forEach((ticket) => {
|
||||
if (name.startsWith(ticket.channelprefix)){
|
||||
prefix = ticket.channelprefix
|
||||
}
|
||||
})
|
||||
|
||||
//interaction.channel.send({embeds:[bot.embeds.commands.closeEmbed(interaction.user)],components:[bot.buttons.close.closeCommandRow]})
|
||||
await require("../../../ticketActions/ticketCloser").NEWcloseTicket(interaction.member,interaction.channel,prefix,"close",reason,true)
|
||||
closeTicketButtonChecker = false
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
const discord = require('discord.js')
|
||||
const bot = require('../../../../index')
|
||||
const client = bot.client
|
||||
const config = bot.config
|
||||
const l = bot.language
|
||||
const log = bot.errorLog.log
|
||||
|
||||
const permissionChecker = require("../../../utils/permisssionChecker")
|
||||
const storage = bot.storage
|
||||
const hiddendata = bot.hiddenData
|
||||
const embed = discord.EmbedBuilder
|
||||
const mc = config.main_color
|
||||
|
||||
const button = discord.ButtonBuilder
|
||||
const arb = discord.ActionRowBuilder
|
||||
const bs = discord.ButtonStyle
|
||||
|
||||
module.exports = () => {
|
||||
//DELETE
|
||||
var deleteTicketButtonChecker = false
|
||||
client.on("interactionCreate",async interaction => {
|
||||
if (!interaction.isButton()) return
|
||||
if (interaction.customId != "OTdeleteTicketTrue") return
|
||||
|
||||
interaction.deferUpdate()
|
||||
|
||||
if (deleteTicketButtonChecker == true) return
|
||||
deleteTicketButtonChecker = true
|
||||
|
||||
const firstcomponents = bot.buttons.close.openRowNormal
|
||||
|
||||
if (!permissionChecker.command(interaction.user.id,interaction.guild.id)){
|
||||
if (!permissionChecker.sendUserNoDelete(interaction.user)){
|
||||
permissionChecker.sendChannelNoDelete(interaction.channel,interaction.user)
|
||||
}
|
||||
await interaction.message.edit({components:[firstcomponents]})
|
||||
deleteTicketButtonChecker = false
|
||||
return
|
||||
}
|
||||
|
||||
/**
|
||||
* @type {String}
|
||||
*/
|
||||
const name = interaction.channel.name
|
||||
var prefix = ""
|
||||
const tickets = config.options
|
||||
tickets.forEach((ticket) => {
|
||||
if (name.startsWith(ticket.channelprefix)){
|
||||
prefix = ticket.channelprefix
|
||||
}
|
||||
})
|
||||
|
||||
interaction.channel.send({embeds:[bot.embeds.commands.deleteEmbed(interaction.user)]})
|
||||
await interaction.message.edit({components:[bot.buttons.close.openRowDisabled]})
|
||||
await require("../../../ticketActions/ticketCloser").NEWcloseTicket(interaction.member,interaction.channel,prefix,"delete",false,true)
|
||||
deleteTicketButtonChecker = false
|
||||
})
|
||||
|
||||
//DELETE NO TRANSCRIPT
|
||||
var deleteTicketButtonChecker1 = false
|
||||
client.on("interactionCreate",async interaction => {
|
||||
if (!interaction.isButton()) return
|
||||
if (interaction.customId != "OTdeleteTicketTrue1") return
|
||||
|
||||
interaction.deferUpdate()
|
||||
|
||||
if (deleteTicketButtonChecker1 == true) return
|
||||
deleteTicketButtonChecker1 = true
|
||||
|
||||
const firstcomponents = bot.buttons.close.closeCommandRow
|
||||
|
||||
if (!permissionChecker.command(interaction.user.id,interaction.guild.id)){
|
||||
if (!permissionChecker.sendUserNoDelete(interaction.user)){
|
||||
permissionChecker.sendChannelNoDelete(interaction.channel,interaction.user)
|
||||
}
|
||||
await interaction.message.edit({components:[firstcomponents]})
|
||||
deleteTicketButtonChecker1 = false
|
||||
return
|
||||
}
|
||||
|
||||
/**
|
||||
* @type {String}
|
||||
*/
|
||||
const name = interaction.channel.name
|
||||
var prefix = ""
|
||||
const tickets = config.options
|
||||
tickets.forEach((ticket) => {
|
||||
if (name.startsWith(ticket.channelprefix)){
|
||||
prefix = ticket.channelprefix
|
||||
}
|
||||
})
|
||||
|
||||
interaction.channel.send({embeds:[bot.embeds.commands.deleteEmbed(interaction.user)]})
|
||||
await require("../../../ticketActions/ticketCloser").NEWcloseTicket(interaction.member,interaction.channel,prefix,"deletenotranscript",false,true)
|
||||
deleteTicketButtonChecker1 = false
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
const discord = require('discord.js')
|
||||
const bot = require('../../../../index')
|
||||
const client = bot.client
|
||||
const config = bot.config
|
||||
const l = bot.language
|
||||
const log = bot.errorLog.log
|
||||
|
||||
const permissionChecker = require("../../../utils/permisssionChecker")
|
||||
const storage = bot.storage
|
||||
const hiddendata = bot.hiddenData
|
||||
const embed = discord.EmbedBuilder
|
||||
const mc = config.main_color
|
||||
|
||||
const button = discord.ButtonBuilder
|
||||
const arb = discord.ActionRowBuilder
|
||||
const bs = discord.ButtonStyle
|
||||
|
||||
module.exports = () => {
|
||||
//REOPEN
|
||||
client.on("interactionCreate",(interaction) => {
|
||||
if (!interaction.isButton()) return
|
||||
if (interaction.customId != "OTreopenTicket") return
|
||||
|
||||
interaction.deferUpdate()
|
||||
interaction.message.edit({embeds:[bot.embeds.commands.reopenEmbed(interaction.user)],components:[bot.buttons.close.openRowNormal]})
|
||||
require("../../../ticketActions/ticketReopener").reopenTicket(interaction.guild,interaction.channel,interaction.user)
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
const discord = require('discord.js')
|
||||
const bot = require('../../../index')
|
||||
const client = bot.client
|
||||
const config = bot.config
|
||||
const l = bot.language
|
||||
const log = bot.errorLog.log
|
||||
|
||||
const storage = bot.storage
|
||||
const hiddendata = bot.hiddenData
|
||||
const embed = discord.EmbedBuilder
|
||||
const mc = config.main_color
|
||||
|
||||
const button = discord.ButtonBuilder
|
||||
const arb = discord.ActionRowBuilder
|
||||
const bs = discord.ButtonStyle
|
||||
|
||||
|
||||
module.exports = () => {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
module.exports = () => {
|
||||
require("./firstmsg")()
|
||||
require("./sendTranscript")()
|
||||
require("./verifyBars")()
|
||||
|
||||
//accepted
|
||||
require("./accepted/closing")()
|
||||
require("./accepted/reopening")()
|
||||
require("./accepted/deleting")()
|
||||
require("./accepted/closingReason")()
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
const discord = require('discord.js')
|
||||
const bot = require('../../../index')
|
||||
const client = bot.client
|
||||
const config = bot.config
|
||||
const l = bot.language
|
||||
const log = bot.errorLog.log
|
||||
|
||||
const storage = bot.storage
|
||||
const hiddendata = bot.hiddenData
|
||||
const embed = discord.EmbedBuilder
|
||||
const mc = config.main_color
|
||||
|
||||
const button = discord.ButtonBuilder
|
||||
const arb = discord.ActionRowBuilder
|
||||
const bs = discord.ButtonStyle
|
||||
|
||||
|
||||
module.exports = () => {
|
||||
client.on("interactionCreate",async (interaction) => {
|
||||
if (!interaction.isButton()) return
|
||||
if (interaction.customId != "OTsendTranscript") return
|
||||
|
||||
interaction.deferUpdate()
|
||||
const tsmsg = await interaction.channel.send({embeds:[bot.embeds.commands.sendTranscriptEmbed(false,interaction.channel,interaction.user)]})
|
||||
|
||||
const channelmessages = await interaction.channel.messages.fetch()
|
||||
|
||||
channelmessages.sweep((msgSweep) => {
|
||||
return msgSweep.author.id == client.user.id
|
||||
})
|
||||
|
||||
var fileattachment = await require("../../transcript").createTranscript(channelmessages,interaction.channel)
|
||||
|
||||
if (fileattachment == false){
|
||||
log("system","internal error: transcript is not created!")
|
||||
tsmsg.edit({embeds:[bot.errorLog.serverError(l.errors.somethingWentWrongTranscript)]})
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
tsmsg.edit({embeds:[bot.embeds.commands.sendTranscriptEmbed(true,interaction.channel,interaction.user)],files:[fileattachment]})
|
||||
}catch{}
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
const discord = require('discord.js')
|
||||
const bot = require('../../../index')
|
||||
const client = bot.client
|
||||
const config = bot.config
|
||||
const l = bot.language
|
||||
const log = bot.errorLog.log
|
||||
|
||||
const storage = bot.storage
|
||||
const hiddendata = bot.hiddenData
|
||||
const embed = discord.EmbedBuilder
|
||||
const mc = config.main_color
|
||||
|
||||
const button = discord.ButtonBuilder
|
||||
const arb = discord.ActionRowBuilder
|
||||
const bs = discord.ButtonStyle
|
||||
|
||||
module.exports = () => {
|
||||
//CLOSE
|
||||
client.on("interactionCreate",interaction => {
|
||||
if (!interaction.isButton()) return
|
||||
if (interaction.customId != "OTcloseTicket") return
|
||||
|
||||
interaction.deferUpdate()
|
||||
interaction.message.edit({components:[bot.buttons.verifybars.closeVerifyBar]})
|
||||
|
||||
})
|
||||
client.on("interactionCreate",interaction => {
|
||||
if (!interaction.isButton()) return
|
||||
if (interaction.customId != "OTcloseTicketFalse") return
|
||||
|
||||
interaction.deferUpdate()
|
||||
interaction.message.edit({components:[bot.buttons.close.openRowNormal]})
|
||||
})
|
||||
|
||||
//DELETE
|
||||
client.on("interactionCreate",interaction => {
|
||||
if (!interaction.isButton()) return
|
||||
if (interaction.customId != "OTdeleteTicket") return
|
||||
|
||||
interaction.deferUpdate()
|
||||
interaction.message.edit({components:[bot.buttons.verifybars.deleteVerifyBar]})
|
||||
|
||||
})
|
||||
client.on("interactionCreate",interaction => {
|
||||
if (!interaction.isButton()) return
|
||||
if (interaction.customId != "OTdeleteTicketFalse") return
|
||||
|
||||
interaction.deferUpdate()
|
||||
interaction.message.edit({components:[bot.buttons.close.openRowNormal]})
|
||||
})
|
||||
|
||||
//DELETE NO TRANSCRIPT
|
||||
client.on("interactionCreate",interaction => {
|
||||
if (!interaction.isButton()) return
|
||||
if (interaction.customId != "OTdeleteTicket1") return
|
||||
|
||||
interaction.deferUpdate()
|
||||
interaction.message.edit({components:[bot.buttons.verifybars.delete1VerifyBar]})
|
||||
|
||||
})
|
||||
client.on("interactionCreate",interaction => {
|
||||
if (!interaction.isButton()) return
|
||||
if (interaction.customId != "OTdeleteTicketFalse1") return
|
||||
|
||||
interaction.deferUpdate()
|
||||
interaction.message.edit({components:[bot.buttons.close.closeCommandRow]})
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
const index = require("../index")
|
||||
|
||||
if (index.developerConfig){
|
||||
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("german")) localLanguage = require("../language/german.json")
|
||||
else if (config.languagefile.startsWith("french")) localLanguage = require("../language/french.json")
|
||||
else if (config.languagefile.startsWith("romanian")) localLanguage = require("../language/romanian.json")
|
||||
else if (config.languagefile.startsWith("arabic")) localLanguage = require("../language/arabic.json")
|
||||
else if (config.languagefile.startsWith("spanish")) localLanguage = require("../language/spanish.json")
|
||||
else if (config.languagefile.startsWith("portuguese")) localLanguage = require("../language/portuguese.json")
|
||||
else if (config.languagefile.startsWith("italian")) localLanguage = require("../language/italian.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)
|
||||
}
|
||||
+52
-33
@@ -2,9 +2,12 @@ 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
|
||||
|
||||
const APIEvents = require("./api/modules/events")
|
||||
|
||||
module.exports = async () => {
|
||||
const chalk = await (await import("chalk")).default
|
||||
|
||||
@@ -14,43 +17,59 @@ module.exports = async () => {
|
||||
|
||||
interaction.deferUpdate()
|
||||
|
||||
const optionid = interaction.customId.split("newR")[1]
|
||||
if (!optionid){
|
||||
interaction.reply({content:"This button doesn't exist anymore"})
|
||||
return
|
||||
}
|
||||
if (interaction.customId.startsWith("newR")){
|
||||
const optionid = interaction.customId.split("newR")[1]
|
||||
if (!optionid){
|
||||
interaction.reply({embeds:[bot.errorLog.serverError(l.errors.roleDoesntExist)]})
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
try {
|
||||
|
||||
const option = require("./utils/getButton").getOption(optionid)
|
||||
/**@type {"add"|"remove"|"add&remove"} */
|
||||
const mode = option.mode
|
||||
const user = interaction.member
|
||||
const option = require("./utils/getButton").getOption(optionid)
|
||||
/**@type {"add"|"remove"|"add&remove"} */
|
||||
const mode = option.mode
|
||||
const user = interaction.member
|
||||
|
||||
if (mode == "add"){
|
||||
option.roles.forEach((role) => {
|
||||
interaction.guild.members.cache.find(u => u.id == user.id).roles.add(role)
|
||||
console.log("[system] added role",role,"to",user.user.tag)
|
||||
})
|
||||
}else if (mode == "remove"){
|
||||
option.roles.forEach((role) => {
|
||||
interaction.guild.members.cache.find(u => u.id == user.id).roles.remove(role)
|
||||
console.log("[system] removed role",role,"from",user.user.tag)
|
||||
})
|
||||
}else if (mode == "add&remove"){
|
||||
option.roles.forEach((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)
|
||||
console.log("[system] removed role",role,"from",user.user.tag)
|
||||
}else {
|
||||
interaction.guild.members.cache.find(u => u.id == user.id).roles.add(role)
|
||||
console.log("[system] added role",role,"to",user.user.tag)
|
||||
if (mode == "add"){
|
||||
option.roles.forEach((role) => {
|
||||
interaction.guild.members.cache.find(u => u.id == user.id).roles.add(role)
|
||||
|
||||
log("system","added role (reaction roles)",[{key:"user",value:interaction.user.tag},{key:"role",value:role}])
|
||||
const apirole = interaction.guild.roles.cache.find(r => r.id == role)
|
||||
APIEvents.onReactionRole("add","add",apirole,interaction.user,interaction.channel,interaction.guild,new Date())
|
||||
})
|
||||
|
||||
}else if (mode == "remove"){
|
||||
option.roles.forEach((role) => {
|
||||
interaction.guild.members.cache.find(u => u.id == user.id).roles.remove(role)
|
||||
|
||||
log("system","removed role (reaction roles)",[{key:"user",value:interaction.user.tag},{key:"role",value:role}])
|
||||
const apirole = interaction.guild.roles.cache.find(r => r.id == role)
|
||||
APIEvents.onReactionRole("remove","remove",apirole,interaction.user,interaction.channel,interaction.guild,new Date())
|
||||
})
|
||||
|
||||
}else if (mode == "add&remove"){
|
||||
option.roles.forEach((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)
|
||||
|
||||
log("system","added role (reaction roles)",[{key:"user",value:interaction.user.tag},{key:"role",value:role}])
|
||||
const apirole = interaction.guild.roles.cache.find(r => r.id == role)
|
||||
APIEvents.onReactionRole("add","add&remove",apirole,interaction.user,interaction.channel,interaction.guild,new Date())
|
||||
}else {
|
||||
interaction.guild.members.cache.find(u => u.id == user.id).roles.add(role)
|
||||
|
||||
log("system","removed role (reaction roles)",[{key:"user",value:interaction.user.tag},{key:"role",value:role}])
|
||||
const apirole = interaction.guild.roles.cache.find(r => r.id == role)
|
||||
APIEvents.onReactionRole("remove","add&remove",apirole,interaction.user,interaction.channel,interaction.guild,new Date())
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}catch{
|
||||
interaction.reply({ephemeral:true,content:"Something went wrong! Contact the owner of this bot for more information"})
|
||||
}catch{
|
||||
interaction.channel.send({embeds:[bot.errorLog.serverError(l.errors.somethingWentWrong)]})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -2,14 +2,13 @@ const discord = require("discord.js")
|
||||
const bot = require("../../index")
|
||||
const client = require("../../index").client
|
||||
const config = bot.config
|
||||
const getoptions = require("../getoptions")
|
||||
|
||||
module.exports = async () => {
|
||||
const chalk = (await import("chalk")).default
|
||||
|
||||
console.log(chalk.red("\nINSTRUCTIONS:\n\n1: Run the command you want to delete in discord.\n2: You get the message 'This command is now deleted!'\n3: There is also a message in the console that says the command is deleted.\n4: reload your discord."))
|
||||
client.on("interactionCreate",(interaction) => {
|
||||
if (!interaction.isCommand()) return console.log("this isn't a command!")
|
||||
if (!interaction.isChatInputCommand()) return console.log("this isn't a command!")
|
||||
|
||||
interaction.reply({content:"This command is now deleted!"})
|
||||
|
||||
|
||||
@@ -2,18 +2,23 @@ const discord = require("discord.js")
|
||||
const bot = require("../../index")
|
||||
const client = require("../../index").client
|
||||
const config = bot.config
|
||||
const getoptions = require("../getoptions")
|
||||
const configParser = require("../utils/configParser")
|
||||
|
||||
const act = discord.ApplicationCommandType
|
||||
const acot = discord.ApplicationCommandOptionType
|
||||
|
||||
module.exports = async () => {
|
||||
const chalk = (await import("chalk")).default
|
||||
const sid = config.server_id
|
||||
|
||||
const ids = getoptions.getTicketValues("id")
|
||||
const ids = configParser.getTicketValuesArray("id")
|
||||
/**@type {[{name:String,value:String}]} */
|
||||
var choices = []
|
||||
ids.forEach((id) => {
|
||||
const option = getoptions.getOptionsById(id)
|
||||
choices.push({name:option.name,value:option.id})
|
||||
const option = configParser.getTicketById(id)
|
||||
if (option){
|
||||
choices.push({name:option.name,value:option.id})
|
||||
}
|
||||
})
|
||||
|
||||
/**@type {[{name:String,value:String}]} */
|
||||
@@ -24,31 +29,34 @@ module.exports = async () => {
|
||||
|
||||
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(() => {
|
||||
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)")
|
||||
if (readystats >= 9){
|
||||
process.stdout.write("[status] there are "+chalk.blue(readystats+" out of 12")+" commands ready! (this can take up to 40 seconds)")
|
||||
if (readystats >= 12){
|
||||
console.log(chalk.green("\nready!"))
|
||||
console.log(chalk.bgBlue("you can now start the bot with 'npm start'!"))
|
||||
console.log(chalk.blue("you can now start the bot with "+chalk.bgBlue("'npm start'")+"!"))
|
||||
process.exit(1)
|
||||
}
|
||||
},100)
|
||||
|
||||
//slashtranslation
|
||||
const ST = require("../../language/slashcmds/slash.json").data
|
||||
|
||||
//create a ticket (/new or /ticket)
|
||||
client.application.commands.create({
|
||||
name:"ticket",
|
||||
description:"Create a ticket!",
|
||||
descriptionLocalizations:ST.newticket,
|
||||
defaultPermission:true,
|
||||
type:"CHAT_INPUT",
|
||||
type:act.ChatInput,
|
||||
options:[
|
||||
{
|
||||
type:"STRING",
|
||||
type:acot.String,
|
||||
name:"type",
|
||||
description:"The type of ticket.",
|
||||
required:true,
|
||||
choices:choices
|
||||
|
||||
}
|
||||
]
|
||||
},sid).then(() => {
|
||||
@@ -59,10 +67,11 @@ module.exports = async () => {
|
||||
name:"new",
|
||||
description:"Create a ticket!",
|
||||
defaultPermission:true,
|
||||
type:"CHAT_INPUT",
|
||||
type:act.ChatInput,
|
||||
descriptionLocalizations:ST.newticket,
|
||||
options:[
|
||||
{
|
||||
type:"STRING",
|
||||
type:acot.String,
|
||||
name:"type",
|
||||
description:"The type of ticket.",
|
||||
required:true,
|
||||
@@ -77,9 +86,10 @@ module.exports = async () => {
|
||||
//help
|
||||
client.application.commands.create({
|
||||
name:"help",
|
||||
description:"The help menu",
|
||||
description:"View the available commands.",
|
||||
defaultPermission:true,
|
||||
type:"CHAT_INPUT"
|
||||
descriptionLocalizations:ST.help,
|
||||
type:act.ChatInput
|
||||
},sid).then(() => {
|
||||
readystats++
|
||||
|
||||
@@ -90,7 +100,15 @@ module.exports = async () => {
|
||||
name:"close",
|
||||
description:"Close the current ticket.",
|
||||
defaultPermission:true,
|
||||
type:"CHAT_INPUT"
|
||||
descriptionLocalizations:ST.close,
|
||||
type:act.ChatInput,
|
||||
options:[{
|
||||
name:"reason",
|
||||
type:discord.ApplicationCommandOptionType.String,
|
||||
required:false,
|
||||
description:"The reason to close this ticket.",
|
||||
maxLength:100
|
||||
}]
|
||||
},sid).then(() => {
|
||||
readystats++
|
||||
})
|
||||
@@ -100,7 +118,8 @@ module.exports = async () => {
|
||||
name:"delete",
|
||||
description:"Delete the current ticket.",
|
||||
defaultPermission:true,
|
||||
type:"CHAT_INPUT"
|
||||
descriptionLocalizations:ST.delete,
|
||||
type:act.ChatInput
|
||||
},sid).then(() => {
|
||||
readystats++
|
||||
})
|
||||
@@ -110,14 +129,16 @@ module.exports = async () => {
|
||||
name:"message",
|
||||
description:"Create a ticket message.",
|
||||
defaultPermission:true,
|
||||
type:"CHAT_INPUT",
|
||||
descriptionLocalizations:ST.message,
|
||||
type:act.ChatInput,
|
||||
options:[
|
||||
{
|
||||
type:"STRING",
|
||||
type:acot.String,
|
||||
name:"id",
|
||||
description:"The message id.",
|
||||
required:true,
|
||||
choices:msgchoices
|
||||
choices:msgchoices,
|
||||
max_length:30
|
||||
|
||||
}
|
||||
]
|
||||
@@ -130,10 +151,11 @@ module.exports = async () => {
|
||||
name:"add",
|
||||
description:"Add people to this ticket.",
|
||||
defaultPermission:true,
|
||||
type:"CHAT_INPUT",
|
||||
descriptionLocalizations:ST.add,
|
||||
type:act.ChatInput,
|
||||
options:[
|
||||
{
|
||||
type:"USER",
|
||||
type:acot.User,
|
||||
name:"user",
|
||||
description:"The user to add.",
|
||||
required:true
|
||||
@@ -148,10 +170,11 @@ module.exports = async () => {
|
||||
name:"remove",
|
||||
description:"Remove people from this ticket.",
|
||||
defaultPermission:true,
|
||||
type:"CHAT_INPUT",
|
||||
descriptionLocalizations:ST.remove,
|
||||
type:act.ChatInput,
|
||||
options:[
|
||||
{
|
||||
type:"USER",
|
||||
type:acot.User,
|
||||
name:"user",
|
||||
description:"The user to remove.",
|
||||
required:true
|
||||
@@ -166,10 +189,11 @@ module.exports = async () => {
|
||||
name:"rename",
|
||||
description:"Rename this ticket.",
|
||||
defaultPermission:true,
|
||||
type:"CHAT_INPUT",
|
||||
descriptionLocalizations:ST.rename,
|
||||
type:act.ChatInput,
|
||||
options:[
|
||||
{
|
||||
type:"STRING",
|
||||
type:acot.String,
|
||||
name:"name",
|
||||
description:"The new name (without prefix).",
|
||||
required:true
|
||||
@@ -179,4 +203,44 @@ module.exports = async () => {
|
||||
readystats++
|
||||
})
|
||||
|
||||
//reopen
|
||||
client.application.commands.create({
|
||||
name:"reopen",
|
||||
description:"Reopen this ticket.",
|
||||
defaultPermission:true,
|
||||
descriptionLocalizations:ST.reopen,
|
||||
type:act.ChatInput
|
||||
},sid).then(() => {
|
||||
readystats++
|
||||
})
|
||||
|
||||
//claim
|
||||
client.application.commands.create({
|
||||
name:"claim",
|
||||
description:"Claim this ticket / claim it for someone else.",
|
||||
defaultPermission:true,
|
||||
type:act.ChatInput,
|
||||
options:[
|
||||
{
|
||||
name:"user",
|
||||
type:acot.User,
|
||||
required:false,
|
||||
description:"The user to claim for."
|
||||
}
|
||||
]
|
||||
|
||||
},sid).then(() => {
|
||||
readystats++
|
||||
})
|
||||
|
||||
//unclaim
|
||||
client.application.commands.create({
|
||||
name:"unclaim",
|
||||
description:"Unclaim this ticket.",
|
||||
defaultPermission:true,
|
||||
type:act.ChatInput
|
||||
},sid).then(() => {
|
||||
readystats++
|
||||
})
|
||||
|
||||
}
|
||||
Executable
+345
@@ -0,0 +1,345 @@
|
||||
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
|
||||
const permsChecker = require("../utils/permisssionChecker")
|
||||
|
||||
const pendingDelete = []
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {discord.GuildMember} member
|
||||
* @param {discord.TextChannel} channel
|
||||
* @param {String} prefix
|
||||
* @param {"delete"|"close"|"deletenotranscript"} mode
|
||||
* @param {Boolean} nomessage
|
||||
* @param {String} reason only when closing, not when deleting!
|
||||
*/
|
||||
exports.NEWcloseTicket = async (member,channel,prefix,mode,reason,nomessage) => {
|
||||
const guild = channel.guild
|
||||
const user = member.user
|
||||
const chalk = await (await import("chalk")).default
|
||||
const channelmessages = await channel.messages.fetch()
|
||||
|
||||
const newReason = reason ? reason : l.messages.none
|
||||
|
||||
//start code
|
||||
|
||||
//FIX CHANNEL COULD BE CLOSED AFTER DELETE:
|
||||
if (pendingDelete.includes(channel.id)) return false
|
||||
|
||||
//remove ot bot from transcript
|
||||
channelmessages.sweep((msgSweep) => {return msgSweep.author.id == client.user.id})
|
||||
|
||||
/**@type {String}*/
|
||||
const channelname = channel.name
|
||||
const ticketOpenerChannelName = channelname.split(prefix)[1]
|
||||
|
||||
//get user that opened the ticket
|
||||
var getuserID = storage.get("userTicketStorage",channel.id)
|
||||
try {
|
||||
var ticketOpener = client.users.cache.find(u => u.id === getuserID)
|
||||
var isDatabaseError = false
|
||||
}catch{var isDatabaseError = true}
|
||||
|
||||
if (!ticketOpener){
|
||||
console.log(chalk.red("[database error]"),"something went wrong when getting the data in the database.\nNo panic, this error fixes itself!")
|
||||
var isDatabaseError = true
|
||||
}
|
||||
|
||||
var enableTranscript = true
|
||||
var deleteRequired = false
|
||||
|
||||
if (mode == "delete"){
|
||||
//delete
|
||||
//check perms
|
||||
if (!guild) return
|
||||
if (!permsChecker.command(user.id,guild.id)){
|
||||
permsChecker.sendUserNoPerms(user)
|
||||
return
|
||||
}
|
||||
|
||||
//start delete proccess
|
||||
deleteRequired = true
|
||||
if (!nomessage){
|
||||
await channel.send({content:"**"+l.messages.gettingdeleted+"**"})
|
||||
}
|
||||
log("system","deleted a ticket",[{key:"user",value:user.tag},{key:"ticket",value:channel.name}])
|
||||
pendingDelete.push(channel.id)
|
||||
|
||||
if (!isDatabaseError) storage.set("ticketStorage",getuserID,Number(storage.get("ticketStorage",getuserID)) - 1)
|
||||
|
||||
//getID & send DM & send api event
|
||||
await channel.messages.fetchPinned().then(async msglist => {
|
||||
var firstmsg = msglist.last()
|
||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return false
|
||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
||||
const ticketId = hiddendata.data.find(d => d.key == "type").value.value
|
||||
const ticketData = require("../utils/configParser").getTicketById(ticketId,true)
|
||||
|
||||
require("../api/modules/events").onTicketDelete(user,channel,guild,new Date(),{name:channel.name,status:"deleted",ticketOptions:ticketData})
|
||||
|
||||
const id = hiddendata.data.find(d => d.key == "openerid").value
|
||||
|
||||
const sphd = bot.hiddenData.removeHiddenData(firstmsg.embeds[0].description)
|
||||
sphd.hiddenData.data.push({key:"pendingdelete",value:"true"})
|
||||
const newEmbed = new discord.EmbedBuilder(firstmsg.embeds[0].data)
|
||||
newEmbed.setDescription(sphd.description + bot.hiddenData.writeHiddenData(sphd.hiddenData.type,sphd.hiddenData.data))
|
||||
await firstmsg.edit({embeds:[newEmbed]})
|
||||
|
||||
if (!id) return false
|
||||
|
||||
try{
|
||||
if (config.system.enable_DM_Messages){
|
||||
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"){
|
||||
//close
|
||||
//check perms
|
||||
if (config.system.closeMode == "adminonly"){
|
||||
if (!guild) return
|
||||
if (!permsChecker.command(user.id,guild.id)){
|
||||
permsChecker.sendUserNoPerms(user)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
//set new permissions
|
||||
var permissionArray = []
|
||||
const pfb = discord.PermissionFlagsBits
|
||||
|
||||
if (!isDatabaseError) permissionArray.push({
|
||||
id:ticketOpener,
|
||||
type:"member",
|
||||
allow:[pfb.ViewChannel],
|
||||
deny:[pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages]
|
||||
})
|
||||
|
||||
permissionArray.push({
|
||||
id:guild.roles.everyone,
|
||||
type:"role",
|
||||
deny:[pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages,pfb.ViewChannel]
|
||||
})
|
||||
|
||||
//add main adminroles
|
||||
config.main_adminroles.forEach((role,index) => {
|
||||
try {
|
||||
const adminrole = guild.roles.cache.find(r => r.id == role)
|
||||
if (!adminrole) return
|
||||
|
||||
permissionArray.push({
|
||||
id:adminrole,
|
||||
type:"role",
|
||||
allow:[pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages,pfb.ViewChannel]
|
||||
})
|
||||
}catch{
|
||||
log("system","invalid role! At 'config.json => main_adminroles:"+index)
|
||||
}
|
||||
})
|
||||
|
||||
//add ticket adminroles
|
||||
await channel.messages.fetchPinned().then(msglist => {
|
||||
var firstmsg = msglist.last()
|
||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return false
|
||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
||||
const ticketData = require("../utils/configParser").getTicketById(ticketId,true)
|
||||
|
||||
if (!ticketData) return
|
||||
|
||||
if (ticketData.closedCategory.enable){
|
||||
/**@type {discord.CategoryChannel} */
|
||||
const category = guild.channels.cache.find(c => c.id == ticketData.closedCategory.id && c.type == discord.ChannelType.GuildCategory)
|
||||
try {
|
||||
channel.setParent(category)
|
||||
}catch{
|
||||
bot.errorLog.log("system","failed to move channel to new category!")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @type {String[]}
|
||||
*/
|
||||
const ticketadmin = ticketData.adminroles
|
||||
ticketadmin.forEach((role,index) => {
|
||||
if (!config.main_adminroles.includes(role)){
|
||||
try {
|
||||
const adminrole = guild.roles.cache.find(r => r.id == role)
|
||||
if (!adminrole) return
|
||||
|
||||
permissionArray.push({
|
||||
id:adminrole,
|
||||
type:"role",
|
||||
allow:[pfb.AddReactions,pfb.ViewChannel],
|
||||
deny:[pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages]
|
||||
})
|
||||
}catch{
|
||||
log("system","invalid role! At 'config.json => options/ticket/...:"+index)
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
channel.permissionOverwrites.set(permissionArray)
|
||||
|
||||
if (!nomessage){
|
||||
//message
|
||||
var closeButtonRow = new discord.ActionRowBuilder()
|
||||
.addComponents(
|
||||
new discord.ButtonBuilder()
|
||||
.setCustomId("OTdeleteTicket1")
|
||||
.setDisabled(false)
|
||||
.setStyle(discord.ButtonStyle.Danger)
|
||||
.setLabel(l.buttons.delete)
|
||||
.setEmoji("✖️")
|
||||
)
|
||||
.addComponents(
|
||||
new discord.ButtonBuilder()
|
||||
.setCustomId("OTsendTranscript")
|
||||
.setDisabled(false)
|
||||
.setStyle(discord.ButtonStyle.Secondary)
|
||||
.setLabel(l.buttons.sendTranscript)
|
||||
.setEmoji("📄")
|
||||
)
|
||||
.addComponents(
|
||||
new discord.ButtonBuilder()
|
||||
.setCustomId("OTreopenTicket")
|
||||
.setDisabled(false)
|
||||
.setStyle(discord.ButtonStyle.Success)
|
||||
.setLabel(l.buttons.reopen)
|
||||
.setEmoji("✔")
|
||||
)
|
||||
|
||||
const embed = new discord.EmbedBuilder()
|
||||
.setColor(config.main_color)
|
||||
.setTitle(":lock: "+l.messages.closedTitle+" :lock:")
|
||||
.setDescription(l.messages.closedDescription)
|
||||
channel.send({embeds:[embed],components:[closeButtonRow]})
|
||||
}
|
||||
|
||||
log("system","closed a ticket",[{key:"user",value:user.tag},{key:"ticket",value:channel.name}])
|
||||
|
||||
|
||||
//getID & send DM & send api event
|
||||
await channel.messages.fetchPinned().then(msglist => {
|
||||
var firstmsg = msglist.last()
|
||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return false
|
||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
||||
const ticketData = require("../utils/configParser").getTicketById(ticketId,true)
|
||||
|
||||
require("../api/modules/events").onTicketClose(user,channel,guild,new Date(),{name:channel.name,status:"closed",ticketOptions:ticketData},newReason)
|
||||
|
||||
const id = hiddendata.data.find(d => d.key == "openerid").value
|
||||
|
||||
if (!id) return false
|
||||
|
||||
try{
|
||||
if (config.system.enable_DM_Messages){
|
||||
member.send({embeds:[bot.errorLog.custom(l.messages.closedTicketDmTitle,l.messages.closedTicketDmDescription+"\n\n**reason:** "+newReason,":ticket:",config.main_color)]})
|
||||
}
|
||||
}
|
||||
catch{log("system","can't send DM to member, member doesn't allow dm's")}
|
||||
})
|
||||
|
||||
|
||||
}else if (mode == "deletenotranscript"){
|
||||
//delete with no transcript
|
||||
//check perms
|
||||
if (!guild) return
|
||||
if (!permsChecker.command(user.id,guild.id)){
|
||||
permsChecker.sendUserNoPerms(user)
|
||||
return
|
||||
}
|
||||
|
||||
//start delete proccess
|
||||
enableTranscript = false
|
||||
deleteRequired = true
|
||||
if (!nomessage){
|
||||
await channel.send({content:"**"+l.messages.gettingdeleted+"**"})
|
||||
}
|
||||
log("system","deleted a ticket",[{key:"user",value:user.tag},{key:"ticket",value:channel.name}])
|
||||
|
||||
if (!isDatabaseError) storage.set("ticketStorage",getuserID,Number(storage.get("ticketStorage",getuserID)) - 1)
|
||||
|
||||
//getID & send DM & send api event
|
||||
await channel.messages.fetchPinned().then(msglist => {
|
||||
var firstmsg = msglist.last()
|
||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return false
|
||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
||||
const ticketData = require("../utils/configParser").getTicketById(ticketId,true)
|
||||
|
||||
require("../api/modules/events").onTicketDelete(user,channel,guild,new Date(),{name:channel.name,status:"deleted",ticketOptions:ticketData})
|
||||
|
||||
const id = hiddendata.data.find(d => d.key == "openerid").value
|
||||
|
||||
if (!id) return false
|
||||
|
||||
try{
|
||||
if (config.system.enable_DM_Messages){
|
||||
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"){
|
||||
|
||||
const transcriptReason = (mode == "close") ? "**"+l.messages.reason+":** "+newReason : "**"+l.messages.reason+":** "+l.messages.none
|
||||
const closedByPrefix = (mode.startsWith("delete")) ? l.messages.deletedby : l.messages.closedby
|
||||
|
||||
if (config.system.enable_transcript || config.system.enable_DM_transcript){
|
||||
var fileattachment = await require("../transcript").createTranscript(channelmessages,channel)
|
||||
|
||||
if (fileattachment == false){log("system","internal error: transcript is not created!");return}
|
||||
}
|
||||
|
||||
if (config.system.enable_transcript && !require("../api/api.json").disable.transcripts.server){
|
||||
const transcriptEmbed = new discord.EmbedBuilder()
|
||||
.setColor(config.main_color)
|
||||
.setTitle("📄 "+l.messages.newTranscriptTitle)
|
||||
.setDescription(transcriptReason)
|
||||
.setFooter({text:closedByPrefix+": "+user.tag+" | ticket: "+channelname,iconURL:user.displayAvatarURL()})
|
||||
|
||||
guild.channels.cache.find(c => c.id == config.system.transcript_channel).send({
|
||||
embeds:[transcriptEmbed],
|
||||
files:[fileattachment]
|
||||
})
|
||||
}
|
||||
|
||||
if (config.system.enable_DM_transcript && !require("../api/api.json").disable.transcripts.dm){
|
||||
const transcriptEmbed = new discord.EmbedBuilder()
|
||||
.setColor(config.main_color)
|
||||
.setTitle("📄 "+l.messages.newTranscriptTitle)
|
||||
.setDescription(transcriptReason)
|
||||
.setFooter({text:closedByPrefix+": "+user.tag+" | ticket: "+channelname,iconURL:user.displayAvatarURL()})
|
||||
|
||||
if (!isDatabaseError) ticketOpener.send({
|
||||
embeds:[transcriptEmbed],
|
||||
files:[fileattachment]
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
if (deleteRequired){
|
||||
//const timer = () => {return new Promise((resolve,reject) => {
|
||||
// setTimeout(() => {resolve(true)},7000)
|
||||
//})}
|
||||
//await timer()
|
||||
|
||||
setTimeout(async () => {
|
||||
pendingDelete.shift()
|
||||
await channel.delete()
|
||||
},6000)
|
||||
}
|
||||
}
|
||||
Executable
+214
@@ -0,0 +1,214 @@
|
||||
const discord = require('discord.js')
|
||||
const bot = require('../../index')
|
||||
const client = bot.client
|
||||
const config = bot.config
|
||||
const l = bot.language
|
||||
const log = bot.errorLog.log
|
||||
|
||||
const configParser = require("../utils/configParser")
|
||||
const storage = bot.storage
|
||||
|
||||
module.exports = () => {
|
||||
//dropdown placeholder
|
||||
client.on("interactionCreate",(interaction) => {
|
||||
if (!interaction.isSelectMenu()) return
|
||||
if (interaction.customId != "OTdropdownMenu") return
|
||||
if (interaction.values.includes("OTChooseTicket")) interaction.deferUpdate()
|
||||
|
||||
})
|
||||
|
||||
|
||||
var closeButton = bot.buttons.firstmsg.firstmsgRowNormal
|
||||
|
||||
//ticket button click / create ticket
|
||||
client.on("interactionCreate",async (interaction) => {
|
||||
if (interaction.isChatInputCommand() && (interaction.commandName == "new" || interaction.commandName == "ticket")){
|
||||
var customId = "OTnewT"+interaction.options.getString("type")
|
||||
}else if (interaction.isButton()){
|
||||
var customId = interaction.customId
|
||||
}else if (interaction.isSelectMenu() && (interaction.customId == "OTdropdownMenu")){
|
||||
var customId = interaction.values[0]
|
||||
|
||||
}else return
|
||||
|
||||
if (interaction.isButton()){
|
||||
if (interaction.customId.startsWith("OTnewT")){
|
||||
const optionid = interaction.customId.split("OTnewT")[1]
|
||||
if (!optionid){
|
||||
interaction.reply({embeds:[bot.errorLog.serverError(l.errors.ticketDoesntExist)]})
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (configParser.getTicketValuesArray("id").includes(customId)){
|
||||
|
||||
//ticketoptions from config
|
||||
const currentTicketOptions = configParser.getTicketById(customId)
|
||||
|
||||
if (currentTicketOptions == false) return interaction.reply({embeds:[bot.errorLog.serverError(l.errors.anotherOption)]})
|
||||
|
||||
if (interaction.isButton()){
|
||||
interaction.deferUpdate()
|
||||
}else if (interaction.isChatInputCommand()){
|
||||
interaction.reply({embeds:[bot.errorLog.success(l.messages.createdTitle,l.messages.createdDescription)]})
|
||||
}else if (interaction.isSelectMenu()){
|
||||
await interaction.deferUpdate()
|
||||
}
|
||||
|
||||
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{
|
||||
if (config.system.enable_DM_Messages){
|
||||
interaction.member.send({embeds:[bot.errorLog.custom(l.messages.newTicketDmTitle,currentTicketOptions.message,":ticket:",config.main_color)]})
|
||||
}
|
||||
}
|
||||
catch{log("system","can't send DM to member, member doesn't allow dm's")}
|
||||
|
||||
|
||||
//update storage
|
||||
storage.set("ticketStorage",interaction.member.id,Number(storage.get("ticketStorage",interaction.member.id))+1)
|
||||
var ticketNumber = interaction.member.user.username
|
||||
|
||||
//set ticketName
|
||||
var ticketName = currentTicketOptions.channelprefix+ticketNumber
|
||||
var logsname = currentTicketOptions.name
|
||||
|
||||
//category
|
||||
if (currentTicketOptions.category.length < 16 || currentTicketOptions.category.length > 20){
|
||||
var newTicketCategory = null
|
||||
}else{
|
||||
var newTicketCategory = currentTicketOptions.category
|
||||
}
|
||||
|
||||
var permissionsArray = []
|
||||
const pfb = discord.PermissionFlagsBits
|
||||
const guild = client.guilds.cache.find(g => g.id == interaction.guild.id)
|
||||
|
||||
//set everyone allowed
|
||||
if (config.system['has@everyoneaccess']){
|
||||
var everyoneAllowPerms = [pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages,pfb.ViewChannel]
|
||||
var everyoneDenyPerms = []
|
||||
}else{
|
||||
var everyoneAllowPerms = []
|
||||
var everyoneDenyPerms = [pfb.ViewChannel]
|
||||
}
|
||||
permissionsArray.push({
|
||||
id:interaction.guild.roles.everyone,
|
||||
type:"role",
|
||||
allow:everyoneAllowPerms,
|
||||
deny:everyoneDenyPerms
|
||||
})
|
||||
|
||||
//add the user that created the ticket
|
||||
permissionsArray.push({
|
||||
id:interaction.member.user,
|
||||
type:"member",
|
||||
allow:[pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages,pfb.ViewChannel]
|
||||
})
|
||||
|
||||
//add main adminroles
|
||||
config.main_adminroles.forEach((role,index) => {
|
||||
try {
|
||||
const adminrole = guild.roles.cache.find(r => r.id == role)
|
||||
if (!adminrole) return
|
||||
|
||||
permissionsArray.push({
|
||||
id:adminrole,
|
||||
type:"role",
|
||||
allow:[pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages,pfb.ViewChannel]
|
||||
})
|
||||
}catch{
|
||||
log("system","invalid role! At 'config.json => main_adminroles:"+index)
|
||||
}
|
||||
})
|
||||
|
||||
//add ticket adminroles
|
||||
/**
|
||||
* @type {String[]}
|
||||
*/
|
||||
const ticketadmin = currentTicketOptions.adminroles
|
||||
ticketadmin.forEach((role,index) => {
|
||||
if (!config.main_adminroles.includes(role)){
|
||||
try {
|
||||
const adminrole = guild.roles.cache.find(r => r.id == role)
|
||||
if (!adminrole) return
|
||||
|
||||
permissionsArray.push({
|
||||
id:adminrole,
|
||||
type:"role",
|
||||
allow:[pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages,pfb.ViewChannel]
|
||||
})
|
||||
}catch{
|
||||
log("system","invalid role! At 'config.json => options/ticket/...:"+index)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
//add member role
|
||||
if (config.system.member_role != "" && config.system.member_role != " " && config.system.member_role != "false" && config.system.member_role != "null" && config.system.member_role != "0"){
|
||||
try {
|
||||
const userrole = guild.roles.cache.find(r => r.id == config.system.member_role)
|
||||
if (!userrole) return
|
||||
permissionsArray.push({
|
||||
id:userrole,
|
||||
type:"role",
|
||||
deny:[pfb.ViewChannel]
|
||||
})
|
||||
}catch{
|
||||
log("system","invalid role! At 'config.json => system/member_role")
|
||||
}
|
||||
}
|
||||
|
||||
//create the channel
|
||||
interaction.guild.channels.create({
|
||||
name:ticketName,
|
||||
type:discord.ChannelType.GuildText,
|
||||
parent:newTicketCategory,
|
||||
reason:"A new ticket is created",
|
||||
permissionOverwrites:permissionsArray
|
||||
|
||||
}).then((ticketChannel) => {
|
||||
storage.set("userTicketStorage",ticketChannel.id,interaction.member.id)
|
||||
|
||||
const hiddendata = bot.hiddenData.writeHiddenData("ticketdata",[{key:"type",value:currentTicketOptions.id},{key:"openerid",value:interaction.user.id},{key:"createdms",value:new Date().getTime()}])
|
||||
|
||||
var ticketEmbed = new discord.EmbedBuilder()
|
||||
//.setAuthor({name:interaction.user.id})
|
||||
.setColor(config.main_color)
|
||||
.setTitle(currentTicketOptions.name)
|
||||
//.setFooter({text:"Ticket Type: "+currentTicketOptions.id})
|
||||
if (currentTicketOptions.ticketmessage.length > 0){
|
||||
ticketEmbed.setDescription(currentTicketOptions.ticketmessage+hiddendata)
|
||||
}else{
|
||||
ticketEmbed.setDescription(hiddendata)
|
||||
}
|
||||
|
||||
if (currentTicketOptions.thumbnail.enable) ticketEmbed.setThumbnail(currentTicketOptions.thumbnail.url)
|
||||
|
||||
ticketChannel.send({
|
||||
content:"<@"+interaction.member.id+"> @here",
|
||||
embeds:[ticketEmbed],
|
||||
components:[closeButton]
|
||||
|
||||
}).then(firstmsg => {
|
||||
firstmsg.pin()
|
||||
})
|
||||
|
||||
log("system","created new ticket",[{key:"ticket",value:ticketName},{key:"user",value:interaction.user.tag}])
|
||||
require("../api/modules/events").onTicketOpen(interaction.user,ticketChannel,interaction.guild,new Date(),{name:ticketName,status:"open",ticketOptions:currentTicketOptions})
|
||||
})
|
||||
}else{
|
||||
try {
|
||||
if (config.system.enable_DM_Messages){
|
||||
interaction.member.send({embeds:[bot.errorLog.warning(l.errors.maxAmountTitle,l.errors.maxAmountDescription)]})
|
||||
}
|
||||
}
|
||||
catch{log("system","can't send DM to member, member doesn't allow dm's")}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
Executable
+52
@@ -0,0 +1,52 @@
|
||||
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
|
||||
const pfb = discord.PermissionFlagsBits
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {discord.Guild} guild
|
||||
* @param {discord.TextBasedChannel} channel
|
||||
* @param {discord.User} user
|
||||
* @returns
|
||||
*/
|
||||
const reopenTicket = (guild,channel,user) => {
|
||||
log("system","re-opened a ticket",[{key:"ticket",value:channel.name},{key:"user",value:user.tag}])
|
||||
|
||||
var permissionsArray = []
|
||||
|
||||
//set everyone allowed
|
||||
if (config.system['has@everyoneaccess']){
|
||||
var everyoneAllowPerms = [pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages,pfb.ViewChannel]
|
||||
var everyoneDenyPerms = []
|
||||
}else{
|
||||
var everyoneAllowPerms = []
|
||||
var everyoneDenyPerms = [pfb.ViewChannel]
|
||||
}
|
||||
permissionsArray.push({
|
||||
id:guild.roles.everyone,
|
||||
type:"role",
|
||||
allow:everyoneAllowPerms,
|
||||
deny:everyoneDenyPerms
|
||||
})
|
||||
|
||||
channel.permissionOverwrites.cache.forEach((p) => {
|
||||
if (p.type == 1){
|
||||
permissionsArray.push({
|
||||
id:p.id,
|
||||
type:"member",
|
||||
allow:[pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages,pfb.ViewChannel],
|
||||
deny:[]
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
channel.permissionOverwrites.set(permissionsArray)
|
||||
|
||||
require("../api/modules/events").onTicketReopen(user,channel,guild,new Date(),{name:channel.name,status:"reopened",ticketOptions:false})
|
||||
}
|
||||
exports.reopenTicket = reopenTicket
|
||||
@@ -1,156 +0,0 @@
|
||||
const discord = require('discord.js')
|
||||
const bot = require('../index')
|
||||
const client = bot.client
|
||||
const config = bot.config
|
||||
|
||||
const storage = bot.storage
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {discord.Interaction} interaction
|
||||
* @param {String} prefix
|
||||
* @param {"delete"|"close"|"deletenotranscript"} mode
|
||||
*/
|
||||
exports.closeTicket = async (interaction,prefix,mode) => {
|
||||
const chalk = await (await import("chalk")).default
|
||||
const channelmessages = await interaction.channel.messages.fetch()
|
||||
|
||||
channelmessages.sweep((msgSweep) => {
|
||||
return msgSweep.author.id == client.user.id
|
||||
})
|
||||
|
||||
/**
|
||||
* @type {String} ticketuserarray
|
||||
*/
|
||||
const ticketuserarray = interaction.channel.name
|
||||
const ticketusername = ticketuserarray.split(prefix)[1]
|
||||
|
||||
var getuserID = storage.get("userTicketStorage",interaction.channel.id)
|
||||
try {
|
||||
var getusernameStep1 = client.users.cache.find(u => u.id === getuserID)
|
||||
var isDatabaseError = false
|
||||
}catch{
|
||||
var isDatabaseError = true
|
||||
}
|
||||
|
||||
if (!getusernameStep1){
|
||||
console.log(chalk.red("[database error]"),"something went wrong when getting the data in the database.\nNo panic, this error fixes itself!")
|
||||
var isDatabaseError = true
|
||||
}
|
||||
|
||||
var enableTranscript = true
|
||||
|
||||
if (mode == "delete"){
|
||||
interaction.channel.delete()
|
||||
if (config.logs){console.log("[system] deleted a ticket (name:"+interaction.channel.name+",user:"+interaction.user.username+")")}
|
||||
|
||||
if (!isDatabaseError) storage.set("ticketStorage",getuserID,Number(storage.get("ticketStorage",getuserID)) - 1)
|
||||
}else if (mode == "close"){
|
||||
var permissionArray = []
|
||||
if (!isDatabaseError) permissionArray.push({
|
||||
id:getusernameStep1.id,
|
||||
type:"member",
|
||||
allow:["VIEW_CHANNEL"],
|
||||
deny:["ADD_REACTIONS","ATTACH_FILES","EMBED_LINKS","SEND_MESSAGES"]
|
||||
})
|
||||
|
||||
permissionArray.push({
|
||||
id:interaction.guild.id,
|
||||
type:"role",
|
||||
deny:["ADD_REACTIONS","ATTACH_FILES","EMBED_LINKS","SEND_MESSAGES","VIEW_CHANNEL"]
|
||||
})
|
||||
|
||||
interaction.channel.permissionOverwrites.set(permissionArray)
|
||||
|
||||
//message
|
||||
var closeButtonRow = new discord.MessageActionRow()
|
||||
.addComponents(
|
||||
new discord.MessageButton()
|
||||
.setCustomId("deleteTicket1")
|
||||
.setDisabled(false)
|
||||
.setStyle("DANGER")
|
||||
.setLabel("Delete Ticket")
|
||||
.setEmoji("✖️")
|
||||
)
|
||||
.addComponents(
|
||||
new discord.MessageButton()
|
||||
.setCustomId("sendTranscript")
|
||||
.setDisabled(false)
|
||||
.setStyle("SECONDARY")
|
||||
.setLabel("Send Transcript File")
|
||||
.setEmoji("📄")
|
||||
)
|
||||
const embed = new discord.MessageEmbed()
|
||||
.setColor(config.main_color)
|
||||
.setTitle("Closed this ticket!")
|
||||
.setDescription("Only admins can now talk in this ticket!\n\n*Click on the button below to delete this ticket*")
|
||||
interaction.channel.send({embeds:[embed],components:[closeButtonRow]})
|
||||
}else if (mode == "deletenotranscript"){
|
||||
enableTranscript = false
|
||||
interaction.channel.delete()
|
||||
if (config.logs){console.log("[system] deleted a ticket (name:"+interaction.channel.name+",user:"+interaction.user.username+")")}
|
||||
|
||||
if (!isDatabaseError) storage.set("ticketStorage",getuserID,Number(storage.get("ticketStorage",getuserID)) - 1)
|
||||
}
|
||||
|
||||
if (enableTranscript == true && mode != "deletenotranscript"){
|
||||
|
||||
if (config.system.enable_transcript || config.system.enable_DM_transcript){
|
||||
var fileattachment = await require("./transcript").createTranscript(channelmessages)
|
||||
|
||||
if (fileattachment == false){console.log("[transcript] internal error: no transcript is created!");return}
|
||||
}
|
||||
|
||||
if (config.system.enable_transcript){
|
||||
const transcriptEmbed = new discord.MessageEmbed()
|
||||
.setColor(config.main_color)
|
||||
.setTitle("A new transcript is here!")
|
||||
.setAuthor({name:interaction.user.username,iconURL:interaction.user.displayAvatarURL({format:"png"})})
|
||||
.setDescription("You can find the transcript in the text file above!")
|
||||
.setFooter({text:"ticket: "+ticketuserarray})
|
||||
|
||||
interaction.guild.channels.cache.find(c => c.id == config.system.transcript_channel).send({
|
||||
embeds:[transcriptEmbed],
|
||||
files:[fileattachment]
|
||||
})
|
||||
}
|
||||
|
||||
if (config.system.enable_DM_transcript){
|
||||
const transcriptEmbed = new discord.MessageEmbed()
|
||||
.setColor(config.main_color)
|
||||
.setTitle("Here is a transcript of your ticket!")
|
||||
.setDescription("You can find the transcript in the text file above!")
|
||||
.setFooter({text:"ticket: "+ticketuserarray})
|
||||
|
||||
if (!isDatabaseError) getusernameStep1.send({
|
||||
embeds:[transcriptEmbed],
|
||||
files:[fileattachment]
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
exports.runThis = () => {
|
||||
client.on("interactionCreate",async (interaction) => {
|
||||
if (!interaction.isButton()) return
|
||||
if (interaction.customId != "sendTranscript") return
|
||||
|
||||
interaction.deferUpdate()
|
||||
|
||||
const channelmessages = await interaction.channel.messages.fetch()
|
||||
|
||||
channelmessages.sweep((msgSweep) => {
|
||||
return msgSweep.author.id == client.user.id
|
||||
})
|
||||
|
||||
var fileattachment = await require("./transcript").createTranscript(channelmessages)
|
||||
|
||||
if (fileattachment == false){
|
||||
console.log("[transcript] internal error: no transcript is created!")
|
||||
interaction.channel.send({content:"**Something went wrong while making the transcript!**\nPlease try again another time!"})
|
||||
return
|
||||
}
|
||||
|
||||
interaction.channel.send({content:"**Here is the transcript:**",files:[fileattachment]})
|
||||
})
|
||||
}
|
||||
@@ -1,95 +0,0 @@
|
||||
const discord = require('discord.js')
|
||||
const bot = require('../index')
|
||||
const client = bot.client
|
||||
const config = bot.config
|
||||
const getButton = require("./utils/getButton")
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {String} id the id from an open-ticket embed
|
||||
* @returns {{embed:discord.MessageEmbed,componentRows:discord.MessageActionRow[]}} discord embed
|
||||
*/
|
||||
|
||||
|
||||
|
||||
exports.createEmbed = (id) => {
|
||||
//-----------------------------------
|
||||
//general importing
|
||||
const data = require("./utils/getTicketMessages").getTicketMessage(id)
|
||||
/**@type {discord.MessageButton[]}*/
|
||||
var buttons = []
|
||||
/**@type {getButton.rawButtonData[]} */
|
||||
var buttonData = []
|
||||
|
||||
data.options.forEach((option) => {
|
||||
var button = getButton.getButton(option)
|
||||
var localButtonData = getButton.getOption(option)
|
||||
if (button) buttons.push(button)
|
||||
if (localButtonData) buttonData.push(localButtonData)
|
||||
})
|
||||
//-----------------------------------
|
||||
|
||||
//-----------------------------------
|
||||
//create the embed
|
||||
const embed = new discord.MessageEmbed()
|
||||
.setColor(data.color)
|
||||
.setTitle(data.name)
|
||||
if (data.enableFooter) embed.setFooter({text:data.footer})
|
||||
if (data.enableThumbnail) embed.setThumbnail(data.thumbnail)
|
||||
|
||||
var description = data.description
|
||||
if (data.enableTicketExplaination){
|
||||
description = description+"\n\n__choose a category:__\n"
|
||||
|
||||
var ticketExplainations = []
|
||||
buttonData.forEach((button) => {
|
||||
var explaination = button.icon+" **"+button.name+":**\n"+button.description
|
||||
ticketExplainations.push(explaination)
|
||||
})
|
||||
|
||||
description = description+ticketExplainations.join("\n\n")
|
||||
}
|
||||
|
||||
if (data.enableMaxTicketsWarning){
|
||||
description = description+"\n\n**Warning:** _You can only create "+config.system.max_allowed_tickets+" ticket(s) at a time!_"
|
||||
}
|
||||
|
||||
embed.setDescription(description)
|
||||
//-----------------------------------
|
||||
|
||||
//-----------------------------------
|
||||
//create the components
|
||||
var AmountOfRows = Math.ceil(buttons.length / 4)
|
||||
var currentRow = 0
|
||||
|
||||
/**
|
||||
* @type {discord.MessageActionRow[]}
|
||||
*/
|
||||
var componentRows = []
|
||||
|
||||
for (let i = AmountOfRows; i > 0; i--){
|
||||
|
||||
componentRows.push(new discord.MessageActionRow())
|
||||
}
|
||||
|
||||
buttons.forEach((button,index) => {
|
||||
componentRows[currentRow].addComponents([button])
|
||||
|
||||
if (index == 3 || index == 7 || index == 11 || index == 15 || index == 19 || index == 23 || index == 27 || index == 31 || index == 35 || index == 39){
|
||||
currentRow = currentRow + 1
|
||||
}
|
||||
})
|
||||
//-----------------------------------
|
||||
|
||||
|
||||
|
||||
//return everything
|
||||
/**
|
||||
* @type {{embed:discord.MessageEmbed,componentRows:discord.MessageActionRow[]}}
|
||||
*/
|
||||
const returnedData = {embed:embed,componentRows:componentRows}
|
||||
return returnedData
|
||||
}
|
||||
|
||||
|
||||
this.createEmbed()
|
||||
@@ -1,168 +0,0 @@
|
||||
const discord = require('discord.js')
|
||||
const bot = require('../index')
|
||||
const client = bot.client
|
||||
const config = bot.config
|
||||
|
||||
const getconfigoptions = require("./getoptions")
|
||||
const storage = bot.storage
|
||||
|
||||
module.exports = () => {
|
||||
var closeButton = new discord.MessageActionRow()
|
||||
.addComponents(
|
||||
new discord.MessageButton()
|
||||
.setCustomId("closeTicket")
|
||||
.setDisabled(false)
|
||||
.setStyle("SECONDARY")
|
||||
.setLabel("Close Ticket")
|
||||
.setEmoji("🔒")
|
||||
)
|
||||
.addComponents(
|
||||
new discord.MessageButton()
|
||||
.setCustomId("deleteTicket")
|
||||
.setDisabled(false)
|
||||
.setStyle("DANGER")
|
||||
.setLabel("Delete Ticket")
|
||||
.setEmoji("✖️")
|
||||
)
|
||||
|
||||
//ticket button click / create ticket
|
||||
client.on("interactionCreate",(interaction) => {
|
||||
if (interaction.isCommand() && (interaction.commandName == "new" || interaction.commandName == "ticket")){
|
||||
var customId = "newT"+interaction.options.getString("type")
|
||||
}else if (interaction.isButton()){
|
||||
var customId = interaction.customId
|
||||
}else return
|
||||
|
||||
if (getconfigoptions.getTicketValues("id").includes(customId)){
|
||||
|
||||
if (interaction.isButton()){
|
||||
interaction.deferUpdate()
|
||||
}else if (interaction.isCommand()){
|
||||
interaction.reply({content:"Your ticket is created!"})
|
||||
}
|
||||
|
||||
//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){
|
||||
|
||||
try{
|
||||
if (config.system.enable_DM_Messages){
|
||||
interaction.member.send({content:currentTicketOptions.message})
|
||||
}
|
||||
}
|
||||
catch{console.log("[system] can't send DM to member, member doesn't allow dm's")}
|
||||
|
||||
|
||||
|
||||
//update storage
|
||||
storage.set("ticketStorage",interaction.member.id,Number(storage.get("ticketStorage",interaction.member.id))+1)
|
||||
var ticketNumber = interaction.member.user.username
|
||||
|
||||
//set ticketName
|
||||
var ticketName = currentTicketOptions.channelprefix+ticketNumber
|
||||
var logsname = currentTicketOptions.name
|
||||
|
||||
//category
|
||||
if (currentTicketOptions.category.length < 16 || currentTicketOptions.category.length > 20){
|
||||
var newTicketCategory = null
|
||||
}else{
|
||||
var newTicketCategory = currentTicketOptions.category
|
||||
}
|
||||
|
||||
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
|
||||
})
|
||||
|
||||
//add the user that created the ticket
|
||||
permissionsArray.push({
|
||||
id:interaction.member.id,
|
||||
type:"member",
|
||||
allow:["ADD_REACTIONS","ATTACH_FILES","EMBED_LINKS","SEND_MESSAGES","VIEW_CHANNEL"]
|
||||
})
|
||||
|
||||
//add main adminroles
|
||||
config.main_adminroles.forEach((role) => {
|
||||
permissionsArray.push({
|
||||
id:role,
|
||||
type:"role",
|
||||
allow:["ADD_REACTIONS","ATTACH_FILES","EMBED_LINKS","SEND_MESSAGES","VIEW_CHANNEL"]
|
||||
})
|
||||
})
|
||||
|
||||
//add ticket adminroles
|
||||
/**
|
||||
* @type {String[]}
|
||||
*/
|
||||
const ticketadmin = currentTicketOptions.adminroles
|
||||
ticketadmin.forEach((role) => {
|
||||
if (!config.main_adminroles.includes(role)){
|
||||
permissionsArray.push({
|
||||
id:role,
|
||||
type:"role",
|
||||
allow:["ADD_REACTIONS","ATTACH_FILES","EMBED_LINKS","SEND_MESSAGES","VIEW_CHANNEL"]
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
//add member role
|
||||
if (config.system.member_role != "" && config.system.member_role != " " && config.system.member_role != "false" && config.system.member_role != "null" && config.system.member_role != "0"){
|
||||
permissionsArray.push({
|
||||
id:config.system.member_role,
|
||||
type:"role",
|
||||
deny:["VIEW_CHANNEL"]
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
//create the channel
|
||||
interaction.guild.channels.create(ticketName,{
|
||||
type:"GUILD_TEXT",
|
||||
parent:newTicketCategory,
|
||||
reason:"A new ticket was created",
|
||||
permissionOverwrites:permissionsArray
|
||||
|
||||
}).then((ticketChannel) => {
|
||||
storage.set("userTicketStorage",ticketChannel.id,interaction.member.id)
|
||||
|
||||
var ticketEmbed = new discord.MessageEmbed()
|
||||
.setColor(config.main_color)
|
||||
.setTitle("You created a ticket!")
|
||||
.setDescription("The staff will help you soon!\n\n*Click on the button below to close the ticket!*")
|
||||
|
||||
ticketChannel.send({
|
||||
content:"<@"+interaction.member.id+"> @everyone",
|
||||
embeds:[ticketEmbed],
|
||||
components:[closeButton]
|
||||
|
||||
}).then(firstmsg => {
|
||||
firstmsg.pin()
|
||||
})
|
||||
if (config.logs){console.log("[system] created a new ticket (name:"+logsname+",user:"+interaction.user.username+")")}
|
||||
})
|
||||
}else{
|
||||
try {
|
||||
if (config.system.enable_DM_Messages){
|
||||
interaction.member.send("you already have the maximum number of tickets allowed!")
|
||||
}
|
||||
}
|
||||
catch{console.log("[system] can't send DM to member, member doesn't allow dm's")}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
Regular → Executable
+47
-8
@@ -2,35 +2,74 @@ const discord = require('discord.js')
|
||||
const bot = require('../index')
|
||||
const client = bot.client
|
||||
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 hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
||||
const ticketId = hiddendata.data.find(d => d.key == "type")
|
||||
|
||||
const id = hiddendata.data.find(d => d.key == "openerid").value
|
||||
|
||||
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
|
||||
* @returns new `discord.messageAttachment`
|
||||
* @param {discord.Channel} channel
|
||||
* @returns new `discord.attachmentBuilder`
|
||||
*/
|
||||
|
||||
exports.createTranscript = async (messagecollection) => {
|
||||
exports.createTranscript = async (messagecollection,channel) => {
|
||||
const ticketuserdata = await getUserInfo(channel)
|
||||
|
||||
require("./api/modules/events").onTranscriptCreation(messagecollection,channel,channel.guild,new Date())
|
||||
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.getHours()+":"+cd.getMinutes()+":"+cd.getSeconds()
|
||||
const filearray = ["open ticket transcript:\ntranscript creation: "+dateString+"\nticket name: "+ticketuserdata.ticketname+"\nticket opener: "+ticketuserdata.ticketopener.name,"\nTRANSCRIPT START:"]
|
||||
|
||||
messagecollection.reverse()
|
||||
|
||||
|
||||
messagecollection.forEach((msg) => {
|
||||
const timestamp = new Date(msg.createdTimestamp)
|
||||
|
||||
if (msg.content){var content = msg.content}else{var content = "*empty message*"}
|
||||
|
||||
const msgstats = "files: "+msg.attachments.size+" | embeds: "+msg.embeds.length+" | isbot: "+msg.author.bot
|
||||
filearray.push("["+timestamp.getDate()+"/"+timestamp.getMonth()+"/"+timestamp.getFullYear()+" | "+timestamp.getHours()+":"+timestamp.getMinutes()+":"+timestamp.getSeconds()+" | "+msg.author.tag+" ] ["+msgstats+"]\n"+content+"\n")
|
||||
const msgstats = "files: "+msg.attachments.size+", embeds: "+msg.embeds.length
|
||||
filearray.push("["+timestamp.getDate()+"/"+timestamp.getMonth()+"/"+timestamp.getFullYear()+", "+timestamp.getHours()+":"+timestamp.getMinutes()+":"+timestamp.getSeconds()+"|"+msg.author.tag+"] ["+msgstats+"]\n"+content+"\n")
|
||||
})
|
||||
|
||||
if (filearray.length < 2) filearray.push("transcript is empty")
|
||||
const filestring = filearray.join("\n")
|
||||
const filebuff = Buffer.from(filestring,"utf-8")
|
||||
return new discord.MessageAttachment(filebuff,"transcript.txt")
|
||||
return new discord.AttachmentBuilder(filebuff,{name:"transcript_"+ticketuserdata.ticketname+".txt",description:"An Open Ticket transcript"})
|
||||
}catch(err){
|
||||
console.log(err)
|
||||
console.log("[error] "+err)
|
||||
return false
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,187 @@
|
||||
const bot = require("../../index")
|
||||
const config = bot.config
|
||||
const l = bot.language
|
||||
|
||||
//TYPEDEFS:
|
||||
//==================
|
||||
|
||||
//OTTicketOptions
|
||||
/**@typedef {{id: String,name: String,description: String,icon: String,label: String,type: "ticket"|"role"|"website",color: "red"|"green"|"blue"|"gray",adminroles: String[],channelprefix: String,category: String,message: String,enableDmOnOpen: Boolean,ticketmessage: String, thumbnail:{enable:Boolean,url:String}, closedCategory:{enable:Boolean,id:String}}} OTTicketOptions */
|
||||
|
||||
//OTRoleOptions
|
||||
/**@typedef {{id: String,name: String,description: String,icon: String,label: String,type: "ticket"|"role"|"website",color:"red"|"green"|"blue"|"gray"|"none",roles:String[],mode:"add&remove"|"remove"|"add",enableDmOnOpen:Boolean}} OTRoleOptions */
|
||||
|
||||
//OTWebsiteOptions
|
||||
/**@typedef {{id: String,name: String,description: String,icon: String,label: String,type: "ticket"|"role"|"website",url:String}} OTWebsiteOptions */
|
||||
|
||||
|
||||
//OTConfigMessage
|
||||
/**@typedef {{id: string, name: string, description: string, dropdown: boolean, enableFooter: boolean, footer: string, enableThumbnail: boolean, thumbnail: string, enableCustomColor: boolean, color: string, options: string[], enableTicketExplaination: boolean, enableMaxTicketsWarning: boolean}} OTConfigMessage*/
|
||||
|
||||
//StringOptions
|
||||
/**@typedef {"id"|"name"|"description"|"icon"|"label"|"type"|"color"|"adminroles"|"channelprefix"|"category"|"message"|"enableDmOnOpen"|"ticketmessage"|"thumbnail"|"closedCategory"} OTTicketStringOptions */
|
||||
/**@typedef {"id"|"name"|"description"|"icon"|"label"|"type"|"color"|"roles"|"mode"|"enableDmOnOpen"} OTRoleStringOptions */
|
||||
/**@typedef {"id"|"name"|"description"|"icon"|"label"|"type"|"url"} OTWebsiteStringOptions */
|
||||
|
||||
//FUNCTIONS:
|
||||
//==================
|
||||
|
||||
/** @param {String} id the id of the embed @returns {OTConfigMessage}*/
|
||||
exports.getConfigMessage = (id) => {
|
||||
var returned = config.messages.find(a => a.id == id)
|
||||
if (returned){
|
||||
return returned
|
||||
}
|
||||
var result = config.messages[0]
|
||||
if (!result){
|
||||
throw new Error("'messages' object in config.json is empty")
|
||||
return
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {String} id
|
||||
* @param {Boolean} withoutOTnewT
|
||||
* @returns {OTTicketOptions|false}
|
||||
*/
|
||||
exports.getTicketById = (id,withoutOTnewT) => {
|
||||
var result = false
|
||||
if (withoutOTnewT){
|
||||
config.options.forEach((option) => {
|
||||
if (option.id == id && option.type == "ticket"){
|
||||
result = option
|
||||
}
|
||||
})
|
||||
}else{
|
||||
config.options.forEach((option) => {
|
||||
if ("OTnewT"+option.id == id && option.type == "ticket"){
|
||||
result = option
|
||||
}
|
||||
})
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {String} id
|
||||
* @param {Boolean} withoutOTnewR
|
||||
* @returns {OTRoleOptions|false}
|
||||
*/
|
||||
exports.getRoleById = (id,withoutOTnewR) => {
|
||||
var result = false
|
||||
if (withoutOTnewR){
|
||||
config.options.forEach((option) => {
|
||||
if (option.id == id && option.type == "role"){
|
||||
result = option
|
||||
}
|
||||
})
|
||||
}else{
|
||||
config.options.forEach((option) => {
|
||||
if ("OTnewR"+option.id == id && option.type == "role"){
|
||||
result = option
|
||||
}
|
||||
})
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {String} id
|
||||
* @returns {OTWebsiteOptions|false}
|
||||
*/
|
||||
exports.getWebsiteById = (id) => {
|
||||
var result = false
|
||||
config.options.forEach((option) => {
|
||||
if (option.id == id && option.type == "website"){
|
||||
result = option
|
||||
}
|
||||
})
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {OTTicketStringOptions} value
|
||||
* @returns {String[]}
|
||||
*/
|
||||
exports.getTicketValuesArray = (value,idWithoutOTnewT) => {
|
||||
var result = []
|
||||
const prefix = idWithoutOTnewT ? "" : "OTnewT"
|
||||
config.options.forEach((opt) => {
|
||||
if (opt.type == "ticket"){
|
||||
if (value == "id"){
|
||||
result.push(prefix+opt[value])
|
||||
}else{
|
||||
result.push(opt[value])
|
||||
}
|
||||
}
|
||||
})
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {OTRoleStringOptions} value
|
||||
* @returns {String[]}
|
||||
*/
|
||||
exports.getRoleValuesArray = (value,idWithoutOTnewR) => {
|
||||
var result = []
|
||||
const prefix = idWithoutOTnewR ? "" : "OTnewR"
|
||||
config.options.forEach((opt) => {
|
||||
if (o.type == "role"){
|
||||
if (value == "id"){
|
||||
result.push(prefix+opt[value])
|
||||
}else{
|
||||
result.push(opt[value])
|
||||
}
|
||||
}
|
||||
})
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {OTWebsiteStringOptions} value
|
||||
* @returns {String[]}
|
||||
*/
|
||||
exports.getWebsiteValuesArray = (value) => {
|
||||
var result = []
|
||||
config.options.forEach((opt) => {
|
||||
if (o.type == "website"){
|
||||
result.push(opt[value])
|
||||
}
|
||||
})
|
||||
return result
|
||||
}
|
||||
|
||||
/**@type {OTTicketOptions} */
|
||||
this.ticketType = {}
|
||||
|
||||
/**@type {OTRoleOptions} */
|
||||
this.roleType = {}
|
||||
|
||||
/**@type {OTWebsiteOptions} */
|
||||
this.websiteType = {}
|
||||
|
||||
/**@type {OTConfigMessage} */
|
||||
this.messageType = {}
|
||||
|
||||
|
||||
//OTAllOptions
|
||||
/**@typedef {{id: String,name: String,description: String,icon: String,label: String,type: "ticket"|"role"|"website",color:"red"|"green"|"blue"|"gray"|"none",roles:String[],mode:"add&remove"|"remove"|"add",adminroles: String[],channelprefix: String,category: String,message: String,enableDmOnOpen: Boolean,ticketmessage: String, thumbnail:{enable:Boolean,url:String}, url:String, closedCategory:{enable:Boolean,id:String}}} OTAllOptions */
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {String} id
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
exports.optionExists = (id) => {
|
||||
var result = false
|
||||
config.options.forEach((option) => {
|
||||
if (option.id == id){
|
||||
result = true
|
||||
}
|
||||
})
|
||||
return result
|
||||
}
|
||||
+16
-14
@@ -1,23 +1,24 @@
|
||||
const discord = require("discord.js")
|
||||
const bot = require("../../index")
|
||||
const config = bot.config
|
||||
const getoptions = require("../getoptions")
|
||||
const l = bot.language
|
||||
|
||||
/**@returns {"DANGER"|"SUCCESS"|"PRIMARY"|"SECONDARY"} */
|
||||
const getColor = (color) => {
|
||||
const b = discord.ButtonStyle
|
||||
if (color.toLowerCase() == "red"){
|
||||
return "DANGER"
|
||||
return b.Danger
|
||||
}else if (color.toLowerCase() == "green"){
|
||||
return "SUCCESS"
|
||||
return b.Success
|
||||
}else if (color.toLowerCase() == "blue" || color.toLowerCase() == "blurple"){
|
||||
return "PRIMARY"
|
||||
return b.Primary
|
||||
}else if (color.toLowerCase() == "black" || color.toLowerCase() == "gray" || color.toLowerCase() == "grey"){
|
||||
return "SECONDARY"
|
||||
return b.Secondary
|
||||
}else if (color == "DANGER" || color == "SECONDARY" || color == "SUCCESS" || color == "PRIMARY"){
|
||||
return color
|
||||
}else if (color.toLowerCase() == "none" || color.toLowerCase() == "false" || color.toLowerCase() == ""){
|
||||
return "SECONDARY"
|
||||
}else return "SECONDARY"
|
||||
return b.Secondary
|
||||
}else return b.Secondary
|
||||
}
|
||||
|
||||
const getOption = (id) => {
|
||||
@@ -28,14 +29,14 @@ exports.getOption = getOption
|
||||
/**
|
||||
*
|
||||
* @param {String} id
|
||||
* @returns {discord.MessageButton|false}
|
||||
* @returns {discord.ButtonBuilder|false}
|
||||
*/
|
||||
exports.getButton = (id) => {
|
||||
const option = getOption(id)
|
||||
if (!option) return false
|
||||
if (option.type == "ticket"){
|
||||
var button = new discord.MessageButton()
|
||||
.setCustomId("newT"+option.id)
|
||||
var button = new discord.ButtonBuilder()
|
||||
.setCustomId("OTnewT"+option.id)
|
||||
.setDisabled(false)
|
||||
.setStyle(getColor(option.color))
|
||||
|
||||
@@ -44,9 +45,9 @@ exports.getButton = (id) => {
|
||||
if (!option.label && !option.icon){button.setLabel("no label or emoji")}
|
||||
|
||||
}else if (option.type == "website"){
|
||||
var button = new discord.MessageButton()
|
||||
var button = new discord.ButtonBuilder()
|
||||
.setDisabled(false)
|
||||
.setStyle("LINK")
|
||||
.setStyle(discord.ButtonStyle.Link)
|
||||
.setURL(option.url)
|
||||
|
||||
if (option.label){button.setLabel(option.label)}
|
||||
@@ -54,7 +55,7 @@ exports.getButton = (id) => {
|
||||
if (!option.label && !option.icon){button.setLabel("no label or emoji")}
|
||||
|
||||
}else if (option.type == "role"){
|
||||
var button = new discord.MessageButton()
|
||||
var button = new discord.ButtonBuilder()
|
||||
.setCustomId("newR"+option.id)
|
||||
.setDisabled(false)
|
||||
.setStyle(getColor(option.color))
|
||||
@@ -79,7 +80,7 @@ exports.rawButtonData = class {
|
||||
this.type = ""
|
||||
|
||||
this.color = ""
|
||||
this.enableDMMessage = true
|
||||
this.enableDmOnOpen = true
|
||||
this.url = ""
|
||||
this.roles = ["",""]
|
||||
this.mode = ""
|
||||
@@ -87,6 +88,7 @@ exports.rawButtonData = class {
|
||||
this.channelprefix = ""
|
||||
this.category = ""
|
||||
this.message = ""
|
||||
this.ticketmessage = ""
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
const discord = require("discord.js")
|
||||
const bot = require("../../index")
|
||||
const config = bot.config
|
||||
const l = bot.language
|
||||
|
||||
const configParser = require("./configParser")
|
||||
/**
|
||||
*
|
||||
* @param {String[]} ids
|
||||
* @returns {discord.SelectMenuBuilder|false}
|
||||
*/
|
||||
exports.getDropdown = (ids) => {
|
||||
const dropdown = new discord.SelectMenuBuilder()
|
||||
.setCustomId("OTdropdownMenu")
|
||||
.setDisabled(false)
|
||||
.setMaxValues(1)
|
||||
.setMinValues(1)
|
||||
.setPlaceholder(l.messages.chooseATicket)
|
||||
.addOptions(
|
||||
new discord.SelectMenuOptionBuilder()
|
||||
.setDefault(true)
|
||||
.setLabel(l.messages.chooseATicket)
|
||||
.setValue("OTChooseTicket")
|
||||
)
|
||||
|
||||
ids.forEach((id) => {
|
||||
const option = configParser.getTicketById(id,true)
|
||||
if (option){
|
||||
const selectComponent = new discord.SelectMenuOptionBuilder()
|
||||
.setDefault(false)
|
||||
.setValue("OTnewT"+option.id)
|
||||
|
||||
if (!option.label && !option.icon){
|
||||
selectComponent.setLabel("OT ERROR: no description/emoji")
|
||||
}else{
|
||||
if (option.label) selectComponent.setLabel(option.label)
|
||||
if (option.icon) selectComponent.setEmoji(option.icon)
|
||||
}
|
||||
|
||||
dropdown.addOptions(selectComponent)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
return dropdown
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
const discord = require('discord.js')
|
||||
const bot = require('../../index')
|
||||
const client = bot.client
|
||||
const config = bot.config
|
||||
const getButton = require("./getButton")
|
||||
const l = bot.language
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {String} id the id from an open-ticket embed
|
||||
* @returns {{embed:discord.EmbedBuilder,componentRows:discord.MessageActionRow[]}} discord embed
|
||||
*/
|
||||
|
||||
|
||||
|
||||
exports.createEmbed = (id) => {
|
||||
//-----------------------------------
|
||||
//general importing
|
||||
const data = require("./configParser").getConfigMessage(id)
|
||||
/**@type {discord.ButtonBuilder[]}*/
|
||||
var buttons = []
|
||||
/**@type {getButton.rawButtonData[]} */
|
||||
var buttonData = []
|
||||
|
||||
data.options.forEach((option) => {
|
||||
var button = getButton.getButton(option)
|
||||
var localButtonData = getButton.getOption(option)
|
||||
if (button) buttons.push(button)
|
||||
if (localButtonData) buttonData.push(localButtonData)
|
||||
})
|
||||
//-----------------------------------
|
||||
|
||||
//-----------------------------------
|
||||
//create the embed
|
||||
const embed = new discord.EmbedBuilder()
|
||||
.setTitle(data.name)
|
||||
if (data.enableFooter) embed.setFooter({text:data.footer})
|
||||
if (data.enableThumbnail) embed.setThumbnail(data.thumbnail)
|
||||
|
||||
if (data.enableCustomColor){
|
||||
embed.setColor(data.color)
|
||||
}else{
|
||||
embed.setColor(config.main_color)
|
||||
}
|
||||
|
||||
var description = data.description
|
||||
if (data.enableTicketExplaination){
|
||||
description = description+"\n\n__"+l.messages.chooseCategory+"__\n"
|
||||
|
||||
var ticketExplainations = []
|
||||
buttonData.forEach((button) => {
|
||||
var explaination = button.icon+" **"+button.name+":**\n"+button.description
|
||||
ticketExplainations.push(explaination)
|
||||
})
|
||||
|
||||
description = description+ticketExplainations.join("\n\n")
|
||||
}
|
||||
|
||||
if (data.enableMaxTicketsWarning){
|
||||
description = description+"\n\n"+l.commands.maxTicketWarning.replace("{0}",config.system.max_allowed_tickets)
|
||||
}
|
||||
|
||||
if (description) embed.setDescription(description)
|
||||
|
||||
//-----------------------------------
|
||||
|
||||
|
||||
//-----------------------------------
|
||||
//create the components IF DROPDOWN IS FALSE
|
||||
if (!data.dropdown){
|
||||
var AmountOfRows = Math.ceil(buttons.length / 4)
|
||||
var currentRow = 0
|
||||
|
||||
/**
|
||||
* @type {discord.MessageActionRow[]}
|
||||
*/
|
||||
var componentRows = []
|
||||
|
||||
for (let i = AmountOfRows; i > 0; i--){
|
||||
|
||||
componentRows.push(new discord.ActionRowBuilder())
|
||||
}
|
||||
|
||||
buttons.forEach((button,index) => {
|
||||
componentRows[currentRow].addComponents([button])
|
||||
|
||||
if (index == 3 || index == 7 || index == 11 || index == 15 || index == 19 || index == 23 || index == 27 || index == 31 || index == 35 || index == 39){
|
||||
currentRow = currentRow + 1
|
||||
}
|
||||
})
|
||||
|
||||
//create the component IF DROPDOWN is true
|
||||
}else{
|
||||
const ids = data.options
|
||||
const dropdown = require("./getDropdown").getDropdown(ids)
|
||||
var componentRows = [
|
||||
new discord.ActionRowBuilder()
|
||||
.setComponents(dropdown)
|
||||
]
|
||||
}
|
||||
//-----------------------------------
|
||||
|
||||
|
||||
|
||||
//return everything
|
||||
/**
|
||||
* @type {{embed:discord.EmbedBuilder,componentRows:discord.MessageActionRow[]}}
|
||||
*/
|
||||
const returnedData = {embed:embed,componentRows:componentRows}
|
||||
return returnedData
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
const bot = require("../../index")
|
||||
const config = bot.config
|
||||
exports.getTicketMessage = (input) => {
|
||||
var returned = config.messages.find(a => a.id == input)
|
||||
if (returned){
|
||||
return returned
|
||||
}
|
||||
var result = config.messages[0]
|
||||
if (!result){
|
||||
throw new Error("'messages' object in config.json is empty")
|
||||
return
|
||||
}
|
||||
return result
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
|
||||
/**@typedef {{type:String,data:[{key:String,value:String}]}} hiddenData */
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {String} messageContent
|
||||
* @returns {hiddenData}
|
||||
*/
|
||||
|
||||
exports.readHiddenData = (messageContent) => {
|
||||
//ticketdata//type:123|userid:456)
|
||||
const rawhidden = messageContent.split("[ ](OTDATA|")[1]
|
||||
const rawhidden2 = rawhidden.split("//")
|
||||
|
||||
const datatype = rawhidden2[0]
|
||||
var rawhiddendata = rawhidden2[1]
|
||||
var rawhiddendataArray = rawhiddendata.split("")
|
||||
rawhiddendataArray.pop()
|
||||
|
||||
rawhiddendata = rawhiddendataArray.join("")
|
||||
|
||||
const splittedData = rawhiddendata.split("|")
|
||||
|
||||
const resultData = []
|
||||
splittedData.forEach((data) => {
|
||||
// type:123
|
||||
const dataresult = data.split(":")
|
||||
|
||||
resultData.push({key:dataresult[0],value:dataresult[1]})
|
||||
})
|
||||
|
||||
return {type:datatype,data:resultData}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {String} type
|
||||
* @param {[{key:String,value:String}]} data
|
||||
* @returns {String}
|
||||
*/
|
||||
exports.writeHiddenData = (type,data) => {
|
||||
const dataValues = []
|
||||
data.forEach((d) => {
|
||||
dataValues.push(d.key+":"+d.value)
|
||||
})
|
||||
|
||||
const datastring = dataValues.join("|")
|
||||
|
||||
const result = "[ ](OTDATA|"+type+"//"+datastring+")"
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {String} description
|
||||
* @returns {{description:String,hiddenData:hiddenData}}
|
||||
*/
|
||||
exports.removeHiddenData = (description) => {
|
||||
const hiddenData = this.readHiddenData(description)
|
||||
|
||||
const splitted = description.split("[ ](OTDATA")
|
||||
const original = splitted[0]
|
||||
|
||||
return {description:original,hiddenData:hiddenData}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
const discord = require('discord.js')
|
||||
const bot = require('../../index')
|
||||
const client = bot.client
|
||||
const config = bot.config
|
||||
const log = bot.errorLog.log
|
||||
|
||||
const loadChalk = async () => {
|
||||
return await (await import("chalk")).default
|
||||
}
|
||||
|
||||
module.exports = async () => {
|
||||
const chalk = await loadChalk()
|
||||
|
||||
//LIVESTATUS SOON
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
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
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {String} memberid
|
||||
* @param {String} guildid
|
||||
* @returns {Boolean} has permissions?
|
||||
*/
|
||||
exports.command = (memberid,guildid) => {
|
||||
const permsmember = client.guilds.cache.find(g => g.id == guildid).members.cache.find(m => m.id == memberid)
|
||||
if (config.main_adminroles.some((item)=>{return permsmember.roles.cache.has(item)}) == false && !permsmember.permissions.has("Administrator") && !permsmember.permissions.has("ManageGuild")){
|
||||
return false
|
||||
}else {return true}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {discord.User} user
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
exports.sendUserNoPerms = (user) => {
|
||||
try {
|
||||
user.send({embeds:[bot.errorLog.noPermsMessage(user)]})
|
||||
return true
|
||||
}catch{
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {discord.User} user
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
exports.sendUserNoTicket = (user) => {
|
||||
try {
|
||||
user.send({embeds:[bot.errorLog.notInATicket]})
|
||||
return true
|
||||
}catch{
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {discord.User} user
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
exports.sendUserNoDelete = (user) => {
|
||||
try {
|
||||
user.send({embeds:[bot.errorLog.noPermsDelete(user)]})
|
||||
return true
|
||||
}catch{
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {discord.TextChannel} channel
|
||||
* @param {discord.User} user
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
exports.sendChannelNoPerms = (channel,user) => {
|
||||
try {
|
||||
channel.send({embeds:[bot.errorLog.noPermsMessage(user)]})
|
||||
return true
|
||||
}catch{
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {discord.TextChannel} channel
|
||||
* @param {discord.User} user
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
exports.sendChannelNoTicket = (channel,user) => {
|
||||
try {
|
||||
channel.send({embeds:[bot.errorLog.notInATicket]})
|
||||
return true
|
||||
}catch{
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {discord.TextChannel} channel
|
||||
* @param {discord.User} user
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
exports.sendChannelNoDelete = (channel,user) => {
|
||||
try {
|
||||
channel.send({embeds:[bot.errorLog.noPermsDelete(user)]})
|
||||
return true
|
||||
}catch{
|
||||
return false
|
||||
}
|
||||
}
|
||||
@@ -1,35 +1,158 @@
|
||||
const discord = require('discord.js')
|
||||
// __________ __________ ___________ ____ ____
|
||||
// / ____ \ / ______ \ / | | \ | |
|
||||
// | / \ | | | | | | |_______| | \ | |
|
||||
// | | | | | |____| | | | | |\ \ | |
|
||||
// | | | | | ________/ | |______ | | \ \ | |
|
||||
// | | | | | | | _____| | | \ \ | |
|
||||
// | | | | | | | | | | \ \ | |
|
||||
// | | | | | | | |________ | | \ \| |
|
||||
// | \____/ | | | | | | | \ |
|
||||
// \__________/ |__| \__________| |__| \___|
|
||||
|
||||
const discord = require("discord.js")
|
||||
const fs = require('fs')
|
||||
const intents = discord.Intents
|
||||
const client = new discord.Client({intents:[intents.FLAGS.GUILDS,intents.FLAGS.GUILD_MESSAGES,intents.FLAGS.GUILD_MEMBERS],partials:["CHANNEL"]})
|
||||
const {GatewayIntentBits,Partials} = discord
|
||||
const APIBase = require("./core/api/modules/base")
|
||||
if (APIBase.embeddedMode){
|
||||
var tempClient = APIBase.clientLocation
|
||||
}else{
|
||||
var tempClient = new discord.Client({
|
||||
intents:[
|
||||
GatewayIntentBits.DirectMessages,
|
||||
GatewayIntentBits.GuildInvites,
|
||||
GatewayIntentBits.GuildMembers,
|
||||
GatewayIntentBits.GuildMessages,
|
||||
GatewayIntentBits.Guilds,
|
||||
GatewayIntentBits.MessageContent
|
||||
],
|
||||
partials:[Partials.Channel,Partials.Message]
|
||||
})
|
||||
}
|
||||
/**@type {discord.Client} */
|
||||
const client = tempClient
|
||||
exports.client = client
|
||||
client.setMaxListeners(50)
|
||||
if (process.argv.some((v) => v == "--debug")) console.log("[TEMP_DEBUG]","created client")
|
||||
|
||||
client.setMaxListeners(20)
|
||||
var tempconfig = require("./config.json")
|
||||
/**@type {Boolean} */
|
||||
var isDevConfig = false
|
||||
|
||||
//change to FALSE on release
|
||||
const isDev = false
|
||||
//!!!!!!!!!!!
|
||||
if (process.argv.some((v) => v == "--devconfig")){
|
||||
async function logFLAGS(){
|
||||
const chalk = await (await import("chalk")).default
|
||||
console.log(chalk.blue("[FLAGS] => used dev config instead of normal config"))
|
||||
}; logFLAGS()
|
||||
isDevConfig = true
|
||||
try{
|
||||
tempconfig = require("./devConfig.json")
|
||||
}catch{tempconfig = require("./config.json")}
|
||||
}else{
|
||||
tempconfig = require("./config.json")
|
||||
}
|
||||
if (process.argv.some((v) => v == "--nochecker")){
|
||||
async function logFLAGS(){
|
||||
const chalk = await (await import("chalk")).default
|
||||
console.log(chalk.blue("[FLAGS] => disabled checker.js"))
|
||||
}; logFLAGS()
|
||||
}
|
||||
if (process.argv.some((v) => v == "--debug")){
|
||||
async function logFLAGS(){
|
||||
const chalk = await (await import("chalk")).default
|
||||
console.log(chalk.blue("[FLAGS] => enabled DEBUG mode"))
|
||||
}; logFLAGS()
|
||||
}
|
||||
if (process.argv.some((v) => v == "--debug")) console.log("[TEMP_DEBUG]","loaded flags")
|
||||
|
||||
if (isDev){
|
||||
try {
|
||||
var config = require('./devConfig.json')
|
||||
}catch{
|
||||
console.log("devConfig.json not found! Trying the normal config...")
|
||||
var config = require("./config.json")
|
||||
}
|
||||
}else{var config = require('./config.json')}
|
||||
exports.developerConfig = isDevConfig
|
||||
const language = require("./core/languageManager").language
|
||||
exports.language = language
|
||||
if (process.argv.some((v) => v == "--debug")) console.log("[TEMP_DEBUG]","loaded language")
|
||||
|
||||
const config = tempconfig
|
||||
exports.config = config
|
||||
if (process.argv.some((v) => v == "--debug")) console.log("[TEMP_DEBUG]","loaded config")
|
||||
exports.storage = require('./core/dynamicdatabase/storage')
|
||||
if (process.argv.some((v) => v == "--debug")) console.log("[TEMP_DEBUG]","loaded storage")
|
||||
|
||||
exports.errorLog = require("./core/errorLogSystem")
|
||||
const log = this.errorLog.log
|
||||
if (process.argv.some((v) => v == "--debug")) console.log("[TEMP_DEBUG]","LOADED LOGGING SYSTEM")
|
||||
if (process.argv.some((v) => v == "--debug")) console.log("[TEMP_DEBUG]","switching to new logs")
|
||||
this.errorLog.log("debug","loaded new logs")
|
||||
|
||||
exports.hiddenData = require("./core/utils/hiddendata")
|
||||
this.errorLog.log("debug","loaded hiddendataTM")
|
||||
|
||||
exports.embeds = {
|
||||
commands:require("./core/interactionHandlers/embeds/commands")
|
||||
}
|
||||
exports.buttons = {
|
||||
close:require("./core/interactionHandlers/buttons/close"),
|
||||
firstmsg:require("./core/interactionHandlers/buttons/firstmsg"),
|
||||
verifybars:require("./core/interactionHandlers/buttons/verifyBars")
|
||||
}
|
||||
this.errorLog.log("debug","loaded buttons & embeds")
|
||||
|
||||
client.on('ready',async () => {
|
||||
const chalk = await (await import("chalk")).default
|
||||
if (process.argv[2] != "slash"){
|
||||
console.log(chalk.green("open-ticket ready!"))
|
||||
if (config.logs){console.log(chalk.white("\n\nlogs:\n============"))}
|
||||
if (config.status.enabled){
|
||||
client.user.setActivity(config.status.text,{type:config.status.type})
|
||||
this.errorLog.log("debug","client logged in")
|
||||
var statusSet = false
|
||||
const setStatus = (type,text) => {
|
||||
if (statusSet == true) return
|
||||
const getTypeEnum = (text) => {
|
||||
if (text.toLowerCase() == "playing") return discord.ActivityType.Playing
|
||||
else if (text.toLowerCase() == "listening") return discord.ActivityType.Listening
|
||||
else if (text.toLowerCase() == "watching") return discord.ActivityType.Watching
|
||||
else return discord.ActivityType.Listening
|
||||
}
|
||||
client.user.setActivity(text,{type:getTypeEnum(type)})
|
||||
statusSet = true
|
||||
log("system","loaded status",[{key:"type",value:type},{key:"text",value:text}])
|
||||
}
|
||||
this.errorLog.log("debug","bot status loaded")
|
||||
|
||||
const chalk = await (await import("chalk")).default
|
||||
|
||||
if (!process.argv[2]){
|
||||
console.log(chalk.red("WELCOME TO OPEN TICKET!"))
|
||||
this.errorLog.log("debug","loaded console interface")
|
||||
log("info","open ticket ready",[{key:"version",value:require("./package.json").version},{key:"language",value:config.languagefile}])
|
||||
require("./core/utils/liveStatus")()
|
||||
|
||||
console.log(chalk.blue("\n\nlogs:")+"\n============")
|
||||
if (config.status.enabled){
|
||||
setStatus(config.status.type,config.status.text)
|
||||
}
|
||||
|
||||
log("system","bot logged in!")
|
||||
|
||||
await client.guilds.cache.find((g) => g.id == config.server_id).members.fetch()
|
||||
return
|
||||
}
|
||||
|
||||
if (process.argv[2] == "d"){
|
||||
if (config.status.enabled){
|
||||
setStatus(config.status.type,config.status.text)
|
||||
}
|
||||
}
|
||||
|
||||
if (!process.argv[2].startsWith("slash")){
|
||||
console.log(chalk.red("WELCOME TO OPEN TICKET!"))
|
||||
this.errorLog.log("debug","loaded console interface")
|
||||
log("info","open ticket ready",[{key:"version",value:require("./package.json").version},{key:"language",value:config.languagefile}])
|
||||
require("./core/utils/liveStatus")()
|
||||
|
||||
console.log(chalk.blue("\n\nlogs:")+"\n============")
|
||||
if (config.status.enabled){
|
||||
setStatus(config.status.type,config.status.text)
|
||||
}
|
||||
|
||||
log("system","bot logged in!")
|
||||
|
||||
await client.guilds.cache.find((g) => g.id == config.server_id).members.fetch()
|
||||
}else{
|
||||
console.log(chalk.red("STARTING IN ")+chalk.blue("SLASH MODE")+chalk.red("..."))
|
||||
this.errorLog.log("debug","slashmode activated")
|
||||
console.log("logs:\n================")
|
||||
console.log("client logged in...")
|
||||
console.log("loading files...")
|
||||
@@ -44,14 +167,20 @@ client.on('ready',async () => {
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
//load plugins
|
||||
require("./core/api/pluginlauncher")()
|
||||
this.errorLog.log("debug","loading plugins")
|
||||
})
|
||||
if (!require("./core/api/api.json").disable.checkerjs.all) require("./core/checker").checker()
|
||||
this.errorLog.log("debug","loading checker.js")
|
||||
this.errorLog.log("debug","checking config...")
|
||||
|
||||
require("./core/checker").checker()
|
||||
|
||||
if (process.argv[2] != "slash"){
|
||||
var storage = require('./core/dynamicdatabase/storage')
|
||||
exports.storage = storage
|
||||
if (process.argv[2] && process.argv[2].startsWith("slash")){
|
||||
//do nothing
|
||||
}else{
|
||||
|
||||
this.errorLog.log("debug","LOADING COMMANDS")
|
||||
//commands
|
||||
require('./commands/ticket')()
|
||||
require("./commands/help")()
|
||||
@@ -60,66 +189,55 @@ if (process.argv[2] != "slash"){
|
||||
require("./commands/rename")()
|
||||
require("./commands/add")()
|
||||
require("./commands/remove")()
|
||||
require("./commands/reopen")()
|
||||
require("./commands/claim")()
|
||||
require("./commands/unclaim")()
|
||||
|
||||
this.errorLog.log("debug","LOADING CORE")
|
||||
//core
|
||||
require('./core/ticketOpener')()
|
||||
require("./core/ticketCloser").runThis()
|
||||
require("./core/closebuttons")()
|
||||
require('./core/ticketActions/ticketOpener')()
|
||||
require("./core/reactionRoles")()
|
||||
|
||||
/**
|
||||
* We need:
|
||||
* - checker.js
|
||||
*/
|
||||
this.errorLog.log("debug","LOADING INTERACTION HANDLERS")
|
||||
//InteractionHandlers
|
||||
require("./core/interactionHandlers/handlers/handlers")()
|
||||
|
||||
//require("./test")()
|
||||
}
|
||||
|
||||
this.errorLog.log("debug","loading api")
|
||||
const APIEvents = require("./core/api/modules/events")
|
||||
const APIConfig = require("./core/api/api.json")
|
||||
|
||||
//=====================================================================
|
||||
//=====================================================================
|
||||
//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"))
|
||||
})
|
||||
const debugLog = (debugString) => {
|
||||
if (!APIConfig.disable.debug.all && !APIConfig.disable.debug.debuglogs){
|
||||
const content = fs.existsSync("./openticketdebug.txt") ? fs.readFileSync("./openticketdebug.txt").toString() : "==========================\n<OPEN TICKET DEBUG FILE:>\n=========================="
|
||||
fs.writeFileSync("./openticketdebug.txt",content+"\nDEBUG: "+debugString)
|
||||
}
|
||||
}
|
||||
if (errorDebugMode) {
|
||||
const debugLog = (debugString) => {
|
||||
const content = fs.existsSync("./openticketdebug.txt") ? fs.readFileSync("./openticketdebug.txt").toString() : "==========================\n<OPEN TICKET DEBUG FILE:>\n=========================="
|
||||
fs.writeFileSync("./openticketdebug.txt",content+"\nDEBUG: "+debugString)
|
||||
const errorLog = (errorString,stack) => {
|
||||
if (!APIConfig.disable.debug.all){
|
||||
const content = fs.existsSync("./openticketdebug.txt") ? fs.readFileSync("./openticketdebug.txt").toString() : "==========================\n<OPEN TICKET DEBUG FILE:>\n=========================="
|
||||
fs.writeFileSync("./openticketdebug.txt",content+"\nERROR: "+errorString+" STACK: "+stack)
|
||||
}
|
||||
const errorLog = (errorString,stack) => {
|
||||
const content = fs.existsSync("./openticketdebug.txt") ? fs.readFileSync("./openticketdebug.txt").toString() : "==========================\n<OPEN TICKET DEBUG FILE:>\n=========================="
|
||||
fs.writeFileSync("./openticketdebug.txt",content+"\nERROR: "+errorString+" STACK: "+stack)
|
||||
}
|
||||
|
||||
client.on("debug", async (message) => {
|
||||
if (message.startsWith("Provided token:")){
|
||||
debugLog("Provided token: ***********bot token is invisible**************...")
|
||||
return
|
||||
}
|
||||
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) => {
|
||||
const chalk = await (await import("chalk")).default
|
||||
console.log(chalk.red("\nMAIN ERROR: ")+"this error is saved in the debug file!")
|
||||
errorLog(error.name+": "+error.message+" | origin: "+origin,error.stack)
|
||||
})
|
||||
}
|
||||
this.errorLog.log("debug","OT error system loaded successfully")
|
||||
|
||||
client.login(config.auth_token)
|
||||
client.on("debug", async (message) => {
|
||||
if (message.startsWith("Provided token:")){
|
||||
debugLog("Provided token: ***********bot token is invisible**************...")
|
||||
return
|
||||
}
|
||||
debugLog(message)
|
||||
});
|
||||
|
||||
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"))
|
||||
errorLog(error.name+": "+error.message+" | origin: "+origin,error.stack)
|
||||
|
||||
APIEvents.onError(error.name+": "+error.message,new Date())
|
||||
})
|
||||
|
||||
if (!APIBase.embeddedMode) client.login(config.auth_token)
|
||||
this.errorLog.log("debug","login with token")
|
||||
@@ -0,0 +1,83 @@
|
||||
{
|
||||
"errors": {
|
||||
"missingArgsTitle": "قيمة غير صالحة!",
|
||||
"missingArgsDescription": "قيمة مفقودة",
|
||||
"noPermsTitle": "ليس لديك برمشنات !",
|
||||
"noPermsDescription": "أنت بحاجة الى برمشن `ADMINISTRATOR` او أن تكون في قائمة المسموح بهم!",
|
||||
"noPermsDelete": "فقط الإداريين يمكنهم حذف التكت!",
|
||||
"chooseFromListTitle": "Invalid ID",
|
||||
"chooseFromListDescription": "قم بأختيار أحد من الأيديات من الأسفل:",
|
||||
"boterror": "خلل في البوت !",
|
||||
"notInTicketTitle": "انت لست في تكت!",
|
||||
"notInTicketDescription": "هذا الأمر لا يعمل خارج التكت!",
|
||||
"ticketDoesntExist": "هذا التكت لم يعد فعال!",
|
||||
"roleDoesntExist": "خطاً ,لم تعد الرتبة موجوده!",
|
||||
"anotherOption": "هذا الخيار ليس التكت و لكنه شيء أخر!",
|
||||
"maxAmountTitle": "خطأ , تم الوصول الى الحد الأقصى!",
|
||||
"maxAmountDescription": "لقد وصلت الى الحد الأقصى لعدد التكتات المسموحة بها!\nSo لا يمكنك فتح واحدة أخرى!",
|
||||
"somethingWentWrong": "**هناك خطاً!**\nأعد المحاولة لاحقاً!",
|
||||
"somethingWentWrongTranscript": "هناك خطاً في محاولة طبع التكت!**\nأعد المحاولة لاحقاً!"
|
||||
},
|
||||
"commands": {
|
||||
"userAddedTitle": "تم أضافة {0} من المستخدمين في التكت!",
|
||||
"userRemovedTitle": "تم أزالة {0} من المستخدمين من التكت!",
|
||||
"renameTitle": "تم تغيير أسم التكت الى {0}!",
|
||||
"closeTitle": "تم أغلاق التكت!",
|
||||
"deleteTitle": " جاري حذف التكت...",
|
||||
"reopenTitle": "إعادة فتح التكت!",
|
||||
"claimTitle":"This ticket is now claimed to {0}",
|
||||
"unclaimTitle":"This ticket isn't claimed anymore!",
|
||||
|
||||
"ticketWarning": "هذا الأمبد موجود بالفعل في الرسالة بالأسفل!",
|
||||
"maxTicketWarning": "**تحذير:** _يمكنك فقط فتح {0} تكت في الوقت!_"
|
||||
},
|
||||
"helpMenu": {
|
||||
"title": "الأوامر المتاحة:",
|
||||
"header1": "**أذهب الى {0} لإنشاء تذكرة!**\n\n",
|
||||
"header2": "**قم بكتابة أمر `/new` او `/ticket` لفتح تكت!**\n\n",
|
||||
|
||||
"msgCmd": "أنشاء أيمبد مع الأزرار. (الأداريين فقط)",
|
||||
"renameCmd": "إعادة تسمية التكت. (بدون مسافات)",
|
||||
"closeCmd": "أغلاق التكت.",
|
||||
"deleteCmd": "حذف التكت.",
|
||||
"addCmd": "إضافة مستخدم الى التكت.",
|
||||
"removeCmd": "إزالة مستخدم من التكت.",
|
||||
"reopenCmd": "إعادة فتح تكت بعد إغلاقة."
|
||||
},
|
||||
"buttons": {
|
||||
"close": "إغلاق التكت",
|
||||
"delete": "حذف التكت",
|
||||
"reopen": "إعادة فتح التكت",
|
||||
"sendTranscript": "طبع التكت",
|
||||
"closeWithReason":"close with reason"
|
||||
},
|
||||
"messages": {
|
||||
"reopenTitle": "تم إعادة فتح التكت بنجاح!",
|
||||
"reopenDescription": "لا تتردد في فتح التكت مرة أخرى , حظاً موفقاً!",
|
||||
"closedTitle": "تم إغلاق التكت!",
|
||||
"closedDescription": "فقط الأداريين يمكنهم التحدث في هذا التكت الأن!\n\n*أضغط على الزر بالأسفل لحذف التكت او إعادة فتحة مجدداً!*",
|
||||
"createdTitle": "تم إنشاء تكت!",
|
||||
"createdDescription": "تم أنشاء تكت , قم بأنتظار الدعم في الطريق!",
|
||||
|
||||
"newTicketDmTitle": "تكت جديد!",
|
||||
"closedTicketDmTitle": "تم إغلاق التكت!",
|
||||
"deletedTicketDmTitle": "تم حذف التكت!",
|
||||
"closedTicketDmDescription": "تم أغلاق تذكرتك من قبل إداري",
|
||||
"deletedTicketDmDescription": "تم حذف تذكرتك من قبل إداري!",
|
||||
"reopenTicketDmTitle": "تم إعادة فتح تذكرتك!",
|
||||
"reopenTicketDmDescription": "تم إعادة فتح التكت!",
|
||||
"newTranscriptTitle": "توجد نسخة تكت جديدة هنا!",
|
||||
"hereIsTheTranscript": "هذا هي النسخة:",
|
||||
|
||||
"chooseCategory": "أختر الكتقاجوري:",
|
||||
"gettingdeleted": "يتم حذف التكت...",
|
||||
|
||||
"none": "لا يوجد",
|
||||
"reason": "سبب",
|
||||
|
||||
"deletedby":"deleted by",
|
||||
"closedby":"closed by",
|
||||
"modalreason":"What is the reason for closing this ticket?",
|
||||
"chooseATicket": "Choose a ticket"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
{
|
||||
"errors":{
|
||||
"missingArgsTitle":"Invalid Arguments!",
|
||||
"missingArgsDescription":"Missing Argument",
|
||||
"noPermsTitle":"No Permissions!",
|
||||
"noPermsDescription":"You need the `ADMINISTRATOR` permission or be in the list of allowed roles!",
|
||||
"noPermsDelete":"Only admins can delete a ticket!",
|
||||
"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":"Added {0} to this ticket!",
|
||||
"userRemovedTitle":"Removed {0} from this ticket!",
|
||||
"renameTitle":"Changed the name to {0}!",
|
||||
"closeTitle":"Closed this ticket!",
|
||||
"deleteTitle":"Deleting this ticket...",
|
||||
"reopenTitle":"Re-Opened this ticket!",
|
||||
"claimTitle":"This ticket is now claimed to {0}",
|
||||
"unclaimTitle":"This ticket isn't claimed anymore!",
|
||||
|
||||
"ticketWarning":"The embed is in the message below!",
|
||||
"maxTicketWarning":"**Warning:** _You can only create {0} ticket(s) at a time!_"
|
||||
},
|
||||
"helpMenu":{
|
||||
"title":"Available Commands:",
|
||||
"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":"Transcript",
|
||||
"closeWithReason":"close with reason"
|
||||
},
|
||||
"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!",
|
||||
"hereIsTheTranscript":"Here is the transcript:",
|
||||
|
||||
"chooseCategory":"choose a category:",
|
||||
"gettingdeleted":"Ticket is getting deleted...",
|
||||
|
||||
"none":"none",
|
||||
"reason":"reason",
|
||||
|
||||
"deletedby":"deleted by",
|
||||
"closedby":"closed by",
|
||||
"modalreason":"What is the reason for closing this ticket?",
|
||||
"chooseATicket": "Choose a ticket"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
{
|
||||
"errors":{
|
||||
"missingArgsTitle":"Neplatné argumenty",
|
||||
"missingArgsDescription":"Chybí argumenty",
|
||||
"noPermsTitle":"Nemáš práva!",
|
||||
"noPermsDescription":"Nemáš dostatečné práva na tento příkaz!\n Potřebuješ ADMINISTRATOR aby jsi mohl provést příkaz!",
|
||||
"noPermsDelete":"Pouze admin může smazat ticket!",
|
||||
"chooseFromListTitle":"Neplatné ID",
|
||||
"chooseFromListDescription":"Vyber si z těchto ID:",
|
||||
"boterror":"Error!",
|
||||
"notInTicketTitle":"Nejsi v ticketu!",
|
||||
"notInTicketDescription":"Tento příkaz nefunguje mimo tickety!",
|
||||
"ticketDoesntExist":"Tento ticket už bohužel neexistuje!",
|
||||
"roleDoesntExist":"Tato role bohužel neexistuje!",
|
||||
"anotherOption":"Tato možnost není ticket ale něco jiného!",
|
||||
"maxAmountTitle":"Maximální počet ticketů dosažen!",
|
||||
"maxAmountDescription":"Dosáhl jsi maximálního povoleného počtu ticketů!\n Nemůžeš si vytvořit nový!",
|
||||
"somethingWentWrong":"**Něco je špatně**\nProsím zkus to příště znovu!",
|
||||
"somethingWentWrongTranscript":"Něco je špatně s transcriptem!**\nProsím zkus to příště znovu!"
|
||||
},
|
||||
"commands":{
|
||||
"userAddedTitle":"{0} byl přidán do ticketu!",
|
||||
"userRemovedTitle":"{0} byl odebrám z ticketu!",
|
||||
"renameTitle":"Jméno bylo změněno!",
|
||||
"closeTitle":"Zavři tento ticket!",
|
||||
"deleteTitle":"Smaž tento ticket!",
|
||||
"reopenTitle":"Znovu otevři ticket!",
|
||||
"claimTitle":"This ticket is now claimed to {0}",
|
||||
"unclaimTitle":"This ticket isn't claimed anymore!",
|
||||
|
||||
"ticketWarning":"The embed is in the message below!",
|
||||
"maxTicketWarning":"**Varovaní:** _Můžeš si vytvořit použe {0} ticket(s) v jednu chvíli!_"
|
||||
},
|
||||
"helpMenu":{
|
||||
"title":"Příkazy:",
|
||||
"header1":"**Běž {0} vytvořit si ticket!**\n\n",
|
||||
"header2":"**Použij příkaz `/new` nebo `/ticket` k vytvoření ticketu!**\n\n",
|
||||
|
||||
"msgCmd":"Vytvoř možnost otevírat tickety přes tlačítko. (ADMIN)",
|
||||
"renameCmd":"Přejmenovat ticket. (Žádné mezery)",
|
||||
"closeCmd":"Zavři ticket.",
|
||||
"deleteCmd":"Smaž ticket.",
|
||||
"addCmd":"Přidej člena do ticketu.",
|
||||
"removeCmd":"Odebere člena z ticketu.",
|
||||
"reopenCmd":"Znovu otevři ticket po uzavření."
|
||||
},
|
||||
"buttons":{
|
||||
"close":"Zavři ticket",
|
||||
"delete":"Smaž ticket",
|
||||
"reopen":"Znovu otevři ticket",
|
||||
"sendTranscript":"Odešli log ticketu",
|
||||
"closeWithReason":"close with reason"
|
||||
},
|
||||
"messages":{
|
||||
"reopenTitle":"Ticket znovu otevřen!",
|
||||
"reopenDescription":"Cítím se skvěle že si můžeme zase povídat!",
|
||||
"closedTitle":"Zavřený ticket!",
|
||||
"closedDescription":"Pouze admin team zde může nyní komunikovat!\n\n*Klikni na tlačítko níže pro smazání nebo znovu otevření ticketu!*",
|
||||
"createdTitle":"Ticket vytvořen!",
|
||||
"createdDescription":"Váš tiket je vytvořen, můžete ho zjistit pomocí pingu!",
|
||||
|
||||
"newTicketDmTitle":"Nový ticket!",
|
||||
"closedTicketDmTitle":"Ticket uzavřen!",
|
||||
"deletedTicketDmTitle":"Ticket smazán!",
|
||||
"closedTicketDmDescription":"Tvůj ticket byl uzavřen!",
|
||||
"deletedTicketDmDescription":"Tvůj ticket byl smazán!",
|
||||
"reopenTicketDmTitle":"Ticket znovu otevřen!",
|
||||
"reopenTicketDmDescription":"Tvůj ticket byl znovu otevřen!",
|
||||
"newTranscriptTitle":"Nový log ticketu je zde!",
|
||||
"hereIsTheTranscript":"Zde je log:",
|
||||
|
||||
"chooseCategory":"Vyber kategorii:",
|
||||
"gettingdeleted":"Ticket bude smazán",
|
||||
|
||||
"none":"nic",
|
||||
"reason":"důvod",
|
||||
|
||||
"deletedby":"deleted by",
|
||||
"closedby":"closed by",
|
||||
"modalreason":"What is the reason for closing this ticket?",
|
||||
"chooseATicket": "Choose a ticket"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
{
|
||||
"errors":{
|
||||
"missingArgsTitle":"Onjuiste parameters!",
|
||||
"missingArgsDescription":"Er missen parameters",
|
||||
"noPermsTitle":"Geen permissies!",
|
||||
"noPermsDescription":"Je hebt de `ADMINISTRATOR` permissie nodig of je moet in de lijst van toegestane users staan!",
|
||||
"noPermsDelete":"Alleen admins kunnen een ticket verwijderen!",
|
||||
"chooseFromListTitle":"Onjuist ID",
|
||||
"chooseFromListDescription":"Kies een van de id's hier onder:",
|
||||
"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 niet een ticket, maar een ander type!",
|
||||
"maxAmountTitle":"Maximum numer bereikt!",
|
||||
"maxAmountDescription":"Je hebt het maximum aantal openstaande tickets bereikt!\nDus je kan geen nieuwe meer maken!",
|
||||
"somethingWentWrong":"**Iets ging fout!**\nProbeer een andere keer opnieuw!",
|
||||
"somethingWentWrongTranscript":"Iets ging fout terwijl het transcript gemaakt werd!**\nProbeer een andere keer opnieuw!"
|
||||
},
|
||||
"commands":{
|
||||
"userAddedTitle":"{0} is toegevoegd aan dit ticket!",
|
||||
"userRemovedTitle":"{0} is verwijderd van dit ticket!",
|
||||
"renameTitle":"De naam is veranderd naar {0}!",
|
||||
"closeTitle":"Ticket gesloten!",
|
||||
"deleteTitle":"Ticket aan het verwijderen...",
|
||||
"reopenTitle":"Ticket heropend!",
|
||||
"claimTitle":"This ticket is now claimed to {0}",
|
||||
"unclaimTitle":"This ticket isn't claimed anymore!",
|
||||
|
||||
"ticketWarning":"De embed is in het bericht hier onder!",
|
||||
"maxTicketWarning":"**Waarschuwing:** _Je kan maar {0} ticket(s) tegelijkertijd maken!_"
|
||||
},
|
||||
"helpMenu":{
|
||||
"title":"Beschikbare Commands:",
|
||||
"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. (alleen admins)",
|
||||
"renameCmd":"Hernoem een ticket. (geen spaties)",
|
||||
"closeCmd":"Sluit een ticket.",
|
||||
"deleteCmd":"Verijder een ticket.",
|
||||
"addCmd":"Voeg een user aan een ticket.",
|
||||
"removeCmd":"Verwijder een user van een ticket.",
|
||||
"reopenCmd":"Heropen een ticket nadat het gesloten is."
|
||||
},
|
||||
"buttons":{
|
||||
"close":"Sluit Ticket",
|
||||
"delete":"Verwijder Ticket",
|
||||
"reopen":"Heropen Ticket",
|
||||
"sendTranscript":"Transcript",
|
||||
"closeWithReason":"sluit met reden"
|
||||
},
|
||||
"messages":{
|
||||
"reopenTitle":"Ticket heropend!",
|
||||
"reopenDescription":"Voel vrij om weer te praten!",
|
||||
"closedTitle":"Ticket gesloten!",
|
||||
"closedDescription":"Alleen admins kunnen nog praten.\n\n*Klik op de knoppen hieronder voor meer acties!*",
|
||||
"createdTitle":"Ticket Aangemaakt!",
|
||||
"createdDescription":"U 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":"Er is een nieuw transcript!",
|
||||
"hereIsTheTranscript":"Hier is het transcript:",
|
||||
|
||||
"chooseCategory":"kies een categorie:",
|
||||
"gettingdeleted":"Ticket wordt verwijderd...",
|
||||
|
||||
"none":"geen",
|
||||
"reason":"reden",
|
||||
|
||||
"deletedby":"verwijderd door",
|
||||
"closedby":"gesloten door",
|
||||
"modalreason":"Wat is de reden om dit ticket te sluiten?",
|
||||
"chooseATicket": "Kies een ticket"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
{
|
||||
"errors":{
|
||||
"missingArgsTitle":"Invalid Arguments!",
|
||||
"missingArgsDescription":"Missing Argument",
|
||||
"noPermsTitle":"No Permissions!",
|
||||
"noPermsDescription":"You need the `ADMINISTRATOR` permission or be in the list of allowed roles!",
|
||||
"noPermsDelete":"Only admins can delete a ticket!",
|
||||
"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":"Added {0} to this ticket!",
|
||||
"userRemovedTitle":"Removed {0} from this ticket!",
|
||||
"renameTitle":"Changed the name to {0}!",
|
||||
"closeTitle":"Closed this ticket!",
|
||||
"deleteTitle":"Deleting this ticket...",
|
||||
"reopenTitle":"Re-Opened this ticket!",
|
||||
"claimTitle":"This ticket is now claimed to {0}",
|
||||
"unclaimTitle":"This ticket isn't claimed anymore!",
|
||||
|
||||
"ticketWarning":"The embed is in the message below!",
|
||||
"maxTicketWarning":"**Warning:** _You can only create {0} ticket(s) at a time!_"
|
||||
},
|
||||
"helpMenu":{
|
||||
"title":"Available Commands:",
|
||||
"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":"Transcript",
|
||||
"closeWithReason":"close with reason"
|
||||
},
|
||||
"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!",
|
||||
"hereIsTheTranscript":"Here is the transcript:",
|
||||
|
||||
"chooseCategory":"choose a category:",
|
||||
"gettingdeleted":"Ticket is getting deleted...",
|
||||
|
||||
"none":"none",
|
||||
"reason":"reason",
|
||||
|
||||
"deletedby":"deleted by",
|
||||
"closedby":"closed by",
|
||||
"modalreason":"What is the reason for closing this ticket?",
|
||||
"chooseATicket": "Choose a ticket"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
{
|
||||
"errors":{
|
||||
"missingArgsTitle":"Arguments invalides!",
|
||||
"missingArgsDescription":"Argument manquant",
|
||||
"noPermsTitle":"Pas de permissions!",
|
||||
"noPermsDescription":"Vous avez besoin de la permission `ADMINISTRATOR` ou être dans la liste des rôles autorisés!",
|
||||
"noPermsDelete":"Seuls les administrateurs peuvent supprimer un ticket!",
|
||||
"chooseFromListTitle":"Invalid ID",
|
||||
"chooseFromListDescription":"Choisissez l'un des identifiants ci-dessous:",
|
||||
"boterror":"Bot Error!",
|
||||
"notInTicketTitle":"Vous n'êtes pas dans un ticket!",
|
||||
"notInTicketDescription":"Cette commande ne fonctionne pas en dehors des tickets!",
|
||||
"ticketDoesntExist":"Ce ticket n'existe plus!",
|
||||
"roleDoesntExist":"Ce rôle n'existe plus!",
|
||||
"anotherOption":"Cette option n'est pas un ticket mais un autre type!",
|
||||
"maxAmountTitle":"Montant maximum atteint!",
|
||||
"maxAmountDescription":"Vous avez atteint le nombre maximum de tickets autorisés!\nVous ne pouvez donc pas en créer un nouveau!",
|
||||
"somethingWentWrong":"**Quelque chose s'est mal passé!**\nVeuillez réessayer une autre fois!",
|
||||
"somethingWentWrongTranscript":"Une erreur s'est produite lors de la création de la transcription!**\nVeuillez réessayer une autre fois!"
|
||||
},
|
||||
"commands":{
|
||||
"userAddedTitle":"{0} a été ajouté à ce ticket!",
|
||||
"userRemovedTitle":"Supprimé {0} de ce ticket!",
|
||||
"renameTitle":"Changement du nom en {0}!",
|
||||
"closeTitle":"Fermé ce ticket!",
|
||||
"deleteTitle":"Suppression de ce ticket...",
|
||||
"reopenTitle":"A rouvert ce ticket!",
|
||||
"claimTitle":"This ticket is now claimed to {0}",
|
||||
"unclaimTitle":"This ticket isn't claimed anymore!",
|
||||
|
||||
"ticketWarning":"L'intégration est dans le message ci-dessous!",
|
||||
"maxTicketWarning":"**Attention :** _Vous ne pouvez créer que {0} ticket(s) à la fois !_"
|
||||
},
|
||||
"helpMenu":{
|
||||
"title":"Commandes disponibles :",
|
||||
"header1":"**Allez à {0} pour créer un ticket !**\n\n",
|
||||
"header2":"**Exécutez la commande `/new` ou `/ticket` pour créer un ticket !**\n\n",
|
||||
|
||||
"msgCmd":"Faire apparaître une intégration avec des boutons. (administrateurs uniquement)",
|
||||
"renameCmd":"Renommer un ticket. (sans espaces)",
|
||||
"closeCmd":"Fermer un ticket.",
|
||||
"deleteCmd":"Supprimer un billet.",
|
||||
"addCmd":"Ajouter un utilisateur au ticket.",
|
||||
"removeCmd":"Supprimer un utilisateur du ticket.",
|
||||
"reopenCmd":"Rouvrir un ticket après sa clôture."
|
||||
},
|
||||
"buttons":{
|
||||
"close":"Fermer le ticket",
|
||||
"delete":"Supprimer le billet",
|
||||
"reopen":"Billet de réouverture",
|
||||
"sendTranscript":"Transcript",
|
||||
"closeWithReason":"fermer avec une raison"
|
||||
},
|
||||
"messages":{
|
||||
"reopenTitle":"A rouvert ce ticket!",
|
||||
"reopenDescription":"N'hésitez pas à reparler!",
|
||||
"closedTitle":"Fermé ce ticket!",
|
||||
"closedDescription":"Seuls les administrateurs peuvent parler dans ce ticket maintenant !\n\n*Cliquez sur le bouton ci-dessous pour supprimer ou rouvrir ce ticket !*",
|
||||
"createdTitle":"Ticket créé !",
|
||||
"createdDescription":"Votre ticket est créé, vous pouvez le détecter par un ping !",
|
||||
|
||||
"newTicketDmTitle":"Nouveau billet!",
|
||||
"closedTicketDmTitle":"Billet fermé!",
|
||||
"deletedTicketDmTitle":"Billet supprimé !",
|
||||
"closedTicketDmDescription":"Votre billet est fermé !",
|
||||
"deletedTicketDmDescription":"Votre billet est supprimé !",
|
||||
"reopenTicketDmTitle":"Billet rouvert!",
|
||||
"reopenTicketDmDescription":"Votre billet est rouvert !",
|
||||
"newTranscriptTitle":"Une nouvelle transcription est ici!",
|
||||
"hereIsTheTranscript":"Voici la transcription :",
|
||||
|
||||
"chooseCategory":"choisissez une catégorie:",
|
||||
"gettingdeleted":"Le ticket est en cours de suppression...",
|
||||
|
||||
"none":"rien",
|
||||
"reason":"raison",
|
||||
|
||||
"deletedby":"supprimé par",
|
||||
"closedby":"fermé par",
|
||||
"modalreason":"Qu’elle est la raison pour fermer ce ticket?",
|
||||
"chooseATicket": "Choisir un ticket"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
{
|
||||
"errors":{
|
||||
"missingArgsTitle":"Ungültiges Argument!",
|
||||
"missingArgsDescription":"Fehlendes Argument!",
|
||||
"noPermsTitle":"Du hast keine Rechte!",
|
||||
"noPermsDescription":"You need the `ADMINISTRATOR` permission or be in the list of allowed roles!",
|
||||
"noPermsDelete":"Only admins can delete a ticket!",
|
||||
"chooseFromListTitle":"Ungültige ID",
|
||||
"chooseFromListDescription":"Wählen Sie eine der folgenden ID:",
|
||||
"boterror":"Bot Fehler!",
|
||||
"notInTicketTitle":"Du bist ein kein Ticket!",
|
||||
"notInTicketDescription":"Der Befehl funktioniert nicht außerhalb eines Tickets!",
|
||||
"ticketDoesntExist":"Das Ticket Exisitert nicht mehr!",
|
||||
"roleDoesntExist":"Die Rolle Exisitiert nicht mehr!",
|
||||
"anotherOption":"Diese Option ist kein Ticket, sondern eine andere Art!",
|
||||
"maxAmountTitle":"Das Limit wurde erreicht!",
|
||||
"maxAmountDescription":"Sie haben die maximal zulässige Anzahl von Tickets erreicht!\nSie können also keine neue erstellen.!",
|
||||
"somethingWentWrong":"**Etwas ist schief gelaufen!**\nBitte versuchen Sie es ein anderes Mal!",
|
||||
"somethingWentWrongTranscript":"Bei der Erstellung der Transcript ist etwas schief gelaufen!**\nBitte versuchen Sie es ein anderes Mal!"
|
||||
},
|
||||
"commands":{
|
||||
"userAddedTitle":"Added {0} to this ticket!",
|
||||
"userRemovedTitle":"Removed {0} from this ticket!",
|
||||
"renameTitle":"Changed the name to {0}!",
|
||||
"closeTitle":"Closed this ticket!",
|
||||
"deleteTitle":"Deleting this ticket...",
|
||||
"reopenTitle":"Re-Opened this ticket!",
|
||||
"claimTitle":"This ticket is now claimed to {0}",
|
||||
"unclaimTitle":"This ticket isn't claimed anymore!",
|
||||
|
||||
"ticketWarning":"The embed is in the message below!",
|
||||
"maxTicketWarning":"**Warning:** _You can only create {0} ticket(s) at a time!_"
|
||||
},
|
||||
"helpMenu":{
|
||||
"title":"Available Commands:",
|
||||
"header1":"**Gehe zu {0} um ein Ticket zu erstellen!**\n\n",
|
||||
"header2":"**Führen Sie den Befehl `/new` oder `/ticket` um ein Ticket zu erstellen!**\n\n",
|
||||
|
||||
"msgCmd":"Eine Einbettung mit Schaltflächen erzeugen. (nur admins)",
|
||||
"renameCmd":"Ein Ticket umbenennen. (keine Leerzeichen)",
|
||||
"closeCmd":"Schließen Sie ein Ticket.",
|
||||
"deleteCmd":"Ein Ticket löschen.",
|
||||
"addCmd":"Fügen Sie dem Ticket einen Benutzer hinzu.",
|
||||
"removeCmd":"Entfernen eines Benutzers aus dem Ticket.",
|
||||
"reopenCmd":"Öffnen Sie ein Ticket erneut, nachdem es geschlossen wurde."
|
||||
},
|
||||
"buttons":{
|
||||
"close":"Ticket schließen",
|
||||
"delete":"Ticket löschen",
|
||||
"reopen":"Ticket wieder öffnen",
|
||||
"sendTranscript":"Transcript-Datei senden",
|
||||
"closeWithReason":"Geschlossen mit dem Grund"
|
||||
},
|
||||
"messages":{
|
||||
"reopenTitle":"Dieses Ticket wiedereröffnet!",
|
||||
"reopenDescription":"Sie können gerne weiterreden!",
|
||||
"closedTitle":"Dieses Ticket geschlossen!",
|
||||
"closedDescription":"Nur Admins können jetzt in diesem Ticket sprechen!\n\n*Klicken Sie auf die Schaltfläche unten, um dieses Ticket zu löschen oder erneut zu öffnen!*",
|
||||
"createdTitle":"Ticket erstellt!",
|
||||
"createdDescription":"Ihr Ticket ist erstellt, Sie können es durch einen Ping erkennen!",
|
||||
|
||||
"newTicketDmTitle":"Neues Ticket!",
|
||||
"closedTicketDmTitle":"Ticket schließen!",
|
||||
"deletedTicketDmTitle":"Ticket löschen!",
|
||||
"closedTicketDmDescription":"Ihr Ticket ist geschlossen!",
|
||||
"deletedTicketDmDescription":"Ihr Ticket ist gelöscht!",
|
||||
"reopenTicketDmTitle":"Ticket neu Eröffnen!",
|
||||
"reopenTicketDmDescription":"Dein Ticket ist Neu eröffnet!",
|
||||
"newTranscriptTitle":"Eine neue Transscript finden Sie hier!",
|
||||
"hereIsTheTranscript":"Hier ist das Transscript:",
|
||||
|
||||
"chooseCategory":"Wähle eine Kategorie:",
|
||||
"gettingdeleted":"Ticket wird gelöscht...",
|
||||
|
||||
"none":"none",
|
||||
"reason":"reason",
|
||||
|
||||
"deletedby":"Gelöscht von",
|
||||
"closedby":"Geschlossen von",
|
||||
"modalreason":"Was ist der Grund für das schließen des Tickets?",
|
||||
"chooseATicket": "Wähle ein Ticket"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
{
|
||||
"errors":{
|
||||
"missingArgsTitle":"Argomenti non validi!",
|
||||
"missingArgsDescription":"Argomento mancante",
|
||||
"noPermsTitle":"Permessi mancanti!",
|
||||
"noPermsDescription":"Hai bisogno del permesso `ADMINISTRATOR` e essere nella lista dei ruoli accettati!",
|
||||
"noPermsDelete":"Solo gli amministratori possono chiudere un ticket!",
|
||||
"chooseFromListTitle":"ID non valido",
|
||||
"chooseFromListDescription":"Scegli uno degli ID sotto:",
|
||||
"boterror":"Errore del bot!",
|
||||
"notInTicketTitle":"Non sei in un ticket!",
|
||||
"notInTicketDescription":"Questo comando non funziona fuori da un ticket!",
|
||||
"ticketDoesntExist":"Questo ticket non esiste più!",
|
||||
"roleDoesntExist":"Questo ruolo non esiste più!",
|
||||
"anotherOption":"Questa opzione non è di un ticket!",
|
||||
"maxAmountTitle":"Massimo numero raggiunto!",
|
||||
"maxAmountDescription":"Hai raggiunto il massimo numero di ticket consentiti!\nNon puoi crearne altri!",
|
||||
"somethingWentWrong":"**Qualcosa è andato storto!**\nPerfavore riprova un'altra volta!",
|
||||
"somethingWentWrongTranscript":"Qualcosa è andata storta durante la trascrizione!**\nPerfavore riprova un'altra volta!"
|
||||
},
|
||||
"commands":{
|
||||
"userAddedTitle":"Aggiunto {0} al ticket!",
|
||||
"userRemovedTitle":"Rimosso {0} da questo ticket!",
|
||||
"renameTitle":"Cambia il nome in {0}!",
|
||||
"closeTitle":"Chiudo questo ticket!",
|
||||
"deleteTitle":"Eliminando questo ticket...",
|
||||
"reopenTitle":"Ri-Aperto questo ticket!",
|
||||
"claimTitle":"This ticket is now claimed to {0}",
|
||||
"unclaimTitle":"This ticket isn't claimed anymore!",
|
||||
|
||||
"ticketWarning":"L'embed è nel messaggio sotto!",
|
||||
"maxTicketWarning":"**Attenzione:** _Tu puoi creare solo {0} ticket(s) per volta!_"
|
||||
},
|
||||
"helpMenu":{
|
||||
"title":"Comandi disponibili:",
|
||||
"header1":"**Vai a {0} per creare un ticket!**\n\n",
|
||||
"header2":"**Esegui il comando `/new` o `/ticket` per creare un ticket!**\n\n",
|
||||
|
||||
"msgCmd":"Crea un embed con pulsanti. (solo amministratori)",
|
||||
"renameCmd":"Rinomina un ticket. (senza spazi)",
|
||||
"closeCmd":"Chiudi un ticket.",
|
||||
"deleteCmd":"Elimina un ticket.",
|
||||
"addCmd":"Aggiungi un membro al ticket.",
|
||||
"removeCmd":"Rimuovi un membro dal ticket.",
|
||||
"reopenCmd":"Riapri un ticket dopo averlo chiuso."
|
||||
},
|
||||
"buttons":{
|
||||
"close":"Chiudi il ticket",
|
||||
"delete":"Elimina il ticket",
|
||||
"reopen":"Riapri il ticket",
|
||||
"sendTranscript":"Trascrizione",
|
||||
"closeWithReason":"chiudi con un motivo"
|
||||
},
|
||||
"messages":{
|
||||
"reopenTitle":"Riaperto questo ticket!",
|
||||
"reopenDescription":"Sentiti libero di parlare di nuovo!",
|
||||
"closedTitle":"Chiudo questo ticket!",
|
||||
"closedDescription":"Solo gli amministratori possono parlare in questo ticket ora!\n\n*Clicca sul bottone sotto per chiudere o riaprire questo ticket!*",
|
||||
"createdTitle":"Ticket creato!",
|
||||
"createdDescription":"Il tuo ticket è stato creato, puoi capirlo dal ping!",
|
||||
|
||||
"newTicketDmTitle":"Nuovo ticket!",
|
||||
"closedTicketDmTitle":"Ticket chiuso!",
|
||||
"deletedTicketDmTitle":"Ticket eliminato!",
|
||||
"closedTicketDmDescription":"Il tuo ticket è chiuso!",
|
||||
"deletedTicketDmDescription":"Il tuo ticket è stato eliminato!",
|
||||
"reopenTicketDmTitle":"Ticket riaperto!",
|
||||
"reopenTicketDmDescription":"Il tuo ticket è stato riaperto!",
|
||||
"newTranscriptTitle":"Un nuova trascrizione è qui!",
|
||||
"hereIsTheTranscript":"Qui è la trascrizione:",
|
||||
|
||||
"chooseCategory":"scegli una categoria:",
|
||||
"gettingdeleted":"Il ticket sta per essere chiuso...",
|
||||
|
||||
"none":"nessuno",
|
||||
"reason":"motivo",
|
||||
|
||||
"deletedby":"eliminato da",
|
||||
"closedby":"chiuso da",
|
||||
"modalreason":"Quale'è il motivo per chiudere il ticket?",
|
||||
"chooseATicket": "Scegli un ticket"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
{
|
||||
"errors":{
|
||||
"missingArgsTitle":"Argumentos inválidos!",
|
||||
"missingArgsDescription":"Argumento ausente",
|
||||
"noPermsTitle":"Sem permissões!",
|
||||
"noPermsDescription":"Você precisa da permissão `ADMINISTRATOR` ou estar na lista de funções permitidas!",
|
||||
"noPermsDelete":"Somente administradores podem deletar um ticket!",
|
||||
"chooseFromListTitle":"ID inválido",
|
||||
"chooseFromListDescription":"Escolha um dos IDs abaixo:",
|
||||
"boterror":"Erro de bot!",
|
||||
"notInTicketTitle":"Você não está em um ticket!",
|
||||
"notInTicketDescription":"Este comando não funciona fora dos tickets!",
|
||||
"ticketDoesntExist":"Este ticket não existe mais!",
|
||||
"roleDoesntExist":"Esta função não existe mais!",
|
||||
"anotherOption":"Esta opção não é um ticket, mas sim outro tipo!",
|
||||
"maxAmountTitle":"Quantidade máxima atingida!",
|
||||
"maxAmountDescription":"Você atingiu o número máximo de tickets permitidos!\nEntão você não pode criar um novo!",
|
||||
"somethingWentWrong":"**Algo deu errado!**\nPor favor, tente novamente outra vez!",
|
||||
"somethingWentWrongTranscript":"Algo deu errado ao fazer a transcrição!**\nPor favor, tente novamente outra vez!"
|
||||
},
|
||||
"commands":{
|
||||
"userAddedTitle":"Adicionado {0} a este ticket!",
|
||||
"userRemovedTitle":"Removido {0} deste ticket!",
|
||||
"renameTitle":"Mudou o nome para {0}!",
|
||||
"closeTitle":"Fechado este ticket!",
|
||||
"deleteTitle":"Excluindo este ticket...",
|
||||
"reopenTitle":"Reabriu este ticket!",
|
||||
"claimTitle":"This ticket is now claimed to {0}",
|
||||
"unclaimTitle":"This ticket isn't claimed anymore!",
|
||||
|
||||
"ticketWarning":"A incorporação está na mensagem abaixo!",
|
||||
"maxTicketWarning":"**Cuidado:** _Você só pode criar {0} ticket(s) de cada vez!!_"
|
||||
},
|
||||
"helpMenu":{
|
||||
"title":"Comandos Disponíveis:",
|
||||
"header1":"**Vá para {0} para criar um ticket!**\n\n",
|
||||
"header2":"**Execute o comando `/new` ou `/ticket` para criar um ticket!**\n\n",
|
||||
|
||||
"msgCmd":"Gerar uma incorporação com botões. (somente administradores)",
|
||||
"renameCmd":"Renomear um ticket. (sem espaços)",
|
||||
"closeCmd":"Fechar um ticket.",
|
||||
"deleteCmd":"Excluir um ticket.",
|
||||
"addCmd":"Adicionar um usuário ao ticket.",
|
||||
"removeCmd":"Remover um usuário do ticket.",
|
||||
"reopenCmd":"Reabra um ticket depois que ele foi fechado."
|
||||
},
|
||||
"buttons":{
|
||||
"close":"Fechar Ticket",
|
||||
"delete":"Excluir Ticket",
|
||||
"reopen":"Reabrir Ticket",
|
||||
"sendTranscript":"Transcrição",
|
||||
"closeWithReason":"close with reason"
|
||||
},
|
||||
"messages":{
|
||||
"reopenTitle":"Reabriu este ticket!",
|
||||
"reopenDescription":"Sinta-se à vontade para falar novamente!",
|
||||
"closedTitle":"Fechado este ticket!",
|
||||
"closedDescription":"Somente administradores podem falar neste ticket agora!\n\n*Clique no botão abaixo para excluir ou reabrir este ticket!*",
|
||||
"createdTitle":"Ticket criado!",
|
||||
"createdDescription":"Seu ticket foi criado, você pode detectá-lo com um ping!",
|
||||
|
||||
"newTicketDmTitle":"Novo Ticket!",
|
||||
"closedTicketDmTitle":"Ticket fechado!",
|
||||
"deletedTicketDmTitle":"Ticket excluído!",
|
||||
"closedTicketDmDescription":"Seu ticket está fechado!",
|
||||
"deletedTicketDmDescription":"Seu bilhete foi excluído!",
|
||||
"reopenTicketDmTitle":"Ticket reaberto!",
|
||||
"reopenTicketDmDescription":"Seu ticket foi reaberto!",
|
||||
"newTranscriptTitle":"Uma nova transcrição está aqui!",
|
||||
"hereIsTheTranscript":"Aqui está a transcrição:",
|
||||
|
||||
"chooseCategory":"Escolha a categoria:",
|
||||
"gettingdeleted":"Ticket está sendo deletado...",
|
||||
|
||||
"none":"none",
|
||||
"reason":"reason",
|
||||
|
||||
"deletedby":"deleted by",
|
||||
"closedby":"closed by",
|
||||
"modalreason":"What is the reason for closing this ticket?",
|
||||
"chooseATicket": "Choose a ticket"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
{
|
||||
"errors":{
|
||||
"missingArgsTitle":"Argumente Invalide",
|
||||
"missingArgsDescription":"Argument Lipsa",
|
||||
"noPermsTitle":"Nu ai permisiunea necesara!",
|
||||
"noPermsDescription":"Ai nevoie de permisiunea de `ADMINISTRATOR`!",
|
||||
"noPermsDelete":"Doar adminii pot inchide un ticket!",
|
||||
"chooseFromListTitle":"Invalid ID",
|
||||
"chooseFromListDescription":"Alege unul dintre id-urile urmatoare:",
|
||||
"boterror":"Eroare bot!",
|
||||
"notInTicketTitle":"Nu esti intr-un ticket!",
|
||||
"notInTicketDescription":"Aceasta comanda nu merge inafara unui ticket!",
|
||||
"ticketDoesntExist":"Acest ticket nu mai exista!",
|
||||
"roleDoesntExist":"Acest rol nu mai exista!",
|
||||
"anotherOption":"Aceasta optiune este altceva decat un tip de ticket!",
|
||||
"maxAmountTitle":"Limita atinsa!",
|
||||
"maxAmountDescription":"Ai atins limita de tickets!\nAsa ca nu mai poti creea altele noi!",
|
||||
"somethingWentWrong":"**Ceva nu a mers bine!**\nTe rugam sa incerci mai tarziu!",
|
||||
"somethingWentWrongTranscript":"Ceva nu aa mers bine in timpul creeari transcript-ului!**\nTe rugam sa incerci mai tarziu!"
|
||||
},
|
||||
"commands":{
|
||||
"userAddedTitle":"{0} a fost adaugat in acest ticket!",
|
||||
"userRemovedTitle":"{0} a fost scos din acest ticket!",
|
||||
"renameTitle":"Nume schimbat in {0}!",
|
||||
"closeTitle":"Ticket inchis!",
|
||||
"deleteTitle":"Se sterge ticket-ul...",
|
||||
"reopenTitle":"Ticket Re-deschis!",
|
||||
"claimTitle":"This ticket is now claimed to {0}",
|
||||
"unclaimTitle":"This ticket isn't claimed anymore!",
|
||||
|
||||
"ticketWarning":"Embed-ul se afla in mesajul de mai jos!",
|
||||
"maxTicketWarning":"**Avertizare:** _Poti creea doar {0} tickete active!_"
|
||||
},
|
||||
"helpMenu":{
|
||||
"title":"Comenzi disponibile:",
|
||||
"header1":"**Mergi la {0} pentru a creea un ticket!**\n\n",
|
||||
"header2":"**Ruleaza comanda `/new` ori `/ticket` pentru a creea un ticket!**\n\n",
|
||||
|
||||
"msgCmd":"Trimite embed-ul cu tickete. (doar admini)",
|
||||
"renameCmd":"Redenumeste un ticket. (fara spatii)",
|
||||
"closeCmd":"Inchide un ticket.",
|
||||
"deleteCmd":"Sterge un ticket.",
|
||||
"addCmd":"Adauga un utilizator in ticket.",
|
||||
"removeCmd":"Sterge un utilizator din ticket.",
|
||||
"reopenCmd":"Re-deschide un ticket dupa ce a fost deschis."
|
||||
},
|
||||
"buttons":{
|
||||
"close":"Inchide ticket-ul",
|
||||
"delete":"Sterge ticket-ul",
|
||||
"reopen":"Re-deschide un ticket",
|
||||
"sendTranscript":"Transcript",
|
||||
"closeWithReason":"Inchide cu motiv"
|
||||
},
|
||||
"messages":{
|
||||
"reopenTitle":"Ticket Re-deschis!",
|
||||
"reopenDescription":"Poti vorbi din nou!",
|
||||
"closedTitle":"Ticket inchis!",
|
||||
"closedDescription":"Doar adminii pot vorbi in acest ticket acum!\n\n*Apasa pe butonul de mai jos pentru a re-deschide ori sterge ticket-ul!*",
|
||||
"createdTitle":"Ticket Creat!",
|
||||
"createdDescription":"Ticket-ul tau a fost creat, poti sa il vezi in canalul pe care ai fost mentionat!",
|
||||
|
||||
"newTicketDmTitle":"Ticket nou!",
|
||||
"closedTicketDmTitle":"Ticket Inchis!",
|
||||
"deletedTicketDmTitle":"Ticket Sters!",
|
||||
"closedTicketDmDescription":"Ticket-ul tau este inchis!",
|
||||
"deletedTicketDmDescription":"Ticket-ul tau este sters!",
|
||||
"reopenTicketDmTitle":"Ticket Re-deschis!",
|
||||
"reopenTicketDmDescription":"Ticket-ul tau este re-deschis!",
|
||||
"newTranscriptTitle":"Un nou transcript este aici!",
|
||||
"hereIsTheTranscript":"Aici este transcriptul:",
|
||||
|
||||
"chooseCategory":"Alege o categorie:",
|
||||
"gettingdeleted":"Ticket-ul se sterge...",
|
||||
|
||||
"none":"niciunul",
|
||||
"reason":"Motiv",
|
||||
|
||||
"deletedby":"Sters de",
|
||||
"closedby":"Inchis de",
|
||||
"modalreason":"Care este motivul pentru inchiderea acestui ticket?",
|
||||
"chooseATicket": "Alege un ticket"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
{
|
||||
"examples":{
|
||||
"en-GB":"english",
|
||||
"en-US":"english",
|
||||
"nl":"dutch",
|
||||
"ro":"romanian",
|
||||
"de":"german",
|
||||
"cs":"czech",
|
||||
"fr":"french",
|
||||
"es-ES":"spanish",
|
||||
"it":"italian",
|
||||
|
||||
"MISSING":"arabic,portuguese",
|
||||
"NOTAVAILABLE":"arabic,portuguese,czech"
|
||||
},
|
||||
"data":{
|
||||
"help":{
|
||||
"en-GB":"A list of the available commands.",
|
||||
"en-US":"A list of the available commands.",
|
||||
"nl":"Een lijst met de beschikbare commands.",
|
||||
"ro":"O lista a comenzilor disponibile.",
|
||||
"de":"Eine Liste der verfügbaren Befehle.",
|
||||
"cs":"A list of the available commands",
|
||||
"fr":"Une liste des commandes.",
|
||||
"es-ES":"Una lista de los comandos disponibles.",
|
||||
"it":"Una lista di tutti i comandi disponibili."
|
||||
},
|
||||
"message":{
|
||||
"en-GB":"Spawn an embed with buttons.",
|
||||
"en-US":"Spawn an embed with buttons.",
|
||||
"nl":"Spawn een embed met knoppen.",
|
||||
"ro":"Deschide un embed cu butoane.",
|
||||
"de":"Sendet ein Embed mit Knöpfen.",
|
||||
"cs":"Spawn an embed with buttons.",
|
||||
"fr":"Créer un embed avec des boutons.",
|
||||
"es-ES":"Genera un embed con botones.",
|
||||
"it":"Genera un embed con un pulsante."
|
||||
},
|
||||
"close":{
|
||||
"en-GB":"Close a ticket.",
|
||||
"en-US":"Close a ticket.",
|
||||
"nl":"Sluit een ticket",
|
||||
"ro":"Inchide un ticket.",
|
||||
"de":"Schließe ein Ticket.",
|
||||
"cs":"Close a ticket.",
|
||||
"fr":"Fermer un ticket.",
|
||||
"es-ES":"Cierra un ticket.",
|
||||
"it":"Chiudi un ticket."
|
||||
},
|
||||
"delete":{
|
||||
"en-GB":"Delete a ticket.",
|
||||
"en-US":"Delete a ticket.",
|
||||
"nl":"Verwijder een ticket",
|
||||
"ro":"Sterge un ticket.",
|
||||
"de":"Lösche ein Ticket.",
|
||||
"cs":"Delete a ticket.",
|
||||
"fr":"Supprimer un ticket.",
|
||||
"es-ES":"Elimina un ticket.",
|
||||
"it":"Elimina un ticket."
|
||||
},
|
||||
"reopen":{
|
||||
"en-GB":"Re-Open a ticket.",
|
||||
"en-US":"Re-Open a ticket.",
|
||||
"nl":"Heropen een ticket.",
|
||||
"ro":"Re-deschide un ticket.",
|
||||
"de":"Wiedereröffnung eines Tickets.",
|
||||
"cs":"Re-Open a ticket.",
|
||||
"fr":"Re-ouvrir un ticket.",
|
||||
"es-ES":"Re-abre un ticket.",
|
||||
"it":"Ri-Apri un ticket."
|
||||
},
|
||||
"add":{
|
||||
"en-GB":"Add another user to a ticket.",
|
||||
"en-US":"Add another user to a ticket.",
|
||||
"nl":"Voeg een andere user toe aan een ticket.",
|
||||
"ro":"Adauga un utilizator la acest ticket.",
|
||||
"de":"Füge einen anderen Nutzer zum Ticket hinzu.",
|
||||
"cs":"Add another user to a ticket.",
|
||||
"fr":"Ajouter un utilisateur au ticket.",
|
||||
"es-ES":"Agrega otro usuario al ticket.",
|
||||
"it":"Aggiungi un membro al ticket"
|
||||
},
|
||||
"remove":{
|
||||
"en-GB":"Remove a user from a ticket.",
|
||||
"en-US":"Remove a user from a ticket.",
|
||||
"nl":"Verwijder een user van een ticket.",
|
||||
"ro":"Sterge un utilizator dintr-un ticket.",
|
||||
"de":"Entferne einen Nutzer von dem Ticket.",
|
||||
"cs":"Remove a user from a ticket.",
|
||||
"fr":"Enlever quelqu’un du ticket.",
|
||||
"es-ES":"Elimina otro usuario del ticket.",
|
||||
"it":"Rimuovi un membro dal ticket"
|
||||
},
|
||||
"newticket":{
|
||||
"en-GB":"Create a ticket",
|
||||
"en-US":"Create a ticket",
|
||||
"nl":"Maak een ticket aan",
|
||||
"ro":"Creeaza un ticket.",
|
||||
"de":"Erstelle ein Ticket.",
|
||||
"cs":"Create a ticket",
|
||||
"fr":"Créer un ticket",
|
||||
"es-ES":"Crear un ticket.",
|
||||
"it":"Crea un ticket"
|
||||
},
|
||||
"rename":{
|
||||
"en-GB":"Rename a ticket channel.",
|
||||
"en-US":"Rename a ticket channel.",
|
||||
"nl":"Hernoem een ticket channel.",
|
||||
"ro":"Redenumeste un ticket.",
|
||||
"de":"Benenne einen Ticket Channel.",
|
||||
"cs":"Rename a ticket channel",
|
||||
"fr":"Renommer un ticket.",
|
||||
"es-ES":"Renombrar un canal de ticket.",
|
||||
"it":"Rinomina il canale di un ticket."
|
||||
},
|
||||
"claim":{
|
||||
"en-GB":"",
|
||||
"en-US":"",
|
||||
"nl":"",
|
||||
"ro":"",
|
||||
"de":"",
|
||||
"cs":"",
|
||||
"fr":"",
|
||||
"es-ES":"",
|
||||
"it":""
|
||||
},
|
||||
"unclaim":{
|
||||
"en-GB":"",
|
||||
"en-US":"",
|
||||
"nl":"",
|
||||
"ro":"",
|
||||
"de":"",
|
||||
"cs":"",
|
||||
"fr":"",
|
||||
"es-ES":"",
|
||||
"it":""
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
{
|
||||
"errors":{
|
||||
"missingArgsTitle":"¡Argumentos inválidos!",
|
||||
"missingArgsDescription":"Argumento faltante.",
|
||||
"noPermsTitle":"¡Sin permisos!",
|
||||
"noPermsDescription":"Necesitas el permiso de `ADMINISTRADOR` o estar en la lista de roles permitidos!",
|
||||
"noPermsDelete":"Solo los administradores pueden eliminar un ticket.!",
|
||||
"chooseFromListTitle":"ID Invalida",
|
||||
"chooseFromListDescription":"Elije una de las ID de abajo:",
|
||||
"boterror":"¡Error del bot!",
|
||||
"notInTicketTitle":"¡No te encuentras en un ticket!",
|
||||
"notInTicketDescription":"¡Este comando no funciona fuera de los tickets!",
|
||||
"ticketDoesntExist":"¡Este ticket no existe!",
|
||||
"roleDoesntExist":"¡Este rol no existe!",
|
||||
"anotherOption":"¡Esta opción no es un ticket, si no otra cosa!",
|
||||
"maxAmountTitle":"¡Máxima cantidad alcanzada!",
|
||||
"maxAmountDescription":"¡Has alcanzado la máxima cantidad de tickets permitida!\n¡Por lo que no puedes crear otro!",
|
||||
"somethingWentWrong":"**¡Algo salió mal!**\n¡Prueba dentro de un rato!",
|
||||
"somethingWentWrongTranscript":"**¡Algo salió mal al hacer el transcript!**\n¡Prueba en otro momento!"
|
||||
},
|
||||
"commands":{
|
||||
"userAddedTitle":"Se agregó {0} al ticket!",
|
||||
"userRemovedTitle":"Se eliminó {0} del ticket!",
|
||||
"renameTitle":"Cambió el nombre a {0}!",
|
||||
"closeTitle":"Cerró este ticket!",
|
||||
"deleteTitle":"Eliminando este ticket...",
|
||||
"reopenTitle":"Re-abrió este boleto!",
|
||||
"claimTitle":"This ticket is now claimed to {0}",
|
||||
"unclaimTitle":"This ticket isn't claimed anymore!",
|
||||
|
||||
"ticketWarning":"La inserción está en el mensaje a continuación!",
|
||||
"maxTicketWarning":"**Advertencia:** _Solo puedes crear {0} ticket(s) a la vez!_"
|
||||
},
|
||||
"helpMenu":{
|
||||
"title":"Comandos disponibles:",
|
||||
"header1":"**¡Dirígete a {0} para crear un nuevo ticket!**\n\n",
|
||||
"header2":"**¡Ejecuta el comando `/new` o `/ticket` para crear un ticket!**\n\n",
|
||||
|
||||
"msgCmd":"Generar un embed con botones. (Solo admins)",
|
||||
"renameCmd":"Renombrar un ticket. (Sin espacios)",
|
||||
"closeCmd":"Cerrar un ticket.",
|
||||
"deleteCmd":"Eliminar un ticket.",
|
||||
"addCmd":"Agregar un usuario al ticket.",
|
||||
"removeCmd":"Eliminar un usuario del ticket.",
|
||||
"reopenCmd":"Re-Abre un ticket después de que este se vea cerrado."
|
||||
},
|
||||
"buttons":{
|
||||
"close":"Cerrar ticket.",
|
||||
"delete":"Eliminar ticket",
|
||||
"reopen":"Re-Abrir ticket",
|
||||
"sendTranscript":"Obtener transcript.",
|
||||
"closeWithReason":"cerrar con razón"
|
||||
},
|
||||
"messages":{
|
||||
"reopenTitle":"¡Ticket Re-Abierto!",
|
||||
"reopenDescription":"¡Siéntete libre de hablar de nuevo!",
|
||||
"closedTitle":"¡Ticket cerrado!",
|
||||
"closedDescription":"¡Solo admins pueden hablar ahora en este ticket!\n\n*¡Presiona en el botón de abajo para eliminar o re-abrir el ticket!*",
|
||||
"createdTitle":"¡Ticket creado!",
|
||||
"createdDescription":"¡Ticket creado, también te he mencionado en él!",
|
||||
|
||||
"newTicketDmTitle":"¡Nuevo ticket!",
|
||||
"closedTicketDmTitle":"¡Ticket cerrado!",
|
||||
"deletedTicketDmTitle":"¡Ticket eliminado!",
|
||||
"closedTicketDmDescription":"¡Tu ticket fué cerrado!",
|
||||
"deletedTicketDmDescription":"¡Tu ticket fué eliminado!",
|
||||
"reopenTicketDmTitle":"¡Ticket re-abierto!",
|
||||
"reopenTicketDmDescription":"¡Tu ticket se vió abierto de nuevo!",
|
||||
"newTranscriptTitle":"¡Un nuevo transcript está aquí!",
|
||||
"hereIsTheTranscript":"Aquí está el transcript:",
|
||||
|
||||
"chooseCategory":"Elije una categoría:",
|
||||
"gettingdeleted":"El ticket se está viendo eliminado...",
|
||||
|
||||
"none":"Ninguna.",
|
||||
"reason":"Razón",
|
||||
|
||||
"deletedby":"eliminado por",
|
||||
"closedby":"cerrado por",
|
||||
"modalreason":"Cúal es la razón para cerrar este ticket?",
|
||||
"chooseATicket": "Elije un ticket"
|
||||
}
|
||||
}
|
||||
+4
-3
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "open-ticket",
|
||||
"version": "2.0.0",
|
||||
"version": "3.0.0",
|
||||
"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",
|
||||
"scripts": {
|
||||
"start": "node index.js",
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"test": "node index.js d",
|
||||
"slashEnable": "node index.js slash enable",
|
||||
"slashDisable": "node index.js slash disable",
|
||||
"cleardata": "node ./core/dynamicdatabase/cleardata.js"
|
||||
@@ -13,8 +13,9 @@
|
||||
"author": "DJdj Development",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"axios": "^0.27.2",
|
||||
"chalk": "^5.0.1",
|
||||
"discord.js": "^13.6.0",
|
||||
"discord.js": "^14.0.2",
|
||||
"express": "^4.17.1",
|
||||
"node": "^16.10.0",
|
||||
"node-localstorage": "^2.2.1"
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
const discord = require("discord.js")
|
||||
const api = require("../core/api/api.js")
|
||||
|
||||
module.exports = () => {
|
||||
const {client,config,events,utils,actions} = api
|
||||
|
||||
//this code will run when the bot starts!
|
||||
|
||||
//in this example, we will say "hello" in the console when someone opens a ticket!
|
||||
|
||||
/**
|
||||
|
||||
events.onTicketOpen((user,channel,guild,date,ticketdata) => {
|
||||
console.log("hello, someone opened a ticket!")
|
||||
})
|
||||
|
||||
|
||||
*/
|
||||
}
|
||||
Vendored
BIN
Binary file not shown.
Reference in New Issue
Block a user