TelegramBots / Telegram.Bot

.NET Client for Telegram Bot API
https://telegrambots.github.io/book
MIT License
3.17k stars 686 forks source link

SendPhotoAsync #508

Closed xSTMx closed 6 years ago

xSTMx commented 6 years ago

private bool pictureSend(string messagetosend) { bool success = true; string Token = Convert.ToString(txtToken.Text); string ChatIDChannel = Convert.ToString(txtChatID.Text); string phototosend = "C.\image.jpg"; var Bot = new Telegram.Bot.TelegramBotClient(Token); using (var stream = System.IO.File.Open(phototosend, FileMode.Open)) { FileToSend fts = new FileToSend(); fts.Content = stream; fts.Filename = phototosend.Split('\').Last(); Bot.SendTextMessageAsync(ChatIDChannel, messagetosend); //Bot.SendPhotoAsync(ChatIDChannel, fts, messagetosend); } }

SendTextMessageAsync works but SendPhotoAsync don't work. Is something in my Code wrong or should it work like that?

poulad commented 6 years ago

@morph1 read https://github.com/TelegramBots/telegram.bot/blob/develop/ISSUE_TEMPLATE.md