Awesome
Scrappy
Scrappy is the Slack bot that powers scrapbook.hackclub.com. Scrappy generates your Scrapbook and Scrapbook posts via Slack messages. For more information about how to sign up for Scrapbook, check out the about page.
Click here to view the Scrapbook repository, which hosts the Scrapbook web code.
Commands
Scrappy provides some helpful commands in Slack. These commands are also documented in our Slack if you send the message /scrappy
in any channel.
/scrappy-togglestreaks
: toggles your streak count on/off in your status/scrappy-togglestreaks all
: opts out of streaks completely/scrappy-open
: opens your scrapbook (or another user's if you specify a username)/scrappy-setcss
: adds a custom CSS file to your scrapbook profile. Check out this cool example!/scrappy-setdomain
: links a custom domain to your scrapbook profile, e.g. https://zachlatta.com/scrappy-setusername
: change your profile username/scrappy-setaudio
: links an audio file to your Scrapbook. See an example here!/scrappy-webring
: adds or removes someone to your webring- Remove a post: delete the Slack message and Scrappy will automatically update for you
- Edit a post: edit the Slack message and it will automatically update for you
- Post a message to the
#scrapbook
channel or add an existing Slack message to Scrapbook by reacting to it with the:scrappy:
emoji (Note: If it isn't working, make sure Scrappy is added to the channel by mentioning@scrappy
)
Contributing
Contributions are encouraged and welcome! There are two GitHub repositories that contain code for Scrapbook: the Scrapbook website and Scrappy (the Slack bot). Each repository has a section on contributing guidelines and how to run each project locally.
Development chatter happens in the #scrapbook-dev channel in the Hack Club Slack.
Running locally
In order to run Scrappy locally, you'll need to join the Hack Club Slack. From there, ask @sampoder to be added to the scrappy (dev)
app on Slack.
- Clone this repository
git clone https://github.com/hackclub/scrappy.git && cd scrappy
- Install ngrok (if you haven't already)
- Recommended installation is via Homebrew
brew install ngrok
- Install dependencies
yarn
- Create
.env
file at root of projecttouch .env
- Send a message mentioning
@creds
in Hack Club's Slack asking for the.env
file contents
- Link your
.env
with your Prisma schemanpx prisma generate
- Start server
yarn dev
- Forward your local server to ngrok
ngrok http 3000
- Your ngrok URL will be printed out after running this command, which you will need for the next step
- Update the Slack settings
- Click the toggle to enable events
- Update the URL request URL to be
<your-ngrok-url>/api/slack/message
. An example would look likehttps://ea61-73-68-194-110.ngrok.io/api/slack/message
- Save changes and reinstall the Slack app
- This will regenerate Scrappy's oauth tokens, so make sure to update these in the
.env
file