#How do I compare the last sent message? The message also includes the user.id

12 messages · Page 1 of 1 (latest)

final cove
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

prisma oasis
#

node 18.12.1

summer niche
#

wdym compare

prisma oasis
#

I want to check if this is the last message containing the user id.

summer niche
#

You can use <Channel>.lastMessage to get the last message, and you should use user.user.id since the user is member

#

If you want you can use interaction.options.getUser('user') if you only need the user

prisma oasis
#

The bot should respond to a message containing the user ID. With .lastmessage I only get the last message from that channel, right?

summer niche
#

yeah .lastmessage gives you the last message sent to the channel

prisma oasis
#

But how do I find the last message that contains the user.id?

summer niche
#

You can't really do that effectively

#

The best you can do is fetch the last 100 messages and filter them

prisma oasis
#

Yes, but then I have all the messages that contain this ID. But I only want the last one xD