userID blacklist

This commit is contained in:
nin0dev 2024-11-21 06:35:39 -05:00
parent f0c23d92af
commit 58936438d9

View file

@ -21,6 +21,10 @@ export default definePlugin({
type: OptionType.STRING, type: OptionType.STRING,
description: "Comma-separated list of channel IDs to watch" description: "Comma-separated list of channel IDs to watch"
}, },
userIDs: {
type: OptionType.STRING,
description: "Comma-separated list of user IDs to ignore"
},
maxChars: { maxChars: {
type: OptionType.NUMBER, type: OptionType.NUMBER,
description: "Maximum chars to check", description: "Maximum chars to check",
@ -32,7 +36,7 @@ export default definePlugin({
({ guildId, message }) { ({ guildId, message }) {
const msg = message as Message; const msg = message as Message;
if (UserStore.getCurrentUser().id === msg.author.id) return; if (UserStore.getCurrentUser().id === msg.author.id || selfPlugin.settings.store.userIDs?.split(",").includes(msg.author.id)) return;
if (!selfPlugin.settings.store.channelIDs?.split(",").includes(msg.channel_id) || msg.content.length > selfPlugin.settings.store.maxChars) return; if (!selfPlugin.settings.store.channelIDs?.split(",").includes(msg.channel_id) || msg.content.length > selfPlugin.settings.store.maxChars) return;
const res = await fetch("https://huskapi.nin0.dev", { const res = await fetch("https://huskapi.nin0.dev", {