Start move to configAccessibleObjects, exclude perm overrides from logs

configAccessibleObjects are used to guarantee backwards compatibility and consistency.
Perm overrides from our own plugins are ignored as to not spam logs through bot managed slowmode or companion channels
This commit is contained in:
Dark 2021-07-06 05:23:47 +02:00
parent dda19de6e6
commit d2dd103175
No known key found for this signature in database
GPG key ID: 384C4B4F5B1E25A8
28 changed files with 259 additions and 75 deletions

View file

@ -25,9 +25,6 @@ export const StarboardReactionAddEvt = starboardEvt({
}
}
// No self-votes!
if (msg.author.id === userId) return;
const member = await resolveMember(pluginData.client, pluginData.guild, userId);
if (!member || member.user.bot) return;
@ -61,7 +58,10 @@ export const StarboardReactionAddEvt = starboardEvt({
});
});
const selfStar = msg.author.id === userId;
for (const starboard of applicableStarboards) {
if (selfStar && !starboard.allow_selfstars) continue;
// Save reaction into the database
await pluginData.state.starboardReactions.createStarboardReaction(msg.id, userId).catch(noop);

View file

@ -9,6 +9,7 @@ const StarboardOpts = t.type({
channel_id: t.string,
stars_required: t.number,
star_emoji: tNullable(t.array(t.string)),
allow_selfstars: tNullable(t.boolean),
copy_full_embed: tNullable(t.boolean),
enabled: tNullable(t.boolean),
show_star_count: t.boolean,