finna
This commit is contained in:
parent
ab365f9878
commit
3f7372d6a7
3 changed files with 53 additions and 2 deletions
|
@ -3,6 +3,7 @@ import {
|
|||
Attachment,
|
||||
MessageActivity,
|
||||
MessageApplication,
|
||||
MessageInteractionPayload,
|
||||
MessageOptions,
|
||||
MessagePayload,
|
||||
MessageReference
|
||||
|
@ -19,9 +20,25 @@ import { Guild } from './guild.ts'
|
|||
import { MessageReactionsManager } from '../managers/messageReactions.ts'
|
||||
import { MessageSticker } from './messageSticker.ts'
|
||||
import { Emoji } from './emoji.ts'
|
||||
import { InteractionType } from '../types/slash.ts'
|
||||
|
||||
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 {
|
||||
id: string
|
||||
channelID: string
|
||||
|
@ -46,6 +63,7 @@ export class Message extends SnowflakeBase {
|
|||
messageReference?: MessageReference
|
||||
flags?: number
|
||||
stickers?: MessageSticker[]
|
||||
interaction?: MessageInteraction
|
||||
|
||||
get createdAt(): Date {
|
||||
return new Date(this.timestamp)
|
||||
|
@ -87,6 +105,10 @@ export class Message extends SnowflakeBase {
|
|||
(payload) => new MessageSticker(this.client, payload)
|
||||
)
|
||||
: undefined
|
||||
this.interaction =
|
||||
data.interaction === undefined
|
||||
? undefined
|
||||
: new MessageInteraction(this.client, data.interaction)
|
||||
}
|
||||
|
||||
readFromData(data: MessagePayload): void {
|
||||
|
|
|
@ -5,6 +5,7 @@ import { Role } from '../structures/role.ts'
|
|||
import { Permissions } from '../utils/permissions.ts'
|
||||
import { EmojiPayload } from './emoji.ts'
|
||||
import { MemberPayload } from './guild.ts'
|
||||
import { InteractionType } from './slash.ts'
|
||||
import { UserPayload } from './user.ts'
|
||||
|
||||
export interface ChannelPayload {
|
||||
|
@ -185,6 +186,7 @@ export interface MessagePayload {
|
|||
message_reference?: MessageReference
|
||||
flags?: number
|
||||
stickers?: MessageStickerPayload[]
|
||||
interaction?: MessageInteractionPayload
|
||||
}
|
||||
|
||||
export enum AllowedMentionType {
|
||||
|
@ -373,3 +375,10 @@ export interface MessageStickerPayload {
|
|||
preview_asset: string | null
|
||||
format_type: MessageStickerFormatTypes
|
||||
}
|
||||
|
||||
export interface MessageInteractionPayload {
|
||||
id: string
|
||||
type: InteractionType
|
||||
name: string
|
||||
user: UserPayload
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue