Skip to content

Search for telegram api errors and get information about them without leaving telegram

License

Notifications You must be signed in to change notification settings

Itz-fork/WhatErrorBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What Error Bot

Simple telegram bot that can help you to search for telegram api errors and get information about them without leaving telegram

Config

config file can be found at: config.ts

  • bot_token - Your telegram bot token
  • mongodb_url - Your mongodb url (srv)
    • Export srv url for Node.js. It'll be something like this mongodb+srv://<your_username>:<your_password_here>@<cluster_url>/?retryWrites=true&w=majority
    • Replace ?retryWrites=true&w=majority with ?authMechanism=SCRAM-SHA-1. Now it'll be something like this mongodb+srv://<your_username>:<your_password_here>@<cluster_url>/?authMechanism=SCRAM-SHA-1

Deploy

Deploying is easy af!

Heroku

deploy to heroku

Self-hosting

To run this bot, you need to install deno runtime in your system.

git clone https://github.com/Itz-fork/WhatErrorBot.git
cd WhatErrorBot
deno run --allow-net --allow-env What/bot.ts

ToDo after deploy

After deploying the app, wait for it to run for the first time. In the first run it'll add all errors to the WhatErrorBot_DB database collection. After that you can create a search index for WhatsErrorBot.WhatErrorBot_DB

Create a search index

The search feature of this bot is depends entirely on the Mongodb atlas1 full text search feature (Based on apache lucene)

  • Click on "Browse Collections"
    • browse collections
  • Navigate to search tab of the mongodb cluster
    • search tab
  • Click on "CREATE INDEX" button
    • create index button
  • Select "JSON Editor" and click on "Next" button
    • select json editor
  • Copy and paste the following index definition to the json editor
    {
        "mappings": {
        "dynamic": false,
        "fields": {
        "description": {
            "type": "string"
                },
        "error": {
            "type": "string"
                }
            }
        }
    }
    
    • add index definition
  • Save and wait for the "Status" to change into "Active" state
    • created search index

Done!

License

Licensed under MIT

Footnotes

  1. This bot doesn't support on-premises text search.

About

Search for telegram api errors and get information about them without leaving telegram

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published