-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
13 starboard #96
base: main
Are you sure you want to change the base?
13 starboard #96
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made a significant architecture change by adding the concept of reaction handlers. Instead of all reaction handling being done in messageReactionAdd.ts
, that file now simply calls the execute message on separate ReactionHandlers. So duplicating reactions was pulled out into its own handler and starboard reaction handling is also in its own handler. In addition, there is a separate messageReactionRemove.ts. Both of these can consume reaction handlers, so we can reuse the starboard reaction handling for both.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
This reverts commit 44c980e.
Co-authored-by: AverageHelper <[email protected]>
K I'm gonna look at this today finally |
Additional considerations:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last comments and then I think it's ready:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this file be called index.ts
instead, following the pattern in src/events/
?
export const messageReactionRemove = onEvent('messageReactionRemove', { | ||
once: false, | ||
execute: buildExecute(allReactionHandlers), | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feels weird for the 'messageReactionRemove'
event to execute allReactionHandlers
, instead of just a remove
handler..
} else { | ||
const customReact = await getCustomReact(guild, react); | ||
if (customReact === undefined) { | ||
throw new UserMessageError('React option must be a valid reaction'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For clarity:
throw new UserMessageError('React option must be a valid reaction'); | |
throw new UserMessageError('React option must be a valid emoji'); |
I don't think you can send a "reaction" as a command argument per-se, but emojis are fair game :P
}, | ||
}); | ||
|
||
await replyPrivately('Reactboard created!'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally this would say something different depending on whether the board was created or updated or destroyed, but since we don't differentiate that rn, more generic language might be best:
await replyPrivately('Reactboard created!'); | |
await replyPrivately('Reactboard set!'); |
352c3fa
to
3bfaee1
Compare
Resolves #13