Deployf.Botf
0.5.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Deployf.Botf --version 0.5.0
NuGet\Install-Package Deployf.Botf -Version 0.5.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="Deployf.Botf" Version="0.5.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Deployf.Botf --version 0.5.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Deployf.Botf, 0.5.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.
// Install Deployf.Botf as a Cake Addin #addin nuget:?package=Deployf.Botf&version=0.5.0 // Install Deployf.Botf as a Cake Tool #tool nuget:?package=Deployf.Botf&version=0.5.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
BotF
Make beautiful and clear telegram bots with the asp.net-like architecture!
BotF have next features:
- long pooling and webhook mode without any changes in the code
- very convinient way to work with commands and reply buttons
- integrated pagination with buttons
- authentication and role-based authorization
- statemachine for complicated dialogs with users
- asp.net-like approach to develop bots
- automatic creating of command menu
- integrated DateTime picker
- auto sending
- good performance
Documentaion
Visit to our wiki to read botf documentation
Install
dotnet add package Deployf.Botf
Example
Put next code into Program.cs
file
using Deployf.Botf;
class Program : BotfProgram
{
// It's boilerplate program entrypoint.
// We just simplified all usual code into static method StartBot.
// But in this case of starting of the bot, you should add a config section under "bot" key to appsettings.json
public static void Main(string[] args) => StartBot(args);
// Action attribute mean that you mark async method `Start`
// as handler for user's text in message which equal to '/start' string.
// You can name method as you want
// And also, second argument of Action's attribute is a description for telegram's menu for this action
[Action("/start", "start the bot")]
public void Start()
{
// Just sending a reply message to user. Very simple, isn't?
Push($"Send `{nameof(Hello)}` to me, please!");
}
[Action(nameof(Hello))]
public void Hello()
{
Push("Hey! Thank you! That's it.");
}
// Here we handle all unknown command or just text sent from user
[On(Handle.Unknown)]
public async Task Unknown()
{
// Here, we use the so-called "buffering of sending message"
// It means you dont need to construct all message in the string and send it once
// You can use Push to just add the text to result message, or PushL - the same but with new line after the string.
PushL("You know.. it's very hard to recognize your command!");
PushL("Please, write a correct text. Or use /start command");
// And finally, send buffered message
await Send();
}
}
And replace content of appsettings.json
with your bot username and token:
{
"bot": {
"Token": "123456778990:YourToken",
"Username": "username_bot",
"AutoSend": true
}
}
And that's it! Veeery easy, isn't?
Just run the program 😃
Other examples you can find in /Examples
folder.
Hosting
After you develop your bot, you can deploy it to our hosting: deploy-f.com
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- Telegram.Bot (>= 17.0.0)
- Telegram.Bot.Framework (>= 2.0.0-alpha5)
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 |
---|---|---|
0.17.3 | 696 | 9/23/2023 |
0.17.2 | 130 | 9/23/2023 |
0.17.1 | 11,644 | 5/9/2023 |
0.17.0 | 172 | 5/8/2023 |
0.16.0 | 606 | 11/26/2022 |
0.15.2 | 16,815 | 11/24/2022 |
0.15.1 | 368 | 11/14/2022 |
0.15.0 | 379 | 11/10/2022 |
0.14.3 | 358 | 11/9/2022 |
0.14.2 | 471 | 10/14/2022 |
0.14.1 | 424 | 10/14/2022 |
0.14.0 | 600 | 8/6/2022 |
0.13.1 | 463 | 7/28/2022 |
0.13.0 | 469 | 7/27/2022 |
0.12.0 | 700 | 4/9/2022 |
0.11.0 | 479 | 4/4/2022 |
0.10.0 | 500 | 3/29/2022 |
0.9.0 | 474 | 3/26/2022 |
0.8.2 | 539 | 2/6/2022 |
0.8.1 | 518 | 1/30/2022 |
0.8.0 | 508 | 1/26/2022 |
0.7.2 | 501 | 1/22/2022 |
0.7.1 | 495 | 1/15/2022 |
0.7.0 | 337 | 1/3/2022 |
0.6.0 | 353 | 12/22/2021 |
0.5.1 | 379 | 12/13/2021 |
0.5.0 | 365 | 12/12/2021 |
0.4.0 | 349 | 12/2/2021 |
0.3.0 | 376 | 11/8/2021 |
0.1.1 | 385 | 11/2/2021 |
0.1.0.1 | 415 | 11/2/2021 |