telegram 0.0.9
telegram: ^0.0.9 copied to clipboard
A simple and light weight utility for sending message via Telegram...
A simple and light weight utility for sending messages via Telegram. Telegram is a globally accessible freemium, cross-platform, cloud-based instant messaging service. The service also provides optional end-to-end encrypted chats and video calling, VoIP, file sharing and several other features.
Features #

📨 Send Message via Telegram
🔗 Telegram Link Generator
📌 Copy Telegram Link
💬 Open Chat Directly
📢 Join Telegram Channel/Group
✅ Check if Telegram is Installed
📞 Share Contact via Telegram
👥 Open Telegram Group
📷 Send Media via Telegram
🔍 Check Username Availability
🤖 Open Telegram Bot
🔥 more coming soon...
Installation #
Add telegram as dependency by running the command below:
flutter pub add telegram
OR
Add telegram this in your pubspec.yaml
:
dependencies:
telegram: latest_version
Usage 📨 #

/// Send message via Telegram
Telegram.send(
username:'UsamaSarwar',
message:'Thanks for building Telegram Package :)'
);
/// Copy Telegram message Link to clipboard
Telegram.copyLinkToClipboard(
username:'UsamaSarwar',
message:'Thanks for building Telegram Package :)'
);
/// Get Telegram message link as String
Telegram.getLink(
username:'UsamaSarwar',
message:'Thanks for building Telegram Package :)'
);
/// Open chat with a specific username
Telegram.openChat(username: 'UsamaSarwar');
/// Join a Telegram channel or group using an invite link
Telegram.joinChannel(inviteLink: 'https://t.me/joinchat/XXXXXXX');
/// Join a Telegram channel or group using an invite link
Telegram.joinChannel(inviteLink: 'https://t.me/joinchat/XXXXXXX');
/// Check if Telegram is installed on the device
bool installed = await Telegram.isTelegramInstalled();
print('Telegram installed: $installed');
/// Share a contact via Telegram
Telegram.shareContact(
phone: '+923100007773',
firstName: 'Usama',
lastName: 'Sarwar'
);
/// Open a Telegram group by username
Telegram.openGroup(username: 'yourgroupname');
/// Send a media file via Telegram
Telegram.sendMedia(filePath: 'https://example.com/sample.jpg');
/// Check if a Telegram username is available
bool exists = await Telegram.checkUsernameAvailability(username: 'exampleUser');
print('Username exists: $exists');
/// Open a Telegram bot using its username
Telegram.openBot(username: 'MyTelegramBot');
Import the package and call any of the methods in your Flutter app. For example:
import 'package:telegram/telegram.dart';
void main() async {
try {
await Telegram.send(
username: 'UsamaSarwar',
message: 'Thanks for building Telegram Package :)'
);
} catch (e) {
print('Error: $e');
}
}
Contribution 💙 #
You are warmly welcome for contributing telegram package. Checkout this contribution guide.
Open Source Contributor from Punjab, Pakistan 🇵🇰