Closed xSTMx closed 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?
@morph1 read https://github.com/TelegramBots/telegram.bot/blob/develop/ISSUE_TEMPLATE.md
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?