buddy

node MVC discord bot
Log | Files | Refs | README

MESSAGE_UPDATE.js (526B)


      1 'use strict';
      2 
      3 const { Events } = require('../../../util/Constants');
      4 
      5 module.exports = (client, packet) => {
      6   const { old, updated } = client.actions.MessageUpdate.handle(packet.d);
      7   if (old && updated) {
      8     /**
      9      * Emitted whenever a message is updated - e.g. embed or content change.
     10      * @event Client#messageUpdate
     11      * @param {Message} oldMessage The message before the update
     12      * @param {Message} newMessage The message after the update
     13      */
     14     client.emit(Events.MESSAGE_UPDATE, old, updated);
     15   }
     16 };