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
2 changed files with 2 additions and 2 deletions
Showing only changes of commit 98d1ca73b5 - Show all commits

View File

@ -10,7 +10,7 @@ export const name = 'messageReactionAdd'
export async function execute(messageReaction: MessageReaction, user: User) {
if (user.id == client.user?.id)
logger.info('Skipping bot reaction')
kenobi marked this conversation as resolved Outdated

need to return here

need to return here

added

added
const requestId = newRequestId
const requestId = newRequestId()
const guildId = messageReaction.message.inGuild() ? messageReaction.message.guildId : noGuildId
const reactedUponMessage: Message = messageReaction.message.partial ? await messageReaction.message.fetch() : messageReaction.message
if (!messageReaction.message.guild) {

View File

@ -1,7 +1,7 @@
import { createLogger, format, transports } from "winston"
import { config } from "./configuration"
import { v4 } from "uuid"
export const newRequestId = v4()
export function newRequestId() { return v4() }
magnetotail marked this conversation as resolved Outdated

why?

why?

This is a complete and total, boneheaded error :D
The intention was to present an more memorizable way to get a new uuid/v4.
Instead this just sets it once, making it useless.
It should be an exported function, returning the output of v4() and the callsite would be
const requestId = newRequestId()
This would prevent the
import { v4 as uuid } from "uuid" or const requestId = v4() which, I think, are tedious or non-obvious.
If you think this is a bad idea, I will gladly revert it though :)

This is a complete and total, boneheaded error :D The _intention_ was to present an more memorizable way to get a new uuid/v4. Instead this just sets it once, making it useless. It _should_ be an exported function, returning the output of `v4()` and the callsite would be `const requestId = newRequestId()` This would prevent the `import { v4 as uuid } from "uuid"` or `const requestId = v4()` which, I think, are tedious or non-obvious. If you think this is a bad idea, I will gladly revert it though :)

I dont think it's bad tbh if we dont need the v4 as uuid import then. But I would also like an eventhandler framework where we would prevent usual boilerplate code like looking for guild Id or making a request id and put those base checks and things in a base class and just have handling code in a subclass. But that is quite hard as I learned

I dont think it's bad tbh if we dont need the v4 as uuid import then. But I would also like an eventhandler framework where we would prevent usual boilerplate code like looking for guild Id or making a request id and put those base checks and things in a base class and just have handling code in a subclass. But that is quite hard as I learned
export const noGuildId = 'NoGuildId'