mirror of
https://github.com/discordjs/discord.js.git
synced 2026-06-03 01:20:07 +00:00
* Cleanup Part 2: Electric Boogaloo (Reloaded) * Moar cleanup * Tweak NOT_A_PERMISSION error
23 lines
475 B
JavaScript
23 lines
475 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 {
|
|
message,
|
|
};
|
|
}
|
|
|
|
return {
|
|
message: null,
|
|
};
|
|
}
|
|
}
|
|
|
|
module.exports = MessageCreateAction;
|