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
Showing only changes of commit 1348abbd48 - Show all commits

View File

@ -2,9 +2,9 @@ import { Message } from "discord.js";
magnetotail marked this conversation as resolved Outdated

Would like an enum of message types and a method with input message and output array of message types for possible messages with multiple things.

Also maybe remove message at start of function names to improve visibility by shorter function name. "isVoteMessage(message)" is precise and readable enough

Would like an enum of message types and a method with input message and output array of message types for possible messages with multiple things. Also maybe remove message at start of function names to improve visibility by shorter function name. "isVoteMessage(message)" is precise and readable enough
// branded types to differentiate objects of identical Type but different contents
export type VoteEndMessage = Message & { readonly __brand: 'voteend' }
export type AnnouncementMessage = Message & { readonly __brand: 'announcement' }
export type VoteMessage = Message & { readonly __brand: 'vote' }
export type VoteEndMessage = Message<true> & { readonly __brand: 'voteend' }
export type AnnouncementMessage = Message<true> & { readonly __brand: 'announcement' }
export type VoteMessage = Message<true> & { readonly __brand: 'vote' }
export type KnownDiscordMessage = VoteMessage | VoteEndMessage | AnnouncementMessage