Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

types: Swap message reaction and emoji identifier types #8969

Merged
merged 4 commits into from
Dec 31, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/discord.js/src/managers/BaseGuildEmojiManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ class BaseGuildEmojiManager extends CachedManager {

/**
* Data that can be resolved to give an emoji identifier. This can be:
* * The unicode representation of an emoji
* * The `<a:name:id>`, `<:name:id>`, `a:name:id` or `name:id` emoji identifier string of an emoji
* * An EmojiResolvable
* * The `<a:name:id>`, `<:name:id>`, `a:name:id` or `name:id` emoji identifier string of an emoji
* * The Unicode representation of an emoji
* @typedef {string|EmojiResolvable} EmojiIdentifierResolvable
*/

Expand Down
1 change: 1 addition & 0 deletions packages/discord.js/src/managers/ReactionManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class ReactionManager extends CachedManager {
* Data that can be resolved to a MessageReaction object. This can be:
* * A MessageReaction
* * A Snowflake
* * The Unicode representation of an emoji
* @typedef {MessageReaction|Snowflake} MessageReactionResolvable
*/

Expand Down
14 changes: 6 additions & 8 deletions packages/discord.js/typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5040,7 +5040,11 @@ export interface EmbedField {
inline: boolean;
}

export type EmojiIdentifierResolvable = string | EmojiResolvable;
export type EmojiIdentifierResolvable =
| EmojiResolvable
| `${'' | 'a:'}${string}:${Snowflake}`
| `<${'' | 'a'}:${string}:${Snowflake}>`
| string;

export type EmojiResolvable = Snowflake | GuildEmoji | ReactionEmoji;

Expand Down Expand Up @@ -5785,13 +5789,7 @@ export interface MessageEditOptions extends Omit<BaseMessageOptions, 'content'>
flags?: BitFieldResolvable<Extract<MessageFlagsString, 'SuppressEmbeds'>, MessageFlags.SuppressEmbeds>;
}

export type MessageReactionResolvable =
| MessageReaction
| Snowflake
| `${string}:${Snowflake}`
| `<:${string}:${Snowflake}>`
| `<a:${string}:${Snowflake}>`
| string;
export type MessageReactionResolvable = MessageReaction | Snowflake | string;

export interface MessageReference {
channelId: Snowflake;
Expand Down