summaryrefslogtreecommitdiff
path: root/node_modules/discord.js/src/client/actions/MessageUpdate.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/discord.js/src/client/actions/MessageUpdate.js')
-rw-r--r--node_modules/discord.js/src/client/actions/MessageUpdate.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/node_modules/discord.js/src/client/actions/MessageUpdate.js b/node_modules/discord.js/src/client/actions/MessageUpdate.js
new file mode 100644
index 0000000..fe757c0
--- /dev/null
+++ b/node_modules/discord.js/src/client/actions/MessageUpdate.js
@@ -0,0 +1,26 @@
+'use strict';
+
+const Action = require('./Action');
+
+class MessageUpdateAction extends Action {
+ handle(data) {
+ const channel = this.getChannel(data);
+ if (channel) {
+ if (!channel.isTextBased()) 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;