2020-10-22 15:50:47 +00:00
|
|
|
import { Client } from '../models/client.ts'
|
|
|
|
import { EmojiPayload } from '../types/emojiTypes.ts'
|
2020-10-23 16:11:00 +00:00
|
|
|
import { UserPayload } from '../types/userTypes.ts'
|
2020-10-22 15:50:47 +00:00
|
|
|
import { Base } from './base.ts'
|
|
|
|
|
2020-10-23 16:11:00 +00:00
|
|
|
export class Emoji extends Base {
|
2020-10-22 15:50:47 +00:00
|
|
|
id: string
|
|
|
|
name: string
|
|
|
|
roles?: []
|
2020-10-23 16:11:00 +00:00
|
|
|
user?: UserPayload
|
|
|
|
requireColons?: boolean
|
2020-10-22 15:50:47 +00:00
|
|
|
managed?: boolean
|
|
|
|
animated?: boolean
|
|
|
|
available?: boolean
|
2020-10-23 03:19:40 +00:00
|
|
|
|
|
|
|
get CustomEmoji () {
|
|
|
|
if (this.animated === false) {
|
2020-10-23 16:11:00 +00:00
|
|
|
return `<:${this.name}:${this.id}>`
|
2020-10-23 03:19:40 +00:00
|
|
|
} else return `<a:${this.name}:${this.id}>`
|
|
|
|
}
|
|
|
|
|
2020-10-22 15:50:47 +00:00
|
|
|
constructor (client: Client, data: EmojiPayload) {
|
|
|
|
super(client)
|
|
|
|
this.id = data.id
|
|
|
|
this.name = data.name
|
|
|
|
this.roles = data.roles
|
|
|
|
this.user = data.user
|
2020-10-23 16:11:00 +00:00
|
|
|
this.requireColons = data.require_colons
|
2020-10-22 15:50:47 +00:00
|
|
|
this.managed = data.managed
|
|
|
|
this.animated = data.animated
|
|
|
|
this.available = data.available
|
|
|
|
}
|
|
|
|
}
|