Files
discord.js-selfbot/src/client/websocket/handlers/RELATIONSHIP_ADD.js
March 7th 07d52ee41b fix: opcode 24 (Interaction search function)
Todo: Rewrite slash command ...
2022-06-12 19:13:12 +07:00

18 lines
543 B
JavaScript

'use strict';
const { Events, RelationshipTypes } = require('../../../util/Constants');
module.exports = (client, { d: data }) => {
if (data.user) {
client.users._add(data.user);
}
client.relationships.cache.set(data.id, data.type);
/**
* Emitted whenever a relationship is updated.
* @event Client#relationshipAdd
* @param {Snowflake} user The userID that was updated
* @param {RelationshipTypes} type The new relationship type
*/
client.emit(Events.RELATIONSHIP_ADD, data.id, RelationshipTypes[data.type]);
};