Skip to content

How to create a Telegram & Facebook Messenger bot with Swift using Vapor on Ubuntu / macOS.

License

Notifications You must be signed in to change notification settings

realmosn/SwiftyBot

 
 

Repository files navigation

SwiftyBot Banner

Build Status codecov codebeat badge Version Language Platform License


What does it doCompatibilityLanguage supportRequirementsCommunicationContributingInstalling and UsageDocumentationChangelogDemoTodoAuthorLicense


What does it do

SwiftyBot is an example of how to create a Telegram & Facebook Messenger bot with Swift using Vapor.
See Compatibility section to check service and version it supports, you can also see its blog post with the link in that table.

Compatibility

Bot Type Version Blog Post Link
Telegram 1.0...1.2 How to create a Telegram bot with Swift using Vapor on Ubuntu / macOS
Facebook Messenger 2.0...2.3 How to create a Facebook Messenger bot with Swift
??? 3.0 ???

Language support

  • English (en)

Requirements

  • 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 (Telegram bot only)
  • Facebook account and a Facebook Messenger App for any platform (Facebook Messenger bot only)

Communication

  • If you need help, open an issue.
  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, see Contributing section.

Contributing

See CONTRIBUTING.md file.

Installing and Usage

Telegram

  • Install Swift on your computer / server
  • Install Vapor Toolbox (Optional)
  • Set a secret key in TELEGRAM_SECRET environment variable
  • Enable TLS (You can use Let's Encrypt)
  • Use Apache or nginx as reverse proxy
  • Create a Telegram bot with BotFather
  • Use Supervisor to ensure your bot is always up and running

If you need more help through this steps, you can read How to create a Telegram bot with Swift using Vapor on Ubuntu / macOS blog post.

Facebook Messenger

  • Install Swift on your computer / server
  • Install Vapor Toolbox (Optional)
  • Set a secret key in MESSENGER_SECRET environment variable
  • Enable TLS (You can use Let's Encrypt)
  • Use Apache or nginx as reverse proxy
  • Create a Facebook App and Page
  • Get a Page access token and set it in MESSENGER_TOKEN environment variable
  • Use Supervisor to ensure your bot is always up and running

If you need more help through this steps, you can read How to create a Facebook Messenger bot with Swift blog post.

Documentation

Every line of the project file are commented.
If you need Vapor documentation you can find it here.
If you need Telegram bot documentation you can find it here.
If you need Facebook Messenger bot documentation you can find it here.

Changelog

To see what has changed in recent version of SwiftyBot, see the CHANGELOG.md file.

Demo

Telegram

You can open Telegram and search for SwiftyBot and start talking with him!

Facebook Messenger

You can open Facebook and search for SwiftyBotMessenger and start talking with him!

Todo

  • Add Telegram support
  • Add Facebook Messenger support
  • Add tests
  • Add code coverage reports

Author

Fabrizio Brancati

Website: https://www.fabriziobrancati.com
Email: fabrizio.brancati@gmail.com

Icon

Roberto Chiaveri

Website: http://robertochiaveri.it

License

SwiftyBot is available under the MIT license. See the LICENSE file for more info.

About

How to create a Telegram & Facebook Messenger bot with Swift using Vapor on Ubuntu / macOS.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 95.1%
  • Ruby 4.3%
  • Other 0.6%