How to get how many messages has been sent in a channel
问题 I am trying to get the number of how many messages have been sent in a channel, and using the logs_from() function wont work because that only accepts a fixed amount of messages to retrieve, how do I do this? 回答1: In the discord.py-rewrite branch, there is a TextChannel.history AsyncIterator . If you pass limit=None , it will return all the messages from the channel @bot.command() async def message_count(ctx, channel: discord.TextChannel=None): channel = channel or ctx.channel count = 0 async