'Discord.js Ping @Here role

How do you get the @here role?

Things I tried:

  • sending @here (doesn't ping)
  • interaction.guild.roles.fetch("@here") (not a real role)
  • '<@&'+threadId+'>' (comes up @deleted-role)

I don't see it in the documentation anywhere but it's really hard to search since search engines ignore the @



Solution 1:[1]

@here is not a role. It simply mentions @everyone but only pings everyone online. You would need to use the everyone role.

const role = interaction.guild.roles.everyone

Note, the everyone role ID is the same as the guild ID, so for things like overwrite editing, you should use the guild ID

await channel.permissionOverwrites.edit(interaction.guild.id, {
  SEND_MESSAGES: false
})

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 MrMythical