idranme / koishi-plugin-adapter-red

Red Protocol Adapter for Koishi
GNU Affero General Public License v3.0
18 stars 2 forks source link

获取群成员信息失败,请求添加相关功能 #1

Open logiest617 opened 1 year ago

logiest617 commented 1 year ago
f6ea987e3442a2c61de38bd2f1201c6a 9345989c4652566165e4a02eef19f05a

目前red疑似拿不到群员信息,在五十人的群依然会显示『群成员太少啦,快去拐骗(?)点老婆回来吧!』。

idranme commented 1 year ago

已查明是 red 那边返回了空数组

idranme commented 10 months ago

目前可使用 waifu 插件替代,waifu 插件采用了一些方式来避免这个问题。

HunterShenSmzh commented 9 months ago

我尝试使用了waifu插件的处理逻辑,发现依然返回是空值。

                  const members = new Map();
                  //遍历当前groupmemberlist
                  let { data, next } = await session.bot.getGuildMemberList(session.guildId);
                  if (next) {
                      const memberList = await session.bot.getGuildMemberList(session.guildId, next);
                      data = [...data, ...memberList.data];
                  }
                  const guildMembers = await members.get(session.gid);
                  if (data.length === 0 && guildMembers) {
                      for (const [, value] of guildMembers) {
                          data.push(value);
                      }
                  }
                  else if (guildMembers) {
                      const map = new Map(data.map(v => {
                          const fid = `${session.platform}:${session.guildId}:${v.user.id}`;
                          return [fid, v];
                      }));
                      members.set(session.gid, map);
                  }
                  console.log(data)

检查data后发现返回为空,但在gocq里头是可以正常返回包涵了user信息的内容的。