Rapptz / discord.py

An API wrapper for Discord written in Python.
http://discordpy.rtfd.org/en/latest
MIT License
14.92k stars 3.77k forks source link

How to take all messages of one members ? #694

Closed AlexisHuvier closed 7 years ago

AlexisHuvier commented 7 years ago

I want to get the number of messages who a members write. How i can make that ?

ghost commented 7 years ago

try: counter = 0 async for log in client.logs_from(message.channel, limit=100): [tab][tab]if log.author == message.author: [tab][tab][tab]counter += 1

NotSoSuper commented 7 years ago

Wrong place to ask, join the discord server in the readme.

mgardne8 commented 7 years ago

Joker is correct in using logs_from, look at the example in the documentation for more info: http://discordpy.readthedocs.io/en/async/api.html?highlight=Logs#discord.Client.logs_from

AlexisHuvier commented 7 years ago

Sorry, NotSoSuper. I answer to jorker and mgardne : but logs_from has a limit of 100 messages

ghost commented 7 years ago

you can change the limit

ghost commented 7 years ago

client.logs_from(message.channel, limit=10000)

AlexisHuvier commented 7 years ago

But you can't use this command without limit ?

ghost commented 7 years ago

make limit absurdly high?

ghost commented 7 years ago

try limit=none

ghost commented 7 years ago

and join discord

AlexisHuvier commented 7 years ago

I will try