Compare commits

...

3 commits
main ... main

2 changed files with 5 additions and 5 deletions

View file

@ -10,7 +10,7 @@ module.exports = {
'wikipedia'
],
usages:[
"<definition>"
"<article>"
],
},
async execute (context) {
@ -23,7 +23,7 @@ module.exports = {
bot.tellraw(`@a`, { text: `${summary}`, color: 'gray' });
} catch (error) {
if (error.toString() === "pageError: TypeError: Cannot read properties of undefined (reading 'pages')") {
bot.tellraw(`@a`, { text: 'Definition not found!', color: 'dark_red' })
bot.tellraw(`@a`, { text: 'Article not found!', color: 'dark_red' })
} else {
bot.tellraw(`@a`, `${error.toString()}`)
}

View file

@ -47,14 +47,14 @@ async function command_manager (bot, options, config, discordClient) {
const event = bot.discord.message;
const roles = event?.member?.roles?.cache;
if (command?.data?.trustLevel === 1 && !source?.sources?.discord) {
if (args.length === 0 && bot.validation.trusted && bot.validation.admin && bot.validation.owner && !source?.sources?.console) throw new CommandError({ text: "Please provide an trusted or an admin or an owner hash", color: "dark_red" })
if (args[0] !== bot.validation.trusted && args[0] !== bot.validation.admin && args[0] !== bot.validation.owner && !source.sources.console) throw new CommandError({ translate: 'Invalid trusted or admin or owner hash', color: 'dark_red' });
if (args.length === 0 && bot.validation.trusted && bot.validation.admin && bot.validation.owner && !source?.sources?.console) throw new CommandError({ text: "Please provide a trusted, admin, or owner hash", color: "dark_red" })
if (args[0] !== bot.validation.trusted && args[0] !== bot.validation.admin && args[0] !== bot.validation.owner && !source.sources.console) throw new CommandError({ translate: 'Invalid trusted, admin, or owner hash', color: 'dark_red' });
} else if (command?.data?.trustLevel === 1 && source?.sources.discord) {
const hasRole = roles?.some(role => role.name === `${config.discord.roles.trusted}` || role.name === `${config.discord.roles.owner}`)
if (!hasRole) throw new CommandError({ translate: 'You are not trusted or the owner!', color: "dark_red" })
}
if (command?.data?.trustLevel === 2 && !source.sources.console) {
if (args.length === 0 && bot.validation.admin && bot.validation.owner && !source.sources.console) throw new CommandError({ text: "Please provide an trusted or owner hash", color: 'dark_red' })
if (args.length === 0 && bot.validation.admin && bot.validation.owner && !source.sources.console) throw new CommandError({ text: "Please provide a trusted or owner hash", color: 'dark_red' })
if (args[0] !== bot.validation.admin && args[0] !== bot.validation.owner && !source.sources.console) throw new CommandError({ translate: 'Invalid trusted or owner hash', color: 'dark_red' });
}
if (command?.data?.trustLevel === 3 && !source.sources.discord && !source.sources.console) {