/[sudobot]/branches/2.x/src/events/message/MessageUpdateEvent.ts
ViewVC logotype

Annotation of /branches/2.x/src/events/message/MessageUpdateEvent.ts

Parent Directory Parent Directory | Revision Log Revision Log


Revision 577 - (hide annotations)
Mon Jul 29 18:52:37 2024 UTC (8 months ago) by rakinar2
File MIME type: application/typescript
File size: 970 byte(s)
chore: add old version archive branches (2.x to 9.x-dev)
1 rakinar2 577 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     }

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26