Coder Social home page Coder Social logo

konata.core's Introduction

Konata.Core

Core C# NuGet
NuGet License Build Telegram

QQ(Android) protocol core implemented with pure C#
based on .NET Standard 2.1, event driven.

Docs

简体中文 / English

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 ❤.

Footnotes

  1. Not supported to recall messages sent from the bot.

  2. Not supported temp messages.

  3. Not supported to forward messages between group and friend.

konata.core's People

Contributors

thesnowfield avatar takayama-lily avatar photonspk avatar sinoahpx avatar chronostasys avatar executor-cheng avatar young-lord avatar yang-fly avatar yiyungent avatar dawn-lc avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.