Giter Club home page Giter Club logo

qqlight-websocket-aardio's Introduction

qqlight-websocket-aardio

QQLight机器人WebSocket插件aardio扩展库

qqlight版本:v3.0+

qqlight-websocket版本:v2.3.0

通过web.socket.jsonClient

与WebSocket-RPC插件(websocket.protocol.ql.dll)进行通信

从而实现跟QQLight机器人框架的交互

WebSocket-RPC插件地址 https://github.com/Chocolatl/qqlight-websocket

安装

在线安装扩展库

//注册远程扩展库安装地址
_IMPORTURL.qqlight = "https://github.com/nlysh007/qqlight-websocket-aardio/releases/latest/download/qqlight.tar.lzma"
import qqlight;

示例

这是一个复读机(Echo)的aardio示例

import console; 
import win;
import qqlight;

var wsClient = qqlight.wsClient();

var pluginPath = "";
if(pluginPath==""){
    error("未指定plugin目录")
} 

wsClient.connectByPluginPath(pluginPath) //通过qqlight的plugin目录路径来连接

wsClient.onOpen = function(){
    console.dump("已连接")
}

wsClient.onMessage = function(event,params){
    console.dump("收到消息",params)
    //简单的消息复读例子
    wsClient.sendMessage({
        ["type"]    = params["type"] ;
        ["group"]   = params["group"];
        ["qq"]      = params["qq"];
        ["content"] = params["content"];
    })	
    console.dump("已复读消息",params["content"])
}

win.loopMessage()
console.pause(true);

qqlight-websocket-aardio's People

Contributors

nlysh007 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

popde hibigdata

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.