mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-08 22:23:03 -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,4 +1,5 @@
|
|||
const { gpt } = require('#api');
|
||||
const { PERMISSION_GROUPS } = require('#constants');
|
||||
|
||||
const { createEmbed } = require('#utils/embed')
|
||||
const { editOrReply } = require('#utils/message')
|
||||
|
@ -6,8 +7,6 @@ const { iconPill, stringwrap, smallIconPill } = require('#utils/markdown')
|
|||
const { STATICS, 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: 'gpt',
|
||||
|
@ -24,7 +23,7 @@ module.exports = {
|
|||
{ name: 'prompt', default: '', required: false, help: "The starting system prompt." },
|
||||
// { name: 'temperature', default: 0.25, required: false, help: "Model temperature." },
|
||||
],
|
||||
permissionsClient: [Permissions.EMBED_LINKS, Permissions.SEND_MESSAGES, Permissions.ATTACH_FILES, Permissions.USE_EXTERNAL_EMOJIS, Permissions.READ_MESSAGE_HISTORY],
|
||||
permissionsClient: [...PERMISSION_GROUPS.baseline, ...PERMISSION_GROUPS.attachments],
|
||||
run: async (context, args) => {
|
||||
if(!await hasFeature(context, "ai/gpt")) return;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue