mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-17 05:47:11 +00:00
* fix: 2.7 dev start * feat: 初步支持function call(WIP) * fix: syntax error * fix: syntax error * feat: 群聊上下文 * fix: 暂时阉割掉全员禁言功能 * fix: 修改禁言时间范围 * fix: 修复一些功能易用性 * fix: 只有管理员和群主才能用jinyan和kickout * fix: 加回来禁言和踢出 * fix: 修复管理员权限判断问题(可能吧) * fix: 试图优化逻辑 * fix: fuck openai documents * fix: 删掉认主不然一直禁言我烦死了 * fix: 哔哩哔哩封面损坏问题 * fix: 加个天气小工具 * fix: 天气不存在城市 * fix: website工具用浏览器 * feat: serp tool * feat: 增加一个google搜索源 * fix: 加一句描述 * feat: 增加搜索来源选项 * feat: 搜图和发图 * fix: groupId format error * fix: add a image caption tool * fix: 修改一些提示。tool太多机器人开始混乱了 * fix: 一些极端的措施 * fix: 增加一些提示和一个暂时的公共接口 * fix: 收拾一下 * fix: 修改命令正则 * fix: 修改一些提示 * fix: move send avatar into send picture tool * fix: 修复解除禁言的bug
35 lines
1 KiB
JavaScript
35 lines
1 KiB
JavaScript
import {AbstractTool} from "./AbstractTool.js";
|
||
|
||
|
||
export class SendDiceTool extends AbstractTool {
|
||
name = 'sendDice'
|
||
|
||
parameters = {
|
||
properties: {
|
||
num: {
|
||
type: 'number',
|
||
description: '骰子的数量'
|
||
},
|
||
groupId: {
|
||
type: 'string',
|
||
description: '群号或qq号,发送目标'
|
||
}
|
||
},
|
||
required: ['num', 'groupId']
|
||
}
|
||
|
||
func = async function (opts) {
|
||
let {num, groupId} = opts
|
||
let groupList = await Bot.getGroupList()
|
||
if (groupList.get(groupId)) {
|
||
let group = await Bot.pickGroup(groupId, true)
|
||
await group.sendMsg(segment.dice(num))
|
||
} else {
|
||
let friend = await Bot.pickFriend(groupId)
|
||
await friend.sendMsg(segment.dice(num))
|
||
}
|
||
return `the dice has been sent`
|
||
}
|
||
|
||
description = 'If you want to roll dice, use this tool. If you know the group number, use the group number instead of the qq number first. The input should be the number of dice to be cast (1-6) and the target group number or qq number,and they should be concat with a space'
|
||
}
|