Show JSON Bot
A Telegram Bot for printing out the JSON data of a message sent or forwarded with support of navigating through the data.
Telegram bot that can show the JSON raw data of a sent message, appended with functioning buttons to navigate through the JSON object. This bot's working flow is inspired by JSONShowBot which is not working as of September 2021.
The code is not perfect. I ain't no pro. A noob trying to make somthing better :) Because I have made a lot of mistakes. And maybe I will fix them later.
Trust me, you don't have to deploy this bot, there is already a working example over here - @jsoonbot. However, incase you really really want to (for some reason):
- Deploy to Heroku:
- Deploy to Railway:
Let me tell you one thing: I made this bot, I made the deployment 100% complicated. But now, I have removed the complication as I can. You only have to configure 4 ENV vars. 2 of them, have default values too.
Required ENV vars
This is all you need to setup this bot basically. Don't care about
CHANNEL_LOG if you only want basic (main focus of this bot) things to work.
BOT_TOKEN: The core thing to make this bot work. You can get Telegram Bot token by chatting with Botfather here: BotFather
DOMAIN: This bot uses Webhooks to recieve updates from Telegram. And this value is set to your app's domain name (if heroku)
DB_ENABLE: This bot has a firebase database integration to make it more complicated xD. No, it stores IDs of the users for later uses - like, broadcasting updates, and to count users. Also it stores the number of JSONs printed for users and total. So, if you don't want it just leave it to the default value
false. Or set true, and see the database vars below at the Optional env vars
CHANNEL_LOG: Set this to
trueif you want to log start, error messages or also update number of users and printed JSONs inside your Telegram channel. If you don't want to please leave it to the default:
false. If you are setting it to
true, see optional env vars for this to work.
Optional ENV vars
Some required ENV vars for optional features like database and channel logging to work.
So, you need database and you set
DB_ENABLE to true. If so, you have to set all four of the ENV vars given below.
You can get these values by going to Firebase Console -> Create a Project -> Project Settings -> Service Accounts ->
And you can choose "Generate new Private Key" and download that JSON file. Open it, get these values:
client_email. Now assign it to the respective vars. Now go to Sidebar and choose: Realtime Database -> Create a database -> Copy it's URL and assign it to
So, you need channel logging and I believe you set
CHANNEL_LOG to true. If so, you have to set
CHANNEL_ID to a valid Telegram Channel ID. You can get the channel ID by forwarding the message to our the demo bot :) or to a ForwardInfoBot like this one(Not mine). Also, you have to set
requiredfor this feature.
USERS_MSG_ID: You have to setup database to make this work (See above). Set this to a valid id of an existing message in your channel (Don't delete it
😐), Only required if you want to update number of users inside your Telegram Channel.
SHOWED_JSON_MSG_ID: You have to setup database to make this work (See above). Just like
USERS_MSG_ID, Set this to a valid id of an existing message in your channel (Don't delete it
😐), and Only required if you want to update number of users inside your Telegram Channel.
And if you liked this repo or this bot, please consider giving it a