TGSimpleLib 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package TGSimpleLib --version 1.0.0
                    
NuGet\Install-Package TGSimpleLib -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TGSimpleLib" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TGSimpleLib" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="TGSimpleLib" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TGSimpleLib --version 1.0.0
                    
#r "nuget: TGSimpleLib, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package TGSimpleLib@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=TGSimpleLib&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=TGSimpleLib&version=1.0.0
                    
Install as a Cake Tool

TGSimpleLib 🤖

English | Русский


English

TGSimpleLib is the easiest way to add Telegram interactivity to your C# application with just one line of code.

Features:

  • Fast Integration: No need to build complex bot architectures.
  • Multi-Admin Support: Send questions to multiple admins at once. The first one to answer wins!
  • Clean UX: Buttons are automatically removed after the first response or timeout.
  • Linear Code: Use await to get a user's response directly in your logic.

Usage:

var bot = new SimpleTG("TOKEN", 30, 12345678, 98765432);

// Simple notification
await bot.NotifyAsync("🚀 Server started!");

// Yes/No question
bool confirm = await bot.AskBoolAsync("Shutdown system?");

// Multiple choice
string choice = await bot.AskChoiceAsync("What to update?", new[] { "Database", "Code", "Assets" });

// Text input
string reason = await bot.AskStringAsync("Provide a reason:");



## Русский

**TGSimpleLib** — это максимально простая библиотека-обертка для Telegram ботов на C#. Она создана для тех, кому нужно быстро добавить систему уведомлений и простых опросов в свои приложения (скрипты, серверы, службы мониторинга) без написания сложной архитектуры обработки обновлений.

### Основные возможности:
- **Мгновенный старт**: Настройка бота занимает одну строку кода.
- **Поддержка нескольких администраторов**: Отправляйте вопросы сразу группе админов. Библиотека примет ответ от того, кто нажал на кнопку первым.
- **Чистый интерфейс (UX)**: Как только получен первый ответ (или вышло время ожидания), библиотека автоматически удаляет кнопки у всех остальных админов, чтобы не вводить их в заблуждение.
- **Линейная логика**: Вы просто пишете `await` и получаете ответ пользователя прямо в переменную.

### Примеры использования:

```csharp
// Инициализация: Токен, Таймаут (сек), и ID админов через запятую
var bot = new SimpleTG("ВАШ_ТОКЕН", 30, 12345678, 87654321);

// 1. Отправка простого уведомления
await bot.NotifyAsync("🤖 Система запущена и готова к работе.");

// 2. Вопрос Да/Нет (возвращает bool)
bool deleteLog = await bot.AskBoolAsync("Лог переполнен. Очистить?");
if (deleteLog) {
    // Ваша логика по очистке
}

// 3. Выбор из ваших вариантов (возвращает строку или null)
string selection = await bot.AskChoiceAsync("Выберите режим:", new[] { "Тихий", "Обычный", "Дебаг" });

// 4. Ожидание текстового ввода (возвращает string или null)
string comment = await bot.AskStringAsync("Введите комментарий к отчету:");
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.0 123 3/6/2026
1.1.0 105 3/5/2026
1.0.0 112 3/3/2026