Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create separate dev telegram account for tdlib client #3

Open
github-actions bot opened this issue Sep 8, 2023 · 0 comments
Open

create separate dev telegram account for tdlib client #3

github-actions bot opened this issue Sep 8, 2023 · 0 comments
Labels

Comments

@github-actions
Copy link

github-actions bot commented Sep 8, 2023

https://api.github.com/vorant94/sofash/blob/fcb3ff714b19baf963f745027eebdd11e63af32c/apps/cli/src/core/create-telegram.ts#L6

import { type Command } from 'commander';
import { type Client, configure, createClient } from 'tdl';
import { type Env } from './env.js';

// TODO dig into why telegram#on error is not working
// TODO create separate dev telegram account for tdlib client
export function createTelegram(program: Command, env: Env): Client {
  configure({
    verbosityLevel: 1,
  });

  const client = createClient({
    apiId: env.TG_CLIENT_API_ID,
    apiHash: env.TG_CLIENT_API_HASH,
  });

  program.hook('postAction', async () => {
    await client.close();
  });

  return client;
}
@github-actions github-actions bot added the todo label Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

0 participants