I just started coding a Discord bot and I have a small problem with mentioning someone. I want my bot to mention someone and say how cool he is when I mention someone on Discord in any channel, for example:
Dahkris: lul howcool @Myfriend Bot: @Myfriend is 80% cool !
( The random part is functional )
Since I'm new to js, I don't know how those arguments work, so I don't know if I should use @member or "member.displayName", etc ( I tried different types ). I've already searched for similar codes but usually the bot only mention the author of the message.
bot.on('message', message => {
if (message.startsWith === 'lul howcool') {
if ( message.content === @member ) {
message.channel.send ( @member + ' is ' + ( Math.floor(Math.random() * 100) + 1 ) + "% cool ! " )
}
}
})
This code doesn't seem to have any errors but doesn't work because the message never contains the " @member" ( I think ).