标签: python python-3.x discord discord.py
我想知道如何获取频道中的第一条消息。 但更可取的是,您能指出我解释这一点的文档部分吗?
答案 0 :(得分:2)
TextChannel 有一个 history 方法。 如果您键入 await channel.history(),您可以获得该文本频道中的所有消息。但这从最后一条消息开始。要从第一条消息开始,请在方法中使用 oldest_first=True。您也可以使用关键字参数 limit 来限制消息量。
TextChannel
history
await channel.history()
oldest_first=True
limit