Telegram.BotBuilder.CalendarPicker
1.0.0
dotnet add package Telegram.BotBuilder.CalendarPicker --version 1.0.0
NuGet\Install-Package Telegram.BotBuilder.CalendarPicker -Version 1.0.0
<PackageReference Include="Telegram.BotBuilder.CalendarPicker" Version="1.0.0" />
paket add Telegram.BotBuilder.CalendarPicker --version 1.0.0
#r "nuget: Telegram.BotBuilder.CalendarPicker, 1.0.0"
// Install Telegram.BotBuilder.CalendarPicker as a Cake Addin #addin nuget:?package=Telegram.BotBuilder.CalendarPicker&version=1.0.0 // Install Telegram.BotBuilder.CalendarPicker as a Cake Tool #tool nuget:?package=Telegram.BotBuilder.CalendarPicker&version=1.0.0
Telegram.BotBuilder.CalendarPicker
Telegram.BotBuilder.CalendarPicker is a library that allows you to pick a date from your telegram bot.
Based on
CalendarPicker
but modified forTelegram.BotBuilder
and fixed some bugs and errors.Works with new version of TelegramAPI
Telegram.Bot
18.0.0-alpha.3
Based on dotnet standard 2.1
And of course, I made this library for my own use, I believe that it can be useful when you are going to develop complex Telegram bots. I am always open to your changes, commits and wishes 😃
How do I get started?
Add Telegram.BotBuilder.CalendarPicker to your project:
Package Manager
PM> Install-Package Telegram.BotBuilder.CalendarPicker
.NET CLI
>dotnet add package Telegram.BotBuilder.CalendarPicker
or something else
Next you should create your handler inherited from ICalendarHandler to handle picked date form telegram bot. For example:
public class CalendarTestHandler : ICalendarHandler
{
public async Task HandlePickedDateAsync(
ITelegramBotClient context,
Message message,
DateTime pickedDate,
CancellationToken cancellationToken
)
{
await context.SendTextMessageAsync(
message.Chat,
$"PickedDate: {pickedDate:d}",
cancellationToken: cancellationToken
);
}
}
After that you can add a calendar picker with a handler
// add calendar with handler
builder.Services.AddCalendarPicker<CalendarTestHandler>("nameOfYourBot", "tokenOfBot");
AddCalendarPicker<> supports various features, including:
- locale, if you need a locale;
- datePickerTitle, for a title of datepicker message;
- initialDate, to select a specific start date;
Next you can bind using LongPolling with adding command string:
// bind calendar as LongPolling
await app.UseCalendarPickerLongPolling("calendar");
Or as Webhook with adding command string and uri of your webhook:
// or as Webhook
await app.UseCalendarPickerWebhook("calendar", new Uri("https://example.com/calendarbot/webhook"));
Product | Versions 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. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 is compatible. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETCoreApp 3.1
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0.0)
- Telegram.BotBuilder (>= 1.0.1)
-
.NETStandard 2.1
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0.0)
- Telegram.BotBuilder (>= 1.0.1)
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.0.0 | 928 | 6/13/2022 |