mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-08 06:03:04 -04:00
update forced incognito visuals
This commit is contained in:
parent
bfc30b5ac3
commit
65e416add3
2 changed files with 24 additions and 8 deletions
|
@ -56,6 +56,7 @@ module.exports.BADGE_ICONS = Object.freeze({
|
||||||
|
|
||||||
module.exports.ICONS = Object.freeze({
|
module.exports.ICONS = Object.freeze({
|
||||||
"brand": "<:ico_brand:1237843729880977459>",
|
"brand": "<:ico_brand:1237843729880977459>",
|
||||||
|
"flask_mini": "<:ico_flask_mini:1260342544600928286>",
|
||||||
|
|
||||||
"home": "<:ico_home:1165257185488551976>",
|
"home": "<:ico_home:1165257185488551976>",
|
||||||
"image": "<:ico_image:1165257188235825274>",
|
"image": "<:ico_image:1165257188235825274>",
|
||||||
|
|
|
@ -2,15 +2,25 @@ const { Permissions, MessageFlags } = require("detritus-client/lib/constants")
|
||||||
const { basecamp } = require("../logging")
|
const { basecamp } = require("../logging")
|
||||||
const { createEmbed } = require("./embed")
|
const { createEmbed } = require("./embed")
|
||||||
const { COLORS } = require("#constants")
|
const { COLORS } = require("#constants")
|
||||||
|
const { icon, link } = require("./markdown")
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* These will force the command to become "incognito".
|
* These will force the command to become "incognito".
|
||||||
*/
|
*/
|
||||||
const BLOCK_REASONS = {
|
const BLOCK_REASONS = {
|
||||||
20016: "Slowmode",
|
20016: {
|
||||||
200000: "AutoMod",
|
message: "the channels slowmode settings",
|
||||||
|
support_article: 360016150952
|
||||||
|
},
|
||||||
|
200000: {
|
||||||
|
message: "the servers AutoMod setup",
|
||||||
|
support_article: 4421269296535
|
||||||
|
},
|
||||||
// TODO: Handle permissions properly, this works as a "hack" for now.
|
// TODO: Handle permissions properly, this works as a "hack" for now.
|
||||||
50013: "Missing Permissions"
|
50013: {
|
||||||
|
message: "the channels permission setup",
|
||||||
|
support_article: 10543994968087
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports.editOrReply = function(context, message, disableReference = false){
|
module.exports.editOrReply = function(context, message, disableReference = false){
|
||||||
|
@ -49,11 +59,16 @@ module.exports.editOrReply = function(context, message, disableReference = false
|
||||||
message.flags = MessageFlags.EPHEMERAL
|
message.flags = MessageFlags.EPHEMERAL
|
||||||
|
|
||||||
// Create a notice
|
// Create a notice
|
||||||
if(message.embeds && message.embeds.length <= 4){
|
if(message.content){
|
||||||
message.embeds.unshift({
|
if(message.embeds && message.embeds.length <= 4){
|
||||||
description: `<:incognito:1250198171859161199> This response has been made incognito due to ${BLOCK_REASONS[errorData.code]}.`,
|
message.embeds.unshift({
|
||||||
color: COLORS.incognito
|
description: `<:incognito:1250198171859161199> This response has been made incognito due to ${BLOCK_REASONS[errorData.code].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 ${BLOCK_REASONS[errorData.code].message} • ${link("https://support.discord.com/hc/en-us/articles/" + BLOCK_REASONS[errorData.code].support_article, "Learn More", "Support Article")}`
|
||||||
}
|
}
|
||||||
|
|
||||||
let replacementMessage = await context.createMessage(message);
|
let replacementMessage = await context.createMessage(message);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue