Created
November 9, 2019 16:47
-
-
Save davidcon/5b4f0b3f927185332d86403ccce7e7d0 to your computer and use it in GitHub Desktop.
Send a Local File
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using (FileStream fs = System.IO.File.OpenRead("c:\test.txt")) | |
{ | |
Telegram.Bot.Types.InputFiles.InputOnlineFile inputOnlineFile = new Telegram.Bot | |
.Types.InputFiles.InputOnlineFile(fs, "FileName.txt"); | |
await Bot.SendDocumentAsync( | |
chatId: new Telegram.Bot.Types.ChatId(1234), | |
document: inputOnlineFile, | |
caption: "User Manual", | |
parseMode: ParseMode.Markdown); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment