This is the code for the !thanks bot that we use on the Autocode Discord server! The bot:
- Tracks messages which start with !thanks and tag at least one member
- Stores these !thanks' in a Google Sheet
- Every Sunday, it DMs everyone who was thanked in a last week with their thank you messages
If you'd like to find out more about why we use our !thanks bot, check out this blog post!
- Create a copy of our required Google Sheet by heading over to this link.
- Install this app! During the installation flow, you'll be asked to set the
THANK_YOU_CHANNEL_ID environment variable. You should set this to the channel ID of the channel you want people to be able to use !thanks in.
- Once installed, link your Discord Bot and Google Sheets linked resources in the bottom left of the editor. Remember, your Google Sheet should be set to the template you copied earlier, and your Discord Bot needs to be in the server containing the channel you set earlier.
That's it! Your !thanks bot is ready to go!
Whenever anyone uses !thanks in the channel that it's enabled for, our bot will parse the message, store the thanks' in a Google Sheet, then react to the message. It's that simple!
Huge thanks to Ethan Kellogg for coming up with the initial concept for our #thank-you channel and helping with this code!