2022-04-12 12:46:08 +07:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
const { Events } = require('../../../util/Constants');
|
|
|
|
|
|
|
|
|
|
module.exports = (client, { d: data }) => {
|
2022-04-16 19:01:05 +07:00
|
|
|
if (data.user) {
|
|
|
|
|
client.users._add(data.user);
|
|
|
|
|
}
|
2022-04-16 17:44:43 +07:00
|
|
|
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
|
2022-04-16 17:44:43 +07:00
|
|
|
* @param {Number} type The new relationship type
|
|
|
|
|
*/
|
|
|
|
|
client.emit(Events.RELATIONSHIP_ADD, data.id, data.type);
|
2022-04-12 12:46:08 +07:00
|
|
|
};
|