mirror of
https://github.com/danbulant/discord.js
synced 2026-05-25 13:02:38 +00:00
23 lines
473 B
JavaScript
23 lines
473 B
JavaScript
const Action = require('./Action');
|
|
const Message = require('../../structures/Message');
|
|
|
|
class MessageCreateAction extends Action {
|
|
|
|
handle(data) {
|
|
const client = this.client;
|
|
const channel = client.channels.get(data.channel_id);
|
|
|
|
if (channel) {
|
|
const message = channel._cacheMessage(new Message(channel, data, client));
|
|
return {
|
|
m: message,
|
|
};
|
|
}
|
|
|
|
return {
|
|
m: null,
|
|
};
|
|
}
|
|
}
|
|
|
|
module.exports = MessageCreateAction;
|