mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-01 16:30:08 +00:00
remove Discord* types for messages
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { SnakeCasedPropertiesDeep } from "../util.ts";
|
||||
import { DiscordAllowedMentionsTypes } from "./allowed_mentions_types.ts";
|
||||
|
||||
/** https://discord.com/developers/docs/resources/channel#allowed-mentions-object */
|
||||
export interface AllowedMentions {
|
||||
/** An array of allowed mention types to parse from the content. */
|
||||
parse?: DiscordAllowedMentionsTypes[];
|
||||
@@ -11,6 +11,3 @@ export interface AllowedMentions {
|
||||
/** For replies, whether to mention the author of the message being replied to (default false) */
|
||||
repliedUser?: boolean;
|
||||
}
|
||||
|
||||
/** https://discord.com/developers/docs/resources/channel#allowed-mentions-object */
|
||||
export type DiscordAllowedMentions = SnakeCasedPropertiesDeep<AllowedMentions>;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { SnakeCasedPropertiesDeep } from "../util.ts";
|
||||
|
||||
/** https://discord.com/developers/docs/resources/channel#attachment-object */
|
||||
export interface Attachment {
|
||||
/** Attachment id */
|
||||
id: string;
|
||||
@@ -18,6 +17,3 @@ export interface Attachment {
|
||||
/** Width of file (if image) */
|
||||
width?: number | null;
|
||||
}
|
||||
|
||||
/** https://discord.com/developers/docs/resources/channel#attachment-object */
|
||||
export type DiscordAttachment = SnakeCasedPropertiesDeep<Attachment>;
|
||||
|
||||
@@ -25,3 +25,5 @@ export interface CreateMessage {
|
||||
export type DiscordCreateMessage = SnakeCasedPropertiesDeep<
|
||||
Omit<CreateMessage, "file">
|
||||
>;
|
||||
|
||||
// TODO: check this
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Embed } from "../embeds/embed.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../util.ts";
|
||||
import { AllowedMentions } from "./allowed_mentions.ts";
|
||||
|
||||
/** https://discord.com/developers/docs/resources/channel#edit-message-json-params */
|
||||
export interface EditMessage {
|
||||
/** The new message contents (up to 2000 characters) */
|
||||
content?: string | null;
|
||||
@@ -12,6 +12,3 @@ export interface EditMessage {
|
||||
/** Allowed mentions for the message */
|
||||
allowedMentions?: AllowedMentions | null;
|
||||
}
|
||||
|
||||
/** https://discord.com/developers/docs/resources/channel#edit-message-json-params */
|
||||
export type DiscordEditMessage = SnakeCasedPropertiesDeep<EditMessage>;
|
||||
|
||||
@@ -1,28 +1,30 @@
|
||||
/** https://discord.com/developers/docs/resources/channel#get-channel-messages-query-string-params */
|
||||
export interface GetMessagesLimit {
|
||||
/** Max number of messages to return (1-100) default 50 */
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
/** https://discord.com/developers/docs/resources/channel#get-channel-messages-query-string-params */
|
||||
export interface GetMessagesAround extends GetMessagesLimit {
|
||||
/** Get messages around this message id */
|
||||
around?: string;
|
||||
}
|
||||
|
||||
/** https://discord.com/developers/docs/resources/channel#get-channel-messages-query-string-params */
|
||||
export interface GetMessagesBefore extends GetMessagesLimit {
|
||||
/** Get messages before this message id */
|
||||
before?: string;
|
||||
}
|
||||
|
||||
/** https://discord.com/developers/docs/resources/channel#get-channel-messages-query-string-params */
|
||||
export interface GetMessagesAfter extends GetMessagesLimit {
|
||||
/** Get messages after this message id */
|
||||
after?: string;
|
||||
}
|
||||
|
||||
/** https://discord.com/developers/docs/resources/channel#get-channel-messages-query-string-params */
|
||||
export type GetMessages =
|
||||
& GetMessagesLimit
|
||||
& GetMessagesAfter
|
||||
& GetMessagesBefore
|
||||
& GetMessagesAround;
|
||||
|
||||
/** https://discord.com/developers/docs/resources/channel#get-channel-messages-query-string-params */
|
||||
export type DiscordGetMessages = GetMessages;
|
||||
|
||||
@@ -4,7 +4,6 @@ import { GuildMember } from "../guilds/guild_member.ts";
|
||||
import { MessageInteraction } from "../interactions/message_interaction.ts";
|
||||
import { Application } from "../oauth2/application.ts";
|
||||
import { User } from "../users/user.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../util.ts";
|
||||
import { Attachment } from "./attachment.ts";
|
||||
import { MessageActivity } from "./message_activity.ts";
|
||||
import { MessageReference } from "./message_reference.ts";
|
||||
@@ -12,6 +11,7 @@ import { MessageSticker } from "./message_sticker.ts";
|
||||
import { DiscordMessageTypes } from "./message_types.ts";
|
||||
import { DiscordReaction } from "./reaction.ts";
|
||||
|
||||
/** https://discord.com/developers/docs/resources/channel#message-object */
|
||||
export interface Message {
|
||||
/** id of the message */
|
||||
id: string;
|
||||
@@ -83,6 +83,3 @@ export interface Message {
|
||||
/** Sent if the message is a response to an Interaction */
|
||||
interaction?: MessageInteraction;
|
||||
}
|
||||
|
||||
/** https://discord.com/developers/docs/resources/channel#message-object */
|
||||
export type DiscordMessage = SnakeCasedPropertiesDeep<Message>;
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
import { SnakeCasedPropertiesDeep } from "../util.ts";
|
||||
import { DiscordMessageActivityTypes } from "./message_activity_types.ts";
|
||||
|
||||
/** https://discord.com/developers/docs/resources/channel#message-object-message-activity-structure */
|
||||
export interface MessageActivity {
|
||||
/** Type of message activity */
|
||||
type: DiscordMessageActivityTypes;
|
||||
/** `party_id` from a Rich Presence event */
|
||||
partyId?: string;
|
||||
}
|
||||
|
||||
/** https://discord.com/developers/docs/resources/channel#message-object-message-activity-structure */
|
||||
export type DiscordMessageActivity = SnakeCasedPropertiesDeep<MessageActivity>;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { SnakeCasedPropertiesDeep } from "../util.ts";
|
||||
|
||||
/** https://discord.com/developers/docs/topics/gateway#message-delete */
|
||||
export interface MessageDelete {
|
||||
/** The id of the message */
|
||||
id: string;
|
||||
@@ -8,6 +7,3 @@ export interface MessageDelete {
|
||||
/** The id of the guild */
|
||||
guildId?: string;
|
||||
}
|
||||
|
||||
/** https://discord.com/developers/docs/topics/gateway#message-delete */
|
||||
export type DiscordMessageDelete = SnakeCasedPropertiesDeep<MessageDelete>;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { SnakeCasedPropertiesDeep } from "../util.ts";
|
||||
|
||||
/** https://discord.com/developers/docs/topics/gateway#message-delete-bulk */
|
||||
export interface MessageDeleteBulk {
|
||||
/** The ids of the messages */
|
||||
ids: string[];
|
||||
@@ -8,8 +7,3 @@ export interface MessageDeleteBulk {
|
||||
/** The id of the guild */
|
||||
guildId?: string;
|
||||
}
|
||||
|
||||
/** https://discord.com/developers/docs/topics/gateway#message-delete-bulk */
|
||||
export type DiscordMessageDeleteBulk = SnakeCasedPropertiesDeep<
|
||||
MessageDeleteBulk
|
||||
>;
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
/** https://discord.com/developers/docs/resources/channel#get-reactions-query-string-params */
|
||||
export interface GetReactions {
|
||||
/** Get users after this user Id */
|
||||
after?: string;
|
||||
/** Max number of users to return (1-100) */
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
/** https://discord.com/developers/docs/resources/channel#get-reactions-query-string-params */
|
||||
export type DiscordGetReactions = GetReactions;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Emoji } from "../emojis/emoji.ts";
|
||||
import { GuildMemberWithUser } from "../guilds/guild_member.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../util.ts";
|
||||
|
||||
/** https://discord.com/developers/docs/topics/gateway#message-reaction-add */
|
||||
export interface MessageReactionAdd {
|
||||
/** The id of the user */
|
||||
userId: string;
|
||||
@@ -16,8 +16,3 @@ export interface MessageReactionAdd {
|
||||
/** The emoji used to react */
|
||||
emoji: Partial<Emoji>;
|
||||
}
|
||||
|
||||
/** https://discord.com/developers/docs/topics/gateway#message-reaction-add */
|
||||
export type DiscordMessageReactionAdd = SnakeCasedPropertiesDeep<
|
||||
MessageReactionAdd
|
||||
>;
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
import { SnakeCasedPropertiesDeep } from "../util.ts";
|
||||
import { MessageReactionAdd } from "./message_reaction_add.ts";
|
||||
|
||||
export type MessageReactionRemove = Omit<MessageReactionAdd, "member">;
|
||||
|
||||
/** https://discord.com/developers/docs/topics/gateway#message-reaction-remove */
|
||||
export type DiscordMessageReactionRemove = SnakeCasedPropertiesDeep<
|
||||
MessageReactionRemove
|
||||
>;
|
||||
export type MessageReactionRemove = Omit<MessageReactionAdd, "member">;
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
import { SnakeCasedPropertiesDeep } from "../util.ts";
|
||||
import { MessageReactionAdd } from "./message_reaction_add.ts";
|
||||
|
||||
/** https://discord.com/developers/docs/topics/gateway#message-reaction-remove-all */
|
||||
export type MessageReactionRemoveAll = Pick<
|
||||
MessageReactionAdd,
|
||||
"channelId" | "messageId" | "guildId"
|
||||
>;
|
||||
|
||||
/** https://discord.com/developers/docs/topics/gateway#message-reaction-remove-all */
|
||||
export type DiscordMessageReactionRemoveAll = SnakeCasedPropertiesDeep<
|
||||
MessageReactionRemoveAll
|
||||
>;
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
import { SnakeCasedPropertiesDeep } from "../util.ts";
|
||||
import { MessageReactionAdd } from "./message_reaction_add.ts";
|
||||
|
||||
/** https://discord.com/developers/docs/topics/gateway#message-reaction-remove-emoji */
|
||||
export type MessageReactionRemoveEmoji = Pick<
|
||||
MessageReactionAdd,
|
||||
"channelId" | "guildId" | "messageId" | "emoji"
|
||||
>;
|
||||
|
||||
/** https://discord.com/developers/docs/topics/gateway#message-reaction-remove-emoji */
|
||||
export type DiscordMessageReactionRemoveEmoji = SnakeCasedPropertiesDeep<
|
||||
MessageReactionRemoveEmoji
|
||||
>;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { SnakeCasedPropertiesDeep } from "../util.ts";
|
||||
|
||||
/** https://discord.com/developers/docs/resources/channel#message-object-message-reference-structure */
|
||||
export interface MessageReference {
|
||||
/** id of the originating message */
|
||||
messageId?: string;
|
||||
@@ -13,8 +12,3 @@ export interface MessageReference {
|
||||
/** When sending, whether to error if the referenced message doesn't exist instead of sending as a normal (non-reply) message, default true */
|
||||
failIfNotExists: boolean;
|
||||
}
|
||||
|
||||
/** https://discord.com/developers/docs/resources/channel#message-object-message-reference-structure */
|
||||
export type DiscordMessageReference = SnakeCasedPropertiesDeep<
|
||||
MessageReference
|
||||
>;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { SnakeCasedPropertiesDeep } from "../util.ts";
|
||||
import { DiscordMessageStickerFormatTypes } from "./message_sticker_format_types.ts";
|
||||
|
||||
/** https://discord.com/developers/docs/resources/channel#message-object-message-sticker-structure */
|
||||
export interface MessageSticker {
|
||||
/** id of the sticker */
|
||||
id: string;
|
||||
@@ -25,6 +25,3 @@ export interface MessageSticker {
|
||||
/** Type of sticker format */
|
||||
formatType: DiscordMessageStickerFormatTypes;
|
||||
}
|
||||
|
||||
/** https://discord.com/developers/docs/resources/channel#message-object-message-sticker-structure */
|
||||
export type DiscordMessageSticker = SnakeCasedPropertiesDeep<MessageSticker>;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Emoji } from "../emojis/emoji.ts";
|
||||
|
||||
/** https://discord.com/developers/docs/resources/channel#reaction-object */
|
||||
export interface Reaction {
|
||||
/** Times this emoji has been used to react */
|
||||
count: number;
|
||||
@@ -8,6 +9,3 @@ export interface Reaction {
|
||||
/** Emoji information */
|
||||
emoji: Partial<Emoji>;
|
||||
}
|
||||
|
||||
/** https://discord.com/developers/docs/resources/channel#reaction-object */
|
||||
export type DiscordReaction = Reaction;
|
||||
|
||||
Reference in New Issue
Block a user