2020-10-22 15:50:47 +00:00
|
|
|
import { User } from '../structures/user.ts'
|
|
|
|
import { GatewayIntents } from '../types/gatewayTypes.ts'
|
|
|
|
import { Gateway } from './gateway.ts'
|
2020-10-23 03:19:40 +00:00
|
|
|
import { Rest } from "./rest.ts"
|
2020-10-22 15:50:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Discord Client.
|
|
|
|
*/
|
|
|
|
export class Client {
|
|
|
|
gateway?: Gateway
|
2020-10-23 03:19:40 +00:00
|
|
|
rest?: Rest
|
2020-10-22 15:50:47 +00:00
|
|
|
user?: User
|
|
|
|
ping = 0
|
|
|
|
|
|
|
|
constructor () {}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This function is used for connect to discord.
|
|
|
|
* @param token Your token. This is required.
|
|
|
|
* @param intents Gateway intents in array. This is required.
|
|
|
|
*/
|
|
|
|
connect (token: string, intents: GatewayIntents[]) {
|
|
|
|
this.gateway = new Gateway(this, token, intents)
|
|
|
|
}
|
|
|
|
}
|