1.1.4 • Published 3 years ago

kaiheila-ws v1.1.4

Weekly downloads
79
License
THE COFFEEWARE LI...
Repository
github
Last release
3 years ago

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)})
1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago