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

添加转发节点参数 nickname #1520

Closed
clacknya opened this issue May 28, 2022 · 1 comment
Closed

添加转发节点参数 nickname #1520

clacknya opened this issue May 28, 2022 · 1 comment

Comments

@clacknya
Copy link

环境信息
Linux x64

go-cqhttp版本: v1.0.0-rc1

需要添加的功能内容

aiocqhttp 中 转发节点 的参数是使用 nickname 标识昵称,而 go-cqhttp 则使用 name,因此直接调用 node_custom 创建的节点进行转发会因为缺少参数报错。

https://github.com/nonebot/aiocqhttp/blob/3e4fcaedee96a98b4d6dfb07ebadc04db710e06f/aiocqhttp/message.py#L375-L385

    def node_custom(user_id: int,
                    nickname: str,
                    content: Message_T) -> 'MessageSegment':
        """合并转发自定义节点。"""
        if not isinstance(content, (str, MessageSegment, Message)):
            content = Message(content)
        return MessageSegment(type_='node', data={
            'user_id': str(user_id),
            'nickname': nickname,
            'content': str(content),
        })

希望能添加对 nickname 的兼容

@assassingyk
Copy link

user_id和uin这个参数其实也不统一,不过这个好像做了兼容倒是

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants