Giter Club home page Giter Club logo

aiogramdetabot's Introduction

Telegram Bot template with aiogram for deployment on Deta Space.

The bot has several useful features, including logging of errors and events to Deta Base, preset CallbackAnswer middleware and automatic webhook setup.

Getting Started

Prerequisites

Installation

  1. Clone the repository: git clone https://github.com/mamsdeveloper/AiogramDetaBot.git
  2. Go to cloned repo's folder
  3. Run space new to create a new Space project
  4. Run space push to deploy the code to Deta Space
  5. Go to Builder and open builder instance of your project
  6. Set up your Telegram Bot token in Develop - Configuration tab
  7. Return to Develop - Overview tab and click on Open Builder Instance button. There will be information about your bot's webhook, if it is set up correctly.
  8. Send /start to your bot and check that it responds

Features

Logging of errors and events to Deta Base

To enable logging of errors and events, set ENABLE_ERRORS_LOGS and ENABLE_EVENTS_LOGS environment variables to True in Develop - Configuration tab. Logs will be stored in logs tables. Additionally, you can set ERROR_LOGS_EXPIRE_AFTER and EVENTS_LOGS_EXPIRE_AFTER environment variables to set expiration time for logs in seconds. By default, logs will be stored forever.

Preset CallbackAnswer middleware

CallbackAnswer middleware is used to automatically answer on all callback queries, so you don't need to do it manually.

Automatic webhook setup

The bot automatically sets webhook on startup.

Page with webhook info

You can find webhook info on /info page. Root page redirects to /info page.

Notes

You can find version tuned for my personal purposes in personal-tuned branch. I may have some additional features

aiogramdetabot's People

Contributors

butvinm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

thewoood

aiogramdetabot's Issues

Disable auto Telegram webhook set up

Why?

  1. It is unstable, FastAPI lifecycle does not work on Deta
  2. It is insecure: mechanism of webhook secrete is public
  3. It is inconvenient for testing

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.