2.2.2 • Published 2 years ago

@qq-guild-sdk/core v2.2.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

QQ Guild SDK core

qq 频道 SDK 核心库,目前还在开发中,如有问题 issue 汇报。

安装

yarn add qq-guild-sdk@core
# or
npm install qq-guild-sdk@core

使用

import { Bot } from 'qq-guild-sdk@core'
// or
const { Bot } = require('qq-guild-sdk@core')

// 创建 bot
const bot = new Bot({
  app: {
    // 在机器人管理端的 app id
    id: '',
    // 在机器人管理端的 app secret
    key: '',
    // 在机器人管理端的 app token
    token: ''
  }
})

;(async () => {
  // api 请求
  // 获取当前机器人加入的频道列表
  const guilds = await bot.guilds
  console.log(guilds)
  // 启动 wss 连接服务,并设置本次连接权限
  await bot.startClient(Bot.Intents.PUBLIC_GUILD_MESSAGES | Bot.Intents.GUILDS)
  bot.on('ready', () => {
    console.log('Bot is ready.')
  })
  bot.on('message', async (msg) => {
    console.log(msg)
  })
})()

特点

  • 自适应扩展请求 api ,只需要扩展接口即可
declare module '@qq-guild-sdk/core' {
  interface Api {
    newApi(id: string): Promise<Entity>
  }
}
// 用户可随意扩展该接口
bot.newApi('123')
2.2.1

2 years ago

2.2.0

2 years ago

2.2.2

2 years ago

2.1.2

3 years ago

2.1.1

3 years ago

2.1.4

3 years ago

2.1.3

3 years ago

2.1.5

3 years ago

2.1.0

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago