
Library shell TgNet for easy creation of group chat bots Telegram
using Telegram.Bot;using Telegram.Bot;
void Main()
{
TgBot = new TelegramBot();
TgBot.Authorization("YOUR_TG_GROUP_API_TOKEN");
TgBot.Start(Handle);
}
void Handle(long id, string text)
{
TgBot.Send(id, "Hello World");
}using Telegram.Bot;
namespace Example
{
internal class Simple
{
static TelegramBot TgBot;
static void Main(string[] args)
{
TgBot = new TelegramBot();
TgBot.Authorization("YOUR_TG_GROUP_API_TOKEN");
TgBot.Start(Handle);
Console.Read();
}
static void Handle(long id,string text)
{
TgBot.Send(id, $"Hello Id: {id}\nYou Say: {text}");
TgBot.Send(id, "Test Inline Keyboard", "Button11;Button21,Button22;Button31,Button32,Button33", true);
TgBot.Send(id, "Test Outline Keyboard", "Contact|CONTACT;Location|LOCATION;Poll|POLL");
}
}
}Symbol [ ; ] separates the vertical lines of the buttons
Symbol [ , ] separates buttons on a line
Symbol [ | ] separates the text of the button and its options
TgBot.Send(id, "Example Test", "Button1Line1;Button1Line2,Button2Line2;Button1Line3,Button2Line3,Button3Line3");| Expression | Button |
|---|---|
| CONTACT | Share Contact |
| LOCATION | Share Location |
| POLL | Create Poll |
| URL | Create Url |
TgBot.Send(id, "Test", "Share Contact|CONTACT;Share Location|LOCATION;Create Poll|POLL");Inline - keyboard embedded in message
OneTime - keyboard hides on next message
Large - big keyboard buttons
TgBot.Send(id, "Example Test", "Button1Line1;Button1Line2,Button2Line2;Button1Line3,Button2Line3,Button3Line3",true);TgBot.SetKeyboardSplitters(':', '.', '|');
TgBot.Send(id, "Test keyboard", "Button1|CONTACT.Button2|LOCATION:Button3|POLL");


