Hello Friends
The first thing you need to know about telegram bot and C# in this blog, that receives and sends data between the two, is Json. The first step is to create bot in Telgram. So in Telegram Address Bar type @FatherBot,
And Create your Bot
Now, Open Visual Studio=>Create c# Project
And Install Telegram.Bot API Class Library From Nuget.Org
Use This Method
- public async void MyRobat()
- {
- TelegramBotClient bot = new TelegramBotClient("Your Bot Token");
- var rkm = new ReplyKeyboardMarkup();
- rkm.Keyboard =
- new KeyboardButton[][]
- {
- new KeyboardButton[]
- {
- new KeyboardButton("item"),
- new KeyboardButton("item")
- },
- new KeyboardButton[]
- {
- new KeyboardButton("item")
- }
- };
- await bot.SendTextMessageAsync(lastIp.Message.Chat.Id, "Text", false, false, 0, rkm);
-
- }