Toriel is currently undergoing a new revamp! You can view the stuff being worked on here, and take part in #toriel-dev, if you're on the slack
Just a lil' ol greeter bot to direct new members joining the Hack Club Slack. You wonder what she might say...
Toriel is a fork of Clippy.
Contributions are encouraged and welcome!
In order to run Toriel locally, you'll need to join the Hack Club Slack. From there, ask @creds to be added to the Toriel app on Slack.
Clone this repository
git clone https://github.com/hackclub/toriel && cd toriel
Install ngrok (if you haven't already)
Install dependencies
npm install
Create .env
file
touch .env
@creds
in Hack Club's Slack asking for the .env
fileStart server
npm run dev
Forward your local server to underpass, an open source alternative made by a Hack Club team member.
Update the settings in the manifest.yml
https://toriel.hackclub.com
with your ngrok URL
ngrok http 3000
. It would look similar to this (your ngrok URL will be different):
https://toriel.hackclub.com/slack/events
URLs (the first slash command url, second slash command url, event url, and interactivity url. Include /slack/events
so your new URLs would be your-ngrok-URL/slack/events
.TORIEL
to something that doesn't start with T
(ex. msw-dev-toriel
). This prevents Slack's auto-suggestions from confusing new users.
/toriel-COMMAND
to something that doesn't start with t
(ex. /toriel-restart
-> /msw-dev-restart
).
Update slash commands
/toriel-restart
and /toriel-call
to your own slash commands like msw-dev-restart
Go to api.slack.com to create a new slack app
Click "Install to Workspace" under the "Basic Information" tab in the settings bar
Edit the env variables in .env file.
SLACK_SIGNING_SECRET=SIGNING_SECRET
SLACK_BOT_TOKEN=Bot_User_OAuth_Token
where SIGNING_SECRET
is your app's Signing Secret, which you can find by clicking on "Basic Information" in the settings bar and scrolling down (click show to and copy it)
and
Bot_User_OAuth_Token
is found under "OAuth & Permissions" (You will need click "Install to Workspace" before you can view the token)
Create a private channel where your app can run the welcome flow. Similar to the role that #in-the-cave plays for Toriel (run toriel-restart
in slack to see what this means).
Edit transcript.yml. If you want to make your own local transcript.yml with your own channels for testing, call it transcript.dev.yaml
, and it will load from that instead, however, it won't be synced to production.
channels:
represent channel-name:channel-id
and these are referred to elsewhere in the codebase with {channels.channel-name}
You can add your own bot to these channels for testing or you can delete or comment out channels you don't need for testing
IMPORTANT: you might need access to these channels later on, like to add a new user to channels, which means not giving your bot access now could break the app.
Add your own private channel to the channel list. For example, if your channel is msw-test-cave
with the channel id CDF1A5EG865
, you would add:
msw-test-cave: CDF1A5EG865
You can find the channel ID by opening the channel and clicking on the channel name in the top left. Scroll down the modal and you should see it in the bottom left corner
Do a global find and replace in the codebase to update channels.cave
to channels.name-of-your-private-channel
{channels.cave}
refers to #in-the-cave
, we need to replace it with the private channel (ex. {channels.msw-test-cave}
) that you created for your botRun npm run dev
again and also reinstall your app to the workspace (under Basic Information)
If you run into an error where the message reads Toriel is not invited to these channels
or channel_not_found
, just invite your bot to that channel (you can check the channel with its ID by referring back to transcript.yml. If the channel is private, you can create a new private channel as its substitute, but remember to update the references in the code. Ex. #toriels-diary
is a private channel, so you can create #msw-toriels-diary
, add it to transcript.yml, and change all {channels.toriels-diary}
to {channels.msw-toriels-diary}
.
Note: you have to re-update the Underpass tunnel URL on the Slack app manifest and verify the URL each time to restart the server, since the tunnel URL changes
Formatting is important, please run npm run fmt
on contribution.