alina sireneva
af54f6e1c3
now they run as-is, without any bundling. this might seem like a downgrade, but we no longer really need to verify that we publish stuff correctly as we delegate that to `@fuman/build` meow
17 lines
507 B
TypeScript
17 lines
507 B
TypeScript
import type { WorkerCustomMethods } from 'mtcute'
|
|
import { BaseTelegramClient, TelegramWorker } from 'mtcute'
|
|
import { getApiParams } from './_utils.ts'
|
|
|
|
const customMethods = {
|
|
hello: async () => 'world',
|
|
sum: async (a: number, b: number) => a + b,
|
|
} as const satisfies WorkerCustomMethods
|
|
export type CustomMethods = typeof customMethods
|
|
|
|
const client = new BaseTelegramClient(getApiParams('dc1.session'))
|
|
|
|
// eslint-disable-next-line no-new
|
|
new TelegramWorker({
|
|
client,
|
|
customMethods,
|
|
})
|