notion-potion icon indicating copy to clipboard operation
notion-potion copied to clipboard

a telegram bot for Notion

๐Ÿงช Notion-Potion

Effortlessly brew new Notion pages with Notion-Potion Telegram Bot!

Notion-Potion is a Telegram bot that lets you quickly and easily save new notes, tasks, events etc... to your Notion workspace.

๐Ÿช„ Inspiration

The idea behind this bot is heavily inspired by David Allen's book Getting Things Done. And, is the upgrade to the method used in this previous blog post: Implementing a GTD inbox in Notion

๐Ÿ”ฎHow it Works

https://github.com/ShoroukAziz/notion-potion/assets/27028706/8d2933bd-9206-4f2c-9e3f-438ec0d29ace

๐Ÿ’ฌ Sending text messages

  • You send a message to your bot. It get's automatically saved to your Notion Inbox database

    • You then can then do any of the following
      • Rename the page
      • Move the page to another database ex: tasks, notes, etc...
      • Link the page to a specific project
      • link the page to a specific Topic
      • Delete the page
  • Or, you can tell the bot directly where to save the page

    • for example to save a page to your notes you append or prepend your message with @note

๐Ÿ”— Sending URLs

  • Links that matches a specific website you have set up before will get saved directly to the specified database
    • Ex: a URL of Youtube video gets added to the Bookmarks database while a URL of an Amazon product gets saved in the Shopping database
  • Text you send with the URL gets saved inside the page as a text block.

๐Ÿ“ƒ Documentation

๐Ÿšง Coming soon

โš ๏ธ Prerequisites

  • You have a telegram bot
    • Use BotFather to create one and obtain your token
  • Yon know your telegram user id
  • You have a Notion API Token
  • You have your Notion workspace setup [๐Ÿšง tutorial coming soon]

๐Ÿš€ Getting Started

  • Fork this repository and clone it to your local machine.
  • Copy .env.example and rename it .env and fill in your tokens and telegram user id
    TELEGRAM_BOT_TOKEN=Your telegram bot token
    MY_USER_ID=your telegram user id
    NOTION_TOKEN=your Notion token
    
  • copy notion.example.sqlite and rename it to notion.sqlite
    • Replace the example databases with your databases [๐Ÿšง tutorial coming soon]
  • Install all the dependencies npm install
  • Run the bot ๐Ÿฅณ npm run

๐Ÿงฑ File Structure

โ”œโ”€โ”€ docs                                       # screenshots for readme
โ”œโ”€โ”€ src
โ”‚  โ”œโ”€โ”€ bot                                     # All the bot code like the event handlers, keyboards, state, etc...
โ”‚  โ”œโ”€โ”€ classes                                 # All the Classes used by the bot
โ”‚  โ”œโ”€โ”€ databases                               # Connection to the database and all the data retrieval
โ”‚  โ”œโ”€โ”€ lib                                     # Helper classes like Logger and Util
โ”œโ”€โ”€โ”€ __test__                                  # Testing code.
โ”œโ”€โ”€โ”€ .env.example                              # example env file.
โ”œโ”€โ”€โ”€ notion.sqlite.example                     # example database file.
โ”œโ”€โ”€โ”€ app.js                                    # Entry point for the bot.
โ”œโ”€โ”€โ”€ package-lock.json
โ”œโ”€โ”€โ”€ package.json
โ””โ”€โ”€โ”€ README.md

๐Ÿ“ฆ Dependencies

๐Ÿงฐ Development Dependencies