mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-08 06:03:04 -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,5 +1,5 @@
|
|||
const { googleTranslate } = require('#api');
|
||||
const { TRANSLATE_LANGUAGES, TRANSLATE_DISPLAY_MAPPINGS } = require('#constants');
|
||||
const { TRANSLATE_LANGUAGES, TRANSLATE_DISPLAY_MAPPINGS, PERMISSION_GROUPS } = require('#constants');
|
||||
|
||||
const { createEmbed } = require('#utils/embed')
|
||||
const { codeblock, icon, pill, stringwrap, smallIconPill } = require('#utils/markdown');
|
||||
|
@ -7,9 +7,6 @@ const { editOrReply } = require('#utils/message')
|
|||
const { STATICS } = require('#utils/statics');
|
||||
const { isSupported, getCodeFromAny } = require('#utils/translate');
|
||||
|
||||
// TODO: Turn this into a general purpose permissions constant
|
||||
const { Permissions } = require("detritus-client/lib/constants");
|
||||
|
||||
module.exports = {
|
||||
name: 'translate',
|
||||
label: 'text',
|
||||
|
@ -25,7 +22,7 @@ module.exports = {
|
|||
{name: 'to', default: 'en', type: 'language', help: "Target Language"},
|
||||
{name: 'from', default: 'auto', type: 'language', help: "Source Language"}
|
||||
],
|
||||
permissionsClient: [Permissions.EMBED_LINKS, Permissions.SEND_MESSAGES, Permissions.READ_MESSAGE_HISTORY, Permissions.USE_EXTERNAL_EMOJIS],
|
||||
permissionsClient: [...PERMISSION_GROUPS.baseline],
|
||||
run: async (context, args) => {
|
||||
await context.triggerTyping();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue