Features β’ Platforms and Tutorials β’ Language Support β’ Requirements β’ Communication β’ Contributing β’ Deploying β’ Platforms Usage β’ Documentation β’ Changelog β’ Demos β’ Authors β’ License
Features
SwiftyBot is an example of how to create a bot with Swift on top of Vapor.
Here is the list of all the features:
- Telegram bot integration
- Facebook Messenger bot integration
- Google Assistant bot integration
- Well documented (you can find more in Documentation section)
- Well tested (currently 99% of code coverage)
- Clean (every bot platform has its folder with its files and tests)
- Easy to follow (every bot platform comes with a tutorial, more in Platforms and Tutorials section)
- Multi language support
There are a lot of bot platforms out there that can be added...
Platforms and Tutorials
Bot Platform | Blog Post Link |
---|---|
Telegram | How to create a Telegram bot with Swift using Vapor on Ubuntu / macOS |
Facebook Messenger | How to create a Facebook Messenger bot with Swift |
Google Assistant | Not Available Yet |
Language Support
- English (en)
Requirements
- Ubuntu 14.04 or later with Swift 5.1 or later / macOS with Xcode 11.2 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)
- Google account and a Google Assistant app for any platform (Google Assistant 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.
Deploying
Private Server
- Install Swift on your computer / server
- Install Vapor Toolbox (Optional)
- Enable TLS (You can use Let's Encrypt)
- Use Apache or nginx as reverse proxy
- 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, from Step 1 to Step 4.
Heroku
- Click the button above
- Go to the Settings section of your application
- Click on the Reveal Config Vars button in Config Vars section
- Copy all the created secret key set to up the bots, read the next sections for more info
Vapor Cloud
- Create an account on Vapor Cloud
- Create an organization
- Create a project
- Create an application
- Add an hosting service and connect it to your GitHub repository
- Add at least 1 environment, 2 is better
- Use the Vapor Toolbox to deploy your bot
Platforms Usage
Telegram
- Set a secret key in
TELEGRAM_SECRET
environment variable - Create a Telegram bot with BotFather
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
- Set a secret key in
MESSENGER_SECRET
environment variable - Create a Facebook app and Page
- Get a Page access token and set it in
MESSENGER_TOKEN
environment variable
If you need more help through this steps, you can read How to create a Facebook Messenger bot with Swift blog post.
Google Assistant
- Set a secret key in
ASSISTANT_SECRET
environment variable - Create an Actions on Google project
- Setup Actions on Google project on Dialogflow
Documentation
Bot
- Every line of every project file is commented.
- If you need Vapor documentation you can find it here.
Platforms
- If you need Telegram bot documentation you can find it here.
- If you need Facebook Messenger bot documentation you can find it here.
- If you need Google Assistant bot documentation you can find it here and here. You can also find some JSON examples here and here.
Changelog
To see what has changed in recent version of SwiftyBot, see the CHANGELOG.md file.
Demos
Telegram
You can open Telegram and search for SwiftyBot to start talking with him!
Facebook Messenger
You can open Facebook Messenger and search for SwiftyBotMessenger to start talking with him!
Google Assistant
You can open Google Assistant and write Talk to SwiftyBot to start talking with him!
Authors
Bot
Fabrizio Brancati
https://www.fabriziobrancati.com - [email protected]
Icon
Roberto Chiaveri
License
SwiftyBot is available under the MIT license. See the LICENSE file for more info.