Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8981c9e60e | ||
|
|
4a90a2d19a | ||
|
|
49b71ecdc6 | ||
|
|
af1c3288c0 | ||
|
|
7d89ac713b | ||
|
|
1fb8ece6ff | ||
|
|
001ae9f86a | ||
|
|
7c15812253 |
@@ -0,0 +1,2 @@
|
||||
node_modules/
|
||||
package-lock.json
|
||||
@@ -1,128 +0,0 @@
|
||||
# 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
|
||||
.
|
||||
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.
|
||||
@@ -1,7 +1,7 @@
|
||||
# open-ticket
|
||||
This is an open-source discord ticket bot, you can configure it and it comes with cool features like a transcript.
|
||||
This is an open-source discord ticket bot, you can configure it and it comes with cool features like transcripts & custom options!
|
||||
|
||||
(WARNING: the bot's language is Dutch, there will be an English version soon!)
|
||||
<img src="logo.png" alt="Open Ticket logo" style="height: 300px; width:300px;"/>
|
||||
|
||||
## features
|
||||
- discord interaction buttons
|
||||
@@ -9,6 +9,10 @@ This is an open-source discord ticket bot, you can configure it and it comes wit
|
||||
- add/remove users from ticket
|
||||
- custom colors & name
|
||||
- has tickets for questions, partners & job applications
|
||||
- uses discord.js 13
|
||||
- configure your own ticket options
|
||||
- remove credits if you want
|
||||
|
||||
|
||||
## installation
|
||||
You need `node.js 16` to run this project, if you don't want to install `node.js 16` then there is a npm package that can help you.
|
||||
@@ -32,27 +36,50 @@ _npm install node@16_
|
||||
## 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.
|
||||
if there are any errors, you can open an **issue on github** or **contact me in the discord server**.
|
||||
|
||||
### config (required)
|
||||
=> main config
|
||||
- `server_name` => the name from your server.
|
||||
- `server_logo`=> the logo from your server.
|
||||
- `bot_name`=> the bot's name.
|
||||
- `main_color`=> the color used in all embeds.
|
||||
- `auth_token`=> the bot's token (Discord Developer Portal)
|
||||
- `botperms_role`=> the id from a role that can run admin commands with the bot.
|
||||
- `ticket_msg/ticket_channel` => the channel where you are gonna put the !ticket msg.
|
||||
- `ticket_system/ticket_category` => the category for tickets.
|
||||
- `ticket_system/member_role` => this role doesn't have access to tickets
|
||||
(WARNING: @everyone does have access to tickets, so make sure all members have a member role!).
|
||||
- `ticket_system/transcript_channel` => the channel for transcripts.
|
||||
- `prefix`=> the bot's prefix.
|
||||
|
||||
### intents
|
||||
- `credits_please-do-not-remove` => remove the credits or not
|
||||
|
||||
=> status config
|
||||
- `status/type` => PLAYING | STREAMING | LISTENING | WATCHING | CUSTOM | COMPETING
|
||||
- `status/text` => the status text
|
||||
|
||||
=> ticket system config
|
||||
- `system/ticket_channel` => the channel where you are going to put the !ticket msg.
|
||||
- `system/ticket_category` => the category for tickets.
|
||||
- `system/member_role` => this role doesn't have access to tickets
|
||||
(WARNING: @everyone does have access to tickets, so make sure all members have a member role!).
|
||||
- `system/transcript_channel` => the channel for transcripts.
|
||||
- `system/enable_transcripts` => enable transcripts.
|
||||
- `system/enable_category` => enable tickets in category.
|
||||
|
||||
=> ticket options config
|
||||
- `options/ticket.../enabled` => set this option TRUE or FALSE.
|
||||
- `options/ticket.../icon` => set an emoji for this ticket option.
|
||||
- `options/ticket.../description` => set a description for this ticket option.
|
||||
- `options/ticket.../name` => set a name for this ticket option.
|
||||
- `options/ticket.../channel_prefix` => this will be the prefix for channel names (empty is disabled!)
|
||||
|
||||
### 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`
|
||||
|
||||
The bot needs `ADMINISTRATOR` permissions to work the best.
|
||||
|
||||
## credits
|
||||
the package contains a license, there are also credits in the bot. It is forbidden to extract these licenses and credits from it!
|
||||
Please don't remove the credits from the bot 😊.
|
||||
|
||||
_v1.2.2_
|
||||
|
||||
© 2021 - DJdj Development | [website](https://www.dj-dj.be) | [discord](https://discord.com/invite/26vT9wt3n3)
|
||||
@@ -0,0 +1,22 @@
|
||||
const discord = require('discord.js')
|
||||
const bot = require('../index')
|
||||
const client = bot.client
|
||||
const config = require("../config.json")
|
||||
|
||||
|
||||
module.exports = () => {
|
||||
client.on("messageCreate",(msg) => {
|
||||
var args = msg.content.split(" ")
|
||||
if (args[0] == config.prefix+"resetdatabase"){
|
||||
if (msg.author.id == client.application.owner.id){
|
||||
const databaseEmbed = new discord.MessageEmbed()
|
||||
.setColor(config.main_color)
|
||||
.setTitle("How to reset the database:")
|
||||
.setDescription("1: Go to the folder `./storage` in your bot's directory.\n\n2: If posible remove the folders\n`./tickets`, `./transcripts` & `./userTickets`\nfrom the folder `./storage`\n\n3: Restart the bot")
|
||||
.setFooter("if it doesn't work, create an issue on github or DM me on discord!")
|
||||
|
||||
msg.channel.send({embeds:[databaseEmbed]})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
+44
-16
@@ -3,45 +3,73 @@ const bot = require('../index')
|
||||
const client = bot.client
|
||||
const config = require("../config.json")
|
||||
|
||||
var name = require('./ticketExtra').name
|
||||
var stringDecoder = require('./ticketSystem').stringDecoder
|
||||
|
||||
|
||||
module.exports = () => {
|
||||
client.on("messageCreate", msg => {
|
||||
if (msg.content == "!ticket msg"){
|
||||
if (msg.content == config.prefix+"ticket msg"){
|
||||
if (msg.member.roles.cache.has(config.botperms_role) == false && msg.author.id != "779742674932072469"){
|
||||
msg.channel.send({content:"Je hebt geen permissions voor deze command!"})
|
||||
msg.channel.send({content:"You don't have permissons for this command!"})
|
||||
return
|
||||
}
|
||||
|
||||
var ticketButton = new discord.MessageActionRow()
|
||||
.addComponents(
|
||||
|
||||
|
||||
if (config.options.ticket1.enabled){
|
||||
ticketButton.addComponents(
|
||||
new discord.MessageButton()
|
||||
.setCustomId("newTicketVraag")
|
||||
.setCustomId("newTicket1")
|
||||
.setDisabled(false)
|
||||
.setStyle("SECONDARY")
|
||||
.setEmoji("❓")
|
||||
.setEmoji(config.options.ticket1.icon)
|
||||
)
|
||||
.addComponents(
|
||||
}
|
||||
|
||||
if (config.options.ticket2.enabled){
|
||||
ticketButton.addComponents(
|
||||
new discord.MessageButton()
|
||||
.setCustomId("newTicketSolli")
|
||||
.setCustomId("newTicket2")
|
||||
.setDisabled(false)
|
||||
.setStyle("SECONDARY")
|
||||
.setEmoji("📝")
|
||||
.setEmoji(config.options.ticket2.icon)
|
||||
)
|
||||
.addComponents(
|
||||
}
|
||||
|
||||
if (config.options.ticket3.enabled){
|
||||
ticketButton.addComponents(
|
||||
new discord.MessageButton()
|
||||
.setCustomId("newTicketPartner")
|
||||
.setCustomId("newTicket3")
|
||||
.setDisabled(false)
|
||||
.setStyle("SECONDARY")
|
||||
.setEmoji("💼")
|
||||
.setEmoji(config.options.ticket3.icon)
|
||||
)
|
||||
}
|
||||
|
||||
if (config.options.ticket4.enabled){
|
||||
ticketButton.addComponents(
|
||||
new discord.MessageButton()
|
||||
.setCustomId("newTicket4")
|
||||
.setDisabled(false)
|
||||
.setStyle("SECONDARY")
|
||||
.setEmoji(config.options.ticket4.icon)
|
||||
)
|
||||
}
|
||||
|
||||
var categorylist = ""
|
||||
if (config.options.ticket1.enabled){categorylist = categorylist+"\n"+config.options.ticket1.icon+": **"+config.options.ticket1.name+"**\n"+config.options.ticket1.description}
|
||||
|
||||
if (config.options.ticket2.enabled){categorylist = categorylist+"\n\n"+config.options.ticket2.icon+": **"+config.options.ticket2.name+"**\n"+config.options.ticket2.description}
|
||||
|
||||
if (config.options.ticket3.enabled){categorylist = categorylist+"\n\n"+config.options.ticket3.icon+": **"+config.options.ticket3.name+"**\n"+config.options.ticket3.description}
|
||||
|
||||
if (config.options.ticket4.enabled){categorylist = categorylist+"\n\n"+config.options.ticket4.icon+": **"+config.options.ticket4.name+"**\n"+config.options.ticket4.description}
|
||||
|
||||
|
||||
|
||||
|
||||
var ticketEmbed = new discord.MessageEmbed()
|
||||
.setColor(config.main_color)
|
||||
.setDescription("**Maak een ticket:**\nKlik op een van de onderstaande knoppen om een ticket aan te maken.\n\n__kies een categorie:__\n\n❓: **Vragen**\nOverige vragen.\n\n📝: **Sollicitatie**\nDoe een sollicitatie.\n\n💼: **Partner**\nWord partner met ons.\n\n**opgepast: **_u kan maar één ticket tegelijkertijd aanmaken!_")
|
||||
.setFooter("bot "+stringDecoder+name+" - https://www.dj-dj.be")
|
||||
.setDescription("**Create a ticket:**\nClick one of the buttons below to create a ticket.\n\n__choose a category:__"+categorylist+"\n\n**watch out:**_You can only create 1 ticket at a time!_")
|
||||
|
||||
|
||||
|
||||
|
||||
+29
-46
@@ -2,33 +2,23 @@ const discord = require('discord.js')
|
||||
const bot = require('../index')
|
||||
const client = bot.client
|
||||
const config = require("../config.json")
|
||||
var name = "DJdj Development"
|
||||
exports.name = name
|
||||
var stringDecoder = require('./ticketSystem').stringDecoder
|
||||
|
||||
|
||||
|
||||
module.exports = () => {
|
||||
client.on("messageCreate",msg => {
|
||||
var args = msg.content.split(" ")
|
||||
if (args[0] == "!solli"){
|
||||
var SolliMsg = new discord.MessageEmbed()
|
||||
.setColor(config.main_color)
|
||||
.setDescription("**Hier is de informatie die wij nodig hebben voor een sollicitatie**\n\n**naam:** Je echte naam.\n**leeftijd:** Je leeftijd.\n**discord naam:** Je discord naam + tag (bv:Wumpus#0001).\n**minecraft naam:** Je minecraft naam.\n**waarom wil je staff worden:** De reden waarom je staff wilt worden.\n**+ punten:** Je plus punten.\n**- punten:** Je min punten.\n**Jou of iemand anders:** Waarom zouden we jou aan moeten nemen en niet een andere sollicitant?\n**ervaring:** Wat is je ervaring met MT servers?\n**andere server:** Ben je op dit moment staff op een andere server?\n**online:** Hoeveel uur per dag/week kan je online zijn?\n**functie:** Voor welke functie solliciteert u?")
|
||||
.setTitle("Sollicitatie")
|
||||
|
||||
msg.channel.send({embeds:[SolliMsg]})
|
||||
}
|
||||
})
|
||||
|
||||
client.on("messageCreate",msg => {
|
||||
var args = msg.content.split(" ")
|
||||
if (args[0] == "!ticket" && (args[1] == undefined ||args[1] == "" ||args[1] == null)){
|
||||
if (args[0] == config.prefix+"ticket" && (args[1] == undefined ||args[1] == "" ||args[1] == null)){
|
||||
var TicketHelpMsg = new discord.MessageEmbed()
|
||||
.setColor(config.main_color)
|
||||
.setDescription("**Ga naar <#"+config.ticket_msg.ticket_channel+"> om een ticket te maken!**\n\n`!ticket msg` ➜ _Maak een ticket reageer bericht (staff only)._\n`!ticket rename` ➜ _Rename een ticket (geen spaties)._\n`!ticket close` ➜ _Close een ticket._\n`!ticket add <user>` ➜ _Voeg een speler toe aan het ticket._\n`!ticket remove <user>` ➜ _Verwijder een speler van het ticket._\n`!partner` ➜ _De informatie voor partners._\n`!solli` ➜ _De informatie voor solliciteren._")
|
||||
.setTitle("Ticket commands")
|
||||
.setFooter(stringDecoder+name)
|
||||
|
||||
const prefix = config.prefix
|
||||
TicketHelpMsg.setDescription("**Go to <#"+config.system.ticket_channel+"> to create a ticket!**\n\n`"+prefix+"ticket msg` ➜ _Admin command._\n`"+prefix+"ticket rename` ➜ _Rename a ticket (no spaces)._\n`"+prefix+"ticket close` ➜ _Close a ticket._\n`"+prefix+"ticket add <user>` ➜ _Add a user to the ticket._\n`"+prefix+"ticket remove <user>` ➜ _Remove a user from the ticket._\n`"+prefix+"resetdatabase` ➜ _Steps to reset the database._")
|
||||
|
||||
if (config['credits_please-do-not-remove']){
|
||||
TicketHelpMsg.setFooter("OpenTicket by DJdj Development | view on github for source code")
|
||||
}
|
||||
|
||||
msg.channel.send({embeds:[TicketHelpMsg]})
|
||||
}
|
||||
@@ -36,34 +26,22 @@ module.exports = () => {
|
||||
|
||||
client.on("messageCreate",msg => {
|
||||
var args = msg.content.split(" ")
|
||||
if (args[0] == "!partner"){
|
||||
var PartnerMsg = new discord.MessageEmbed()
|
||||
.setColor(config.main_color)
|
||||
.setDescription("**Hier zijn de doelen die je moet hebben voor een partnership**\n\n**server:** De naam van je server.\n**beschrijving:** Waar gaat je server over?\n**members:** Het aantal members in je server.\n**invite:** Een oneindige invite.\n\n_als wij dit goedkeuren, kan je je 'invite bericht' plaatsen._")
|
||||
.setTitle("Partnership")
|
||||
|
||||
msg.channel.send({embeds:[PartnerMsg]})
|
||||
}
|
||||
})
|
||||
|
||||
client.on("messageCreate",msg => {
|
||||
var args = msg.content.split(" ")
|
||||
if (args[0] == "!ticket" && args[1] == "close"){
|
||||
if (args[0] == config.prefix+"ticket" && args[1] == "close"){
|
||||
|
||||
msg.channel.messages.fetchPinned().then(msglist => {
|
||||
var firstmsg = msglist.last()
|
||||
|
||||
if (firstmsg == undefined){
|
||||
msg.channel.send({content:"Ik heb de sluit knop niet gevonden!"})
|
||||
msg.channel.send({content:"I didn't find the close button!"})
|
||||
}
|
||||
if (firstmsg.author.id != client.user.id){
|
||||
msg.channel.send({content:"Je bent niet in een ticket!"})
|
||||
msg.channel.send({content:"You aren't in a ticket!"})
|
||||
return
|
||||
}
|
||||
var CloseMsg = new discord.MessageEmbed()
|
||||
.setColor(config.main_color)
|
||||
.setDescription("klik [hier]("+firstmsg.url+") om het ticket te sluiten.")
|
||||
.setTitle("Sluit dit ticket:")
|
||||
.setDescription("Click [here]("+firstmsg.url+") to close this ticket.")
|
||||
.setTitle("Close this ticket:")
|
||||
|
||||
msg.channel.send({embeds:[CloseMsg]})
|
||||
})
|
||||
@@ -74,10 +52,15 @@ module.exports = () => {
|
||||
|
||||
client.on("messageCreate",msg => {
|
||||
var args = msg.content.split(" ")
|
||||
if (args[0] == "!ticket" && args[1] == "rename"){
|
||||
if (args[0] == config.prefix+"ticket" && args[1] == "rename"){
|
||||
|
||||
if (msg.member.roles.cache.has(config.botperms_role) == false && msg.author.id != "779742674932072469"){
|
||||
msg.channel.send({content:"Je hebt geen permissions voor deze command!"})
|
||||
msg.channel.send({content:"You don't have permissions for this command!"})
|
||||
return
|
||||
}
|
||||
|
||||
if (args[2] == null || args[2] == undefined || args[2] == "" || args[2] == false){
|
||||
msg.channel.send({content:"Not enough parameters!"})
|
||||
return
|
||||
}
|
||||
|
||||
@@ -88,7 +71,7 @@ module.exports = () => {
|
||||
rmsg.channel.setName(name)
|
||||
})
|
||||
}else{
|
||||
msg.channel.send({content:"Je bent niet in een ticket!"})
|
||||
msg.channel.send({content:"You aren't in a ticket!"})
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -96,21 +79,21 @@ module.exports = () => {
|
||||
|
||||
client.on("messageCreate",msg => {
|
||||
var args = msg.content.split(" ")
|
||||
if (args[0] == "!ticket" && args[1] == "add"){
|
||||
if (args[0] == config.prefix+"ticket" && args[1] == "add"){
|
||||
|
||||
if (msg.member.roles.cache.has(config.botperms_role) == false && msg.author.id != "779742674932072469"){
|
||||
msg.channel.send({content:"Je hebt geen permissions voor deze command!"})
|
||||
msg.channel.send({content:"You don't have permissions for this command!"})
|
||||
return
|
||||
}
|
||||
|
||||
msg.channel.messages.fetch().then(msglist => {
|
||||
if (msglist.last().author.id != client.user.id){
|
||||
msg.channel.send({content:"Je bent niet in een ticket!"})
|
||||
msg.channel.send({content:"You aren't in a ticket!"})
|
||||
return
|
||||
}
|
||||
|
||||
if (args[2] == null || args[2] == undefined || args[2] == "" || args[2] == false){
|
||||
msg.channel.send({content:"Niet genoeg parameters!"})
|
||||
msg.channel.send({content:"Not enough parameters!"})
|
||||
return
|
||||
}
|
||||
var user = msg.mentions.users.first()
|
||||
@@ -126,21 +109,21 @@ module.exports = () => {
|
||||
|
||||
client.on("messageCreate",msg => {
|
||||
var args = msg.content.split(" ")
|
||||
if (args[0] == "!ticket" && args[1] == "remove"){
|
||||
if (args[0] == config.prefix+"ticket" && args[1] == "remove"){
|
||||
|
||||
if (msg.member.roles.cache.has(config.botperms_role) == false && msg.author.id != "779742674932072469"){
|
||||
msg.channel.send({content:"Je hebt geen permissions voor deze command!"})
|
||||
msg.channel.send({content:"You don't have permissions for this command!"})
|
||||
return
|
||||
}
|
||||
|
||||
msg.channel.messages.fetchPinned().then(msglist => {
|
||||
if (msglist.last().author.id != client.user.id){
|
||||
msg.channel.send({content:"Je bent niet in een ticket!"})
|
||||
msg.channel.send({content:"You aren't in a ticket!"})
|
||||
return
|
||||
}
|
||||
|
||||
if (args[2] == null || args[2] == undefined || args[2] == "" || args[2] == false){
|
||||
msg.channel.send({content:"Niet genoeg parameters!"})
|
||||
msg.channel.send({content:"Not enough parameters!"})
|
||||
return
|
||||
}
|
||||
var user = msg.mentions.users.first()
|
||||
|
||||
+39
-42
@@ -7,9 +7,6 @@ const ticketStorage = bot.TicketStorage
|
||||
const userTicketStorage = bot.userTicketStorage
|
||||
const transcriptStorage = bot.transcriptStorage
|
||||
|
||||
var stringDecoder = "Created By "
|
||||
exports.stringDecoder = stringDecoder
|
||||
|
||||
module.exports = () => {
|
||||
|
||||
var closeButton = new discord.MessageActionRow()
|
||||
@@ -18,7 +15,7 @@ module.exports = () => {
|
||||
.setCustomId("closeTicket")
|
||||
.setDisabled(false)
|
||||
.setStyle("SECONDARY")
|
||||
.setLabel("Sluit Ticket")
|
||||
.setLabel("Close Ticket")
|
||||
.setEmoji("❌")
|
||||
)
|
||||
|
||||
@@ -28,16 +25,16 @@ module.exports = () => {
|
||||
return
|
||||
}
|
||||
|
||||
if (interaction.customId == "newTicketVraag"||interaction.customId == "newTicketSolli"||interaction.customId == "newTicketPartner"){
|
||||
if (interaction.customId == "newTicket1"||interaction.customId == "newTicket2"||interaction.customId == "newTicket3"||interaction.customId == "newTicket4"){
|
||||
|
||||
interaction.deferUpdate()
|
||||
|
||||
if (ticketStorage.getItem(interaction.member.id) == null ||ticketStorage.getItem(interaction.member.id) == "false"){
|
||||
|
||||
try{
|
||||
interaction.member.send("**Je ticket is aangemaakt!**")
|
||||
interaction.member.send("**You created a ticket in our server!**")
|
||||
}
|
||||
catch{console.log("cant send DM to member")}
|
||||
catch{console.log("can't send DM to member || member doesn't allow dm's")}
|
||||
|
||||
|
||||
|
||||
@@ -45,15 +42,19 @@ module.exports = () => {
|
||||
|
||||
var ticketNumber = interaction.member.user.username
|
||||
|
||||
if (interaction.customId == "newTicketVraag"){
|
||||
var ticketName = "vraag-"+ticketNumber
|
||||
}else if (interaction.customId == "newTicketSolli"){
|
||||
var ticketName = "solli-"+ticketNumber
|
||||
}else if (interaction.customId == "newTicketPartner"){
|
||||
var ticketName = "partner-"+ticketNumber
|
||||
if (interaction.customId == "newTicket1"){
|
||||
var ticketName = config.options.ticket1.channel_prefix+ticketNumber
|
||||
}else if (interaction.customId == "newTicket2"){
|
||||
var ticketName = config.options.ticket2.channel_prefix+ticketNumber
|
||||
}else if (interaction.customId == "newTicket3"){
|
||||
var ticketName = config.options.ticket3.channel_prefix+ticketNumber
|
||||
}else if (interaction.customId == "newTicket4"){
|
||||
var ticketName = config.options.ticket4.channel_prefix+ticketNumber
|
||||
}
|
||||
|
||||
var Category = config.ticket_system.ticket_category
|
||||
if (config.system.enable_category){
|
||||
var Category = config.system.ticket_category
|
||||
}else{var Category = null}
|
||||
|
||||
interaction.guild.channels.create(ticketName,{
|
||||
type:"GUILD_TEXT",
|
||||
@@ -70,7 +71,7 @@ module.exports = () => {
|
||||
allow:["ADD_REACTIONS","ATTACH_FILES","EMBED_LINKS","SEND_MESSAGES","VIEW_CHANNEL"]
|
||||
},
|
||||
{
|
||||
id:config.ticket_system.member_role,
|
||||
id:config.system.member_role,
|
||||
type:"role",
|
||||
deny:["VIEW_CHANNEL"]
|
||||
}
|
||||
@@ -82,13 +83,7 @@ module.exports = () => {
|
||||
var ticketEmbed = new discord.MessageEmbed()
|
||||
.setColor(config.main_color)
|
||||
|
||||
if (interaction.customId == "newTicketVraag"){
|
||||
ticketEmbed.setDescription("**Ticket gemaakt:**\nJe hebt gekozen voor **overige vragen**, zeg alvast maar je vraag, onze staffleden komen u zo helpen.\n\n_Klik op knop hieronder om dit ticket te sluiten_")
|
||||
}else if (interaction.customId == "newTicketSolli"){
|
||||
ticketEmbed.setDescription("**Ticket gemaakt:**\nJe hebt gekozen voor **sollicitatie**, neem maar tijd om u sollicitatie brief voor te bereiden. Met de `!solli` command kan je zien wat je allemaal moet zeggen.\n\n_Klik op knop hieronder om dit ticket te sluiten_")
|
||||
}else if (interaction.customId == "newTicketPartner"){
|
||||
ticketEmbed.setDescription("**Ticket gemaakt:**\nJe hebt gekozen voor **partner**, neem maar tijd om u partner brief voor te bereiden. Met de `!partner` command kan je zien wat de vereisen zijn.\n\n_Klik op knop hieronder om dit ticket te sluiten_")
|
||||
}
|
||||
ticketEmbed.setDescription("You created a ticket!\n\n_Click on the close button below to close this ticket_")
|
||||
|
||||
tChannel.send({content:"<@"+interaction.member.id+"> <@&"+config.botperms_role+">",embeds:[ticketEmbed],components:[closeButton]}).then(firstmsg => {
|
||||
firstmsg.pin()
|
||||
@@ -99,9 +94,9 @@ module.exports = () => {
|
||||
|
||||
}else{
|
||||
try {
|
||||
interaction.member.send("**Je hebt al een ticket open!**")
|
||||
interaction.member.send("**You have already created a ticket!**")
|
||||
}
|
||||
catch{console.log("cant send DM to member")}
|
||||
catch{console.log("can't send DM to member || member doesn't allow dm's")}
|
||||
|
||||
|
||||
}
|
||||
@@ -168,12 +163,13 @@ module.exports = () => {
|
||||
var getuserID = userTicketStorage.getItem(interaction.channel.id)
|
||||
var getusernameStep1 = client.users.cache.find(u => u.id === getuserID)
|
||||
if (getusernameStep1 == null || getusernameStep1 == undefined || getusernameStep1 == false || getusernameStep1 == ""){
|
||||
var getuserNAME = ":user niet in database:"
|
||||
var getuserNAME = ":usernotfound:"
|
||||
}else {
|
||||
var getuserNAME = getusernameStep1.username
|
||||
}
|
||||
|
||||
|
||||
if (config.system.enable_transcript){
|
||||
var transcript = transcriptArray.reverse().join("\n")
|
||||
transcriptStorage.setItem(interaction.channel.id,transcript)
|
||||
|
||||
@@ -186,38 +182,39 @@ module.exports = () => {
|
||||
}
|
||||
var transcriptEmbed = new discord.MessageEmbed()
|
||||
.setColor(config.main_color)
|
||||
.setAuthor(interaction.channel.name + " - ticket gemaakt door "+getuserNAME)
|
||||
.setTitle("Er is een nieuw transcript!")
|
||||
.setAuthor(interaction.channel.name + " - ticket created by "+getuserNAME)
|
||||
.setTitle("There is a new transcript!")
|
||||
.setDescription(splittedTranscript[0])
|
||||
.setFooter("ticket gesloten door "+interaction.member.user.username)
|
||||
.setFooter("ticket closed by "+interaction.member.user.username)
|
||||
|
||||
if (transcript.length > 4000){
|
||||
var transcriptEmbed2 = new discord.MessageEmbed()
|
||||
.setColor(config.main_color)
|
||||
.setAuthor(interaction.channel.name + " - ticket gemaakt door "+getuserNAME)
|
||||
.setTitle("Deel 2 van het transcript")
|
||||
.setAuthor(interaction.channel.name + " - ticket created by "+getuserNAME)
|
||||
.setTitle("transcript #2")
|
||||
.setDescription(splittedTranscript[1])
|
||||
.setFooter("ticket gesloten door "+interaction.member.user.username)
|
||||
.setFooter("ticket closed by "+interaction.member.user.username)
|
||||
var transcriptEmbed3 = new discord.MessageEmbed()
|
||||
.setColor(config.main_color)
|
||||
.setAuthor(interaction.channel.name + " - ticket gemaakt door "+getuserNAME)
|
||||
.setTitle("Deel 3 van het transcript")
|
||||
.setAuthor(interaction.channel.name + " - ticket created by "+getuserNAME)
|
||||
.setTitle("transcript #3")
|
||||
.setDescription(splittedTranscript[1])
|
||||
.setFooter("ticket gesloten door "+interaction.member.user.username)
|
||||
.setFooter("ticket closed by "+interaction.member.user.username)
|
||||
|
||||
client.channels.cache.find(ch => ch.id == config.ticket_system.transcript_channel).send({embeds:[transcriptEmbed,transcriptEmbed2,transcriptEmbed3]})
|
||||
client.channels.cache.find(ch => ch.id == config.system.transcript_channel).send({embeds:[transcriptEmbed,transcriptEmbed2,transcriptEmbed3]})
|
||||
|
||||
}else if (transcript.length > 2000){
|
||||
var transcriptEmbed2 = new discord.MessageEmbed()
|
||||
.setColor(config.main_color)
|
||||
.setAuthor(interaction.channel.name + " - ticket gemaakt door "+getuserNAME)
|
||||
.setTitle("Deel 2 van het transcript")
|
||||
.setAuthor(interaction.channel.name + " - ticket created by "+getuserNAME)
|
||||
.setTitle("transcript #2")
|
||||
.setDescription(splittedTranscript[1])
|
||||
.setFooter("ticket gesloten door "+interaction.member.user.username)
|
||||
.setFooter("ticket closed by "+interaction.member.user.username)
|
||||
|
||||
client.channels.cache.find(ch => ch.id == config.ticket_system.transcript_channel).send({embeds:[transcriptEmbed,transcriptEmbed2]})
|
||||
client.channels.cache.find(ch => ch.id == config.system.transcript_channel).send({embeds:[transcriptEmbed,transcriptEmbed2]})
|
||||
}else{
|
||||
client.channels.cache.find(ch => ch.id == config.ticket_system.transcript_channel).send({embeds:[transcriptEmbed]})
|
||||
client.channels.cache.find(ch => ch.id == config.system.transcript_channel).send({embeds:[transcriptEmbed]})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -228,9 +225,9 @@ module.exports = () => {
|
||||
ticketStorage.setItem(getuserID,"false")
|
||||
|
||||
try {
|
||||
interaction.member.send("**Je ticket is gesloten door "+interaction.member.user.username+"!**")
|
||||
interaction.member.send("**your ticket is closed by "+interaction.member.user.username+"!**")
|
||||
}
|
||||
catch{console.log("cant send DM to member")}
|
||||
catch{console.log("can't send DM to member || member doesn't allow dm's")}
|
||||
})
|
||||
|
||||
|
||||
|
||||
+46
-4
@@ -5,13 +5,55 @@
|
||||
"main_color":"#fffff",
|
||||
"auth_token":"the bot's auth token",
|
||||
"botperms_role":"the id from a role that can do anything with the bot",
|
||||
"prefix":"!",
|
||||
|
||||
"ticket_msg":{
|
||||
"ticket_channel":"id of the channel with the !ticket msg"
|
||||
"credits_please-do-not-remove":true,
|
||||
|
||||
"status":{
|
||||
"type":"PLAYING | STREAMING | LISTENING | WATCHING | CUSTOM | COMPETING",
|
||||
"text":"!ticket"
|
||||
},
|
||||
"ticket_system":{
|
||||
|
||||
"system":{
|
||||
"ticket_channel":"id of the channel with the !ticket msg",
|
||||
|
||||
"enable_category":false,
|
||||
"ticket_category":"the id of a category for the tickets",
|
||||
|
||||
"member_role":"this role doesn't have access to tickets (WARNING: @everyone does have access to tickets, so make sure all members have a member role!)",
|
||||
"transcript_channel":"the channel for transcripts (REQUIRED,or else the bot will crash)"
|
||||
|
||||
"enable_transcript":false,
|
||||
"transcript_channel":"the channel for transcripts"
|
||||
},
|
||||
|
||||
"options":{
|
||||
"ticket1":{
|
||||
"enabled":true,
|
||||
"icon":"🎫",
|
||||
"description":"Create a general ticket.",
|
||||
"name":"Ticket",
|
||||
"channel_prefix":"ticket-"
|
||||
},
|
||||
"ticket2":{
|
||||
"enabled":false,
|
||||
"icon":"💼",
|
||||
"description":"Do you want to apply? Then click here!",
|
||||
"name":"Apply",
|
||||
"channel_prefix":"apply-"
|
||||
},
|
||||
"ticket3":{
|
||||
"enabled":false,
|
||||
"icon":"❓",
|
||||
"description":"Click here if you have a question about the server.",
|
||||
"name":"Question",
|
||||
"channel_prefix":"question-"
|
||||
},
|
||||
"ticket4":{
|
||||
"enabled":false,
|
||||
"icon":"🛒",
|
||||
"description":"Buy something in our shop.",
|
||||
"name":"Shop",
|
||||
"channel_prefix":"shop-"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ exports.client = client
|
||||
|
||||
client.on('ready',() => {
|
||||
console.log('ready')
|
||||
client.user.setActivity("HighMT",{type:"PLAYING"})
|
||||
client.user.setActivity(config.status.text,{type:config.status.type})
|
||||
})
|
||||
|
||||
var storage = require('./storage/storage')
|
||||
@@ -24,5 +24,8 @@ ticketSystem()
|
||||
var ticketExtra = require("./commands/ticketExtra")
|
||||
ticketExtra()
|
||||
|
||||
var database = require('./commands/database')
|
||||
database()
|
||||
|
||||
|
||||
client.login(config.auth_token)
|
||||
+10
-2
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "safemt-tickets",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"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",
|
||||
@@ -15,5 +15,13 @@
|
||||
"express": "^4.17.1",
|
||||
"node": "^16.10.0",
|
||||
"node-localstorage": "^2.2.1"
|
||||
}
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/DJj123dj/open-ticket.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/DJj123dj/open-ticket/issues"
|
||||
},
|
||||
"homepage": "https://github.com/DJj123dj/open-ticket#readme"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user