feat(onePingPerDM): never throttle pings from chosen users (#323)

* feat(onePingPerDM): add ignoreUsers list for unthrottled pings

Adds a comma-separated list of user IDs whose messages will always trigger an audio ping, even when OnePingPerDM would normally suppress subsequent pings.

* Update index.ts

* Update index.ts

---------

Co-authored-by: thororen <78185467+thororen1234@users.noreply.github.com>
This commit is contained in:
gitb0i 2025-08-03 18:40:29 -07:00 • committed by GitHub
parent 8909849f2c
commit 14b59146eb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -35,6 +35,12 @@ const settings = definePluginSettings({
description: "Receive audio pings for @everyone and @here in group DMs",
default: false,
},
ignoreUsers: {
type: OptionType.STRING,
description: "User IDs (comma + space) whose pings should NEVER be throttled",
restartNeeded: true,
default: ""
}
});
export default definePlugin({
@ -54,6 +60,8 @@ export default definePlugin({
}]
}],
isPrivateChannelRead(message: MessageJSON) {
const ignoreList = settings.store.ignoreUsers.split(", ").filter(Boolean)
if (ignoreList.includes(message.author.id)) return true;
const channelType = ChannelStore.getChannel(message.channel_id)?.type;
if (
(channelType !== ChannelType.DM && channelType !== ChannelType.GROUP_DM) ||