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

怎么删除主动发送在频道中的消息? #232

Open
axiangcoding opened this issue May 4, 2024 · 1 comment
Open

怎么删除主动发送在频道中的消息? #232

axiangcoding opened this issue May 4, 2024 · 1 comment

Comments

@axiangcoding
Copy link

形如 ret = await ch.send(“Hello"),可以从ret中拿到msg_id,接着我应该使用哪个方法删除掉这条消息

@hank9999
Copy link
Contributor

需要调用 API 删除消息
这里有一个函数可以参考

async def delete_msg(bot: Bot, msg_id: str):
    """
    删除消息
    :param bot: 机器人实例
    :param msg_id: 消息ID
    :return:
    """
    await bot.client.gate.exec_req(api.Message.delete(msg_id))

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

No branches or pull requests

2 participants