UNPKG

selfbot-discord

Version:
21 lines (18 loc) • 576 B
const AbstractHandler = require('./AbstractHandler'); class RelationshipAddHandler extends AbstractHandler { handle(packet) { const client = this.packetManager.client; const data = packet.d; client.actions.RelationshipAdd.handle(data); if (data.type === 1) { client.fetchUser(data.id).then(user => { client.user.friends.set(user.id, user); }); } else if (data.type === 2) { client.fetchUser(data.id).then(user => { client.user.blocked.set(user.id, user); }); } } } module.exports = RelationshipAddHandler;