What does it do • Compatibility • Language support • Requirements • Communication • Contributing • Installing and Usage • Documentation • Changelog • Demo • Todo • Author • License
SwiftyBot is an example on 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.
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 |
- English (en)
- Ubuntu 14.04 or later with Swift 4.0 or later / macOS with Xcode 9.0 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)
- 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.
See CONTRIBUTING.md file.
- Install Swift on your computer / server
- Install Vapor Toolbox (Optional)
- Set a secret key in
secrets/app.json
- 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 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.
- Install Swift on your computer / server
- Install Vapor Toolbox (Optional)
- Set a secret key in
secrets/app.json
- 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 add it to
secrets/app.json
- Use Supervisor to ensure your bot is always running
If you need more help through this steps, you can read How to create a Facebook Messenger bot with Swift blog post.
Every line of main.swift file is 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.
To see what has changed in recent version of SwiftyBot, see the CHANGELOG.md file.
You can open Telegram and search for SwiftyBot and start talking with him!
You can open Facebook and search for SwiftyBotMessenger and start talking with him!
- Add tests
- Add more functions and commands
- Add support for edited messages
- Add support for deleted messages
- Add support for images
- Include BFKit-Swift dependency
Fabrizio Brancati
Website: https://www.fabriziobrancati.com
Email: fabrizio.brancati@gmail.com
Roberto Chiaveri
Website: http://robertochiaveri.it
SwiftyBot is available under the MIT license. See the LICENSE file for more info.