I want to find out the username by the message_id from a responsed message. So there is a response and I get the message that is responsed by that message, and from that message I already know the MESSAGE ID, but I want to know the user that has written it.
So, is there any way to get the USER from the MESSAGE ID?
Sorry for my maybe bad English, I am GERMAN.
I am also new at coding Discord Bots.
I tried:
msg = message.reference.message_id
author = msg.author
print(author)
And as a result I get:
AttributeError: 'int' object has no attribute 'author'
Help?
You want to use the
cached_messageattribute to access the Message and then get the user from that. However, it might beNoneif the reference message isn't in the cache.I don't know what context you're doing this in (as you've not provided any in your question) so I'm using everything on the basis you have a
discord.Messageand we're within anasynccontext.