Giter Club home page Giter Club logo

notepher-bot's Introduction

Notepher is an intuitive note-taking Telegram Mini App designed to effortlessly capture your ideas, to-do lists, and important information. Stay organized and productive without leaving your favorite messenger.

Features

  • Offline First. Notes are stored locally and synchronized when an internet connection is available.
  • Synced. Notepher leverages the power of Telegram Cloud Storage to keep your notes in sync across all your devices.
  • Seamless. Interface colors match your app theme.
  • Organized. Tag your notes and filter them by tags, pin the most important notes at the top.
  • Search. Instantly search through all your notes.
  • Powerful. Formatting, text highlighting, editing history, lists and to-do lists.

For more details, check out User Guide.

Launch

Follow these steps to set up and run your bot using this repository:

  1. Clone Repository

    git clone https://github.com/deptyped/notepher-bot.git
  2. Build and Deploy Web App

    After cloning the repository, navigate to the web-app directory:

    cd apps/web-app

    Run the following command to build the web app:

    npm run build

    This command will generate build output resources inside the dist directory. You can now deploy these resources as a regular static website to your hosting provider of choice.

    For information on launching the web app in developer mode, please refer to apps/web-app/README.md

  3. Configure the Menu Button

    • Open the Telegram app and search for "@BotFather".
    • Start a chat with @BotFather.
    • Use the /setmenubutton command to see your bot list and select the bot you want to configure the menu button.
    • Follow the prompts to set up the menu button with the URL obtained in the previous step.
    • After that, the menu button will be available to users when they interact with your bot.

Congrats! Web App is deployed and available to bot users.

Note

At this stage web app is fully functional, further steps are optional.

  1. Environment Variables Setup

    Once you have completed the web app build and deployment, navigate to the apps/bot directory:

    cd ../bot

    Create an environment variables file by copying the provided example file:

    cp .env.example .env

    Open the newly created .env file and set the BOT_TOKEN environment variable. This token should be obtained from @BotFather.

    Set the WEB_APP_URL environment variable with the URL obtained during the web app deployment (step 2).

  2. Launching the Bot

    You can run your bot in both development and production modes.

    Development Mode:

    Install the required dependencies:

    npm install

    Start the bot in watch mode (auto-reload when code changes):

    npm run dev

    Production Mode:

    Install only production dependencies (no development dependencies):

    npm install --only=prod

    Set the NODE_ENV environment variable to "production" in your .env file. Also, make sure to update BOT_WEBHOOK with the actual URL where your bot will receive updates.

    NODE_ENV=production
    BOT_WEBHOOK=<your_webhook_url>

    Start the bot in production mode:

    npm start
    # or
    npm run start:force # if you want to skip type checking

List of Available Commands

  • npm run lint — Lint source code.
  • npm run format — Format source code.
  • npm run typecheck — Run type checking.
  • npm run dev — Start the bot in development mode.
  • npm run start — Start the bot.
  • npm run start:force — Start the bot without type checking.

Environment Variables

Variable Type Description
NODE_ENV String Specifies the application environment. (development or production)
BOT_TOKEN String Telegram Bot API token obtained from @BotFather.
WEB_APP_URL String HTTPS link to Web App.
LOG_LEVEL String Optional. Specifies the application log level.
For example, use info for general logging. View the Pino documentation for more log level options.
Defaults to info.
BOT_MODE String Optional. Specifies method to receive incoming updates. (polling or webhook)
BOT_WEBHOOK String Optional in polling mode. Webhook endpoint URL, used to configure webhook in production environment.
BOT_SERVER_HOST String Optional. Specifies the server hostname.
Defaults to 0.0.0.0.
BOT_SERVER_PORT Number Optional. Specifies the server port.
Defaults to 80.
BOT_ALLOWED_UPDATES Array of String Optional. A JSON-serialized list of the update types you want your bot to receive. See Update for a complete list of available update types.
Defaults to an empty array (all update types except chat_member).
BOT_ADMINS Array of Number Optional. Administrator user IDs. Use this to specify user IDs that have special privileges, such as executing /setcommands.
Defaults to an empty array.

notepher-bot's People

Contributors

deptyped avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

notepher-bot's Issues

SyntaxError: Unexpected reserved word

Hello! I really love your app. I would like to add it to an existing Telegram chat to improve interactions between the members of a small team. So, I tried to follow your instructions, but I got a Syntax error while building the web app:

path/bla/bla/notepher-bot/web-app/node_modules/vite/bin/vite.js:7
await import('source-map-support').then((r) => r.default.install())
^^^^^

SyntaxError: Unexpected reserved word

Unfortunately, I do not have much skills with npm and java, I use python and would not be able to solve it. Can you please have a look? Thanks a lot!

Add automatic "pull" of notes

Hi, I really enjoy using your app but I find it annoying when I switch from one device to another that I always have to click the cloud icon to receive the edits I made on the other device.

Would it be possible to automatically refresh the notes every couple of seconds to avoid this issue?

Alert

Hi
Thank you for this program
I opened your web app in Telegram but it doesn't show anything
I noticed that the server you are using is blocked at least in our country, I don't know in other countries
Works well with vpn

Deploy to Netlify or similar alternative

Hi, I've been trying to deploy the bot and web app on netlify but I'm having a hard time making everything work.
Do you think that this can be done easily?

I think what is currently missing is a way to configure the variables in .env. I have no experience with netlify but it looks like it is possible to do something similar with a netlify.toml file. I used this guide as a reference. Could it just be just a matter of swapping the .env with netlify.toml?

The other thing I currently do not understand is wether I can host both the bot and the webapp at the same time.

I think it could be really useful to be able to easily deploy you app with such a service and I might be happy to take a look into it if it's not too difficult.

Is there any easier solution available or something else that I'm missing?

docker compose

Hi dev!
What about docker compose file? Is it possible to run your bot as container?

Added to group but I don't know how to start it.

I love this bot, but when I tried to use it in a group, I have added it but I don't know how to start, I tried with /start /new /list, list, new, add, start, I have tried adding @notepherbot to all of these commands, but no one worked. 😭

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.