A simple template for creating a telegram bot via Сommand pattern.
Repository uses Telegram.Bot and Newtonsoft.Json libraries
-
Fill Settings section in appsettings.json:
- Enter telegram bot token:
"Token": "put_token_here"
- Enter application url:
"ApplicationUrl": "https://example.com/{0}"
. Don't forget "\{0}
" at the end to define the path to the controller
- Enter telegram bot token:
-
Add more UpdateTypes and Commands to
Bot.cs
to expand functionality. -
Program for opening external access to the port to test this template - Ngrok
- Open tunel with
ngrok http 80
or another port defined inlaunchSettings.json
- Set
ApplicationUrl
inappsettings.json
- Run program
- Open tunel with