Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

重复收到好友请求 #966

Open
dlytang opened this issue Jul 27, 2021 · 1 comment
Open

重复收到好友请求 #966

dlytang opened this issue Jul 27, 2021 · 1 comment
Labels
bug? The issue author think this is a bug

Comments

@dlytang
Copy link

dlytang commented Jul 27, 2021

环境信息

go-cqhttp版本: v1.0.0-beta4
运行环境: centos7
连接方式: 反向ws
使用协议: ipad

使用nonebot1
bug内容
收到好友请求后发送一句话如“成功添加”,如果用户发送一句带参数的命令,就会重复收到好友请求,并再次发送“成功添加”

复现方法
收到好友请求:

@on_request('friend')   
async def friend(session: RequestSession):   
    await session.approve()   
    await asyncio.sleep(1)   
    await session.send('成功添加')

带参数命令:

@on_command('test',aliases=["test"])   
async def test(session: CommandSession):   
    test_info = session.get('test_info', prompt='请发送内容') 
    await session.send(test_info)    
@test.args_parser       
async def _(session: CommandSession):    
    stripped_arg = session.current_arg_text.strip()    
    if session.is_first_run:    
        if stripped_arg:    
            session.state['test_info'] = stripped_arg    
        return    
    if not stripped_arg:    
        session.pause('发送超时,请重新发送')    
    session.state[session.current_key] = stripped_arg    

M{BUL GN5CU)JW ( }EG5_9

日志:

[2021-07-27 10:42:17] [INFO]: 收到来自 白日梦想家(140063****) 的好友请求:  
[2021-07-27 10:42:17] [INFO]: 添加了新好友: 白日梦想家(140063****) 
[2021-07-27 10:42:18] [INFO]: 发送好友 140063****(140063****)  的消息: [{"type":  ... (1749843657) 
[2021-07-27 10:42:25] [INFO]: 收到好友 白日梦想家(140063****) 的消息: test (1822502633) 
[2021-07-27 10:42:25] [INFO]: 发送好友 140063****(140063****)  的消息: [{"type":  ... (525028959) 
[2021-07-27 10:42:25] [INFO]: 收到来自 白日梦想家(140063****) 的好友请求:  
[2021-07-27 10:42:26] [INFO]: 发送好友 140063****(140063****)  的消息: [{"type":  ... (-1879813170) 
@dlytang dlytang added the bug? The issue author think this is a bug label Jul 27, 2021
@github-actions github-actions bot added the Issuebot: Pending Recheck A recheck is scheduled by Issuebot label Jul 27, 2021
@github-actions github-actions bot reopened this Jul 27, 2021
@github-actions github-actions bot removed the Issuebot: Pending Recheck A recheck is scheduled by Issuebot label Jul 27, 2021
@luodeb
Copy link

luodeb commented Oct 29, 2022

这个问题解决了吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug? The issue author think this is a bug
Projects
None yet
Development

No branches or pull requests

2 participants