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:
parent
8909849f2c
commit
14b59146eb
1 changed files with 8 additions and 0 deletions
|
|
@ -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) ||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue