Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dcdunkan/show-json-bot
A simple bot to show JSON data of Telegram messages.
https://github.com/dcdunkan/show-json-bot
grammyjs show-json telegram-bot tg-devtools
Last synced: 15 days ago
JSON representation
A simple bot to show JSON data of Telegram messages.
- Host: GitHub
- URL: https://github.com/dcdunkan/show-json-bot
- Owner: dcdunkan
- License: mit
- Created: 2021-10-02T18:14:48.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-05-09T18:38:19.000Z (over 2 years ago)
- Last Synced: 2024-02-15T07:34:17.253Z (9 months ago)
- Topics: grammyjs, show-json, telegram-bot, tg-devtools
- Language: TypeScript
- Homepage: https://telegram.me/jsoonbot
- Size: 96.7 KB
- Stars: 20
- Watchers: 1
- Forks: 11
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-grammY - dcdunkan/show-json-bot - See the JSON data behind Telegram messages. [ᴜsᴇ](https://t.me/jsoonbot) (Bots)
README
Show JSON Bot
### Try the running bot here: [Show JSON Bot](https://telegram.me/jsoonbot)
A simple Telegram Bot to show JSON data of Telegram messages. The JSON data is
the updates that Telegram sent to the bot. The bot also provides an UI to
navigate through the JSON object. The workflow is highly inspired by
[JSONShowBot](https://telegram.me/JSONShowBot) which is **NOT** working as of
May 2, 2022.Re-written in [TypeScript](https://typescriptlang.org/) and now it runs on
[Deno](https://deno.land/).- [Built Using](#built-using)
- [Setup](#setup) › [Running Locally](#running-locally)
- [Setup](#setup) › [Deno Deploy](#deno-deploy)
- [Setup](#setup) › [Environment Variables](#environment-variables)
It's a re-write! See the old version: node/
https://github.com/dcdunkan/show-json-bot/tree/node
## Built Using
Thanks to these tools and libraries.
1. _[grammY](https://grammy.dev)_ - The Telegram Bot Framework.
2. _[Deta.sh Base](https://deta.sh)_ - Free and unlimited Cloud Database
service.## Setup
### Running Locally
Make sure you have installed [Deno CLI](https://deno.land/).
- Clone the repository.
```bash
git clone https://github.com/dcdunkan/show-json-bot.git
```
- Change directory (`cd`) to the cloned repository.
- Create a `.env` file and set [environment variables](#environment-variables)
like in [`.env.example`](.env.example).
- Run the bot using the command below.
```bash
deno run --allow-net --allow-env --allow-read mod.ts
```**Required permissions**
- `--allow-net` - To communicate with Telegram servers and receive updates.
- `--allow-env` - To access environment variables.
- `--allow-read` - To read .env file.If everything is done correct, you should see "(Username) started" in your
console.### Deno Deploy
The working bot, [@jsoonbot](https://telegram.me/jsoonbot) is currently deployed
on **[Deno Deploy](https://deno.com/deploy) (Beta)**.Click the button to deploy to [Deno Deploy](https://deno.com/deploy).
After deploying you will get a link to your application, in the format
https://\.deno.dev/.Open a browser and go to the link down below.
- Replace the `` with your `BOT_TOKEN`.
- Replace `` with the link to your application.`https://api.telegram.org/bot/setWebhook?url=`
This will set the bot's webhook to the deployed application, so that Telegram
will sent further updates to there.### Environment Variables
| Variable | Required? | Description |
| ----------- | --------- | -------------------------------------------------------------------------------- |
| `BOT_TOKEN` | **Yes.** | The API token of the Bot. Chat with https://t.me/BotFather to get one. |
| `DETA_KEY` | **Yes.** | Project Key of Deta.sh Project. Sign up and create a project at https://deta.sh. |## License
[MIT License](LICENSE). Copyright (c) 2022 dcdunkan (Dunkan)
## Contributing
Feel free to contribute! And if you are having issues or if you want suggest
something, please open an issue here:
[dcdunkan/show-json-bot/issues](https://github.com/dcdunkan/show-json-bot/issues).
Or, open a [PQ](https://telegram.me/grammyjs/34358)!---