2020-10-23 16:11:00 +00:00
|
|
|
import { Client } from '../models/client.ts'
|
|
|
|
import { UserPayload } from '../types/userTypes.ts'
|
|
|
|
import { WebhookPayload } from '../types/webhookTypes.ts'
|
|
|
|
import { Base } from './base.ts'
|
2020-10-23 03:19:40 +00:00
|
|
|
|
2020-10-23 16:11:00 +00:00
|
|
|
export class Webhook extends Base {
|
|
|
|
id: string
|
|
|
|
type: 1 | 2
|
|
|
|
guildID?: string
|
|
|
|
channelID: string
|
|
|
|
user?: UserPayload
|
|
|
|
name?: string
|
|
|
|
avatar?: string
|
|
|
|
token?: string
|
|
|
|
applicationID?: string
|
2020-10-23 03:19:40 +00:00
|
|
|
|
2020-10-23 16:11:00 +00:00
|
|
|
constructor (client: Client, data: WebhookPayload) {
|
|
|
|
super(client)
|
|
|
|
this.id = data.id
|
|
|
|
this.type = data.type
|
|
|
|
this.channelID = data.channel_id
|
|
|
|
}
|
|
|
|
}
|