telegram_client 0.5.19 copy "telegram_client: ^0.5.19" to clipboard
telegram_client: ^0.5.19 copied to clipboard

Telegram Client Lightweight, blazing and Highly customizable for make application telegram based tdlib, mtproto, or bot api and support server side.

example/example.dart

import 'package:galaxeus_lib/galaxeus_lib.dart';
import 'package:telegram_client/telegram_client.dart';

void main(List<String> args) async {
  /// ignore: unused_local_variable
  TelegramClient tg = TelegramClient();
  tg.on(
    event_name: tg.event_update,
    onUpdate: (UpdateTelegramClient updateTelegramClient) async {
      if (updateTelegramClient.telegramClientData.telegramClientType ==
          TelegramClientType.tdlib) {
        if (updateTelegramClient.rawData["@type"] == "updateConnectionState") {
          var res = await updateTelegramClient.tg.invoke(
            parameters: {
              "@type": "getAuthorizationState",
            },
            telegramClientData: updateTelegramClient.telegramClientData,
          );
          print(res.rawData.toStringifyPretty(2));
        }

        // ignore: unused_local_variable
        Map? update = await updateTelegramClient.update;
        if (updateTelegramClient.rawData["@type"] == "updateNewMessage") {
          Map message = updateTelegramClient.rawData["message"];

          print(message.toStringifyPretty(2));
        }
      }
    },
    onError: (error, stackTrace) {},
  );

  await tg.init(
    pathTdlib: TgUtils.pathTdlib(),
  );
  await tg.tdlib.initIsolate();
}
155
likes
0
points
2.64k
downloads

Publisher

unverified uploader

Weekly Downloads

Telegram Client Lightweight, blazing and Highly customizable for make application telegram based tdlib, mtproto, or bot api and support server side.

Homepage
Repository (GitHub)
View/report issues

Topics

#telegram #tdlib #mtproto #userbot #telegram-bot-api

Documentation

Documentation

Funding

Consider supporting this project:

github.com

License

unknown (license)

Dependencies

alfred, ffi, galaxeus_lib, http, mason_logger, path, universal_io, web_ffi

More

Packages that depend on telegram_client