1 |
import BaseEvent from '../../utils/structures/BaseEvent'; |
2 |
import { FileOptions, Message } from 'discord.js'; |
3 |
import DiscordClient from '../../client/Client'; |
4 |
import CommandOptions from '../../types/CommandOptions'; |
5 |
import path from 'path'; |
6 |
import MessageEmbed from '../../client/MessageEmbed'; |
7 |
|
8 |
export default class MessageUpdateEvent extends BaseEvent { |
9 |
constructor() { |
10 |
super('messageUpdate'); |
11 |
} |
12 |
|
13 |
async run(client: DiscordClient, oldMessage: Message, newMessage: Message) { |
14 |
if (oldMessage.author.bot || !oldMessage.guild || oldMessage.channel.type === 'DM' || oldMessage.content === newMessage.content) |
15 |
return; |
16 |
|
17 |
let msg = await client.msg; |
18 |
await (client.msg = newMessage); |
19 |
|
20 |
await client.messageFilter.start(newMessage); |
21 |
// await client.messageFilter.start(newMessage, this.commandManager); |
22 |
|
23 |
await client.logger.logEdit(oldMessage, newMessage); |
24 |
await (client.msg = msg); |
25 |
} |
26 |
} |