Skip to content

Commit c941f41

Browse files
committed
docs: add example for updating unicode_emoji field
1 parent 4c2aa04 commit c941f41

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/managers/RoleManager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class RoleManager extends CachedManager {
106106
* @property {number} [position] The position of the new role
107107
* @property {boolean} [mentionable] Whether or not the new role should be mentionable
108108
* @property {?(BufferResolvable|Base64Resolvable)} [icon] The icon for the role
109-
* @property {?string} [unicodeEmoji] The unicode emoji for the role
109+
* @property {?string} [unicodeEmoji] The name of the unicode emoji for the role
110110
* @property {string} [reason] The reason for creating this role
111111
*/
112112

src/structures/Role.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class Role extends Base {
9090
this.icon = data.icon;
9191

9292
/**
93-
* The unicode emoji of the role
93+
* The name of the unicode emoji for the role
9494
* @type {?string}
9595
*/
9696
this.unicodeEmoji = data.unicode_emoji;
@@ -196,7 +196,7 @@ class Role extends Base {
196196
* @property {PermissionResolvable} [permissions] The permissions of the role
197197
* @property {boolean} [mentionable] Whether or not the role should be mentionable
198198
* @property {?(BufferResolvable|Base64Resolvable)} [icon] The icon for the role
199-
* @property {?string} [unicodeEmoji] The unicode emoji for the role
199+
* @property {?string} [unicodeEmoji] The name of the unicode emoji for the role
200200
*/
201201

202202
/**
@@ -318,9 +318,14 @@ class Role extends Base {
318318

319319
/**
320320
* Sets a new unicode emoji for the role.
321-
* @param {?string} unicodeEmoji The unicode emoji for the role
321+
* @param {?string} unicodeEmoji The name of the new unicode emoji for the role
322322
* @param {string} [reason] Reason for changing the role's unicode emoji
323323
* @returns {Promise<Role>}
324+
* @example
325+
* // Set a new unicode emoji for the role
326+
* role.setUnicodeEmoji('robot')
327+
* .then(updated => console.log(`Set unicode emoji for the role to ${updated.unicodeEmoji}`))
328+
* .catch(console.error);
324329
*/
325330
setUnicodeEmoji(unicodeEmoji, reason) {
326331
return this.edit({ unicodeEmoji }, reason);

0 commit comments

Comments
 (0)