mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-16 01:53:08 -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 { wallpaper } = require("#obelisk");
|
||||
|
||||
const { createEmbed } = require("#utils/embed");
|
||||
|
@ -6,9 +7,6 @@ const { editOrReply } = require("#utils/message");
|
|||
const { STATIC_ICONS, STATIC_ASSETS } = require("#utils/statics");
|
||||
const { hasFeature } = require("#utils/testing");
|
||||
|
||||
// TODO: Turn this into a general purpose permissions constant
|
||||
const { Permissions } = require("detritus-client/lib/constants");
|
||||
|
||||
module.exports = {
|
||||
name: 'wallpaper',
|
||||
label: 'text',
|
||||
|
@ -23,7 +21,7 @@ module.exports = {
|
|||
args: [
|
||||
{ name: 'format', default: 'wide', required: false, help: "Image style (wide, square)." }
|
||||
],
|
||||
permissionsClient: [Permissions.EMBED_LINKS, Permissions.SEND_MESSAGES, Permissions.USE_EXTERNAL_EMOJIS, Permissions.ATTACH_FILES, Permissions.READ_MESSAGE_HISTORY],
|
||||
permissionsClient: [...PERMISSION_GROUPS.baseline, ...PERMISSION_GROUPS.attachments],
|
||||
run: async (context, args) => {
|
||||
if(!await hasFeature(context, "ai/wallpapers")) return;
|
||||
context.triggerTyping();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue