3. User Note
Credit: Discord S.C.U.M
This commit is contained in:
parent
c8598a36d5
commit
8c7dfd595c
@ -92,7 +92,9 @@ class UserManager extends CachedManager {
|
|||||||
|
|
||||||
const data = await this.client.api.users(id).get();
|
const data = await this.client.api.users(id).get();
|
||||||
const userObject = this._add(data, cache);
|
const userObject = this._add(data, cache);
|
||||||
if(!userObject.bot) await userObject.getProfile().catch(() => {});
|
await userObject.getProfile().catch(() => {});
|
||||||
|
const noteObject = await this.client.api.users['@me'].notes(id).get().catch(() => null);
|
||||||
|
userObject.note = noteObject?.note ?? null;
|
||||||
return userObject;
|
return userObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,6 +39,7 @@ class User extends Base {
|
|||||||
this.premiumGuildSince = null;
|
this.premiumGuildSince = null;
|
||||||
this.mutualGuilds = new Collection();
|
this.mutualGuilds = new Collection();
|
||||||
this.applications = null;
|
this.applications = null;
|
||||||
|
this.note = null;
|
||||||
this._patch(data);
|
this._patch(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -422,6 +423,13 @@ class User extends Base {
|
|||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async setNote(note = null) {
|
||||||
|
await this.client.api.users['@me']
|
||||||
|
.notes(id)
|
||||||
|
.put({ data: { note } });
|
||||||
|
return this.note = note;
|
||||||
|
}
|
||||||
|
|
||||||
// These are here only for documentation purposes - they are implemented by TextBasedChannel
|
// These are here only for documentation purposes - they are implemented by TextBasedChannel
|
||||||
/* eslint-disable no-empty-function */
|
/* eslint-disable no-empty-function */
|
||||||
send() {}
|
send() {}
|
||||||
|
Loading…
Reference in New Issue
Block a user