v3.2.2 push 1

This commit is contained in:
DJj123dj
2023-02-24 14:49:36 +01:00
parent 05c97909d4
commit dc14a39c4e
9 changed files with 112 additions and 50 deletions
+8 -6
View File
@@ -1,11 +1,11 @@
node_modules/
package-lock.json
devConfig.json
devConfig1.json
devConfig2.json
devConfig3.json
devConfig4.json
devConfig5.json
devconfig.json
devconfig1.json
devconfig2.json
devconfig3.json
devconfig4.json
devconfig5.json
.DS_Store
openticketdebug.txt
developerChangelog.md
@@ -18,3 +18,5 @@ storage/.DS_Store
livestatus.json
test.js
devtsconfig.json
plugins/*
!plugins/example.plugin.js
+2 -2
View File
@@ -47,7 +47,6 @@ Translators
|--------------|-------------------------|
|Dutch |DJj123dj#1706 |
|Romanian |Sanke#6086 |
|Russian |Apexo#0723 |
|French |Sanke#6086 |
|Spanish |Redactado#1673 & josuens14#5267|
|German |david.#8276 |
@@ -55,7 +54,8 @@ Translators
|Czech |t0miiis#3022 |
|Arabic |ChilledBroke#9986 & M4#5882|
|Danish |the_gamer#5095 |
|Portuguese |*unknown* |
|Portuguese |QuirAddon#9778 |
|Russian |Apexo#0723 |
## links
current version: _v3.2.2_
+4 -3
View File
@@ -18,12 +18,13 @@
"enable_DM_Messages":true,
"has@everyoneaccess":false,
"member_role":"member role (doesn't have access to tickets)",
"closeMode":"adminonly|normal",
"member_role":"member role (this role doesn't have access to tickets)",
"closeMode":"adminonly or normal (select one of the 2)",
"transcripts":"!!!! ALL SETTINGS FOR TRANSCRIPTS ARE LOCATED IN: transcriptconfig.json !!!!",
"showSlashcmdsInHelp":false
"showSlashcmdsInHelp":false,
"answerInEphemeralOnOpen":true
},
"options":[
+2 -2
View File
@@ -5,7 +5,7 @@ exports.checker = async () => {
if (process.argv.some((v) => v == "--devconfig")){
//console.log(chalk.blue("=> used dev config instead of normal config"))
try{
var tempconfig = require("../devConfig.json")
var tempconfig = require("../devconfig.json")
}catch(err){console.log(err);var tempconfig = require("../config.json")}
}else{
var tempconfig = require("../config.json")
@@ -404,7 +404,7 @@ exports.checker = async () => {
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") && !lf.startsWith("czech") && !lf.startsWith("danish")){
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") && !lf.startsWith("czech") && !lf.startsWith("danish") && !lf.startsWith("russian")){
createError("'languagefile' | invalid language, more info in the wiki")
}
+4 -13
View File
@@ -1,23 +1,14 @@
const index = require("../index")
if (index.developerConfig){
var config = require("../devConfig.json")
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")
else if (config.languagefile.startsWith("danish")) localLanguage = require("../language/danish.json")
const fs = require("fs")
const lfexists = fs.existsSync("./language/"+config.languagefile+".json")
if (lfexists) localLanguage = require("../language/"+config.languagefile+".json")
const errorLog = async () => {
const chalk = await (await import("chalk")).default
+26 -1
View File
@@ -239,12 +239,37 @@ exports.NEWcloseTicket = async (member,channel,prefix,mode,reason,nomessage) =>
}
/**
*
* @param {discord.TextChannel} channel
* @param {Number} limit
* @returns
*/
const getmessages = async (channel,limit) => {
const final = []
var lastId = ""
while (true) {
const options = {limit:100}
if (lastId) options.before = lastId
const messages = await channel.messages.fetch(options)
messages.forEach(msg => {final.push(msg)})
lastId = messages.last().id
if (messages.size != 100 || final >= limit) {
break
}
}
return final
}
const transcriptHandler = async () => {
if (!bot.tsconfig.sendTranscripts.enableChannel && !bot.tsconfig.sendTranscripts.enableDM) return false
const APIEvents = require("../api/modules/events")
const messages = await channel.messages.fetch({cache:true})
const messages = await getmessages(channel,5000)
await require("../transcriptSystem/manager")(messages,guild,channel,user,reason)
APIEvents.onTranscriptCreation(messages,channel,guild,new Date())
}
+20 -10
View File
@@ -53,10 +53,10 @@ module.exports = () => {
if (interaction.isButton()){
try {
interaction.deferUpdate()
if (config.system.answerInEphemeralOnOpen) interaction.deferReply({ephemeral:true})
} catch{}
}else if (interaction.isChatInputCommand()){
interaction.reply({embeds:[bot.errorLog.success(l.messages.createdTitle,l.messages.createdDescription)]})
interaction.deferReply({ephemeral:config.system.answerInEphemeralOnOpen})
}else if (interaction.isStringSelectMenu()){
try {
interaction.deferUpdate()
@@ -65,14 +65,6 @@ module.exports = () => {
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 (currentTicketOptions.enableDmOnOpen){
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
@@ -205,6 +197,24 @@ module.exports = () => {
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})
const channelbutton = new discord.ActionRowBuilder()
.addComponents([
new discord.ButtonBuilder()
.setStyle(discord.ButtonStyle.Link)
.setDisabled(false)
.setEmoji("🎫")
.setLabel("go to ticket")
.setURL(ticketChannel.url)
])
try{
if (currentTicketOptions.enableDmOnOpen) interaction.member.send({embeds:[bot.errorLog.custom(l.messages.newTicketDmTitle,currentTicketOptions.message,":ticket:",config.main_color)],components:[channelbutton]})
}
catch{log("system","failed to send DM")}
if ((interaction.isButton() && config.system.answerInEphemeralOnOpen) || interaction.isChatInputCommand()) interaction.editReply({embeds:[bot.errorLog.success(l.messages.createdTitle,l.messages.createdDescription)],components:[channelbutton]})
})
}else{
try {
+1 -1
View File
@@ -119,7 +119,7 @@ module.exports = async (messages,guild,channel,user,reason) => {
if (!user) return
const embed = tsembeds.tsready(chName,chId,url,user)
try {
user.send({embeds:[embed]})
ticketopener.send({embeds:[embed]})
}catch{}
}
},duration)
+44 -11
View File
@@ -1,13 +1,46 @@
// __________ __________ ___________ ____ ____
// / ____ \ / ______ \ / | | \ | |
// | / \ | | | | | | |_______| | \ | |
// | | | | | |____| | | | | |\ \ | |
// | | | | | ________/ | |______ | | \ \ | |
// | | | | | | | _____| | | \ \ | |
// | | | | | | | | | | \ \ | |
// | | | | | | | |________ | | \ \| |
// | \____/ | | | | | | | \ |
// \__________/ |__| \__________| |__| \___|
/**
____ _____ ______ _ _ _______ _____ _____ _ ________ _______
/ __ \| __ \| ____| \ | | |__ __|_ _/ ____| |/ / ____|__ __|
| | | | |__) | |__ | \| | | | | || | | ' /| |__ | |
| | | | ___/| __| | . ` | | | | || | | < | __| | |
| |__| | | | |____| |\ | | | _| || |____| . \| |____ | |
\____/|_| |______|_| \_| |_| |_____\_____|_|\_\______| |_|
Hey! we are looking for you!
Do you speak a language that isn't yet in our /languages directory
or do you speak one that isn't up-to-date? Open Ticket needs
translators for lots of different languages!
Feel free to join our translator team and help us improve Open Ticket!
SUGGESTING NEW FEATURES:
=====================
Open Ticket is a community project. This means that
almost all feature ideas come from our community.
Are you missing something you want in open ticket?
Then join our Discord server and we will add it (if possible)
Did you know that 80% of all features in OT were ideas from our community?
INFORMATION:
============
Open Ticket v3.2.2 - © DJdj Development
discord: https://discord.dj-dj.be
website: https://www.dj-dj.be
github: https://openticket.dj-dj.be
support e-mail: support@dj-dj.be
Config files:
./config.json
./transcriptconfig.json
Send ./openticketdebug.txt when there are errors!
*/
const discord = require("discord.js")
const fs = require('fs')
@@ -45,7 +78,7 @@ if (process.argv.some((v) => v == "--devconfig")){
}; logFLAGS()
isDevConfig = true
try{
tempconfig = require("./devConfig.json")
tempconfig = require("./devconfig.json")
}catch{tempconfig = require("./config.json")}
}else{
tempconfig = require("./config.json")