televerse 1.0.0 copy "televerse: ^1.0.0" to clipboard
televerse: ^1.0.0 copied to clipboard

outdated

Televerse is a Telegram Bot API Framework written completely in Dart.

example/televerse_example.dart

import 'dart:io';

import 'package:televerse/televerse.dart';

void main() {
  final String token = Platform.environment["BOT_TOKEN"]!;

  Bot bot = Bot(token);

  bot.onMessage.listen((MessageContext ctx) async {
    // Collect the ChatID from the context
    final chatId = ChatID(ctx.chat.id);

    // Send a message to the chat
    await ctx.reply("Hello World!");

    // And with the [api] getter you can access the Telegram API
    await ctx.api.sendMessage(chatId, "Hello World!");

    // Looking for a way to send a photo?
    // You can use the [sendPhoto] method
    final photo = InputFile.fromUrl("https://i.imgur.com/1Z1Z1Z1.jpg");
    await ctx.api.sendPhoto(chatId, photo);
  });

  bot.start();
}
83
likes
0
points
1.57k
downloads

Publisher

verified publisherxooniverse.com

Weekly Downloads

Televerse is a Telegram Bot API Framework written completely in Dart.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

http

More

Packages that depend on televerse