Skip to content

Commit

Permalink
feat: application emojis (#1036)
Browse files Browse the repository at this point in the history
  • Loading branch information
sdanialraza authored Jul 20, 2024
1 parent cbcd51d commit 5f22a6b
Show file tree
Hide file tree
Showing 8 changed files with 240 additions and 12 deletions.
37 changes: 37 additions & 0 deletions deno/rest/v10/emoji.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,40 @@ export type RESTPatchAPIGuildEmojiResult = APIEmoji;
* https://discord.com/developers/docs/resources/emoji#delete-guild-emoji
*/
export type RESTDeleteAPIGuildEmojiResult = never;

/**
* https://discord.com/developers/docs/resources/emoji#list-application-emojis
*/
export interface RESTGetAPIApplicationEmojisResult {
items: APIEmoji[];
}

/**
* https://discord.com/developers/docs/resources/emoji#get-application-emoji
*/
export type RESTGetAPIApplicationEmojiResult = APIEmoji;

/**
* https://discord.com/developers/docs/resources/emoji#create-application-emoji-json-params
*/
export type RESTPostAPIApplicationEmojiJSONBody = Pick<RESTPostAPIGuildEmojiJSONBody, 'image' | 'name'>;

/**
* https://discord.com/developers/docs/resources/emoji#create-application-emoji
*/
export type RESTPostAPIApplicationEmojiResult = APIEmoji;

/**
* https://discord.com/developers/docs/resources/emoji#modify-application-emoji
*/
export type RESTPatchAPIApplicationEmojiJSONBody = Pick<RESTPatchAPIGuildEmojiJSONBody, 'name'>;

/**
* https://discord.com/developers/docs/resources/emoji#modify-application-emoji
*/
export type RESTPatchAPIApplicationEmojiResult = APIEmoji;

/**
* https://discord.com/developers/docs/resources/emoji#delete-application-emoji
*/
export type RESTDeleteAPIApplicationEmojiResult = never;
26 changes: 23 additions & 3 deletions deno/rest/v10/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const Routes = {
applicationRoleConnectionMetadata(applicationId: Snowflake) {
return `/applications/${applicationId}/role-connections/metadata` as const;
},

/**
* Route for:
* - GET `/guilds/{guild.id}/auto-moderation/rules`
Expand Down Expand Up @@ -912,8 +913,8 @@ export const Routes = {

/**
* Route for:
* - GET `/guilds/${guild.id}/onboarding`
* - PUT `/guilds/${guild.id}/onboarding`
* - GET `/guilds/{guild.id}/onboarding`
* - PUT `/guilds/{guild.id}/onboarding`
*/
guildOnboarding(guildId: Snowflake) {
return `/guilds/${guildId}/onboarding` as const;
Expand Down Expand Up @@ -963,11 +964,30 @@ export const Routes = {

/**
* Route for:
* - POST `/applications/${application.id}/entitlements/${entitlement.id}/consume`
* - POST `/applications/{application.id}/entitlements/{entitlement.id}/consume`
*/
consumeEntitlement(applicationId: Snowflake, entitlementId: Snowflake) {
return `/applications/${applicationId}/entitlements/${entitlementId}/consume` as const;
},

/**
* Route for:
* - GET `/applications/{application.id}/emojis`
* - POST `/applications/{application.id}/emojis`
*/
applicationEmojis(applicationId: Snowflake) {
return `/applications/${applicationId}/emojis` as const;
},

/**
* Route for:
* - GET `/applications/{application.id}/emojis/{emoji.id}`
* - PATCH `/applications/{application.id}/emojis/{emoji.id}`
* - DELETE `/applications/{application.id}/emojis/{emoji.id}`
*/
applicationEmoji(applicationId: Snowflake, emojiId: Snowflake) {
return `/applications/${applicationId}/emojis/${emojiId}` as const;
},
};

export const StickerPackApplicationId = '710982414301790216';
Expand Down
37 changes: 37 additions & 0 deletions deno/rest/v9/emoji.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,40 @@ export type RESTPatchAPIGuildEmojiResult = APIEmoji;
* https://discord.com/developers/docs/resources/emoji#delete-guild-emoji
*/
export type RESTDeleteAPIGuildEmojiResult = never;

/**
* https://discord.com/developers/docs/resources/emoji#list-application-emojis
*/
export interface RESTGetAPIApplicationEmojisResult {
items: APIEmoji[];
}

/**
* https://discord.com/developers/docs/resources/emoji#get-application-emoji
*/
export type RESTGetAPIApplicationEmojiResult = APIEmoji;

/**
* https://discord.com/developers/docs/resources/emoji#create-application-emoji-json-params
*/
export type RESTPostAPIApplicationEmojiJSONBody = Pick<RESTPostAPIGuildEmojiJSONBody, 'image' | 'name'>;

/**
* https://discord.com/developers/docs/resources/emoji#create-application-emoji
*/
export type RESTPostAPIApplicationEmojiResult = APIEmoji;

/**
* https://discord.com/developers/docs/resources/emoji#modify-application-emoji
*/
export type RESTPatchAPIApplicationEmojiJSONBody = Pick<RESTPatchAPIGuildEmojiJSONBody, 'name'>;

/**
* https://discord.com/developers/docs/resources/emoji#modify-application-emoji
*/
export type RESTPatchAPIApplicationEmojiResult = APIEmoji;

/**
* https://discord.com/developers/docs/resources/emoji#delete-application-emoji
*/
export type RESTDeleteAPIApplicationEmojiResult = never;
26 changes: 23 additions & 3 deletions deno/rest/v9/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const Routes = {
applicationRoleConnectionMetadata(applicationId: Snowflake) {
return `/applications/${applicationId}/role-connections/metadata` as const;
},

/**
* Route for:
* - GET `/guilds/{guild.id}/auto-moderation/rules`
Expand Down Expand Up @@ -921,8 +922,8 @@ export const Routes = {

/**
* Route for:
* - GET `/guilds/${guild.id}/onboarding`
* - PUT `/guilds/${guild.id}/onboarding`
* - GET `/guilds/{guild.id}/onboarding`
* - PUT `/guilds/{guild.id}/onboarding`
*/
guildOnboarding(guildId: Snowflake) {
return `/guilds/${guildId}/onboarding` as const;
Expand Down Expand Up @@ -972,11 +973,30 @@ export const Routes = {

/**
* Route for:
* - POST `/applications/${application.id}/entitlements/${entitlement.id}/consume`
* - POST `/applications/{application.id}/entitlements/{entitlement.id}/consume`
*/
consumeEntitlement(applicationId: Snowflake, entitlementId: Snowflake) {
return `/applications/${applicationId}/entitlements/${entitlementId}/consume` as const;
},

/**
* Route for:
* - GET `/applications/{application.id}/emojis`
* - POST `/applications/{application.id}/emojis`
*/
applicationEmojis(applicationId: Snowflake) {
return `/applications/${applicationId}/emojis` as const;
},

/**
* Route for:
* - GET `/applications/{application.id}/emojis/{emoji.id}`
* - PATCH `/applications/{application.id}/emojis/{emoji.id}`
* - DELETE `/applications/{application.id}/emojis/{emoji.id}`
*/
applicationEmoji(applicationId: Snowflake, emojiId: Snowflake) {
return `/applications/${applicationId}/emojis/${emojiId}` as const;
},
};

export const StickerPackApplicationId = '710982414301790216';
Expand Down
37 changes: 37 additions & 0 deletions rest/v10/emoji.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,40 @@ export type RESTPatchAPIGuildEmojiResult = APIEmoji;
* https://discord.com/developers/docs/resources/emoji#delete-guild-emoji
*/
export type RESTDeleteAPIGuildEmojiResult = never;

/**
* https://discord.com/developers/docs/resources/emoji#list-application-emojis
*/
export interface RESTGetAPIApplicationEmojisResult {
items: APIEmoji[];
}

/**
* https://discord.com/developers/docs/resources/emoji#get-application-emoji
*/
export type RESTGetAPIApplicationEmojiResult = APIEmoji;

/**
* https://discord.com/developers/docs/resources/emoji#create-application-emoji-json-params
*/
export type RESTPostAPIApplicationEmojiJSONBody = Pick<RESTPostAPIGuildEmojiJSONBody, 'image' | 'name'>;

/**
* https://discord.com/developers/docs/resources/emoji#create-application-emoji
*/
export type RESTPostAPIApplicationEmojiResult = APIEmoji;

/**
* https://discord.com/developers/docs/resources/emoji#modify-application-emoji
*/
export type RESTPatchAPIApplicationEmojiJSONBody = Pick<RESTPatchAPIGuildEmojiJSONBody, 'name'>;

/**
* https://discord.com/developers/docs/resources/emoji#modify-application-emoji
*/
export type RESTPatchAPIApplicationEmojiResult = APIEmoji;

/**
* https://discord.com/developers/docs/resources/emoji#delete-application-emoji
*/
export type RESTDeleteAPIApplicationEmojiResult = never;
26 changes: 23 additions & 3 deletions rest/v10/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const Routes = {
applicationRoleConnectionMetadata(applicationId: Snowflake) {
return `/applications/${applicationId}/role-connections/metadata` as const;
},

/**
* Route for:
* - GET `/guilds/{guild.id}/auto-moderation/rules`
Expand Down Expand Up @@ -912,8 +913,8 @@ export const Routes = {

/**
* Route for:
* - GET `/guilds/${guild.id}/onboarding`
* - PUT `/guilds/${guild.id}/onboarding`
* - GET `/guilds/{guild.id}/onboarding`
* - PUT `/guilds/{guild.id}/onboarding`
*/
guildOnboarding(guildId: Snowflake) {
return `/guilds/${guildId}/onboarding` as const;
Expand Down Expand Up @@ -963,11 +964,30 @@ export const Routes = {

/**
* Route for:
* - POST `/applications/${application.id}/entitlements/${entitlement.id}/consume`
* - POST `/applications/{application.id}/entitlements/{entitlement.id}/consume`
*/
consumeEntitlement(applicationId: Snowflake, entitlementId: Snowflake) {
return `/applications/${applicationId}/entitlements/${entitlementId}/consume` as const;
},

/**
* Route for:
* - GET `/applications/{application.id}/emojis`
* - POST `/applications/{application.id}/emojis`
*/
applicationEmojis(applicationId: Snowflake) {
return `/applications/${applicationId}/emojis` as const;
},

/**
* Route for:
* - GET `/applications/{application.id}/emojis/{emoji.id}`
* - PATCH `/applications/{application.id}/emojis/{emoji.id}`
* - DELETE `/applications/{application.id}/emojis/{emoji.id}`
*/
applicationEmoji(applicationId: Snowflake, emojiId: Snowflake) {
return `/applications/${applicationId}/emojis/${emojiId}` as const;
},
};

export const StickerPackApplicationId = '710982414301790216';
Expand Down
37 changes: 37 additions & 0 deletions rest/v9/emoji.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,40 @@ export type RESTPatchAPIGuildEmojiResult = APIEmoji;
* https://discord.com/developers/docs/resources/emoji#delete-guild-emoji
*/
export type RESTDeleteAPIGuildEmojiResult = never;

/**
* https://discord.com/developers/docs/resources/emoji#list-application-emojis
*/
export interface RESTGetAPIApplicationEmojisResult {
items: APIEmoji[];
}

/**
* https://discord.com/developers/docs/resources/emoji#get-application-emoji
*/
export type RESTGetAPIApplicationEmojiResult = APIEmoji;

/**
* https://discord.com/developers/docs/resources/emoji#create-application-emoji-json-params
*/
export type RESTPostAPIApplicationEmojiJSONBody = Pick<RESTPostAPIGuildEmojiJSONBody, 'image' | 'name'>;

/**
* https://discord.com/developers/docs/resources/emoji#create-application-emoji
*/
export type RESTPostAPIApplicationEmojiResult = APIEmoji;

/**
* https://discord.com/developers/docs/resources/emoji#modify-application-emoji
*/
export type RESTPatchAPIApplicationEmojiJSONBody = Pick<RESTPatchAPIGuildEmojiJSONBody, 'name'>;

/**
* https://discord.com/developers/docs/resources/emoji#modify-application-emoji
*/
export type RESTPatchAPIApplicationEmojiResult = APIEmoji;

/**
* https://discord.com/developers/docs/resources/emoji#delete-application-emoji
*/
export type RESTDeleteAPIApplicationEmojiResult = never;
26 changes: 23 additions & 3 deletions rest/v9/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const Routes = {
applicationRoleConnectionMetadata(applicationId: Snowflake) {
return `/applications/${applicationId}/role-connections/metadata` as const;
},

/**
* Route for:
* - GET `/guilds/{guild.id}/auto-moderation/rules`
Expand Down Expand Up @@ -921,8 +922,8 @@ export const Routes = {

/**
* Route for:
* - GET `/guilds/${guild.id}/onboarding`
* - PUT `/guilds/${guild.id}/onboarding`
* - GET `/guilds/{guild.id}/onboarding`
* - PUT `/guilds/{guild.id}/onboarding`
*/
guildOnboarding(guildId: Snowflake) {
return `/guilds/${guildId}/onboarding` as const;
Expand Down Expand Up @@ -972,11 +973,30 @@ export const Routes = {

/**
* Route for:
* - POST `/applications/${application.id}/entitlements/${entitlement.id}/consume`
* - POST `/applications/{application.id}/entitlements/{entitlement.id}/consume`
*/
consumeEntitlement(applicationId: Snowflake, entitlementId: Snowflake) {
return `/applications/${applicationId}/entitlements/${entitlementId}/consume` as const;
},

/**
* Route for:
* - GET `/applications/{application.id}/emojis`
* - POST `/applications/{application.id}/emojis`
*/
applicationEmojis(applicationId: Snowflake) {
return `/applications/${applicationId}/emojis` as const;
},

/**
* Route for:
* - GET `/applications/{application.id}/emojis/{emoji.id}`
* - PATCH `/applications/{application.id}/emojis/{emoji.id}`
* - DELETE `/applications/{application.id}/emojis/{emoji.id}`
*/
applicationEmoji(applicationId: Snowflake, emojiId: Snowflake) {
return `/applications/${applicationId}/emojis/${emojiId}` as const;
},
};

export const StickerPackApplicationId = '710982414301790216';
Expand Down

0 comments on commit 5f22a6b

Please # to comment.