Telegram Bot Framework written in Swift 4.1 with SwiftNIO network framework
What does it do
Telegrammer is open-source framework for Telegram Bots developers. It was built on top of Apple/SwiftNIO which help to demonstrate excellent performance.
SwiftNIO is a cross-platform asynchronous event-driven network application framework for rapid development of maintainable high performance protocol servers and clients.
Also Telegrammer use some submodules of Vapor 3 server side swift framework
- Ubuntu 14.04 or later with Swift 4.1 or later / macOS with Xcode 9.3 or later
- Telegram account and a Telegram App for any platform
- Swift Package Manager (SPM) for dependencies
- Vapor 3 (optionally, for bots with database and other server side stuff)
See CONTRIBUTING.md file.
Join to Telegram developers chat
Installing and Usage
- Create package with Swift Package Manager (SPM)
$ mkdir MyBot $ cd MyBot $ swift package init --type executable
- Define Dependencies in Package.swift file
let package = Package( name: "MyBot", dependencies: [ .package(url: "https://github.com/givip/Telegrammer.git", from: "0.1.0"), ], targets: [ .target( name: "MyBot", dependencies: ["Telegrammer"]), ] )
- Resolve dependencies
$ swift package resolve
- Generate XCode project (for macOS only)
$ swift package generate-xcodeproj
- Open in XCode (for macOS only)
$ open MyBot.xcodeproj
You project is ready to create new Telegram Bot.
If you need more help through this steps, you can read How to create a Telegram bot with Telegrammer on Ubuntu / macOS (Coming soon...)
- Add Telegram Token in Environment Variables, e.g.
- Run EchoBot executable scheme or
$ swift run
- Send /echo command to bot