diff options
author | outfoxxed <outfoxxed@outfoxxed.me> | 2023-05-13 17:01:10 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-14 00:01:10 +0000 |
commit | caf77a3d7fed3e270da7692dc112f70784a85c56 (patch) | |
tree | d8a84b08ae523ef5cdfd08098ff93fb8934ee7f6 /src | |
parent | 7a27de892767aa8d9104ef16fe5ba2a2a75568cf (diff) | |
download | Vencord-caf77a3d7fed3e270da7692dc112f70784a85c56.tar.gz Vencord-caf77a3d7fed3e270da7692dc112f70784a85c56.tar.bz2 Vencord-caf77a3d7fed3e270da7692dc112f70784a85c56.zip |
NoReplyMention: add option to only exclude specific users from pings (#1107)
Co-authored-by: V <vendicated@riseup.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/noReplyMention.tsx | 24 | ||||
-rw-r--r-- | src/utils/constants.ts | 6 |
2 files changed, 25 insertions, 5 deletions
diff --git a/src/plugins/noReplyMention.tsx b/src/plugins/noReplyMention.tsx index 3ec8aef..16b3a3e 100644 --- a/src/plugins/noReplyMention.tsx +++ b/src/plugins/noReplyMention.tsx @@ -22,12 +22,27 @@ import definePlugin, { OptionType } from "@utils/types"; import type { Message } from "discord-types/general"; const settings = definePluginSettings({ - exemptList: { + userList: { description: - "List of users to exempt from this plugin (separated by commas or spaces)", + "List of users to allow or exempt pings for (separated by commas or spaces)", type: OptionType.STRING, default: "1234567890123445,1234567890123445", }, + shouldPingListed: { + description: "Behaviour", + type: OptionType.SELECT, + options: [ + { + label: "Do not ping the listed users", + value: false, + }, + { + label: "Only ping the listed users", + value: true, + default: true, + }, + ], + }, inverseShiftReply: { description: "Invert Discord's shift replying behaviour (enable to make shift reply mention user)", type: OptionType.BOOLEAN, @@ -38,11 +53,12 @@ const settings = definePluginSettings({ export default definePlugin({ name: "NoReplyMention", description: "Disables reply pings by default", - authors: [Devs.DustyAngel47, Devs.axyie, Devs.pylix], + authors: [Devs.DustyAngel47, Devs.axyie, Devs.pylix, Devs.outfoxxed], settings, shouldMention(message: Message, isHoldingShift: boolean) { - const isExempt = settings.store.exemptList.includes(message.author.id); + const isListed = settings.store.userList.includes(message.author.id); + const isExempt = settings.store.shouldPingListed ? isListed : !isListed; return settings.store.inverseShiftReply ? isHoldingShift !== isExempt : !isHoldingShift && isExempt; }, diff --git a/src/utils/constants.ts b/src/utils/constants.ts index b53c1d7..1c70470 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -290,5 +290,9 @@ export const Devs = /* #__PURE__*/ Object.freeze({ CatNoir: { name: "CatNoir", id: 260371016348336128n - } + }, + outfoxxed: { + name: "outfoxxed", + id: 837425748435796060n + }, }); |