Compare commits
3 commits
Author | SHA1 | Date | |
---|---|---|---|
55ac75b19c | |||
a96911531e | |||
728da518b0 |
2 changed files with 5 additions and 5 deletions
|
@ -10,7 +10,7 @@ module.exports = {
|
||||||
'wikipedia'
|
'wikipedia'
|
||||||
],
|
],
|
||||||
usages:[
|
usages:[
|
||||||
"<definition>"
|
"<article>"
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
async execute (context) {
|
async execute (context) {
|
||||||
|
@ -23,7 +23,7 @@ module.exports = {
|
||||||
bot.tellraw(`@a`, { text: `${summary}`, color: 'gray' });
|
bot.tellraw(`@a`, { text: `${summary}`, color: 'gray' });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.toString() === "pageError: TypeError: Cannot read properties of undefined (reading 'pages')") {
|
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 {
|
} else {
|
||||||
bot.tellraw(`@a`, `${error.toString()}`)
|
bot.tellraw(`@a`, `${error.toString()}`)
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,14 +47,14 @@ async function command_manager (bot, options, config, discordClient) {
|
||||||
const event = bot.discord.message;
|
const event = bot.discord.message;
|
||||||
const roles = event?.member?.roles?.cache;
|
const roles = event?.member?.roles?.cache;
|
||||||
if (command?.data?.trustLevel === 1 && !source?.sources?.discord) {
|
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.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 or 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) {
|
} 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}`)
|
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 (!hasRole) throw new CommandError({ translate: 'You are not trusted or the owner!', color: "dark_red" })
|
||||||
}
|
}
|
||||||
if (command?.data?.trustLevel === 2 && !source.sources.console) {
|
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 (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) {
|
if (command?.data?.trustLevel === 3 && !source.sources.discord && !source.sources.console) {
|
||||||
|
|
Loading…
Reference in a new issue