Konata.Core
QQ(Android) protocol core implemented with pure C#
based on .NET Standard 2.1, event driven.
Docs
įŽäŊä¸æ / English
- Go to API references page
- Quick start with Kagami
Example code snippets
// Create a bot instance
var bot = BotFather.Create(config, device, keystore);
{
// Handle the captcha
bot.OnCaptcha += (bot, e) =>
{
if(e.Type == CaptchaType.Slider)
{
Console.WriteLine(e.SliderUrl);
bot.SubmitSliderTicket(Console.ReadLine());
}
else if(e.Type == CaptchaType.Sms)
{
Console.WriteLine(e.Phone);
bot.SubmitSmsCode(Console.ReadLine());
}
};
// Print the log
bot.OnLog += (_, e)
=> Console.WriteLine(e.EventMessage);
// Handle group messages
bot.OnGroupMessage += (_, e)
=> Console.WriteLine(e.Message);
// Handle friend messages
bot.OnFriendMessage += (_, e)
=> Console.WriteLine(e.Message);
// ... More handlers
}
// Do login
if(!await bot.Login())
{
Console.WriteLine("Login failed");
return;
}
Console.WriteLine("We got online!");
Features List
Messages | Support | Operations | Support | Events | Support |
---|---|---|---|---|---|
Images | đĸ | Poke | đĸ | Captcha | đĸ |
Text / At | đĸ | Recall | đĄ1 | BotOnline | đĸ |
Records | đĸ | Leave Group | đĸ | BotOffline | đĸ |
QFace | đĸ | Special Title | đĸ | Message | đĄ2 |
Json | đĸ | Kick Member | đĸ | Poke | đĸ |
Xml | đĸ | Mute Member | đĸ | MessageRecall | đĸ |
Forward | đĄ3 | Set Admin | đĸ | GroupMemberDecrease | đĸ |
Video | đ´ | Friend Request | đĸ | GroupMemberIncrease | đĸ |
Flash Image | đĸ | Group Request | đĸ | GroupPromoteAdmin | đĸ |
Reply | đĸ | Voice Call | đ´ | GroupInvite | đĸ |
File | đ´ | Csrf Token | đĸ | GroupRequestJoin | đĸ |
Cookies | đ´ | FriendRequest | đĸ | ||
FriendTyping | đĸ | ||||
FriendVoiceCall | đ´ |
Special Thanks
Special thanks to JetBrains offers free open-source licenses for us!
License
Licensed in GNU GPLv3 with â¤.