feat/40-reroll-on-disinterest #54

Merged
kenobi merged 73 commits from feat/40-reroll-on-disinterest into master 2023-11-19 20:24:36 +01:00
4 changed files with 3 additions and 7 deletions
Showing only changes of commit 1a13638ed9 - Show all commits

View File

@ -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()

View File

@ -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";

View File

@ -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"

View File

@ -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

duplicate check. already checked before call in handleMessageReactionAdd

duplicate check. already checked before call in handleMessageReactionAdd

removed

removed
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 })