Skip to content

A python bot that does project tracking from a discord server to a notion database

Notifications You must be signed in to change notification settings

PauseAI/ProjectBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ProjectBot

This repository contains a python script running a Discord bot that fetches information from messages in forum channels and creates corresponding entries in a Notion database. It's designed to help with project management, allowing users to quickly transfer and track project details from Discord discussions to a structured Notion database.

STATUS: OFFLINE, UNMAINTAINED. As of October 29th 2024, this application is no longer available online. We haven't been able to find a maintainer for this project.

Prerequisites

Before you begin, ensure you have the following:

  • Anaconda or Miniconda installed on your system. You can download Anaconda here or Miniconda here.
  • A Discord bot token. Follow the instructions here to create a bot and obtain your token.
  • A Notion integration token and a database ID. Follow the setup instructions here to create an integration and share a database with it.
  • An Airtable API key and base ID. Set up an Airtable account and create a new base for the bot to interact with.
  • A Heroku account for deployment.

Setup

  1. Clone the Repository

Clone this repository to your local machine using:

git clone <repository-url>
cd <repository-directory>
  1. Set up Linter

If you're using VSCode, you should see a popup the first time you open the workspace asking you to install recommended workspace extensions. If not, install the equivalent extensions for your IDE.

The extension is all you'll need to see yellow warning squiggles in your editor, but if you'd like to run the linter from the command line as well, instructions to install it are here: https://docs.astral.sh/ruff/installation/.

Currently, lint violations are not enforced on pull requests, but that may change in the future. Please try to avoid introducing new violations.

The configuration for Ruff can be found in ruff.toml.

  1. Create Conda Environment

Create a new Conda environment using the environment.yml file included in the project:

conda env create -f environment.yml

This will create a new environment named projectbot with all the necessary Python dependencies installed.

  1. Activate the Environment

Activate the newly created Conda environment:

conda activate projectbot
  1. Configure Secrets

Create a secrets.yml file in the project directory with your Discord bot token and Notion integration details:

DISCORD_BOT_SECRET:
  staging: "YOUR_DISCORD_BOT_TOKEN_FOR_TESTING"
  prod: "YOUR_DISCORD_BOT_TOKEN_FOR_PRODUCTION"
AIRTABLE_TOKEN:
  staging: "YOUR_AIRTABLE_TOKEN_FOR_TESTING"
  prod: "YOUR_AIRTABLE_TOKEN_FOR_PRODUCTION"
OPENAI_API_KEY:
  staging: "YOUR_OPENAI_API_KEY_FOR_TESTING"
  prod: "YOUR_OPENAI_API_KEY_FOR_PRODUCTION"

Make sure to replace the placeholders with your actual tokens and IDs.

Running the Bot Locally

  1. Start the Bot

With the Conda environment activated and the secrets configured, start the bot by running:

python main.py
  1. Using the Bot
  • In any Discord server where the bot is a member, navigate to a forum channel or a thread and type !track to trigger the bot. The bot will fetch information from the original post in the thread and create a corresponding entry in your Notion database.
  • Use the !projects and !tasks commands to generate shortlists of important projects and tasks.

Deployment

To deploy the bot on Heroku, follow these steps:

  1. Install the Heroku CLI by following the instructions here.
  2. Log in to your Heroku account using the CLI:
heroku login
  1. Create a new Heroku app:
heroku create <app-name>
  1. Set the environment variables on Heroku using the secrets from your secrets.yml file:
heroku config:set DISCORD_BOT_TOKEN=YOUR_DISCORD_BOT_TOKEN
heroku config:set NOTION_INTEGRATION_TOKEN=YOUR_NOTION_INTEGRATION_TOKEN
heroku config:set NOTION_DATABASE_ID=YOUR_NOTION_DATABASE_ID
heroku config:set AIRTABLE_API_KEY=YOUR_AIRTABLE_API_KEY
heroku config:set AIRTABLE_BASE_ID=YOUR_AIRTABLE_BASE_ID
  1. Push the code to Heroku:
git push heroku main
  1. Start the bot on Heroku:
heroku ps:scale worker=1

Your bot should now be running on Heroku.

Notes

  • Ensure the bot has the necessary permissions on your Discord server to read messages and access forum channels.
  • The Notion database must be shared with your Notion integration for the bot to create entries.
  • Make sure to set up the appropriate tables and fields in your Airtable base to match the bot's functionality.

About

A python bot that does project tracking from a discord server to a notion database

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages