Telegram client dart library to make application telegram based flutter and userbot / bot support server side and client side
-
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
dart pub add telegram_client
flutter pub add telegram_client
quickstart:
import 'package:telegram_client/telegram_client.dart';
void main() async {
Tdlib tg = Tdlib("libtdjson.so");
tg.on("update", (UpdateTd update) {
print(update.raw);
});
tg.initIsolate();
}
constructor
No |
key |
value |
Deskripsi |
required |
1 |
path_tdlib |
String path tdlib |
|
yes |
2 |
options_tdlib |
object |
parameters di butuhkan jika method membutuhkannya |
no |
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 |
tg.on("update", (UpdateTd update) {
print(update.raw);
});
initIsolate
No |
key |
value |
Deskripsi |
required |
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 |
tg.request("sendMessage", {
"chat_id": 123456,
"text": "Hello world"
});
invoke
No |
key |
value |
Deskripsi |
required |
1 |
parameters |
object |
parameters di butuhkan jika method membutuhkannya |
yes |
tg.invoke({
"@type": "getMe",
});
invokeSync
No |
key |
value |
Deskripsi |
required |
1 |
parameters |
object |
parameters di butuhkan jika method membutuhkannya |
yes |
tg.invokeSync({
"@type": "getMe",
});
raw
raw_api_light
raw_api
message
channel_post
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 |
quickstart:
import 'package:telegram_client/telegram_client.dart';
void main(List<String> args) async {
TelegramBotApi tg = TelegramBotApi("token_bot");
// add this if you want your bot get update longpoll
tg.on("update", (UpdateApi update_origin) async {
var update = update_origin.raw;
print(update);
if (update["message"] is Map) {
var msg = update["message"];
if (msg["text"] is String) {
if (RegExp("/start", caseSensitive: false).hasMatch(msg["text"])) {
return await tg.request("sendMessage", {"chat_id": msg["chat"]["id"], "text": "Hello world"});
}
}
}
});
await tg.initIsolate(); // add this if you want your bot get update longpoll
}
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 |
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 |
tg.request("sendMessage", {
"chat_id": 123456,
"text": "Hello world"
});
Quickstart:
import 'package:telegram_client/telegram_client.dart';
void main() async {
Mtproto tg = Mtproto();
tg.connect();
tg.on("update", (data) {
print(data);
});
}