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

outdated

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

Telegram Client library #

Fast, Enjoyable & Customizable Telegram Client

Pub Version

Telegram client dart library to make application telegram based flutter and userbot / bot support server side and client side

Features #

  • 🚀 Cross platform: mobile, desktop, browser
  • ⚡ Great performance
  • ❤️ Simple, powerful, & intuitive API

Examples App use Telegram Client #

  1. Azkagram


Install Library #

dart pub add telegram_client
flutter pub add telegram_client

Feature #

Docs #

Tdlib #

quickstart:

  • single
import 'dart:io';
import 'package:telegram_client/telegram_client.dart';
void main(List<String> args) async {
  var path = Directory.current.path;
  Tdlib tg = Tdlib("libtdjson.so", {
    'api_id': 12345,
    'api_hash': 'abcdefgjjaijiajdisd',
    'database_directory': "$path/user/",
    'files_directory': "$path/user/",
  });
  tg.on("update", (UpdateTd update, Tdlib ctx) {
    print(update.raw);
  });
  await tg.initIsolate();
}
  • multi
import 'dart:io';
import 'package:telegram_client/telegram_client.dart';
void main(List<String> args) async {
  var path = Directory.current.path;
  Tdlib tg = Tdlib("libtdjson.so", {
    'api_id': 12345678,
    'api_hash': 'asaskaoskaoskoa',
    'database_directory': "$path/user_0/",
    'files_directory': "$path/user_0/",
  });
  tg.on("update", (UpdateTd update, Tdlib ctx) {
    if (tg.client_id == ctx.client_id) {
      print("user_0");
    } else {
      print("user_1");
    }
    print(update.raw);
  });
  await tg.initIsolate();
  await tg.initIsolateNewClient(clientId: tg.client_create().address, clientOption: {
    'database_directory': "$path/user_1/",
    'files_directory': "$path/user_1/",
  });
}

constructor

No key value Deskripsi required
1 path_tdlib String path tdlib yes
2 options_tdlib object parameters di butuhkan jika method membutuhkannya no
  • examples
Tdlib tg = Tdlib("./tdjson.so", {
  'api_id': 123435,
  'api_hash': 'asmamskmaks',
  'database_directory': "",
  'files_directory': "",
  "use_file_database": true,
  "use_chat_info_database": true,
  "use_message_database": true,
  "use_secret_chats": true,
  'enable_storage_optimizer': true,
  'system_language_code': 'en',
  'new_verbosity_level': 0,
  'application_version': 'v1',
  'device_model': 'Telegram Client Hexaminate',
});

on

No key value Deskripsi required
1 type_update String path tdlib yes
2 function object parameters di butuhkan jika method membutuhkannya yes
  • examples
tg.on("update", (UpdateTd update, Tdlib ctx) {
  print(update.raw);    
});

initIsolate

No key value Deskripsi required
1 clientId int addres client_create no
2 clientOption object parameters di butuhkan jika method membutuhkannya no
  • examples
tg.initIsolate();

request

No key value Deskripsi required
1 name_method String more method check tdlib-docs yes
2 parameters object parameters di butuhkan jika method membutuhkannya options
  • examples
tg.request("sendMessage", parameters: {
  "chat_id": 123456,
  "text": "Hello world"
});

invoke

No key value Deskripsi required
1 parameters object parameters di butuhkan jika method membutuhkannya yes
  • examples
tg.invoke({
  "@type": "getMe",
});

invokeSync

No key value Deskripsi required
1 parameters object parameters di butuhkan jika method membutuhkannya yes
  • examples
tg.invokeSync({
  "@type": "getMe",
});

Object #


UpdateTd #

raw

raw_api_light

raw_api

message

channel_post


methods #

more method check tdlib-docs

sendMessage

No key value Deskripsi required
1 chat_id String or int yes
2 text String yes

sendPhoto

No key value Deskripsi required
1 chat_id String or int yes
2 photo String yes

TelegramBotApi #

quickstart:

  • single
import 'package:telegram_client/telegram_client.dart';
void main(List<String> args) async {
  TelegramBotApi tg = TelegramBotApi("token");
  tg.on("update", (UpdateApi update, TelegramBotApi ctx) {
    print(update.raw);
  });
  await tg.initIsolate(); // add this jika ingin menggunakan long poll update
}
  • multi
import 'package:telegram_client/telegram_client.dart';
void main(List<String> args) async {
  TelegramBotApi tg = TelegramBotApi("token");
  tg.on("update", (UpdateApi update, TelegramBotApi ctx) {
    print(update.raw);
  });
  await tg.initIsolate();
  await tg.initIsolate(tokenBot: "new_token_bot");
}

constructor

No key value Deskripsi required
1 string_token_bot String token bot @botfather yes
2 options_tdlib object parameters di butuhkan jika method membutuhkannya no
  • examples
TelegramBotApi tg = TelegramBotApi("token_bot");
request
No key value Deskripsi required
1 name_method String more method check tdlib-docs yes
2 parameters object parameters di butuhkan jika method membutuhkannya options
  • examples
tg.request("sendMessage", parameters:{
  "chat_id": 123456,
  "text": "Hello world"
});

MtProto #

Quickstart:

import 'package:telegram_client/telegram_client.dart';
void main() async {
  Mtproto tg = Mtproto();
  tg.connect();
  tg.on("update", (data) {
    print(data);
  });
}
  • Tags: #telegram #telegram_client #tdlib #mtproto #telegram_bot_api #telegram_dart #telegram_flutter #telegram_clone #telegram_userbot #telegram_bot

  • Seo Telegram Dart Telegram Client Telegram Flutter Telegram userbot Telegram Bot Telegram Tdlib Tdlib Mtproto Telegram Bot Api Telegram Library Telegram clone Telegram clone flutter Tdlib Dart Tdlib Flutter Mtproto dart Mtproto flutter Telegram Bot Api Telegram Bot Api dart Telegram Bot Api Flutter


147
likes
0
pub points
74%
popularity

Publisher

unverified uploader

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

License

unknown (license)

Dependencies

ffi, hexaminate, http, universal_io, web_ffi

More

Packages that depend on telegram_client