BaleSharp 2.1.0
See the version list below for details.
dotnet add package BaleSharp --version 2.1.0
NuGet\Install-Package BaleSharp -Version 2.1.0
<PackageReference Include="BaleSharp" Version="2.1.0" />
<PackageVersion Include="BaleSharp" Version="2.1.0" />
<PackageReference Include="BaleSharp" />
paket add BaleSharp --version 2.1.0
#r "nuget: BaleSharp, 2.1.0"
#addin nuget:?package=BaleSharp&version=2.1.0
#tool nuget:?package=BaleSharp&version=2.1.0
baleSharp
baleSharp is a powerful and easy-to-use C# library to create bots for Bale Messenger. Designed for developers aiming to build efficient, scalable, and maintainable bots with minimal effort.
Features
- Intuitive API tailored for Bale Messenger bot development
- Support for message handling, event listening, and reply management
- Fully asynchronous operations for high performance
- Easy integration with existing C# projects
- Flexible and extensible architecture
- Compatible with .NET 8.0 and newer
Example
using Bale;
using Newtonsoft.Json;
int YOUR_CHAT_ID = 000000000;
string token = "TOKEN";
Bale.Client cli = new Client(token);
Bale.Message m = await cli.SendMessage(YOUR_CHAT_ID, "This is the test of the First BaleSharp bot, Made by CodeWizaard");
Bale.User me = await cli.getMe();
Console.WriteLine($"bot {me.first_name} started...");
try
{
cli.OnCommand = async (message, command, args) =>
{
switch (command)
{
case "start": await cli.reply_to(message, "Welcome to this bot, This bot is made by BaleSharp"); break;
}
};
cli.OnMessage = async (message) =>
{
switch (message.text)
{
case "Inline":
var key = new InlineKeyboardBuilder().AddButton("CallbackButton", "call")
.NewRow()
.AddButton("urlButton", url: "https://ble.ir/BaleSharp")
.NewRow()
.AddButton("copyTextButton", copyText:"text is copied")
.Build();
await cli.reply_to(message, "Here is some of Inline buttons", key);
break;
case "Reply":
var keyboard = new ReplyKeyboardBuilder().AddButton("Made by")
.NewRow()
.AddButton("BaleSharp")
.Build();
await cli.reply_to(message, "Here are some ReplyKeyboard buttons", keyboard);
break;
default:
await cli.reply_to(message, $"You said : {message.text}");
break;
}
};
cli.OnCallbackQuery = async (callback_query) =>
{
switch (callback_query.data)
{
case "call":
await cli.SendMessage(callback_query.from.id, "callback_query button clicked!");
break;
}
};
cli.StartReceiving();
await Task.Delay(-1);
}catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
finally
{
cli.StopReceiving();
}
Installation
Install the balebot package via NuGet:
dotnet add package BaleSharp
Docs and News : @BaleSharp Support : @BleSharpGP Beta channel : @SharpBeta
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. 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. |
-
net8.0
- Newtonsoft.Json (>= 13.0.3)
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 | |
---|---|---|---|
2.1.1 | 92 | 5/31/2025 | |
2.1.0 | 136 | 5/27/2025 | |
2.0.0 | 132 | 5/25/2025 | |
1.5.9-Beta | 50 | 5/24/2025 | |
1.5.8 | 136 | 5/18/2025 | |
1.5.7 | 209 | 5/14/2025 | |
1.5.7-Beta | 231 | 5/12/2025 | |
1.5.6 | 125 | 5/11/2025 | |
1.5.6-Alpha | 52 | 5/10/2025 | |
1.5.5 | 131 | 5/8/2025 | |
1.5.5-Fix | 129 | 5/8/2025 | |
1.5.4 | 136 | 5/5/2025 | |
1.5.3 | 138 | 4/30/2025 | |
1.5.2 | 143 | 4/29/2025 | |
1.5.1 | 146 | 4/29/2025 | |
1.4.2 | 144 | 4/29/2025 | |
1.4.1 | 149 | 4/28/2025 | |
1.4.0 | 142 | 4/28/2025 | |
1.3.4 | 232 | 4/28/2025 | |
1.3.3 | 144 | 4/27/2025 | |
1.3.2 | 145 | 4/27/2025 | |
1.3.1 | 144 | 4/27/2025 | |
1.2.1 | 142 | 4/27/2025 | |
1.1.1 | 144 | 4/27/2025 | |
1.1.0 | 147 | 4/27/2025 | |
1.0.0 | 143 | 4/27/2025 |
v2.1.0 Changes :
1. Added Objects.Transaction
2. Added InquireTransaction
3. Added Constructors to `LabledPrice` and `CopyTextButton` and `WebAppInfo`
4. Added `logout` and `close`
5. Changed input type of webapp button in inlines, from WebAppInfo to String
6. Fixed some bugs