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,14 +1,11 @@
|
|||
const { paginator } = require('#client');
|
||||
const { DISCORD_INVITES, DEFAULT_PREFIXES } = require('#constants');
|
||||
const { DISCORD_INVITES, DEFAULT_PREFIXES, PERMISSION_GROUPS } = require('#constants');
|
||||
|
||||
const { createEmbed, formatPaginationEmbeds, page } = require('#utils/embed')
|
||||
const { codeblock, icon, link, pill, smallPill, iconPill, stringwrap } = require('#utils/markdown')
|
||||
const { editOrReply } = require('#utils/message');
|
||||
const { hasFeature } = require('#utils/testing');
|
||||
|
||||
// TODO: Turn this into a general purpose permissions constant
|
||||
const { Permissions } = require("detritus-client/lib/constants");
|
||||
|
||||
function createHelpPage(context, title, contents, descriptions) {
|
||||
return page(createEmbed("default", context, {
|
||||
description: `${title}\n\n` +
|
||||
|
@ -131,7 +128,7 @@ module.exports = {
|
|||
category: 'core',
|
||||
usage: 'help [<command>]'
|
||||
},
|
||||
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, "core/help")) categories["limited"] = `${iconPill("stars", "Limited Test Commands")}`;
|
||||
else if (categories["limited"]) delete categories["limited"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue