feat/40-reroll-on-disinterest #54
@ -1,5 +1,4 @@
|
||||
import { GuildScheduledEvent, Message, MessageCreateOptions, TextChannel } from "discord.js";
|
||||
import { ScheduledTask } from "node-cron";
|
||||
import { v4 as uuid } from "uuid";
|
||||
import { client, yavinJellyfinHandler } from "../..";
|
||||
import { config } from "../configuration";
|
||||
@ -11,8 +10,6 @@ import { Emotes, NONE_OF_THAT } from "../constants";
|
||||
|
||||
export const name = 'guildScheduledEventCreate'
|
||||
|
||||
|
||||
|
||||
export async function execute(event: GuildScheduledEvent) {
|
||||
const requestId = uuid()
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { format, isToday, toDate } from "date-fns";
|
||||
import { format, isToday } from "date-fns";
|
||||
import { utcToZonedTime } from "date-fns-tz"
|
||||
import { GuildScheduledEvent } from "discord.js";
|
||||
import { logger } from "../logger";
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Collection, Guild, GuildMember, Role, User } from "discord.js"
|
||||
import { Collection, Guild, GuildMember, Role } from "discord.js"
|
||||
import { ChangedRoles, Maybe, PermissionLevel } from "../interfaces"
|
||||
import { logger } from "../logger"
|
||||
import { config } from "../configuration"
|
||||
|
@ -2,7 +2,6 @@ import { Message, MessageReaction, User } from "discord.js"
|
||||
import { client } from "../.."
|
||||
import { NONE_OF_THAT } from "../constants"
|
||||
import { logger } from "../logger"
|
||||
import { messageIsVoteMessage } from "./messageIdentifiers"
|
||||
import { getMembersWithRoleFromGuild } from "./roleFilter"
|
||||
import { config } from "../configuration"
|
||||
|
||||
@ -15,7 +14,7 @@ export default class VoteController {
|
||||
logger.info("ROLE MEMBERS " + JSON.stringify(watcherRoleMember), { requestId, guildId })
|
||||
const watcherRoleMemberCount = watcherRoleMember.size
|
||||
kenobi marked this conversation as resolved
Outdated
|
||||
logger.info(`MEMBER COUNT: ${watcherRoleMemberCount}`, { requestId, guildId })
|
||||
let noneOfThatReactions = messageReaction.message.reactions.cache.get(NONE_OF_THAT)?.users.cache.filter(x => x.id !== client.user?.id).size ?? 0
|
||||
const noneOfThatReactions = messageReaction.message.reactions.cache.get(NONE_OF_THAT)?.users.cache.filter(x => x.id !== client.user?.id).size ?? 0
|
||||
|
||||
const memberThreshold = (watcherRoleMemberCount / 2)
|
||||
logger.info(`Reroll ${noneOfThatReactions} > ${memberThreshold} ?`, { requestId, guildId })
|
||||
|
Loading…
Reference in New Issue
Block a user
duplicate check. already checked before call in handleMessageReactionAdd
removed