mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-08 06:03:04 -04:00
add permission checks to everything user-facing
This commit is contained in:
parent
9e9c53e1bd
commit
61274d6be5
66 changed files with 276 additions and 27 deletions
|
@ -1,5 +1,4 @@
|
|||
const { Constants } = require("detritus-client");
|
||||
const Permissions = Constants.Permissions;
|
||||
const { Permissions } = require("detritus-client/lib/constants");
|
||||
|
||||
const { icon } = require("../../../labscore/utils/markdown");
|
||||
|
||||
|
@ -19,9 +18,8 @@ module.exports = {
|
|||
{default: 20, name: 'amount', type: 'integer', help: "Amount of messages to be checked (1-20)"},
|
||||
{default: true, name: 'case', type: 'bool', help: "If provided, should the search query be case sensitive"},
|
||||
],
|
||||
permissionsClient: [Permissions.MANAGE_MESSAGES],
|
||||
permissionsClient: [Permissions.EMBED_LINKS, Permissions.SEND_MESSAGES, Permissions.USE_EXTERNAL_EMOJIS, Permissions.MANAGE_MESSAGES, Permissions.READ_MESSAGE_HISTORY],
|
||||
permissions: [Permissions.MANAGE_MESSAGES],
|
||||
onPermissionsFailClient: (context) => context.editOrReply(`${icon("failiure_simple")} ${context.message.author.mention}, the bot needs the \`Manage Messages\` permission to run this command.`),
|
||||
onPermissionsFail: (context) => context.editOrReply(`${icon("failiure_simple")} ${context.message.author.mention}, you are lacking the permission \`Manage Messages\`.`),
|
||||
ratelimit: {
|
||||
type: 'guild',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue