mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-15 05:41:51 +00:00
starboard: fix category overrides not working
This commit is contained in:
parent
7fb7787583
commit
e7d647f1e6
1 changed files with 10 additions and 6 deletions
|
@ -1,6 +1,6 @@
|
|||
import { starboardEvt } from "../types";
|
||||
import { Message } from "eris";
|
||||
import { UnknownUser, resolveMember, noop } from "src/utils";
|
||||
import { Message, TextChannel } from "eris";
|
||||
import { UnknownUser, resolveMember, noop, resolveUser } from "src/utils";
|
||||
import { saveMessageToStarboard } from "../util/saveMessageToStarboard";
|
||||
|
||||
export const StarboardReactionAddEvt = starboardEvt({
|
||||
|
@ -26,11 +26,15 @@ export const StarboardReactionAddEvt = starboardEvt({
|
|||
// No self-votes!
|
||||
if (msg.author.id === userId) return;
|
||||
|
||||
const user = await resolveMember(pluginData.client, pluginData.guild, userId);
|
||||
if (user instanceof UnknownUser) return;
|
||||
if (user.bot) return;
|
||||
const member = await resolveMember(pluginData.client, pluginData.guild, userId);
|
||||
if (!member || member.bot) return;
|
||||
|
||||
const config = pluginData.config.getMatchingConfig({
|
||||
member,
|
||||
channelId: msg.channel.id,
|
||||
categoryId: (msg.channel as TextChannel).parentID,
|
||||
});
|
||||
|
||||
const config = pluginData.config.getMatchingConfig({ member: user, channelId: msg.channel.id });
|
||||
const applicableStarboards = Object.values(config.boards)
|
||||
.filter(board => board.enabled)
|
||||
// Can't star messages in the starboard channel itself
|
||||
|
|
Loading…
Add table
Reference in a new issue