Teledart는 최신 Telegram Bot API에 대한 깔끔하고 효율적인 인터페이스를 제공하는 Dart 라이브러리입니다. Android, iOS, macOS, Windows, Linux 등 여러 플랫폼용 Telegram 봇을 개발할 수 있도록 도와줍니다. 휠링과 웹훅 기반의 봇 운영을 지원하며, 메시지 처리, 사용자 상호작용 및 봇 관리를 간소화합니다. 이 라이브러리는 활발히 유지보수되고 있으며, 현대적인 Dart 실천 방식을 기반으로 설계되어 실시간 채팅 애플리케이션과 자동화 서비스에 적합합니다.
사용 사례
고객 지원을 위한 텔레그램 봇 만들기
자동 메시지 시스템 만들기
소셜 미디어를 위한 인터랙티브 챗봇 개발
앱에 텔레그램 알림 통합
실시간 사용자 상호작용 활성화
주요 기능
Telegram Bot API v6+를 지원합니다
크로스 플랫폼 호환성
폴링 및 웹훅 통합
형 안전한 이벤트 처리
내장 메시지 및 업데이트 처리
적합한 대상
Dart 개발자가 텔레그램 봇을 구축하고 있습니다
채팅 기능을 통합하는 풀스택 개발자
자동화 도구를 만드는 팀
고려 사항
Telegram 봇 토큰이 필요합니다
웹훅을 위해 적절한 서버 설정이 필요합니다
생산 배포를 위해 추가 구성이 필요할 수 있습니다
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
TeleDart
A clean implementation of Telegram bot API allows you to create your own easily.
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';
voidmain() {
var BOT_TOKEN = 'YOUR_BOT_TOKEN_FROM_BOT_FATHER';
final username = (awaitTelegram(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!'));
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'));