
Product
Introducing Repository Access Permissions and Custom Roles
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.
kaiheila-bot-root
Advanced tools
开黑啦机器人 JavaScript SDK
npm i kaiheila-bot-root
在开黑啦机器人概况中选择连接模式为 webhook 并设置为
http://你的公网IP或域名:8600/?compress=0
代码:
var Bot = require('kaiheila-bot-root').KaiheilaBot
var bot = new Bot({
mode: 'webhook',
port: 8600,
key: 'YOUR ENCRYPT KEY', // 和设置的一致,如果这个值为空视为不加密
token: 'YOUR TOKEN',
verifyToken: 'YOUR VERIFY TOKEN',
})
/**
* 输出保存原始数据
*/
bot.messageSource.on('message', (e) => {
console.log(e)
if (typeof e.msg_id === 'string') {
writeFile(
`cache/${e.msg_id}.json`,
JSON.stringify(e, undefined, 2),
(e) => {
if (e) {
console.error(e)
}
}
)
}
})
/**
* 监听文本信息
*/
bot.on('textMessage', (e) => {
console.log(e)
})
bot.listen()
做了,懒得写了
var Bot = require('kaiheila-bot-root').KaiheilaBot
var bot = new Bot({
mode: 'websocket',
token: 'YOUR TOKEN',
})
/**
* 输出保存原始数据
*/
bot.messageSource.on('message', (e) => {
console.log(e)
if (typeof e.msg_id === 'string') {
writeFile(
`cache/${e.msg_id}.json`,
JSON.stringify(e, undefined, 2),
(e) => {
if (e) {
console.error(e)
}
}
)
}
})
/**
* 监听文本信息
*/
bot.on('textMessage', (e) => {
console.log(e)
})
bot.listen()
FAQs
开黑啦机器人 JavaScript SDK
The npm package kaiheila-bot-root receives a total of 33 weekly downloads. As such, kaiheila-bot-root popularity was classified as not popular.
We found that kaiheila-bot-root demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.

Product
Socket Firewall blocks malicious VS Code and Open VSX extensions before install, protecting developers from compromised editor marketplaces.