mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-07 21:53:07 -04:00
- properly handle permissions for user commands
- add central permission group constant
This commit is contained in:
parent
dcb823a0a1
commit
d2aeecf70d
100 changed files with 245 additions and 942 deletions
|
@ -1,3 +1,4 @@
|
|||
const { PERMISSION_GROUPS } = require('#constants');
|
||||
const { SparkWebSummarize } = require('#obelisk');
|
||||
|
||||
const { createEmbed } = require('#utils/embed')
|
||||
|
@ -6,9 +7,6 @@ const { editOrReply } = require('#utils/message')
|
|||
const { STATIC_ICONS } = require('#utils/statics');
|
||||
const { hasFeature } = require('#utils/testing');
|
||||
|
||||
// TODO: Turn this into a general purpose permissions constant
|
||||
const { Permissions } = require("detritus-client/lib/constants");
|
||||
|
||||
// TODO: general purpose constant? regex util?
|
||||
const URL_REGEX = /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([^> \n]*)/
|
||||
|
||||
|
@ -23,7 +21,7 @@ module.exports = {
|
|||
category: 'limited',
|
||||
usage: 'summarize'
|
||||
},
|
||||
permissionsClient: [Permissions.EMBED_LINKS, Permissions.SEND_MESSAGES, Permissions.USE_EXTERNAL_EMOJIS, Permissions.READ_MESSAGE_HISTORY],
|
||||
permissionsClient: [...PERMISSION_GROUPS.baseline],
|
||||
run: async (context, args) => {
|
||||
if(!await hasFeature(context, "flamingo/summary")) return;
|
||||
context.triggerTyping();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue