Giter Club home page Giter Club logo

receiver-meow's Introduction

receiver-meow

All Contributors Build status MIT NLua code-size

能运行lua脚本的接待喵qq机器人,欢迎加入交流群931546484

功能

  • 对接OneBot的http/websocket通讯协议
  • 使用 .Net Core 5 开发,可跨平台
  • 消息处理逻辑,完全由lua实现
  • lua代码动态加载,重载虚拟机后,立即生效
  • Lua层可直接调用C#层接口
  • 自带了http(s) post/get、2D图片处理、数据存储(xml)等接口

下载

正式版:GitHub Releases

快照版:appveyor

默认脚本

自从插件的V2.0.0版本开始,默认脚本仓库与主仓库分离,Lua代码可在此仓库查看:receiver-meow-lua

使用Lua进行开发

与机器人相关的,收发消息与各种事件的处理接口、脚本运行逻辑、各接口调用方法,请参阅develop.md的描述

Task架构介绍

主虚拟机由Task框架调度,具体的任务、定时器用法请见LuaTask项目的Readme

每次收到新的消息上报,便会加到对应名称的Lua虚拟机中来处理,具体分配代码见Events.cs

整个LuaTask管理,由LuaStates.cs控制:

                  LuaStates.cs文件的代码逻辑

           +-----------+                +--------------------+
New message|           | Name not exist |                    |
>>>>>>>>>>>+ lua pool  +--------------->+create new lua state|
           |           |                |                    |
           +----+------+                +-------+----------+-+
                |                               |          |
                |Name Exist                     |          |
                v                               |          |
       +--------+-------------------+           |          |
       | add new task to this state +<----------+          |
       +-------------+--------------+                      |
                     |                                     |
                     |                                     |
       +-------------+-------------+                       |
       |                           |   start run new state |
       |   task framework running  +<----------------------+
       |                           |
       +---------------------------+

食用

先去下载一个支持OneBot的框架,推荐go-cqhttp。配置好qq和密码跑起来

接待喵使用的连接方式为:HTTP接口、WebSocket消息触发

下载接待喵:releases

推荐运行时开个死循环,这样即使软件崩溃,也可以自动重启,例如下面两种:

run.bat

:go
receiver-meow.exe
goto go

run.sh

while [ 1 ]
do
./receiver-meow
done

命令行可添加参数(http的端口ws的端口),运行后,输入?即可查看帮助

默认脚本可以在群内输入帮助查看自带功能

脚本的功能解释请见Lua脚本项目的Readme

结尾

本项目基于MIT协议

Contributors ✨

Thanks goes to these wonderful people (emoji key):


一般通过吃瓜群众

🚧 💻 🤔

CXM

💻 🐛

morinoyuki

💻 🐛

gy39830

💻 🐛

This project follows the all-contributors specification. Contributions of any kind welcome!

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.