Deployf.Botf
0.17.3
dotnet add package Deployf.Botf --version 0.17.3
NuGet\Install-Package Deployf.Botf -Version 0.17.3
<PackageReference Include="Deployf.Botf" Version="0.17.3" />
<PackageVersion Include="Deployf.Botf" Version="0.17.3" />
<PackageReference Include="Deployf.Botf" />
paket add Deployf.Botf --version 0.17.3
#r "nuget: Deployf.Botf, 0.17.3"
#:package Deployf.Botf@0.17.3
#addin nuget:?package=Deployf.Botf&version=0.17.3
#tool nuget:?package=Deployf.Botf&version=0.17.3
BotF
Make beautiful and clear telegram bots with the asp.net-like architecture!
BotF has 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
π² webapp native support
π€ good performance
Documentaion
π Documentation is under developement. We will push it here in the readme file soon. Feel free to ask us your questions in community chat in telegram
βΆοΈ There is a good video on youtube https://www.youtube.com/watch?v=hieLnm9wO6s
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:
{
"botf": "123456778990:YourToken"
}
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. 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. |
-
net6.0
- Telegram.Bot (>= 18.0.0)
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 | 1,980 | 9/23/2023 |
| 0.17.2 | 227 | 9/23/2023 |
| 0.17.1 | 33,328 | 5/9/2023 |
| 0.17.0 | 320 | 5/8/2023 |
| 0.16.0 | 783 | 11/26/2022 |
| 0.15.2 | 38,572 | 11/24/2022 |
| 0.15.1 | 512 | 11/14/2022 |
| 0.15.0 | 534 | 11/10/2022 |
| 0.14.3 | 500 | 11/9/2022 |
| 0.14.2 | 627 | 10/14/2022 |
| 0.14.1 | 565 | 10/14/2022 |
| 0.14.0 | 755 | 8/6/2022 |
| 0.13.1 | 644 | 7/28/2022 |
| 0.13.0 | 636 | 7/27/2022 |
| 0.12.0 | 869 | 4/9/2022 |
| 0.11.0 | 648 | 4/4/2022 |
| 0.10.0 | 671 | 3/29/2022 |
| 0.9.0 | 637 | 3/26/2022 |
| 0.8.2 | 719 | 2/6/2022 |