Modern SDK for Telegram Bot API made for .NET
Explore the docs » (soon)
Library us built for .NET Standard 2.1
Install
- Nuget
Install-Package TeleSharpX
Assuming you have create .NET 7 Console application and installed TeleSharpX package. Basic echo bot:
using TeleSharpX;
var client = new TelegramClient(new()
{
Token = "Bot Token goes here"
})
client.OnMessage += async (s,e) =>
{
await client.SendMessage(e.From.Id, e.Text);
};
await client.StartPolling(); // this call will block your main thread until `client.StopPolling()` is called
See the open issues for a list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- If you have suggestions for adding or removing projects, feel free to open an issue to discuss it, or directly create a pull request after you edit the README.md file with necessary changes.
- Please make sure you check your spelling and grammar.
- Create individual PR for each suggestion.
- Please also read through the Code Of Conduct (soon) before posting your first idea as well.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.