update
This commit is contained in:
@@ -1,16 +1,19 @@
|
||||
'use strict';
|
||||
const { Events } = require('../../../util/Constants');
|
||||
module.exports = (client, packet) => {
|
||||
/**
|
||||
* Emitted whenever a recipient is added from a group DM.
|
||||
* @event Client#channelRecipientAdd
|
||||
* @param {PartialGroupDMChannel} channel Group DM channel
|
||||
* @param {User} user User
|
||||
*/
|
||||
const { Events, Status } = require('../../../util/Constants');
|
||||
module.exports = (client, packet, shard) => {
|
||||
const channel = client.channels.cache.get(packet.d.channel_id);
|
||||
if (!channel) return;
|
||||
if (!channel._recipients) channel._recipients = [];
|
||||
channel._recipients.push(packet.d.user);
|
||||
const user = client.users._add(packet.d.user);
|
||||
client.emit(Events.CHANNEL_RECIPIENT_ADD, channel, user);
|
||||
if (channel) {
|
||||
if (!channel._recipients) channel._recipients = [];
|
||||
channel._recipients.push(packet.d.user);
|
||||
const user = client.users._add(packet.d.user);
|
||||
if (shard.status == Status.READY) {
|
||||
/**
|
||||
* Emitted whenever a recipient is added from a group DM.
|
||||
* @event Client#channelRecipientAdd
|
||||
* @param {GroupDMChannel} channel Group DM channel
|
||||
* @param {User} user User
|
||||
*/
|
||||
client.emit(Events.CHANNEL_RECIPIENT_ADD, channel, user);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@@ -1,16 +1,16 @@
|
||||
'use strict';
|
||||
const { Events } = require('../../../util/Constants');
|
||||
module.exports = (client, packet) => {
|
||||
/**
|
||||
* Emitted whenever a recipient is removed from a group DM.
|
||||
* @event Client#channelRecipientRemove
|
||||
* @param {PartialGroupDMChannel} channel Group DM channel
|
||||
* @param {User} user User
|
||||
*/
|
||||
const channel = client.channels.cache.get(packet.d.channel_id);
|
||||
if (!channel) return;
|
||||
if (!channel._recipients) channel._recipients = [];
|
||||
channel._recipients = channel._recipients.filter(r => r !== packet.d.user.id);
|
||||
const user = client.users._add(packet.d.user);
|
||||
client.emit(Events.CHANNEL_RECIPIENT_REMOVE, channel, user);
|
||||
if (channel) {
|
||||
if (!channel._recipients) channel._recipients = [];
|
||||
channel._recipients = channel._recipients.filter(u => u.id !== packet.d.user.id);
|
||||
/**
|
||||
* Emitted whenever a recipient is removed from a group DM.
|
||||
* @event Client#channelRecipientRemove
|
||||
* @param {GroupDMChannel} channel Group DM channel
|
||||
* @param {User} user User
|
||||
*/
|
||||
client.emit(Events.CHANNEL_RECIPIENT_REMOVE, channel, client.users._add(packet.d.user));
|
||||
}
|
||||
};
|
||||
|
@@ -1,11 +0,0 @@
|
||||
'use strict';
|
||||
const { Events } = require('../../../util/Constants');
|
||||
|
||||
module.exports = (client, { d: data }) => {
|
||||
for (const command of data.application_commands) {
|
||||
const user = client.users.cache.get(command.application_id);
|
||||
if (!user || !user.bot) continue;
|
||||
user.application?.commands?._add(command, true);
|
||||
}
|
||||
client.emit(Events.GUILD_APPLICATION_COMMANDS_UPDATE, data);
|
||||
};
|
@@ -1,16 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const { Events } = require('../../../util/Constants');
|
||||
|
||||
module.exports = (client, { d: data }) => {
|
||||
const channel = client.channels.cache.get(data.channel_id);
|
||||
/**
|
||||
* Emitted whenever message is acknowledged (mark read / unread)
|
||||
* @event Client#messageAck
|
||||
* @param {TextChannel} channel Channel
|
||||
* @param {Snowflake} message_id Message ID
|
||||
* @param {boolean} isRead Whether the message is read
|
||||
* @param {Object} raw Raw data
|
||||
*/
|
||||
client.emit(Events.MESSAGE_ACK, channel, data.message_id, !data.manual, data);
|
||||
};
|
@@ -1,5 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = (client, { d: data }) => {
|
||||
client.user.notes.set(data.id, data.note);
|
||||
client.notes.cache.set(data.id, data.note);
|
||||
};
|
||||
|
Reference in New Issue
Block a user