Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create messaging module using telegram api in flutter [closed]

I want to create a messaging module using telegram api in my flutter application. What I want to do is, I want to create a UI like messaging and I want to message telegram users using my module in my application. Is it possible? Any help or links will be appreciated.

like image 823
Saif Chaudhry Avatar asked May 11 '26 15:05

Saif Chaudhry


1 Answers

Yes, it is possible. There is a TeleDart package. You can use it. You will need a Telegram API token. And then you can use it like this:

import 'package:teledart/teledart.dart';
import 'package:teledart/telegram.dart';
import 'package:teledart/model.dart';

void main() {
  var teledart = TeleDart(Telegram('YOUR_BOT_TOKEN'), Event());

  teledart.start().then((me) => print('${me.username} is initialised'));

  teledart
      .onMessage(keyword: 'Fight for freedom')
      .listen((message) => message.reply('Stand with Hong Kong'));
  
}
like image 83
Akif Avatar answered May 14 '26 10:05

Akif



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!