import { MessageReaction } from 'discord.js' ; import { Handler } from '../../common/handler' ; import { IContainer } from '../../common/types' ; export class PointReactHandler extends Handler { public name : string = 'PointReact' ; constructor ( public container ) { super ( ) ; } public async execute ( reaction ) { const { message } = reaction ; const userReacted = reaction . users . cache . last ( ) ; if ( ! userReacted ) { return ; } if ( [ message . author ?. id , this . container . clientService . user ?. id ] . some ( ( id ) => id === userReacted . id ) ) { return ; } await this . container . pointService . awardPoints ( message . author ?. id , 1 ) ; } }