Giter Site home page Giter Site logo

yuq's Introduction

YuQ 是一个 QQ 机器人快速开发框架。开发文档

  • 路由映射
  • 依赖注入
  • 定时任务
  • ORM支持
  • 上下文消息

YuQ 使用 Kotlin 开发,并且完美支持 Java 与 Kotlin。

Maven Central

在 YuQ 我们仅需很简单的代码,就可以完成很复杂的功能。
比如,我们要针对一个指令"菜单",进行一个标准的菜单消息回复。

@GroupController
public class GroupMenu{ 
    @Action("菜单")
    public String menu(){
        return "这是具体的菜单内容。";
    } 
}

YuQ 会在指令式机器人的开发中,提供非常好的帮助,让开发者能有更好的开发体验。
在 Controller 中,我们的 Action 方法,返回的内容,会直接构建成消息,并发送当当前消息源。
通过路由映射,我们可以很方便的编写指令,只需要将 Class 声明为一个 Controller,并且编写 Action 方法。
其余的,YuQ 会帮您完成。

比如我们想禁言一个人,禁言的指令为"ban @xxx或QQ号码 time" 我们只需要编写:

@GroupController
public class GroupMenu{
     @Action("ban {ban} {time}")
     public String ban(Member ban, int time){
         ban.ban(time);
         return "好的!";
     }
}

这样,我们就可以很轻易的完成 ban 这个指令了。

对于需要连续对话的指令式机器人,基于 YuQ 也可以轻松满足。

通过 ContextSession 提供的 waitNextMessage 方法,或者 ContextController,我们可以轻松完成上下文对话的机器人。
Context

yuq's People

Contributors

icecream-qaq 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.