mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 18:43:31 +01:00
Add support for notes (#860)
* Add support for notes * Ensure consistency with notes from ready payload * Add getter method for users * Minor tweaks * Update warning messages * More minor fixes
This commit is contained in:
committed by
Schuyler Cebulskie
parent
a673a97441
commit
6dc95cd084
@@ -31,6 +31,15 @@ class ReadyHandler extends AbstractHandler {
|
||||
client._setPresence(presence.user.id, presence);
|
||||
}
|
||||
|
||||
if (data.notes) {
|
||||
for (const user in data.notes) {
|
||||
let note = data.notes[user];
|
||||
if (!note.length) note = null;
|
||||
|
||||
client.user.notes.set(user, note);
|
||||
}
|
||||
}
|
||||
|
||||
if (!client.user.bot && client.options.sync) client.setInterval(client.syncGuilds.bind(client), 30000);
|
||||
client.once('ready', client.syncGuilds.bind(client));
|
||||
|
||||
|
||||
12
src/client/websocket/packets/handlers/UserNoteUpdate.js
Normal file
12
src/client/websocket/packets/handlers/UserNoteUpdate.js
Normal file
@@ -0,0 +1,12 @@
|
||||
const AbstractHandler = require('./AbstractHandler');
|
||||
|
||||
class UserNoteUpdateHandler extends AbstractHandler {
|
||||
handle(packet) {
|
||||
const client = this.packetManager.client;
|
||||
const data = packet.d;
|
||||
|
||||
client.actions.UserNoteUpdate.handle(data);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = UserNoteUpdateHandler;
|
||||
Reference in New Issue
Block a user