2020-10-25 17:03:53 +00:00
|
|
|
import { Embed } from '../structures/embed.ts'
|
2020-10-31 12:33:34 +00:00
|
|
|
import { EmojiPayload } from './emoji.ts'
|
|
|
|
import { MemberPayload } from './guild.ts'
|
|
|
|
import { UserPayload } from './user.ts'
|
2020-10-22 15:50:47 +00:00
|
|
|
|
2020-10-30 14:51:40 +00:00
|
|
|
export interface ChannelPayload {
|
2020-10-22 15:50:47 +00:00
|
|
|
id: string
|
|
|
|
type: ChannelTypes
|
2020-10-23 16:11:00 +00:00
|
|
|
}
|
|
|
|
|
2020-10-30 14:51:40 +00:00
|
|
|
export interface TextChannelPayload extends ChannelPayload {
|
2020-10-22 15:50:47 +00:00
|
|
|
last_message_id?: string
|
|
|
|
last_pin_timestamp?: string
|
2020-10-22 06:10:51 +00:00
|
|
|
}
|
|
|
|
|
2020-10-30 14:51:40 +00:00
|
|
|
export interface GuildChannelPayload extends ChannelPayload {
|
2020-10-23 16:11:00 +00:00
|
|
|
guild_id: string
|
|
|
|
name: string
|
|
|
|
position: number
|
|
|
|
permission_overwrites: Overwrite[]
|
|
|
|
nsfw: boolean
|
|
|
|
parent_id?: string
|
|
|
|
}
|
|
|
|
|
2020-10-30 14:51:40 +00:00
|
|
|
export interface GuildTextChannelPayload
|
2020-10-23 16:11:00 +00:00
|
|
|
extends TextChannelPayload,
|
|
|
|
GuildChannelPayload {
|
|
|
|
rate_limit_per_user: number
|
|
|
|
topic?: string
|
|
|
|
}
|
|
|
|
|
2020-10-30 14:51:40 +00:00
|
|
|
export interface GuildNewsChannelPayload
|
2020-10-23 16:11:00 +00:00
|
|
|
extends TextChannelPayload,
|
|
|
|
GuildChannelPayload {
|
|
|
|
topic?: string
|
|
|
|
}
|
|
|
|
|
2020-10-30 14:51:40 +00:00
|
|
|
export interface GuildVoiceChannelPayload extends GuildChannelPayload {
|
2020-10-23 16:11:00 +00:00
|
|
|
bitrate: string
|
|
|
|
user_limit: number
|
|
|
|
}
|
|
|
|
|
2020-10-30 14:51:40 +00:00
|
|
|
export interface DMChannelPayload extends TextChannelPayload {
|
2020-10-23 16:11:00 +00:00
|
|
|
recipients: UserPayload[]
|
|
|
|
}
|
|
|
|
|
2020-10-30 14:51:40 +00:00
|
|
|
export interface GroupDMChannelPayload extends DMChannelPayload {
|
2020-10-23 16:11:00 +00:00
|
|
|
name: string
|
|
|
|
icon?: string
|
|
|
|
owner_id: string
|
|
|
|
}
|
|
|
|
|
2020-10-30 14:51:40 +00:00
|
|
|
export interface GuildChannelCategoryPayload
|
2020-10-23 16:11:00 +00:00
|
|
|
extends ChannelPayload,
|
|
|
|
GuildChannelPayload {}
|
|
|
|
|
2020-10-30 14:51:40 +00:00
|
|
|
export interface Overwrite {
|
2020-10-22 15:50:47 +00:00
|
|
|
id: string
|
|
|
|
type: number
|
|
|
|
allow: string
|
|
|
|
deny: string
|
2020-10-22 06:10:51 +00:00
|
|
|
}
|
|
|
|
|
2020-10-30 14:51:40 +00:00
|
|
|
export enum ChannelTypes {
|
2020-10-22 15:50:47 +00:00
|
|
|
GUILD_TEXT = 0,
|
|
|
|
DM = 1,
|
|
|
|
GUILD_VOICE = 2,
|
|
|
|
GROUP_DM = 3,
|
|
|
|
GUILD_CATEGORY = 4,
|
|
|
|
GUILD_NEWS = 5,
|
|
|
|
GUILD_STORE = 6
|
|
|
|
}
|
|
|
|
|
2020-10-30 14:51:40 +00:00
|
|
|
export interface MessagePayload {
|
2020-10-22 15:50:47 +00:00
|
|
|
id: string
|
|
|
|
channel_id: string
|
|
|
|
guild_id?: string
|
2020-10-23 16:11:00 +00:00
|
|
|
author: UserPayload
|
|
|
|
member?: MemberPayload
|
2020-10-22 15:50:47 +00:00
|
|
|
content: string
|
|
|
|
timestamp: string
|
2020-10-23 16:11:00 +00:00
|
|
|
edited_timestamp?: string
|
2020-10-22 15:50:47 +00:00
|
|
|
tts: boolean
|
|
|
|
mention_everyone: boolean
|
2020-10-29 14:43:27 +00:00
|
|
|
mentions: UserPayload[]
|
|
|
|
mention_roles: string[]
|
2020-10-22 15:50:47 +00:00
|
|
|
mention_channels?: ChannelMention[]
|
|
|
|
attachments: Attachment[]
|
|
|
|
embeds: EmbedPayload[]
|
|
|
|
reactions?: Reaction[]
|
|
|
|
nonce?: number | string
|
|
|
|
pinned: boolean
|
|
|
|
webhook_id?: string
|
|
|
|
type: number
|
|
|
|
activity?: MessageActivity
|
|
|
|
application?: MessageApplication
|
|
|
|
message_reference?: MessageReference
|
|
|
|
flags?: number
|
2020-12-17 01:20:06 +00:00
|
|
|
stickers?: MessageStickerPayload[]
|
2020-10-22 06:10:51 +00:00
|
|
|
}
|
|
|
|
|
2020-10-30 14:51:40 +00:00
|
|
|
export interface MessageOption {
|
2020-11-04 12:38:00 +00:00
|
|
|
tts?: boolean
|
2020-11-25 11:53:40 +00:00
|
|
|
embed?: Embed
|
2020-11-04 12:38:00 +00:00
|
|
|
file?: Attachment
|
2020-11-28 05:14:37 +00:00
|
|
|
allowedMentions?: {
|
2020-12-03 06:36:18 +00:00
|
|
|
parse?: 'everyone' | 'users' | 'roles'
|
|
|
|
roles?: string[]
|
|
|
|
users?: string[]
|
2020-10-25 17:03:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-30 14:51:40 +00:00
|
|
|
export interface ChannelMention {
|
2020-10-22 15:50:47 +00:00
|
|
|
id: string
|
|
|
|
guild_id: string
|
|
|
|
type: ChannelTypes
|
|
|
|
name: string
|
2020-10-22 06:10:51 +00:00
|
|
|
}
|
|
|
|
|
2020-10-30 14:51:40 +00:00
|
|
|
export interface Attachment {
|
2020-10-22 15:50:47 +00:00
|
|
|
id: string
|
|
|
|
filename: string
|
|
|
|
size: number
|
|
|
|
url: string
|
|
|
|
proxy_url: string
|
|
|
|
height: number | undefined
|
|
|
|
width: number | undefined
|
|
|
|
}
|
|
|
|
|
2020-10-30 14:51:40 +00:00
|
|
|
export interface EmbedPayload {
|
2020-10-22 15:50:47 +00:00
|
|
|
title?: string
|
|
|
|
type?: EmbedTypes
|
|
|
|
description?: string
|
|
|
|
url?: string
|
|
|
|
timestamp?: string
|
|
|
|
color?: number
|
|
|
|
footer?: EmbedFooter
|
|
|
|
image?: EmbedImage
|
|
|
|
thumbnail?: EmbedThumbnail
|
|
|
|
video?: EmbedVideo
|
|
|
|
provider?: EmbedProvider
|
|
|
|
author?: EmbedAuthor
|
|
|
|
fields?: EmbedField[]
|
|
|
|
}
|
|
|
|
|
2020-10-30 14:51:40 +00:00
|
|
|
export type EmbedTypes =
|
|
|
|
| 'rich'
|
|
|
|
| 'image'
|
|
|
|
| 'video'
|
|
|
|
| 'gifv'
|
|
|
|
| 'article'
|
|
|
|
| 'link'
|
2020-10-22 06:10:51 +00:00
|
|
|
|
2020-10-30 14:51:40 +00:00
|
|
|
export interface EmbedField {
|
2020-10-22 15:50:47 +00:00
|
|
|
name: string
|
|
|
|
value: string
|
|
|
|
inline?: boolean
|
2020-10-22 06:10:51 +00:00
|
|
|
}
|
|
|
|
|
2020-10-30 14:51:40 +00:00
|
|
|
export interface EmbedAuthor {
|
2020-10-22 15:50:47 +00:00
|
|
|
name?: string
|
|
|
|
url?: string
|
|
|
|
icon_url?: string
|
|
|
|
proxy_icon_url?: string
|
2020-10-22 06:10:51 +00:00
|
|
|
}
|
|
|
|
|
2020-10-30 14:51:40 +00:00
|
|
|
export interface EmbedFooter {
|
2020-10-22 15:50:47 +00:00
|
|
|
text: string
|
|
|
|
icon_url?: string
|
|
|
|
proxy_icon_url?: string
|
2020-10-22 06:10:51 +00:00
|
|
|
}
|
|
|
|
|
2020-10-30 14:51:40 +00:00
|
|
|
export interface EmbedImage {
|
2020-10-22 15:50:47 +00:00
|
|
|
url?: string
|
|
|
|
proxy_url?: string
|
|
|
|
height?: number
|
|
|
|
width?: number
|
2020-10-22 06:10:51 +00:00
|
|
|
}
|
|
|
|
|
2020-10-30 14:51:40 +00:00
|
|
|
export interface EmbedProvider {
|
2020-10-22 15:50:47 +00:00
|
|
|
name?: string
|
|
|
|
url?: string
|
2020-10-22 06:10:51 +00:00
|
|
|
}
|
|
|
|
|
2020-10-30 14:51:40 +00:00
|
|
|
export interface EmbedVideo {
|
2020-10-22 15:50:47 +00:00
|
|
|
url?: string
|
|
|
|
height?: number
|
|
|
|
width?: number
|
2020-10-22 06:10:51 +00:00
|
|
|
}
|
|
|
|
|
2020-10-30 14:51:40 +00:00
|
|
|
export interface EmbedThumbnail {
|
2020-10-22 15:50:47 +00:00
|
|
|
url?: string
|
|
|
|
proxy_url?: string
|
|
|
|
height?: number
|
|
|
|
width?: number
|
2020-10-22 06:10:51 +00:00
|
|
|
}
|
|
|
|
|
2020-10-30 14:51:40 +00:00
|
|
|
export interface Reaction {
|
2020-10-22 15:50:47 +00:00
|
|
|
count: number
|
|
|
|
me: boolean
|
|
|
|
emoji: EmojiPayload
|
2020-10-22 06:10:51 +00:00
|
|
|
}
|
|
|
|
|
2020-10-30 14:51:40 +00:00
|
|
|
export interface MessageActivity {
|
2020-10-22 15:50:47 +00:00
|
|
|
type: MessageTypes
|
|
|
|
party_id?: string
|
2020-10-22 06:10:51 +00:00
|
|
|
}
|
|
|
|
|
2020-10-30 14:51:40 +00:00
|
|
|
export interface MessageApplication {
|
2020-10-22 15:50:47 +00:00
|
|
|
id: string
|
|
|
|
cover_image?: string
|
|
|
|
desription: string
|
|
|
|
icon: string | undefined
|
|
|
|
name: string
|
2020-10-22 06:10:51 +00:00
|
|
|
}
|
|
|
|
|
2020-10-30 14:51:40 +00:00
|
|
|
export interface MessageReference {
|
2020-10-22 15:50:47 +00:00
|
|
|
message_id?: string
|
|
|
|
channel_id?: string
|
|
|
|
guild_id?: string
|
2020-10-22 06:10:51 +00:00
|
|
|
}
|
|
|
|
|
2020-10-30 14:51:40 +00:00
|
|
|
export enum MessageTypes {
|
2020-10-22 15:50:47 +00:00
|
|
|
DEFAULT = 0,
|
|
|
|
RECIPIENT_ADD = 1,
|
|
|
|
RECIPIENT_REMOVE = 2,
|
|
|
|
CALL = 3,
|
|
|
|
CHANNEL_NAME_CHANGE = 4,
|
|
|
|
CHANNEL_ICON_CHANGE = 5,
|
|
|
|
CHANNEL_PINNED_MESSAGE = 6,
|
|
|
|
GUILD_MEMBER_JOIN = 7,
|
|
|
|
USER_PREMIUM_GUILD_SUBSCRIPTION = 8,
|
|
|
|
USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_1 = 9,
|
|
|
|
USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_2 = 10,
|
|
|
|
USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_3 = 11,
|
|
|
|
CHANNEL_FOLLOW_ADD = 12,
|
|
|
|
GUILD_DISCOVERY_DISQUALIFIED = 14,
|
|
|
|
GUILD_DISCOVERY_REQUALIFIED = 15
|
2020-10-22 06:10:51 +00:00
|
|
|
}
|
|
|
|
|
2020-10-30 14:51:40 +00:00
|
|
|
export enum MessageActivityTypes {
|
2020-10-22 15:50:47 +00:00
|
|
|
JOIN = 1,
|
|
|
|
SPECTATE = 2,
|
|
|
|
LISTEN = 3,
|
|
|
|
JOIN_REQUEST = 4
|
2020-10-22 06:10:51 +00:00
|
|
|
}
|
|
|
|
|
2020-10-30 14:51:40 +00:00
|
|
|
export enum MessageFlags {
|
2020-10-22 15:50:47 +00:00
|
|
|
CROSSPOSTED = 1 << 0,
|
|
|
|
IS_CROSSPOST = 1 << 1,
|
|
|
|
SUPPRESS_EMBEDS = 1 << 2,
|
|
|
|
SOURCE_MESSAGE_DELETED = 1 << 3,
|
|
|
|
URGENT = 1 << 4
|
2020-10-22 06:10:51 +00:00
|
|
|
}
|
|
|
|
|
2020-10-30 14:51:40 +00:00
|
|
|
export interface FollowedChannel {
|
2020-10-22 15:50:47 +00:00
|
|
|
channel_id: string
|
|
|
|
webhook_id: string
|
2020-10-22 06:10:51 +00:00
|
|
|
}
|
2020-12-17 01:20:06 +00:00
|
|
|
|
|
|
|
export enum MessageStickerFormatTypes {
|
|
|
|
PNG = 1,
|
|
|
|
APNG = 2,
|
|
|
|
LOTTIE = 3
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface MessageStickerPayload {
|
|
|
|
id: string
|
|
|
|
pack_id: string
|
|
|
|
name: string
|
|
|
|
description: string
|
|
|
|
tags?: string
|
|
|
|
asset: string
|
|
|
|
preview_asset: string | null
|
|
|
|
format_type: MessageStickerFormatTypes
|
|
|
|
}
|