chore: release v2.8.8
- User.themeColors - Update ClientBuild
This commit is contained in:
@@ -5,6 +5,7 @@ const Invite = require('./Invite');
|
||||
const { Message } = require('./Message');
|
||||
const User = require('./User');
|
||||
const { Util } = require('..');
|
||||
const { Error: Error_ } = require('../errors');
|
||||
const { Opcodes, NitroType, HypeSquadType } = require('../util/Constants');
|
||||
const DataResolver = require('../util/DataResolver');
|
||||
const PurchasedFlags = require('../util/PurchasedFlags');
|
||||
@@ -487,6 +488,31 @@ class ClientUser extends User {
|
||||
}
|
||||
return collection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Change Theme color
|
||||
* @param {ColorResolvable} primary The primary color of the user's profile
|
||||
* @param {ColorResolvable} accent The accent color of the user's profile
|
||||
* @returns {Promise<ClientUser>}
|
||||
*/
|
||||
async setThemeColors(primary, accent) {
|
||||
if (!primary || !accent) throw new Error('PRIMARY_COLOR or ACCENT_COLOR are required.');
|
||||
// Check nitro
|
||||
if (this.nitroType !== 'NITRO_BOOST') {
|
||||
throw new Error_('NITRO_BOOST_REQUIRED', 'themeColors');
|
||||
}
|
||||
primary = Util.resolveColor(primary) || this.themeColors[0];
|
||||
accent = Util.resolveColor(accent) || this.themeColors[1];
|
||||
const data_ = await this.client.api.users['@me'].profile.patch({
|
||||
data: {
|
||||
theme_colors: [primary, accent],
|
||||
},
|
||||
});
|
||||
this._ProfilePatch({
|
||||
user_profile: data_,
|
||||
});
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = ClientUser;
|
||||
|
Reference in New Issue
Block a user