finna
This commit is contained in:
parent
ab365f9878
commit
3f7372d6a7
3 changed files with 53 additions and 2 deletions
24
mod.ts
24
mod.ts
|
@ -5,7 +5,13 @@ export type { GatewayTypedEvents } from './src/gateway/index.ts'
|
||||||
export type { ClientEvents } from './src/gateway/handlers/index.ts'
|
export type { ClientEvents } from './src/gateway/handlers/index.ts'
|
||||||
export * from './src/models/client.ts'
|
export * from './src/models/client.ts'
|
||||||
export * from './src/models/slashClient.ts'
|
export * from './src/models/slashClient.ts'
|
||||||
export { RESTManager, TokenType, HttpResponseCode } from './src/models/rest.ts'
|
export {
|
||||||
|
RESTManager,
|
||||||
|
TokenType,
|
||||||
|
HttpResponseCode,
|
||||||
|
DiscordAPIError
|
||||||
|
} from './src/models/rest.ts'
|
||||||
|
export type { APIMap, DiscordAPIErrorPayload } from './src/models/rest.ts'
|
||||||
export type { RequestHeaders } from './src/models/rest.ts'
|
export type { RequestHeaders } from './src/models/rest.ts'
|
||||||
export type { RESTOptions } from './src/models/rest.ts'
|
export type { RESTOptions } from './src/models/rest.ts'
|
||||||
export * from './src/models/cacheAdapter.ts'
|
export * from './src/models/cacheAdapter.ts'
|
||||||
|
@ -62,7 +68,11 @@ export { NewsChannel } from './src/structures/guildNewsChannel.ts'
|
||||||
export { VoiceChannel } from './src/structures/guildVoiceChannel.ts'
|
export { VoiceChannel } from './src/structures/guildVoiceChannel.ts'
|
||||||
export { Invite } from './src/structures/invite.ts'
|
export { Invite } from './src/structures/invite.ts'
|
||||||
export * from './src/structures/member.ts'
|
export * from './src/structures/member.ts'
|
||||||
export { Message, MessageAttachment } from './src/structures/message.ts'
|
export {
|
||||||
|
Message,
|
||||||
|
MessageAttachment,
|
||||||
|
MessageInteraction
|
||||||
|
} from './src/structures/message.ts'
|
||||||
export { MessageMentions } from './src/structures/messageMentions.ts'
|
export { MessageMentions } from './src/structures/messageMentions.ts'
|
||||||
export {
|
export {
|
||||||
Presence,
|
Presence,
|
||||||
|
@ -109,6 +119,16 @@ export type {
|
||||||
GuildVoiceChannelPayload,
|
GuildVoiceChannelPayload,
|
||||||
GroupDMChannelPayload,
|
GroupDMChannelPayload,
|
||||||
MessageOptions,
|
MessageOptions,
|
||||||
|
MessagePayload,
|
||||||
|
MessageInteractionPayload,
|
||||||
|
MessageReference,
|
||||||
|
MessageActivity,
|
||||||
|
MessageActivityTypes,
|
||||||
|
MessageApplication,
|
||||||
|
MessageFlags,
|
||||||
|
MessageStickerFormatTypes,
|
||||||
|
MessageStickerPayload,
|
||||||
|
MessageTypes,
|
||||||
OverwriteAsArg,
|
OverwriteAsArg,
|
||||||
Overwrite,
|
Overwrite,
|
||||||
OverwriteAsOptions
|
OverwriteAsOptions
|
||||||
|
|
|
@ -3,6 +3,7 @@ import {
|
||||||
Attachment,
|
Attachment,
|
||||||
MessageActivity,
|
MessageActivity,
|
||||||
MessageApplication,
|
MessageApplication,
|
||||||
|
MessageInteractionPayload,
|
||||||
MessageOptions,
|
MessageOptions,
|
||||||
MessagePayload,
|
MessagePayload,
|
||||||
MessageReference
|
MessageReference
|
||||||
|
@ -19,9 +20,25 @@ import { Guild } from './guild.ts'
|
||||||
import { MessageReactionsManager } from '../managers/messageReactions.ts'
|
import { MessageReactionsManager } from '../managers/messageReactions.ts'
|
||||||
import { MessageSticker } from './messageSticker.ts'
|
import { MessageSticker } from './messageSticker.ts'
|
||||||
import { Emoji } from './emoji.ts'
|
import { Emoji } from './emoji.ts'
|
||||||
|
import { InteractionType } from '../types/slash.ts'
|
||||||
|
|
||||||
type AllMessageOptions = MessageOptions | Embed
|
type AllMessageOptions = MessageOptions | Embed
|
||||||
|
|
||||||
|
export class MessageInteraction extends SnowflakeBase {
|
||||||
|
id: string
|
||||||
|
name: string
|
||||||
|
type: InteractionType
|
||||||
|
user: User
|
||||||
|
|
||||||
|
constructor(client: Client, data: MessageInteractionPayload) {
|
||||||
|
super(client)
|
||||||
|
this.id = data.id
|
||||||
|
this.name = data.name
|
||||||
|
this.type = data.type
|
||||||
|
this.user = new User(this.client, data.user)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export class Message extends SnowflakeBase {
|
export class Message extends SnowflakeBase {
|
||||||
id: string
|
id: string
|
||||||
channelID: string
|
channelID: string
|
||||||
|
@ -46,6 +63,7 @@ export class Message extends SnowflakeBase {
|
||||||
messageReference?: MessageReference
|
messageReference?: MessageReference
|
||||||
flags?: number
|
flags?: number
|
||||||
stickers?: MessageSticker[]
|
stickers?: MessageSticker[]
|
||||||
|
interaction?: MessageInteraction
|
||||||
|
|
||||||
get createdAt(): Date {
|
get createdAt(): Date {
|
||||||
return new Date(this.timestamp)
|
return new Date(this.timestamp)
|
||||||
|
@ -87,6 +105,10 @@ export class Message extends SnowflakeBase {
|
||||||
(payload) => new MessageSticker(this.client, payload)
|
(payload) => new MessageSticker(this.client, payload)
|
||||||
)
|
)
|
||||||
: undefined
|
: undefined
|
||||||
|
this.interaction =
|
||||||
|
data.interaction === undefined
|
||||||
|
? undefined
|
||||||
|
: new MessageInteraction(this.client, data.interaction)
|
||||||
}
|
}
|
||||||
|
|
||||||
readFromData(data: MessagePayload): void {
|
readFromData(data: MessagePayload): void {
|
||||||
|
|
|
@ -5,6 +5,7 @@ import { Role } from '../structures/role.ts'
|
||||||
import { Permissions } from '../utils/permissions.ts'
|
import { Permissions } from '../utils/permissions.ts'
|
||||||
import { EmojiPayload } from './emoji.ts'
|
import { EmojiPayload } from './emoji.ts'
|
||||||
import { MemberPayload } from './guild.ts'
|
import { MemberPayload } from './guild.ts'
|
||||||
|
import { InteractionType } from './slash.ts'
|
||||||
import { UserPayload } from './user.ts'
|
import { UserPayload } from './user.ts'
|
||||||
|
|
||||||
export interface ChannelPayload {
|
export interface ChannelPayload {
|
||||||
|
@ -185,6 +186,7 @@ export interface MessagePayload {
|
||||||
message_reference?: MessageReference
|
message_reference?: MessageReference
|
||||||
flags?: number
|
flags?: number
|
||||||
stickers?: MessageStickerPayload[]
|
stickers?: MessageStickerPayload[]
|
||||||
|
interaction?: MessageInteractionPayload
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum AllowedMentionType {
|
export enum AllowedMentionType {
|
||||||
|
@ -373,3 +375,10 @@ export interface MessageStickerPayload {
|
||||||
preview_asset: string | null
|
preview_asset: string | null
|
||||||
format_type: MessageStickerFormatTypes
|
format_type: MessageStickerFormatTypes
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface MessageInteractionPayload {
|
||||||
|
id: string
|
||||||
|
type: InteractionType
|
||||||
|
name: string
|
||||||
|
user: UserPayload
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue