Skip to content

varshav0119/notion-discord-book-recommendations

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Notion-Discord Book Recommendations

About the Integration

This is a Discord bot that ports book recommendations from Discord to Notion. Here is a simple diagram to illustrate what the bot does! Could not Load Diagram

This integration works using an unofficial Python SDK for the Notion API, which can be found at notion-sdk-py.

Tutorial

For a more comprehensive explanation about this project, and better set-up instructions, visit this tutorial: Making a Discord bot that talks to Notion.

Try it Yourself

To test this Discord bot, you will need to set up a few things:

Notion Reading List Database Template

You can duplicate this template for running this example. You need to create a Notion integration as explained in the Notion API documentation here. After doing this, you will obtain a Notion Internal Integration Token and a database ID. Note these down somewhere secure to use later.

Discord Bot

Follow the instructions here to create a Discord Bot and add it to your server. Make sure to give the bot permissions to view the channel(s) where book recommendations will be coming in! At the end of this, you will obtain a Discord Bot Token. Note this down too.

Google Books API

Create a GCP project and get your Google Books API credentials by following these instructions.

Running the Bot

  1. Clone this repository locally:
    git clone https://github.com/FruitVodka/notion-discord-book-recommendations.git
  2. Add the credentials from the previous sections to a .env file in src folder; the file should look like:
DISCORD_TOKEN={discord-bot-token}
DISCORD_GUILD={discord-server-name}
NOTION_TOKEN={notion-integration-token}
DATABASE_ID={notion-database-id}
BOOKS_API_KEY={google-books-api-key}
  1. Install the requirements in requirements.txt by running this command in the project root directory
    pip3 install -r requirements.txt
  2. Run src/bot.py - it contains the code that powers this Discord bot - using the command
    python3 src/bot.py

Using the Bot

  1. !add <book-name> will look up the book-name on Google Books, and add the best match to the Notion database. If it cannot find a match, it will display a message saying adding failed.
  2. !tma >book-name> will look up the book-name on Google Books, and display the description of the book. Based on this, users can decide whether to add the book to the database using the previous command.

Resources

Contributing

This is a work-in-progress. To contribute, fork this repository and raise a pull request. Feedback and suggestions are welcome, please head to the Discussions section to start a conversation!

About

Ports book recommendations from Discord text channels to a common Notion database.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages