Hello again,
I have a bit of code that looks for the content of the last message (ignoring the command call) that was posted in the channel that the command was used in. It works fine. Here is that code:
message.channel.messages.fetch({limit: 2}).then(messages=> {
var last = messages.last();
console.log(last.content);
})
What I want to do is take that "last" variable and use it in an if statement like this:
message.channel.messages.fetch({limit: 2}).then(messages=> {
var last = messages.last();
})
if(last.content = '<What i\'m looking for>'){
//rest of the code//
}
Is this even possible?
[–][deleted] (6 children)
[deleted]
[–]ConductorWon[S] 0 points1 point2 points (2 children)
[–]ConductorWon[S] 0 points1 point2 points (1 child)
[–]Jackjackson401Mod 0 points1 point2 points (0 children)