chat-space
TypeScript icon, indicating that this package has built-in type declarations

0.0.7 • Public • Published

chat-space

连接 discord、kook、qqbot 开放平台的机器人

npm install chat-space

Development

  • Discord
import { DCClient } from 'chat-space'

// 创建客户端
const Client = new DCClient({
  token: ''
})

// 连接
Client.connect()

// 监听消息创建
Client.on('MESSAGE_CREATE', async e => {
  // 排除是bot用户的消息
  if (e.author?.bot) return
  // 在子频道回复消息
  Client.channelsMessages(e.channel_id, {
    content: `收到消息${e.content}`
  })
})

Client.on('ERROR', e => {
  if (e.message) {
    console.log('出现错误', e.message)
  } else {
    console.log('出现错误', e)
  }
})

Community

QQ Group 806943302

Dependents (0)

Package Sidebar

Install

npm i chat-space

Weekly Downloads

1

Version

0.0.7

License

none

Unpacked Size

228 kB

Total Files

112

Last publish

Collaborators

  • ningmengchongshui