mirror of
https://github.com/ReVanced/revanced-bots.git
synced 2026-02-01 07:11:04 +00:00
refactor(apis/websocket): clean up imports, format, and fix issues
This commit is contained in:
@@ -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>,
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user