feat(bots/discord): add source

This commit is contained in:
PalmDevs
2024-03-28 21:52:23 +07:00
parent b3b7723b4f
commit f9d50a0a6b
30 changed files with 1482 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
import type { ClientWebSocketEvents } from '@revanced/bot-api'
import { api } from '../../context'
const { client } = api
export function on<Event extends EventName>(event: Event, listener: ListenerOf<Event>) {
client.on(event, listener)
}
export function once<Event extends EventName>(event: Event, listener: ListenerOf<Event>) {
client.once(event, listener)
}
export type EventName = keyof ClientWebSocketEvents
export type ListenerOf<Event extends EventName> = ClientWebSocketEvents[Event]