mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-10 23:23: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
|
@ -32,6 +32,21 @@ module.exports.editOrReply = function(context, message, disableReference = false
|
|||
});
|
||||
}
|
||||
|
||||
if(context._meta?.incognitoReason){
|
||||
// TODO: make this an applyIncognitoNotice helper
|
||||
if(message.content){
|
||||
if(message.embeds && message.embeds.length <= 4){
|
||||
message.embeds.unshift({
|
||||
description: `${icon("flask_incognito")} This response has been made incognito due to ${MESSAGE_BLOCK_REASONS[context._meta.incognitoReason].message}.`,
|
||||
color: COLORS.incognito
|
||||
})
|
||||
}
|
||||
} else {
|
||||
// Uses new subtext formatting to look more "native"
|
||||
message.content = `-# ${icon("flask_mini")} This response has been made incognito due to ${MESSAGE_BLOCK_REASONS[context._meta.incognitoReason].message} • ${link("https://support.discord.com/hc/en-us/articles/" + MESSAGE_BLOCK_REASONS[context._meta.incognitoReason].support_article, "Learn More", "Support Article")}`
|
||||
}
|
||||
}
|
||||
|
||||
return context.editOrRespond(message).catch(async (e)=>{
|
||||
const errorData = await e.response.json();
|
||||
if(MESSAGE_BLOCK_REASONS[errorData.code]){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue