How to use Telegram API in C# to send a message -
i want use telegram api in c# send simple message number. found lib's on github not able use them.
can give simple code ? can make http calls ?
- install-package telegram.bot
- create bot using botfather
- get api key using /token command (still in botfather)
- use code:
var bot = new api("your api key here"); var t = await bot.sendtextmessage("@channelname or chat_id", "text message");
you can pass channel username (in format @channelusername) in place of chat_id in methods (and instead of from_chat_id in forwardmessage). work, bot must administrator in channel.
Comments
Post a Comment