import { Client , GuildMember , Message , MessageReaction , User } from 'discord.js' ; import { Event } from './event' ; type ReactionData = { reaction : MessageReaction ; message : Message ; member : GuildMember ; } ; export abstract class MessageReactionEvent extends Event { constructor ( client , protected reaction , protected user ) { super ( client ) ; } param reaction param user protected async fetchData ( reaction , user ) { if ( reaction . partial ) { reaction = await reaction . fetch ( ) ; } let message = reaction . message ; if ( message . partial ) { message = await reaction . message . fetch ( ) ; } if ( user . partial ) { user = await user . fetch ( ) ; } const member = message . guild . members . resolve ( user ) ; return { reaction , message , member , } ; } }