Giter Club home page Giter Club logo

projecttelegramwebhook's Introduction

What is this project

It is a small / simple project that shows how to use telegram bot api, the example was used as the basis https://github.com/TelegramBots/Telegram.Bot.Examples

Project Type WebAPI

.NET 5.0

Telegram.Bot 15.7.1

Utils

ngrok

How to run this project

  1. Change the appsettings files, the BotToken attribute, by the token generated by the telegram <MY_TOKEN_HERE>
  2. Execute dotnet run to run this project
  3. Download and execute this command ngrok.exe http -host-header=localhost 5000
  4. Get the https url, generated by ngrok and test if webhook work
  5. Contract telegram with webhook using the first command below

Some useful commands

Contract webhook with telegram

https://api.telegram.org/bot<MY_TOKEN_HERE>/setWebhook?url=MY_LINK/Api/Update

Return some information about the bot

https://api.telegram.org/bot<MY_TOKEN_HERE>/getMe

Get all informations about contract with webhook

https://api.telegram.org/bot<MY_TOKEN_HERE>/getWebhookInfo

Delete contract between webhook and telegram

https://api.telegram.org/bot<MY_TOKEN_HERE>/deleteWebhook

Retrieves all messages in the telegram pool

https://api.telegram.org/bot<MY_TOKEN_HERE>/getUpdates

Remove chat message of TELEGRAM, but dont clear pool messages

https://api.telegram.org/bot<MY_TOKEN_HERE>/deleteMessage?chat_id=697809357&message_id=63

Retrieves all messages in the telegram pool, if the offser parameter is informed, with the message_id of the pool, it excludes the previous one

https://api.telegram.org/bot<MY_TOKEN_HERE>/getUpdates?offset=697809357

projecttelegramwebhook's People

Contributors

jeftegoes avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.