whitechi73 / OpenShamrock

A Bot Framework based on Lsposed with OneBot11(停止维护/禁用于违法用途)
https://whitechi73.github.io/OpenShamrock
GNU General Public License v3.0
1.41k stars 186 forks source link

bug: get_group_member_list群人数较多时无法获取群成员列表 #265

Closed sckiyo closed 8 months ago

sckiyo commented 8 months ago

警告: 在进一步操作之前,请检查下列选项。如果您忽视此模板或者没有提供关键信息,您的 Issue 将直接被关闭

描述 Bug

群成员较多时,get_group_member_list无法获取群成员列表。 试过3个人的群和几个几百个人的群,3个人的群可以,几百个人的群都不行。

ERROR java.lang.IllegalArgumentException: method com.tencent.mobileqq.troop.handler.TroopMemberListHandler.B argument 2 has type java.lang.String, got java.lang.Long
    at java.lang.reflect.Method.invoke(Native Method)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.internal.ScopeCoroutine.afterResume(Scopes.kt:32)
    at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:102)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
    at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174)
    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167)
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569)
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at io.ktor.server.netty.EventLoopGroupProxy$Companion.create$lambda$1$lambda$0(NettyApplicationEngine.kt:296)
    at io.ktor.server.netty.EventLoopGroupProxy$Companion.$r8$lambda$XgnKz7L6tCWRUaIAa7SVURwtFE4(Unknown Source:0)
    at io.ktor.server.netty.EventLoopGroupProxy$Companion$$ExternalSyntheticLambda1.run(Unknown Source:2)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.lang.Thread.run(Thread.java:930)

复现 Bug

import httpx
import asyncio

HOST = ""
PORT = ""

async def call_api(endpoint, data):
    async with httpx.AsyncClient() as client:
        response = await client.post(f"http://{HOST}:{PORT}/{endpoint}", json=data)
        if response.status_code == 200:
            return response.json()
        else:
            raise ValueError(f"Error calling {endpoint}: {response.status_code}")

async def main():
    response = await call_api("get_group_member_list", {
        "group_id": 
    })
    print(response)

asyncio.run(main())

结果:{'status': 'failed', 'retcode': 20002, 'data': {'url': '/get_group_member_list', 'error': 'method com.tencent.mobileqq.troop.handler.TroopMemberListHandler.B argument 2 has type java.lang.String, got java.lang.Long'}}

系统信息

whitechi73 commented 8 months ago

试试看这个版本还有没有问题

sckiyo commented 8 months ago

没有问题了