Simple telegram bot that can help you to search for telegram api errors and get information about them without leaving telegram
config file can be found at: config.ts
bot_token
- Your telegram bot tokenmongodb_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 thismongodb+srv://<your_username>:<your_password_here>@<cluster_url>/?authMechanism=SCRAM-SHA-1
- Export srv url for Node.js. It'll be something like this
Deploying is easy af!
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
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
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"
- Navigate to search tab of the mongodb cluster
- Click on "CREATE INDEX" button
- Select "JSON Editor" and click on "Next" button
- Copy and paste the following index definition to the json editor
{ "mappings": { "dynamic": false, "fields": { "description": { "type": "string" }, "error": { "type": "string" } } } }
- Save and wait for the "Status" to change into "Active" state
Done!
Licensed under MIT
Footnotes
-
This bot doesn't support on-premises text search. ↩