-
-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Connector } from '../Connector'; | ||
import { NodeOption } from '../../Shoukaku'; | ||
|
||
export class Seyfert extends Connector { | ||
// sendPacket is where your library send packets to Discord Gateway | ||
public sendPacket(shardId: number, payload: any, important: boolean): void { | ||
return this.client.gateway.send(shardId, payload); | ||
} | ||
// getId is a getter where the lib stores the client user (the one logged in as a bot) id | ||
public getId(): string { | ||
return this.client.botId; | ||
} | ||
// Listen attaches the event listener to the library you are using | ||
public listen(nodes: NodeOption[]): void { | ||
this.client.events.values.RAW = { | ||
data: { name: "raw" }, | ||
run: (packet: any) => { | ||
// Only attach to ready event once, refer to your library for its ready event | ||
if (packet.t === "READY") return this.ready(nodes); | ||
// Attach to the raw websocket event, this event must be 1:1 on spec with dapi (most libs implement this) | ||
return this.raw(packet); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './DiscordJS'; | ||
export * from './Eris'; | ||
export * from './OceanicJS'; | ||
export * from "./Seyfert" |