refactor(apis/websocket): clean up imports, format, and fix issues

This commit is contained in:
PalmDevs
2024-01-14 21:46:25 +07:00
parent 3e84821c23
commit a90e59edb8
7 changed files with 25 additions and 29 deletions

View File

@@ -1,12 +1,12 @@
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.js'
import type { Config } from '../utils/getConfig.js'
import type { Logger } from '@revanced/bot-shared'
import { ClientPacketObject } from '../classes/Client'
import type { Config } from '../utils/getConfig'
export { default as parseTextEventHandler } from './parseText.js'
export { default as parseImageEventHandler } from './parseImage.js'
export { default as parseTextEventHandler } from './parseText'
export { default as parseImageEventHandler } from './parseImage'
export type EventHandler<POp extends ClientOperation> = (
packet: ClientPacketObject<POp>,

View File

@@ -1,7 +1,7 @@
import { ClientOperation, ServerOperation } from '@revanced/bot-shared'
import { AsyncQueue } from '@sapphire/async-queue'
import type { EventHandler } from './index.js'
import type { EventHandler } from './index'
const queue = new AsyncQueue()

View File

@@ -1,8 +1,8 @@
import { ClientOperation, ServerOperation } from '@revanced/bot-shared'
import { inspect as inspectObject } from 'node:util'
import { inspect as inspectObject } from 'util'
import type { EventHandler } from './index.js'
import type { EventHandler } from './index'
const parseTextEventHandler: EventHandler<ClientOperation.ParseText> = async (packet, { witClient, logger }) => {
const {
@@ -14,7 +14,6 @@ const parseTextEventHandler: EventHandler<ClientOperation.ParseText> = async (pa
try {
const { intents } = await witClient.message(text, {})
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const intentsWithoutIds = intents.map(({ id, ...rest }) => rest)
await client.send({