Files
discord.js-selfbot/src/client/websocket/handlers/RELATIONSHIP_ADD.js

18 lines
529 B
JavaScript
Raw Normal View History

'use strict';
const { Events, Relationship } = require('../../../util/Constants');
module.exports = (client, { d: data }) => {
2022-04-16 19:01:05 +07:00
if (data.user) {
client.users._add(data.user);
}
client.relationships.cache.set(data.id, data.type);
/**
* Emitted whenever a relationship is updated.
2022-05-06 21:17:20 +07:00
* @event Client#relationshipAdd
* @param {UserId} user The userID that was updated
* @param {RelationshipType} type The new relationship type
*/
client.emit(Events.RELATIONSHIP_ADD, data.id, Relationship[data.type]);
};