【问题标题】:Deleting a bot message after a while?一段时间后删除机器人消息?
【发布时间】:2022-01-06 14:49:51
【问题描述】:

我的机器人欢迎新成员,过了一会儿我如何删除消息?

我的 hello 消息代码:

@client.event
async def on_member_join(member):
    channel = client.get_channel(channelID)
    await channel.send(f'Hello')

【问题讨论】:

    标签: python discord discord.py bots


    【解决方案1】:

    使用delete_after kwarg。
    例如await channel.send(f'Hello', delete_after=60)

    【讨论】:

    • 非常感谢!
    • 请告诉我,可以实时向用户显示还剩多少时间。以倒计时为例?
    猜你喜欢
    • 2019-06-02
    • 1970-01-01
    • 2021-06-11
    • 2021-04-01
    • 2021-04-09
    • 2020-11-08
    • 2020-08-24
    • 2021-10-14
    • 2018-12-29
    相关资源
    最近更新 更多