Search code examples
javascriptdiscorddiscord.jsping

Discord.js how to ping Members


I wanted the bot to ping a member ( with @) and i tried

message.channel.send(<@id>+" text")

but it says unexpected sign '<'. How can i make the bot ping members?


Solution

  • member ping: <@${memberID}>

    Channel ping: <#${channelID}>

    Role ping: <@&${roleID}>

    Also you need to use [`] like:

    message.channel.send({content: `<@${memberID}> i pinged you`})