M
M
mrozhentsev2020-12-05 12:09:31
Python
mrozhentsev, 2020-12-05 12:09:31

Messages not being sent to discord.py, what's the problem?

The discord bot cannot send a message to the user. The error below says that the user with this id does not exist, so it returns a None object, and the None object does not have a send attribute.
And it all worked before.

member = bot.get_user(int(executor))
await member.send(f"Заказ №{order_id} оплачен.")


Discord.ext.commands.errors.CommandInvokeError
: Command raised an exception: AttributeError: 'NoneType' object has no attribute 'send'

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Art005, 2020-12-05
@Art005

Most likely get_user does not find anyone

R
RAINGM, 2020-12-05
@RAINGM

get_user accepts a user ID, try writing bot.get_user(executor.id)

A
AS1 -, 2020-12-17
@AS1AW

Most likely it can't find the user

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question