- properly handle permissions for user commands

- add central permission group constant
This commit is contained in:
bignutty 2024-12-08 14:49:57 +01:00
parent dcb823a0a1
commit d2aeecf70d
100 changed files with 245 additions and 942 deletions

View file

@ -1,9 +1,7 @@
const { PERMISSION_GROUPS } = require('#constants');
const { createEmbed } = require('#utils/embed')
const { editOrReply } = require('#utils/message')
// TODO: Turn this into a general purpose permissions constant
const { Permissions } = require("detritus-client/lib/constants");
module.exports = {
name: 'undo',
default: 1,
@ -15,7 +13,7 @@ module.exports = {
category: 'core',
usage: 'undo [<amount (1-5)>]'
},
permissionsClient: [Permissions.SEND_MESSAGES, Permissions.EMBED_LINKS, Permissions.READ_MESSAGE_HISTORY],
permissionsClient: [...PERMISSION_GROUPS.baseline],
run: async (context, args) => {
try{
if(typeof(args.amount) == "string") args.amount = parseInt(args.amount)