Swiftpack.co - Package - givip/Telegrammer

SwiftyBot Banner

Telegrammer

Telegram Bot Framework written in Swift 4.1 with SwiftNIO network framework

Build Version Language Platform License


What does it doRequirementsContributingInstalling and UsageDocumentationDemo botsAuthor


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

Requirements

Contributing

See CONTRIBUTING.md file.

Join to Telegram developers chat

Installing and Usage

  1. Create package with Swift Package Manager (SPM)
$ mkdir MyBot
$ cd MyBot
$ swift package init --type executable
  1. 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"]),
]
)
  1. Resolve dependencies
$ swift package resolve
  1. Generate XCode project (for macOS only)
$ swift package generate-xcodeproj
  1. 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...)

Documentation

Demo bots

EchoBot Sample

  1. Add Telegram Token in Environment Variables, e.g.
TELEGRAM_BOT_TOKEN 000000000:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  1. Run EchoBot executable scheme or
$ swift run
  1. Send /echo command to bot

Author

Givi Pataridze

pataridzegivi@gmail.com

Github

link
Stars: 10
Help us keep the lights on

Used By

Total: 1