1 |
rakin |
51 |
import BaseEvent from '../../utils/structures/BaseEvent'; |
2 |
|
|
import DiscordClient from '../../client/Client'; |
3 |
|
|
import { Message, MessageReaction } from 'discord.js'; |
4 |
|
|
|
5 |
|
|
export default class MessageReactionAddEvent extends BaseEvent { |
6 |
|
|
constructor() { |
7 |
|
|
super('messageReactionAdd'); |
8 |
|
|
} |
9 |
|
|
|
10 |
|
|
async run(client: DiscordClient, reaction: MessageReaction) { |
11 |
|
|
console.log('inside'); |
12 |
|
|
|
13 |
|
|
if (!reaction || !reaction.message.guild || reaction.message.channel.type === 'DM') { |
14 |
|
|
return; |
15 |
|
|
} |
16 |
|
|
|
17 |
|
|
await (client.msg = <Message> reaction.message); |
18 |
|
|
await client.starboard.handle(reaction); |
19 |
|
|
} |
20 |
|
|
} |