2023-11-29 20:31:18 +03:00
|
|
|
import { BaseTelegramClientOptions } from '@mtcute/core'
|
2023-12-01 15:03:11 +03:00
|
|
|
import { MemoryStorage } from '@mtcute/core/storage/memory.js'
|
2023-12-02 04:10:31 +03:00
|
|
|
import { LogManager } from '@mtcute/core/utils.js'
|
2023-10-16 19:23:53 +03:00
|
|
|
|
|
|
|
export const getApiParams = (): BaseTelegramClientOptions => {
|
|
|
|
if (!process.env.API_ID || !process.env.API_HASH) {
|
|
|
|
throw new Error('API_ID and API_HASH env variables must be set')
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
apiId: parseInt(process.env.API_ID),
|
|
|
|
apiHash: process.env.API_HASH,
|
|
|
|
testMode: true,
|
2023-12-01 15:03:11 +03:00
|
|
|
storage: new MemoryStorage(),
|
2023-12-02 04:10:31 +03:00
|
|
|
logLevel: LogManager.DEBUG,
|
2023-10-16 19:23:53 +03:00
|
|
|
}
|
|
|
|
}
|