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 ?

  1. install-package telegram.bot
  2. create bot using botfather
  3. get api key using /token command (still in botfather)
  4. 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.

https://core.telegram.org/bots/api


Comments

Popular posts from this blog

How to provide Authorization & Authentication using Asp.net, C#? -

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

How to use Authorization & Authentication in Asp.net, C#? -