@client.event
async def on_message(message):
if message.author == client.user:
return
else:
global counter
counter +=1
print('Message from {0.author}: {0.content}'.format(message))
user = message.author
msg = message.content
print(user, msg)
Counter
из стандартной библиотеки collections
: https://docs.python.org/3/library/collections.html...from collections import Counter
...
msg_count = Counter()
@client.event
async def on_message(msg):
if msg.author == client.user:
return
global msg_count
msg_count[msg.author.id] += 1
print(f"Message by {msg.author}: {msg.content}")
...