Telesharp is library, which can help you to create bots for Telegram with C#.
Use the token sent by @BotFather
You can create bot, who doing nothing:
var Bot = new Bot(INSERT_YOUR_TOKEN_HERE);
Bot.Run();
Bot.WaitToDie();
You can create bot, who send random zombie sounds:
var zombieSounds = new []{"aggrh", "zzz", "grrrr", "arrr", "ogrrrh"};
var Bot = new Bot(INSERT_YOUR_TOKEN_HERE);
Bot.OnParseMessage += (o,e) =>
{
Bot.Methods.SendMessage(e.Message.Chat,
zombieSounds[(new Random(DateTime.Now.Millisecond))
.Next(0, zombieSounds.Length)]);
};
Bot.Run();
Bot.WaitToDie();
Not all methods included in this API.
Excluded:
• setWebhook([Optional] String url, [Optional] InputFile certificate)
It is needed? Vote here
Temporarily not included:
- sendCustomRequest(String uri, Dictionary<String, Object> parametrs)
- sendVoice(Integer chat_id, InputFile voice, [Optional] duration, [Optional] reply_to_message_id, [Optional] reply_markup)
You can get help on using the API bots here