Coder Social home page Coder Social logo

raghavtinker / notion-discordbot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from servatom/notion-discordbot

1.0 0.0 0.0 2.84 MB

A discord bot consuming Notion API to add, retrieve data to Notion databases.

Home Page: https://discord.com/api/oauth2/authorize?client_id=859893575227670528&permissions=274877910016&scope=bot

License: MIT License

Python 98.52% Shell 0.15% Dockerfile 1.34%

notion-discordbot's Introduction

Notion-DiscordBot

Build StatusVisits Badge

A discord bot consuming Notion API to add and retrieve data from Notion databases.




Instructions to use the bot:

Invite the bot using Bot Invite Link and run *setup

To self-host the bot, read SETUP.md.


Creating Notion Database:

  1. Go to Notion and create a new Integration. Note the internal Integration.

  2. Then in Notion create a table like this (Tag being optional field):

4 columns where:

  • Contributor is of property type Title
  • URL of url type
  • Title of text type
  • Tag of multi-select type
  1. Click on the three dots and press Open as page


  1. Then press share and copy the URL. The URL will look something like this: https://www.notion.so/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX?v=YYYYYYYYYYYYYYYYYYYYYYYYY

Note down the X part of the url (RED part)

This is your database id

  1. Also press share again, press Invite and then click on the integration you made earlier

Bot Usage:

  1. Setup
  2. Add Record
  3. Search
  4. Delete
  5. Upload Files
  6. Change Prefix

Setup Bot:

Run *setup command and enter notion api key (the one you got after creating integration) and notion database id.


Adding Record:

*add <URL_YOU_WANT_TO_RECORD> => This will add a new record to your database (if tagging is enabled, it will add a misc tag)

*add <URL_YOU_WANT_TO_RECORD> <TAG> => This will add a new record to your database with the <TAG> tag

For multiple tags: *add <URL_YOU_WANT_TO_RECORD> <TAG>,<TAG1>,<TAG2>

Example:

Sample database populated by the bot:

Searching Record through tags:

*search <Tag1>

For multiple tags: /search <Tag1> <Tag2>.....<TagN>

Searching Record through title:

*title <title>

Example:

Deleting Record through tags:

*delete <Tag 1>

For multiple tags: *delete <Tag 1> <Tag2>......<Tag N>

Deleting Record through title:

*delete <title>

Example:

Uploading files

NOTE: In the below images the prefix used is: *

You can upload any file to the notion database. It can be a pdf, png, jpeg etc.
Here a png file is being uploaded

  1. Drag your file to the chat in discord, add comment to the file you uploaded


Here servatom is tag for the file.

  1. It will then ask the title of the file you uploaded:


  1. The database will be updated:


Changing Prefix

To change the bot prefix, type *prefix, * being the deault prefix.




notion-discordbot's People

Contributors

jmakhack avatar nayan2306 avatar raghavtinker avatar rdotjain avatar yash22arora avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.