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

outdated

telegram client library to make bot or userbot Support Telegram Api and Support Tdlib Telegram Database Library.

LOCALDB

Telegram Bot api dart library auto update from official Telegram-Bot-Api, Support All Method Api.


Welcome to Azkadev's profile!

Youtube       Twitter             Dev.to       Ko-fi       Free Stuff

I'm Gibran Alazka, a freshman at THU.

  • ⚒ Javascript / Dart / C++
  • ✏️ Ubuntu
  • 🌱 Taking courses & doing assignments at THU
  • 👨 Pronouns: he/him

📃 My Skilss:

Dart Express.js Fastify Flutter Figma JavaScript NodeJS Vue.js



I'm Gibran Alazka, a freshman at THU.

  • ⚒ Javascript / Dart / C++
  • ✏️ Ubuntu
  • 🌱 Taking courses & doing assignments at THU
  • 👨 Pronouns: he/him

My Social Media

Subscriber Stars Custom badge Custom badge Custom badge Custom badge Custom badge Custom badge Custom badge #

Donate #

ID: Jika Anda Menyukai karya saya dan ingin memberikan dana untuk saya membeli beberapa snack silahkan donasi seberapapun itu akan saya terima dan terima kasih banyak ya.

EN: If you like my work and want to give me funds to buy some snacks, please donate any amount I will accept and thank you very much.

Github-sponsors-Badge Paypal-Badge

Framework #

ID: Project ini Menggunakan beberapa bahasa framework sebagai berikut.

EN: This project uses several framework as follows.

Custom badge

Language Code #

ID: Project ini Menggunakan beberapa bahasa code program sebagai berikut.

EN: This project uses several programming language languages as follows.

Dart-Badge


Use This Library #

ID: untuk anda yang ingin mencoba menggunakan source code ini, silahkan ikuti step berikut ini :

EN: for those of you who want to try to using this source code, please follow these steps :

Install Library
dart pub add telegram_client

Quickstart #

  • Apps
  • Test Tdlib
import 'package:telegram_client/telegram_client.dart';

void main() {
  var option = {
    'api_id': 1917085,
    'api_hash': 'a612212e6ac3ff1f97a99b2e0f050894',
    'database_directory':"/home/azkadev/Documents/telegram_client/dart/telegram_client/bin/bot",
    'files_directory': "/home/azkadev/Documents/telegram_client/dart/telegram_client/bin/bot"
  };
  Tdlib tg = Tdlib("/home/azkadev/Desktop/azkauserrobot/libtdjson.so", option);
  tg.on("update", (UpdateTd update) async {
    if (update.message.is_found) {
      var msg = update.message;
      if (!msg.is_outgoing) {
        if (msg.text == "/start") {
          return tg.request("sendMessage", {
            "chat_id": msg.chat.id,
            "text": "start message"
          });
        } else {
          return tg.request("sendMessage", {
            "chat_id": msg.chat.id,
            "text": "Echo ${msg.text ?? "undefined"}"
          });
        }
      }
    }
  });
  await tg.bot("2123043767:AAEY0KTdVYo0JTRmFF5S4QPBnvoCdpe2yPI");
}
  • Test Cli Telegram Api
import 'package:telegram_client/telegram_client.dart';
import 'dart:io';

void main() async {
  stdout.write("Paste your token bot from @botfather here: ");
  var tokenBot = stdin.readLineSync().toString();
  if (tokenBot.isNotEmpty) {
    var tg = Telegram(tokenBot);
    stdout.write("Enter your chat_id : ");
    var chatId = stdin.readLineSync();
    if (chatId.toString().isNotEmpty) {
      // ignore: non_constant_identifier_names
      var chat_id = chatId;
      // request raw auto update library latest
      var options = {
        "chat_id": chat_id,
        "document": tg.api.file(
            "/home/azkadev/Documents/telegram_client/dart/telegram_client/docs/README.md"),
        "caption": "hello world",
        "protect_content": true,
        "reply_markup": {
          "inline_keyboard": [
            [
              {"text": "form data nih bos", "url": "google.com"}
            ]
          ]
        }
      };
      try {
        try {
          await tg.api.request("sendDocument", options, true);
        } catch (e) {
          print("eror");
        }
        await tg.api.sendMessage(chat_id, "hello world", {
          "reply_markup": {
            "inline_keyboard": [
              [
                {"text": "hewlo", "url": "google.com"}
              ]
            ]
          }
        });
        var request = await tg.api.request("getMe");
        print(request);
      } catch (e) {
        try {
          await tg.api.sendMessage(chat_id, e.toString());
        } catch (e) {
          print(e);
        }
      }
    } else {
      print("silahkan ulangin lagi dari awal");
    }
  } else {
    print("silahkan ulangin lagi dari awal");
  }
}
140
likes
0
pub points
73%
popularity

Publisher

unverified uploader

telegram client library to make bot or userbot Support Telegram Api and Support Tdlib Telegram Database Library.

Homepage
Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

eventify, ffi, hexaminate, http, uuid

More

Packages that depend on telegram_client