Book
  • Introduction
  • Installation
  • Getting Updates
    • Polling
    • Webhook
  • Requests
    • Get Me
    • Send Text
  • Extras
    • Logo
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. Requests

Send Text

PreviousGet MeNextLogo

Last updated 4 years ago

Was this helpful?

Send a simple text using chat id

SendText request = new SendText(123456789, "Hello, World!");

Response<TextMessage> response = await bot.HandleAsync(request);

Send a simple text using chat username

using Telegram.Bots.Requests.Usernames;

SendText request = new SendText("@yourgroup", "Hello, World!");

Response<TextMessage> response = await bot.HandleAsync(request);

Send a website URL with its preview disabled

SendText request = new SendText(123456789, "https://www.example.com")
{
  DisableWebPagePreview = true
};

Response<TextMessage> response = await bot.HandleAsync(request);

https://core.telegram.org/bots/api#sendMessage