BaleSharp 1.4.2
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 BaleSharp --version 1.4.2
NuGet\Install-Package BaleSharp -Version 1.4.2
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="BaleSharp" Version="1.4.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BaleSharp" Version="1.4.2" />
<PackageReference Include="BaleSharp" />
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 BaleSharp --version 1.4.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: BaleSharp, 1.4.2"
#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.
#addin nuget:?package=BaleSharp&version=1.4.2
#tool nuget:?package=BaleSharp&version=1.4.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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 = 2035204913;
string token = "1782917547:nJGgN2rH1fyXDYe9JnfXWai";
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...");
int lastUpdateId = 0;
while (true)
{
try
{
// Create parameters with offset to get only new updates
int tmp = lastUpdateId + 1;
Update[] u = await cli.GetUpdates(tmp);
if (u != null && u.Length > 0)
{
foreach (Bale.Update update in u)
{
// Update our last processed ID
lastUpdateId = update.update_id;
// Check if this is a message with text
if (update.message?.text != null)
{
Console.WriteLine($"Received: {update.message.text}");
await cli.reply_to(update.message, $"Echo : {update.message.text}");
}
}
}
else
{
Console.WriteLine("No new updates...");
}
}
catch (Exception ex)
{
await cli.SendMessage(YOUR_CHAT_ID, $"Error : {ex.Message}");
break;
}
// Add a small delay to avoid hitting rate limits
await Task.Delay(1000);
}
Installation
Install the balebot package via NuGet:
dotnet add package BaleSharp
Docs and News : @BaleSharp Support : @BleSharpGP
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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
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 | 93 | 5/31/2025 | |
2.1.0 | 136 | 5/27/2025 | |
2.0.0 | 134 | 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 |