Discord.js: User.previousMessage

Created on 19 May 2017  路  4Comments  路  Source: discordjs/discord.js

I know of User.lastMessage, but in the message event, it shows as the current message. User.previousMessage could be used as the message previous to the current message. Useful for checking how fast a user posted, or if the two messages are similar or the same, and then take action based on that.

low caching utility enhancement

Most helpful comment

I disagree with this. If anything, there might be a case for setting the lastMessage property after the message event fires, but caching 2 messages on each user is pointless.

All 4 comments

just as a side note: checking how fast a user is posting messages should not be a two-data-point endeavor, just as a note. You will want at least five (but probably more).

I disagree with this. If anything, there might be a case for setting the lastMessage property after the message event fires, but caching 2 messages on each user is pointless.

If you set the lastMessage after message event fires that would work perfectly fine.

Don't think discord.js needs to do this

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BrandonCookeDev picture BrandonCookeDev  路  3Comments

Lombra picture Lombra  路  3Comments

LLamaFTL picture LLamaFTL  路  3Comments

DatMayo picture DatMayo  路  3Comments

Dmitry221060 picture Dmitry221060  路  3Comments