1
0
mirror of synced 2024-11-21 20:46:05 +03:00

add README.md to the examples directory

This commit is contained in:
Pavel 2023-12-29 11:58:47 +03:00 committed by GitHub
commit df74983564
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

18
examples/README.md Normal file
View File

@ -0,0 +1,18 @@
# Usage examples
This directory contains examples on how to use the library properly. Currently two examples are available:
- [Simple Telegram transport (only text messages are supported)](telegram)
- [MG Webhook processing example](webhooks)
## `telegram`
How to run the example:
1. Copy `config.json.dist` to `config.json`.
2. Replace placeholder values in the `config.json` with your data. You'll need a service like ngrok.io for that.
3. Navigate to `telegram` directory via terminal and run `go run ./...`
The sample will automatically register itself in the target system and will begin transferring the messages between Telegram and MessageGateway.
## `webhook`
You can run this example by executing `go run /...`. Transport API webhooks from MessageGateway should be sent to the `/api/v1/webhook` route.