Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.
/ KaiheilaWS Public archive

开黑啦机器人v3 API的收发SDK,基于ECMAScript

License

Unknown, Unknown licenses found

Licenses found

Unknown
LICENSE
Unknown
LICENSE.md
Notifications You must be signed in to change notification settings

853Lab/KaiheilaWS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kaiheila WebSocket 以及 V3 API 请求收发接口集合

使用示例:

安装:

npm i kaiheila-ws

WebSocket (Bot):

import { KaiheilaWS } from 'kaiheila-ws'
let kaiheiws = new KaiheilaWS({
    type: "Bot",
    Bot: {
        token: ""
    },
    retry: true
})
kaiheiws.on("Message", r => { console.log(r) })
kaiheiws.connect()

WebSocket (User):

import { KaiheilaWS } from 'kaiheila-ws'
let kaiheiws = new KaiheilaWS({
    type: "User",
    User: {
        auth: ""
    },
    retry: true
})
kaiheiws.on("Message", r => { console.log(r) })
kaiheiws.connect()

发送消息:

kaiheiws.sendmsg("Hell yeah!", "8815380044828253")

接收机器人自身信息:

kaiheiws.getme().then(r=>{console.log(r)})

接收机器人已加入的服务器:

kaiheiws.getGuilds().then(r=>{console.log(r)})

给予、移除用户对应的角色:

// 给予角色
kaiheiws.setrole("7430659266664661", "3543259271", 40956, "Grant").then(r=>{console.log(r)})
// 移除角色
kaiheiws.setrole("7430659266664661", "3543259271", 40956, "Revoke").then(r=>{console.log(r)})

About

开黑啦机器人v3 API的收发SDK,基于ECMAScript

Resources

License

Unknown, Unknown licenses found

Licenses found

Unknown
LICENSE
Unknown
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published