mirror of
https://github.com/ReVanced/revanced-bots.git
synced 2026-01-11 13:56:15 +00:00
feat!: big feature changes
BREAKING CHANGES: - Heartbeating removed - `config.consoleLogLevel` -> `config.logLevel` NEW FEATURES: - Training messages - Sequence number system - WebSocket close codes used instead of disconnect packets FIXES: - Improved error handling - Some performance improvements - Made code more clean - Updated dependencies
This commit is contained in:
@@ -1,20 +1,33 @@
|
||||
import type { ClientOperation } from '@revanced/bot-shared'
|
||||
import type { Logger } from '@revanced/bot-shared'
|
||||
import type { Wit } from 'node-wit'
|
||||
import type { Worker as TesseractWorker } from 'tesseract.js'
|
||||
import { ClientPacketObject } from '../classes/Client'
|
||||
import type { Config } from '../utils/getConfig'
|
||||
import type { ClientPacketObject } from '../classes/Client'
|
||||
import type { Config } from '../utils/config'
|
||||
|
||||
export { default as parseTextEventHandler } from './parseText'
|
||||
export { default as parseImageEventHandler } from './parseImage'
|
||||
export { default as trainMessageEventHandler } from './trainMessage'
|
||||
|
||||
export type EventHandler<POp extends ClientOperation> = (
|
||||
packet: ClientPacketObject<POp>,
|
||||
context: EventContext,
|
||||
) => void | Promise<void>
|
||||
|
||||
export type EventContext = {
|
||||
witClient: Wit
|
||||
tesseractWorker: TesseractWorker
|
||||
wit: {
|
||||
train(text: string, label: string): Promise<void>
|
||||
message(text: string): Promise<WitMessageResponse>
|
||||
}
|
||||
tesseract: TesseractWorker
|
||||
logger: Logger
|
||||
config: Config
|
||||
}
|
||||
|
||||
export interface WitMessageResponse {
|
||||
text: string
|
||||
intents: Array<{
|
||||
id: string
|
||||
name: string
|
||||
confidence: number
|
||||
}>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user