-
Notifications
You must be signed in to change notification settings - Fork 13
Sending Photos
Alex edited this page Jun 25, 2017
·
3 revisions
If you want to upload a new photo and it does not exist on Telegram servers, you can use the NewFile class. Don't forget to set FileName property. If you don't, the photo will not be sent.
var client = new TelegramBotClient()
{
Token = "",
};
var photo = new NewFile()
{
FileContent = System.IO.File.ReadAllBytes("PATH TO YOUR PHOTO"),
FileName = "FILENAME.EXT"
};
client.SendPhoto(chatId, photo);
Each file on Telegram servers has an identity string (named: file_id). You can use the ExistingFile class to send photos already on Telegram servers.
var client = new TelegramBotClient()
{
Token = "",
};
var photo = new ExistingFile()
{
FileId = "YOUR FILE ID"
};
client.SendPhoto(chatId, photo);
- How to use
-
Installation
Basics
Receiving messages
Sending messages
Sending photos
Custom keyboards
How use proxy - About development