【发布时间】: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