mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
27 lines
602 B
JavaScript
27 lines
602 B
JavaScript
'use strict';
|
|
|
|
const Action = require('./Action');
|
|
|
|
class MessageUpdateAction extends Action {
|
|
handle(data) {
|
|
const channel = this.getChannel(data);
|
|
if (channel) {
|
|
if (!channel.isText()) return {};
|
|
|
|
const { id, channel_id, guild_id, author, timestamp, type } = data;
|
|
const message = this.getMessage({ id, channel_id, guild_id, author, timestamp, type }, channel);
|
|
if (message) {
|
|
const old = message._update(data);
|
|
return {
|
|
old,
|
|
updated: message,
|
|
};
|
|
}
|
|
}
|
|
|
|
return {};
|
|
}
|
|
}
|
|
|
|
module.exports = MessageUpdateAction;
|