Posts

Showing posts with the label .NET CORE

[Quick guide] How to create a C# Telegram bot

Image
Quick guide to setup a .NET Telegram Bot and deploy it as a Windows Service Create the bot definition (Telegram) On Telegram, search and use the “ botFather” bot (looks like the image below). Once you found the bot, type the ‘/newbot’ command and follow the instructions: You have to store: the TOKEN to access the API your bot’s name and user’s name Once your bot is created, you can customize it by different ways (type ‘ /start ’ to get the full list of available operations): General bot communication workflow After creating your bot, you have to understand the very general main communication workflow for a Telegram bot: Design a new bot (.NET example) .NET project using Telegram.BotApi package We will design a Telegram BOT in .NET. Fot this, we will use the Telegram.BotApi nuget package. First create a new .NET 8 Project (latest .NET version). ADD tht Telegram.BotApi package (one of the most complete package at this time): https://www.nuget.org/packages/Telegram.B