@@ -683,6 +683,17 @@ class Client extends EventEmitter {
683683 return this . requestHandler . request ( "POST" , Endpoints . COMMANDS ( this . application . id ) , true , command ) . then ( ( command ) => new ApplicationCommand ( command , this ) ) ;
684684 }
685685
686+ /**
687+ * Create an emoji for this application
688+ * @arg {Object} options Emoji options
689+ * @arg {String} options.image The base 64 encoded string
690+ * @arg {String} options.name The name of emoji
691+ * @returns {Promise<Object> } An emoji object
692+ */
693+ createEmoji ( options ) {
694+ return this . requestHandler . request ( "POST" , Endpoints . APPLICATION_EMOJIS ( this . application . id ) , true , options ) ;
695+ }
696+
686697 /**
687698 * Create a group channel with other users
688699 * @arg {Object} options The options for the group channel
@@ -1237,6 +1248,15 @@ class Client extends EventEmitter {
12371248 return this . requestHandler . request ( "DELETE" , Endpoints . COMMAND ( this . application . id , commandID ) , true ) ;
12381249 }
12391250
1251+ /**
1252+ * Delete an emoji for this application
1253+ * @arg {String} emojiID The id of the emoji
1254+ * @returns {Promise }
1255+ */
1256+ deleteEmoji ( emojiID ) {
1257+ return this . requestHandler . request ( "DELETE" , Endpoints . APPLICATION_EMOJI ( this . application . id , emojiID ) , true ) ;
1258+ }
1259+
12401260 /**
12411261 * Delete a guild (bot user must be owner)
12421262 * @arg {String} guildID The ID of the guild
@@ -1681,6 +1701,16 @@ class Client extends EventEmitter {
16811701 return this . requestHandler . request ( "PATCH" , Endpoints . COMMAND ( this . application . id , commandID ) , true , command ) . then ( ( command ) => new ApplicationCommand ( command , this ) ) ;
16821702 }
16831703
1704+ /**
1705+ * Edit an existing emoji for this application
1706+ * @arg {Object} options Emoji options
1707+ * @arg {String} options.name The name of emoji
1708+ * @returns {Promise<Object> } An emoji object
1709+ */
1710+ editEmoji ( emojiID , options ) {
1711+ return this . requestHandler . request ( "PATCH" , Endpoints . APPLICATION_EMOJI ( this . application . id , emojiID ) , true , options ) ;
1712+ }
1713+
16841714 /**
16851715 * Edits command permissions for a specific command in a guild.
16861716 * Note: You can only add up to 10 permission overwrites for a command.
@@ -2603,6 +2633,39 @@ class Client extends EventEmitter {
26032633 } ) . then ( ( dmChannel ) => new DMChannel ( dmChannel , this ) ) ;
26042634 }
26052635
2636+ /**
2637+ * Get an emoji for this application
2638+ * @arg {String} emojiID The ID of the emoji
2639+ * @returns {Promise<Object> } Resolves with an emoji object
2640+ */
2641+ getEmoji ( emojiID ) {
2642+ return this . requestHandler . request ( "GET" , Endpoints . APPLICATION_EMOJI ( this . application . id , emojiID ) , true ) . then ( ( emoji ) => {
2643+ if ( emoji . user ) {
2644+ emoji . user = this . users . update ( emoji . user , this ) ;
2645+ }
2646+
2647+ return emoji ;
2648+ } ) ;
2649+ }
2650+
2651+ /**
2652+ * Get the emojis for this application
2653+ * @returns {Promise<Object> } Resolves with an object that contains a property "items" which is an array of emoji objects
2654+ */
2655+ getEmojis ( ) {
2656+ return this . requestHandler . request ( "GET" , Endpoints . APPLICATION_EMOJIS ( this . application . id ) , true ) . then ( ( data ) => {
2657+ data . items = data . items . map ( ( emoji ) => {
2658+ if ( emoji . user ) {
2659+ emoji . user = this . users . update ( emoji . user , this ) ;
2660+ }
2661+
2662+ return emoji ;
2663+ } ) ;
2664+
2665+ return data ;
2666+ } ) ;
2667+ }
2668+
26062669 /**
26072670 * Get a guild from the guild's emoji ID
26082671 * @arg {String} emojiID The ID of the emoji
0 commit comments