Skip to content

Commit 4b0a3af

Browse files
authored
feat: Specific typings for application emojis (#1228)
1 parent 7196d87 commit 4b0a3af

File tree

8 files changed

+144
-20
lines changed

8 files changed

+144
-20
lines changed

deno/payloads/v10/emoji.ts

Lines changed: 31 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deno/payloads/v9/emoji.ts

Lines changed: 31 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deno/rest/v10/emoji.ts

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deno/rest/v9/emoji.ts

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

payloads/v10/emoji.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*/
44

55
import type { Snowflake } from '../../globals';
6+
import type { _NonNullableFields } from '../../utils/internals';
67
import type { APIRole } from './permissions';
78
import type { APIUser } from './user';
89

@@ -49,3 +50,33 @@ export interface APIEmoji extends APIPartialEmoji {
4950
*/
5051
available?: boolean;
5152
}
53+
54+
/**
55+
* @see {@link https://discord.com/developers/docs/resources/emoji#emoji-object-applicationowned-emoji}
56+
*/
57+
export type APIApplicationEmoji = _NonNullableFields<Required<Pick<APIEmoji, 'animated' | 'id' | 'name' | 'user'>>> & {
58+
/**
59+
* Roles allowed to use this emoji.
60+
*
61+
* @remarks Always empty.
62+
*/
63+
roles: [];
64+
/**
65+
* Whether this emoji must be wrapped in colons.
66+
*
67+
* @remarks Always `true`.
68+
*/
69+
require_colons: true;
70+
/**
71+
* Whether this emoji is managed.
72+
*
73+
* @remarks Always `false`.
74+
*/
75+
managed: false;
76+
/**
77+
* Whether this emoji is available.
78+
*
79+
* @remarks Always `true`.
80+
*/
81+
available: true;
82+
};

payloads/v9/emoji.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*/
44

55
import type { Snowflake } from '../../globals';
6+
import type { _NonNullableFields } from '../../utils/internals';
67
import type { APIRole } from './permissions';
78
import type { APIUser } from './user';
89

@@ -49,3 +50,33 @@ export interface APIEmoji extends APIPartialEmoji {
4950
*/
5051
available?: boolean;
5152
}
53+
54+
/**
55+
* @see {@link https://discord.com/developers/docs/resources/emoji#emoji-object-applicationowned-emoji}
56+
*/
57+
export type APIApplicationEmoji = _NonNullableFields<Required<Pick<APIEmoji, 'animated' | 'id' | 'name' | 'user'>>> & {
58+
/**
59+
* Roles allowed to use this emoji.
60+
*
61+
* @remarks Always empty.
62+
*/
63+
roles: [];
64+
/**
65+
* Whether this emoji must be wrapped in colons.
66+
*
67+
* @remarks Always `true`.
68+
*/
69+
require_colons: true;
70+
/**
71+
* Whether this emoji is managed.
72+
*
73+
* @remarks Always `false`.
74+
*/
75+
managed: false;
76+
/**
77+
* Whether this emoji is available.
78+
*
79+
* @remarks Always `true`.
80+
*/
81+
available: true;
82+
};

rest/v10/emoji.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { Snowflake } from '../../globals';
2-
import type { APIEmoji } from '../../payloads/v10/index';
2+
import type { APIApplicationEmoji, APIEmoji } from '../../payloads/v10';
33

44
/**
55
* @see {@link https://discord.com/developers/docs/resources/emoji#list-guild-emojis}
@@ -64,13 +64,13 @@ export type RESTDeleteAPIGuildEmojiResult = never;
6464
* @see {@link https://discord.com/developers/docs/resources/emoji#list-application-emojis}
6565
*/
6666
export interface RESTGetAPIApplicationEmojisResult {
67-
items: APIEmoji[];
67+
items: APIApplicationEmoji[];
6868
}
6969

7070
/**
7171
* @see {@link https://discord.com/developers/docs/resources/emoji#get-application-emoji}
7272
*/
73-
export type RESTGetAPIApplicationEmojiResult = APIEmoji;
73+
export type RESTGetAPIApplicationEmojiResult = APIApplicationEmoji;
7474

7575
/**
7676
* @see {@link https://discord.com/developers/docs/resources/emoji#create-application-emoji-json-params}
@@ -80,7 +80,7 @@ export type RESTPostAPIApplicationEmojiJSONBody = Pick<RESTPostAPIGuildEmojiJSON
8080
/**
8181
* @see {@link https://discord.com/developers/docs/resources/emoji#create-application-emoji}
8282
*/
83-
export type RESTPostAPIApplicationEmojiResult = APIEmoji;
83+
export type RESTPostAPIApplicationEmojiResult = APIApplicationEmoji;
8484

8585
/**
8686
* @see {@link https://discord.com/developers/docs/resources/emoji#modify-application-emoji}
@@ -90,7 +90,7 @@ export type RESTPatchAPIApplicationEmojiJSONBody = Pick<RESTPatchAPIGuildEmojiJS
9090
/**
9191
* @see {@link https://discord.com/developers/docs/resources/emoji#modify-application-emoji}
9292
*/
93-
export type RESTPatchAPIApplicationEmojiResult = APIEmoji;
93+
export type RESTPatchAPIApplicationEmojiResult = APIApplicationEmoji;
9494

9595
/**
9696
* @see {@link https://discord.com/developers/docs/resources/emoji#delete-application-emoji}

rest/v9/emoji.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { Snowflake } from '../../globals';
2-
import type { APIEmoji } from '../../payloads/v9/index';
2+
import type { APIApplicationEmoji, APIEmoji } from '../../payloads/v9';
33

44
/**
55
* @see {@link https://discord.com/developers/docs/resources/emoji#list-guild-emojis}
@@ -64,13 +64,13 @@ export type RESTDeleteAPIGuildEmojiResult = never;
6464
* @see {@link https://discord.com/developers/docs/resources/emoji#list-application-emojis}
6565
*/
6666
export interface RESTGetAPIApplicationEmojisResult {
67-
items: APIEmoji[];
67+
items: APIApplicationEmoji[];
6868
}
6969

7070
/**
7171
* @see {@link https://discord.com/developers/docs/resources/emoji#get-application-emoji}
7272
*/
73-
export type RESTGetAPIApplicationEmojiResult = APIEmoji;
73+
export type RESTGetAPIApplicationEmojiResult = APIApplicationEmoji;
7474

7575
/**
7676
* @see {@link https://discord.com/developers/docs/resources/emoji#create-application-emoji-json-params}
@@ -80,7 +80,7 @@ export type RESTPostAPIApplicationEmojiJSONBody = Pick<RESTPostAPIGuildEmojiJSON
8080
/**
8181
* @see {@link https://discord.com/developers/docs/resources/emoji#create-application-emoji}
8282
*/
83-
export type RESTPostAPIApplicationEmojiResult = APIEmoji;
83+
export type RESTPostAPIApplicationEmojiResult = APIApplicationEmoji;
8484

8585
/**
8686
* @see {@link https://discord.com/developers/docs/resources/emoji#modify-application-emoji}
@@ -90,7 +90,7 @@ export type RESTPatchAPIApplicationEmojiJSONBody = Pick<RESTPatchAPIGuildEmojiJS
9090
/**
9191
* @see {@link https://discord.com/developers/docs/resources/emoji#modify-application-emoji}
9292
*/
93-
export type RESTPatchAPIApplicationEmojiResult = APIEmoji;
93+
export type RESTPatchAPIApplicationEmojiResult = APIApplicationEmoji;
9494

9595
/**
9696
* @see {@link https://discord.com/developers/docs/resources/emoji#delete-application-emoji}

0 commit comments

Comments
 (0)