Skip to content

modaresimr/TeleBot.NET

Repository files navigation

Telesharp Build Status Build status

Telesharp is library, which can help you to create bots for Telegram with C#.

Creating bots

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();

Also you can view examples:

  1. Message listener
  2. Sticker-Sender bot
  3. LIKE5 wallpapers bot

API

Not all methods included in this API.

Excluded:

setWebhook([Optional] String url, [Optional] InputFile certificate)

It is needed? Vote here

Temporarily not included:

You can get help on using the API bots here

Bots FAQ

About

Telesharp -- library, which can help you to create Telegram Bots with C#.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages