パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v0.6.1

teledart

最新のTelegram Bot APIとインターフェースするDartライブラリ。

AndroidiOSmacOSWindowsLinux
30日間ダウンロード
1570
いいね数
312
Pub ポイント
140

パッケージをインストール

flutter pub add teledart

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Teledart は、最新の Telegram Bot API 用に洗練された効率的なインターフェースを提供する Dart ライブラリです。Android、iOS、macOS、Windows、Linux など複数のプラットフォーム向けに Telegram ボットを構築できるようにします。ポーリングと Webhook を使用したボット運用に対応しており、メッセージ処理、ユーザーとのやり取り、ボット管理を簡素化します。このライブラリは現在も積極的にメンテナンスされており、現代的な Dart の実践に基づいて設計されているため、リアルタイムチャットアプリや自動化サービスに適しています。

用途

  • カスタマーサポート用のTelegramボットの構築
  • 自動化メッセージシステムの作成
  • ソーシャルメディア用のインタラクティブなチャットボットを開発する
  • アプリへのTelegram通知の統合
  • リアルタイムでのユーザーインタラクションを有効にする

主な機能

  • Telegram Bot API v6+ をサポートしています
  • クロスプラットフォーム互換性
  • ポーリングおよびWebhookの統合
  • 型安全なイベント処理
  • 組み込みメッセージおよび更新処理

適している対象

  • Dart開発者がTelegramボットを構築しています
  • チャット機能を統合するフルスタック開発者
  • 自動化ツールを作成するチーム

注意事項

  • Telegram ボットのトークンが必要です
  • Webhookのための適切なサーバー設定が必要です
  • 本番デプロイには追加の設定が必要になる場合があります

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

TeleDart

A clean implementation of Telegram bot API allows you to create your own easily.

TeleDart

Bot API Version Dart Version License: GPL v3

Readme Card

Creating a Telegram bot

In order to create a Telegram bot, you need to talk to @BotFather generating a bot token. Simply follow the instructions.

Usage

Initialising the bot:

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

void main() {
  var BOT_TOKEN = 'YOUR_BOT_TOKEN_FROM_BOT_FATHER';
  final username = (await Telegram(BOT_TOKEN).getMe()).username;
  var teledart = TeleDart(BOT_TOKEN, Event(username!));

  teledart.start()
}

A simple usage example:

teledart.onMessage(keyword: 'Fight for freedom')
    .listen((message) => message.reply('Stand with Hong Kong'));

Using bot commands:

// Long way
teledart.onMessage(entityType: 'bot_command', keyword: 'start')
    .listen((message) => teledart.sendMessage(message.chat.id, 'Hello TeleDart!'));

// Short way (recommended)
teledart.onCommand('glory')
    .listen((message) => message.reply('to Ukraine!'));

Modifying Stream:

teledart
    .onMessage(keyword: 'dart')
    .where((message) => message.text?.contains('telegram') ?? false)
    .listen((message) => message.replyPhoto(
        //  io.File('example/dash_paper_plane.png'),
        'https://raw.githubusercontent.com/DinoLeung/TeleDart/master/example/dash_paper_plane.png',
        caption: 'This is how the Dart Bird and Telegram are met'));

Inline mode example:

teledart.onInlineQuery().listen((inlineQuery) => inlineQuery.answer([
      InlineQueryResultArticle(
          id: 'ping',
          title: 'ping',
          inputMessageContent: InputTextMessageContent(
              messageText: '*pong*', parseMode: 'MarkdownV2')),
      InlineQueryResultArticle(
          id: 'ding',
          title: 'ding',
          inputMessageContent: InputTextMessageContent(
              messageText: '*_dong_*', parseMode: 'MarkdownV2')),
    ]));

Bugs and feature requests

Please file feature requests and bugs at the issue tracker.

カテゴリー

依存関係

依存関係一覧 2 件

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。