3.0 public beta 3

This commit is contained in:
DJj123dj
2022-10-01 12:08:42 +02:00
parent 893a7c5b1f
commit 69b669956e
12 changed files with 34 additions and 23 deletions
+3 -2
View File
@@ -7,11 +7,12 @@ 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 add.js")
client.on("messageCreate",msg => {
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({embeds:[bot.errorLog.invalidArgsMessage(l.errors.missingArgsDescription+" `<user>`:\n`"+config.prefix+"add <user>`")]})
@@ -43,7 +44,7 @@ module.exports = () => {
})
client.on("interactionCreate",(interaction) => {
if (!DISABLE.commands.slash.add) client.on("interactionCreate",(interaction) => {
if (!interaction.isChatInputCommand()) return
if (interaction.commandName != "add") return
const user = interaction.options.getUser("user")
+3 -2
View File
@@ -7,11 +7,12 @@ 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 close.js")
client.on("messageCreate",msg => {
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(" ")
@@ -53,7 +54,7 @@ module.exports = () => {
})
client.on("interactionCreate",(interaction) => {
if (!DISABLE.commands.slash.close) client.on("interactionCreate",(interaction) => {
if (!interaction.isChatInputCommand()) return
if (interaction.commandName != "close") return
+3 -2
View File
@@ -7,11 +7,12 @@ 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 delete.js")
client.on("messageCreate",msg => {
if (!DISABLE.commands.text.delete) client.on("messageCreate",msg => {
if (!msg.content.startsWith(config.prefix+"delete")) return
if (!msg.guild) return
@@ -46,7 +47,7 @@ module.exports = () => {
})
client.on("interactionCreate",(interaction) => {
if (!DISABLE.commands.slash.delete) client.on("interactionCreate",(interaction) => {
if (!interaction.isChatInputCommand()) return
if (interaction.commandName != "delete") return
+3 -2
View File
@@ -6,6 +6,7 @@ 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 = () => {
bot.errorLog.log("debug","COMMANDS: loaded help.js")
@@ -22,7 +23,7 @@ module.exports = () => {
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)
@@ -42,7 +43,7 @@ module.exports = () => {
}
})
client.on("interactionCreate",(interaction) => {
if (!DISABLE.commands.slash.help) client.on("interactionCreate",(interaction) => {
if (!interaction.isChatInputCommand()) return
if (interaction.commandName != "help") return
+3 -2
View File
@@ -7,11 +7,12 @@ 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 remove.js")
client.on("messageCreate",msg => {
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({embeds:[bot.errorLog.invalidArgsMessage(l.errors.missingArgsDescription+" `<user>`:\n`"+config.prefix+"remove <user>`")]})
@@ -43,7 +44,7 @@ module.exports = () => {
})
client.on("interactionCreate",async (interaction) => {
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")
+3 -2
View File
@@ -7,11 +7,12 @@ 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 rename.js")
client.on("messageCreate",msg => {
if (!DISABLE.commands.text.rename) client.on("messageCreate",msg => {
if (!msg.content.startsWith(config.prefix+"rename")) return
if (!msg.guild) return
@@ -52,7 +53,7 @@ module.exports = () => {
})
client.on("interactionCreate",(interaction) => {
if (!DISABLE.commands.slash.rename) client.on("interactionCreate",(interaction) => {
if (!interaction.isChatInputCommand()) return
if (interaction.commandName != "rename") return
+3 -2
View File
@@ -7,11 +7,12 @@ 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")
client.on("messageCreate",msg => {
if (!DISABLE.commands.text.reopen) client.on("messageCreate",msg => {
if (!msg.content.startsWith(config.prefix+"reopen")) return
msg.channel.messages.fetchPinned().then(msglist => {
@@ -32,7 +33,7 @@ module.exports = () => {
})
client.on("interactionCreate",async (interaction) => {
if (!DISABLE.commands.slash.reopen) client.on("interactionCreate",async (interaction) => {
if (!interaction.isChatInputCommand()) return
if (interaction.commandName != "reopen") return
+3 -2
View File
@@ -7,6 +7,7 @@ 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 ticket.js")
@@ -18,7 +19,7 @@ module.exports = () => {
})
client.on("messageCreate", msg => {
if (!DISABLE.commands.text.msg) client.on("messageCreate", msg => {
if (msg.content.startsWith(config.prefix+"msg"||config.prefix+"message")){
if (!msg.guild) return
@@ -42,7 +43,7 @@ module.exports = () => {
}
})
client.on("interactionCreate", (interaction) => {
if (!DISABLE.commands.slash.msg) client.on("interactionCreate", (interaction) => {
if (!interaction.isChatInputCommand()) return
if (interaction.commandName != "message") return
+4 -3
View File
@@ -1,11 +1,12 @@
{
"version":"1.0.0",
"disclaimer":"DISABLE doesn't work yet! Below this message!",
"enableAPIdebug":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,
+3 -1
View File
@@ -331,7 +331,9 @@ exports.checker = async () => {
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")
//languagefile
+2 -2
View File
@@ -294,7 +294,7 @@ exports.NEWcloseTicket = async (member,channel,prefix,mode,reason,nomessage) =>
if (fileattachment == false){log("system","internal error: transcript is not created!");return}
}
if (config.system.enable_transcript){
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)
@@ -307,7 +307,7 @@ exports.NEWcloseTicket = async (member,channel,prefix,mode,reason,nomessage) =>
})
}
if (config.system.enable_DM_transcript){
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)
+1 -1
View File
@@ -165,7 +165,7 @@ client.on('ready',async () => {
require("./core/api/pluginlauncher")()
this.errorLog.log("debug","loading plugins")
})
require("./core/checker").checker()
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...")