A red-envelope style app for Flock.
Ever wanted to get your team's attention on Flock, but your message keeps getting buried under gifs of dogs? Use Pinata, the app that get's your Flock chat's attention immediately by seding them a pinata filled with money!
Manager send pinata filled with designated amount of money, ie. $10. First person to click on it get's the largest percentage of that money, then the second and third receive less, respectively, and so on. Incentivizes employees to check their company Flock chat, and helps them create fond memories of the company chat.
It's simple, just use the '/pinata' slash command to play!
- To recreate this app, fork and clone this repo git clone
- Install ngrok
- In the directory where you downloaded ngrok, run ./ngrok http 8080
- Create your new Flock App here
- Give your app a name and description, click save.
- Click to expand Advanced Info section
- Event listener URL should be your ngrok https url, + '/events' (ie. 'https://.ngrok.io/events')
- Make sure it's https!
- Turn Slash Command on, give it a slash command (just the word, no slash before it here) and description
- Select slash command action "Send to event listener URL"
- Enable bot
- Click save for this section (important!)
- Copy the App Id, App Secret, Bot Id, and Bot Secret for you config.js file (how to format this config.js below)
- Click Save for Publish your app on Flock App store (you can leave it private, or select team-only install if you want team members to be able to download it too).
After you've created your new Flock App here, you will find the following ID's and tokens for your config.js file.
Since config.js is in the gitignore, you'll have to first create the file, then add the following:
module.exports = {
appId: <your app id>,
appSecret: <your app secret>,
botUserId: <your bot id>,
botToken: <your bot token>
};
Replace any ngrok urls in the index file with your currently running one. ngrok urls refresh every time ngrok is started.
- In your project directory, run node index.js
- Once you have your config.js file setup, click install on the top of the page where you setup your app! (If you've navigated away, it's under the Flock Apps >> Your Apps section when you go to Build Apps)
- You should see the install event appear on your server!
- Type /pinata in your chat
- 🎉 🎉 Magic happens 🎉 🎉