【问题标题】:Discord py: Repeating any previously written messageDiscord py:重复任何以前写的消息
【发布时间】:2022-11-26 22:06:43
【问题描述】:

我正在尝试让我的机器人在此频道中一次接收一位用户写的随机消息并定期发送出去。这将是一个模仿一个用户交流方式的机器人。 如何使用 Discord.py 制作它?有任何想法吗?

@bot.event
async def check(message):
    return message.author.id == 'some id'
messages = async channel.history(limit=100, check=check).flatten()


@bot.command
async def start(ctx):
    element = messages.choice(messages)
    ctx.send(element)

【问题讨论】:

    标签: python discord discord.py


    【解决方案1】:

    截屏 - - - - - - - - - - - - - - - - - - - - - - - - - ----

    https://i.stack.imgur.com/kfDBb.png

    【讨论】:

    • 不要使用其他信息的答案-edit你的问题。
    • 不要包含文本图像。所有文本都应作为文本包含在内。
    猜你喜欢
    • 1970-01-01
    • 2019-10-02
    • 2021-10-22
    • 2020-04-07
    • 2021-06-17
    • 1970-01-01
    • 2021-06-14
    • 2021-04-20
    • 2021-10-29
    相关资源
    最近更新 更多