Closed L-o-s-t closed 3 years ago
According to the documentation and example codes, the on_message event requires only the "message" parameter, so everything will work normally.
This example uses Development branch, but also works in 1.8.1
According to the documentation and example codes, the on_message event requires only the "message" parameter, so everything will work normally.
This example uses Development branch, but also works in 1.8.1
Even so, other users using commands that includes "message.author" are greeted with "None#0"
Result:
Code:
from discord.ext import commands
client = commands.Bot(command_prefix=">", self_bot=False)
@client.event
async def on_message(message):
if message.content.startswith('$greet'):
channel = message.channel
await channel.send('Say hello!')
def check(m):
return m.content == 'hello' and m.channel == channel
msg = await client.wait_for('message', check=check)
await channel.send(f'Hello {msg.author}!')
client.run('token')
I recommend you to use breakpoints to get more details of this type of problem, as you can see in the image I sent you, to get the user's nick it's necessary to use message.author.display_name, and ID with message.author.discriminator
This is a problem related to LazyUsers, which are going to be removed in the next version. The beta is in the development branch.
Summary
When other users are triggering commands/events using "message.author" and "message.author.avatar_url" it returns as "None"
Reproduction Steps
1. Get a different user to send the command that uses "message.author". In my case the command used was ">test"
Code
Relevant code that shows the bug.
Expected Results
It's supposed to return the correct author tag, and avatar url
Actual Results
It's sending "none"
System Info
Run
python -m discord --version
and paste the information below.Checklist
Let's make sure this issue is valid!