fix: 尝试修复onebot无法获取群聊记录及图片tools发图异常

1.类比shamrock,onebot使用e.group.getChatHistory(0, num, false)可以直接取到记录历史记录
2.我这边napcat的onebot得到的e.bot.getGroupList()是数组这。不同协议差别这么大吗。。先这样能发送了
This commit is contained in:
127Wzc 2025-03-11 23:13:23 +08:00
parent 4900f40502
commit aaaee383a8
2 changed files with 43 additions and 42 deletions

View file

@ -45,7 +45,8 @@ export class SendPictureTool extends AbstractTool {
}
let errs = []
try {
if (groupList.get(target)) {
if ((typeof groupList.get === 'function' && groupList.get(target)) ||
(Array.isArray(groupList) && groupList.includes(target))) {
let group = await e.bot.pickGroup(target)
for (let pic of pictures) {
try {