Skip to content

Eptagone/ShopBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ShopBot

This is a Telegram bot imitation of @ShopBot made with NET 8.

This bot can do everything @ShopBot does, or well... almost everything. You won't be able to see the difference. If you're interested in how the Payment API works in Bots, this project can help you.

How to Run: Long Polling

You just need to specify your bot token and your payment provider token in the ShopBotNET.AppService project.

The provider token allows your bot to use the payment API. If you don't already have it, you can get one for testing by creating an account on stripe and enabling TEST mode. Then go to BotFather and get your token.

Your secrets.json or appsettings.json should look like the following code:

{
"ShopBot": {
    "BotToken": "123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11",
    "ProviderToken": "123456789:TEST:XXXXXXXXXXXXXXXXX"
  }
}

You can also use enviroment variables instead:

Env Description
ShopBot__BotToken Your bot token provided by @BotFather.
ShopBot__ProviderToken Your provider token.

Finally, run ShopBotNET.AppService and see the magic.

How to Run: Webhook

If you want to run this bot using a webhook, you must add two additional settings: the application url and a secret token in the ShopBotNET.Webhook project. Optionally, you can specify the certificate path to use with your webhook.

Your secrets.json or appsettings.json should look like the following code:

{
  "ShopBot": {
    "WebhookUrl": "https://www.example.com",
    "BotToken": "123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11",
    "SecretToken": "SUPERSECRETTOKEN",
    "ProviderToken": "123456789:TEST:XXXXXXXXXXXXXXXXX"
  }
}

You can also use enviroment variables instead:

Env Description
ShopBot__WebhookUrl Your webhook url. Ex: https://example.com
ShopBot__SecretToken Your webhook secret token. It must be specified by yourself.
ShopBot__BotToken Your bot token provided by @BotFather.
ShopBot__ProviderToken Your provider token.

Finally, run ShopBotNET.Webhook and see the magic.