Fix lint & Added reconnect handler

This commit is contained in:
AkiaCode 2020-11-04 08:00:03 +09:00
parent c9be27ff44
commit c4fb67c07e
No known key found for this signature in database
GPG key ID: 8FE597305C258393
6 changed files with 17 additions and 10 deletions

View file

@ -4,13 +4,13 @@
[![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme) [![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)
An easy to use Discord API Library for Deno **An easy to use Discord API Library for Deno**
## Table of Contents ## Table of Contents
- [Usage](#usage) - [Usage](#usage)
- [Docs](#docs) - [Docs](#docs)
- [Maintainers](#maintainers) - [Maintainer](#maintainer)
- [Contributing](#contributing) - [Contributing](#contributing)
- [License](#license) - [License](#license)
@ -35,7 +35,7 @@ bot.connect(TOKEN, [GatewayIntents.GUILD_MESSAGES])
Not made yet Not made yet
## Maintainers ## Maintainer
[@Helloyunho](https://github.com/Helloyunho) [@Helloyunho](https://github.com/Helloyunho)

View file

@ -12,12 +12,13 @@ import { ready } from './ready.ts'
import { guildBanRemove } from './guildBanRemove.ts' import { guildBanRemove } from './guildBanRemove.ts'
import { messageCreate } from "./messageCreate.ts" import { messageCreate } from "./messageCreate.ts"
import { resume } from "./resume.ts" import { resume } from "./resume.ts"
import { reconnect } from './reconnect.ts'
export const gatewayHandlers: { export const gatewayHandlers: {
[eventCode in GatewayEvents]: GatewayEventHandler | undefined [eventCode in GatewayEvents]: GatewayEventHandler | undefined
} = { } = {
READY: ready, READY: ready,
RECONNECT: undefined, RECONNECT: reconnect,
RESUMED: resume, RESUMED: resume,
CHANNEL_CREATE: channelCreate, CHANNEL_CREATE: channelCreate,
CHANNEL_DELETE: channelDelete, CHANNEL_DELETE: channelDelete,

View file

@ -0,0 +1,6 @@
import { Gateway } from "../index.ts"
import { GatewayEventHandler } from "../index.ts"
export const reconnect: GatewayEventHandler = async (gateway: Gateway, d: any) => {
gateway.reconnect()
}