I want to ping a role from config.json with discord.js

Do I have to do it like this Ex: <@&{congif.ownersRoleid}> ??
22 Replies
d.js toolkit
d.js toolkit2y ago
- What's your exact discord.js npm list discord.js and node node -v version? - Post the full error stack trace, not just the top part! - Show your code! - Explain what exactly your issue is. - Not a discord.js issue? Check out #useful-servers. - Issue solved? Press the button!
treble/luna
treble/luna2y ago
yes Or if you have the role object you can stringify it
xjanex
xjanexOP2y ago
But when I write it with the example I erote it don't ping it
treble/luna
treble/luna2y ago
what show how you do it
xjanex
xjanexOP2y ago
Gemme a min
xjanex
xjanexOP2y ago
xjanex
xjanexOP2y ago
it doesnt ping it
d.js docs
d.js docs2y ago
mdn Template literals (Template strings) Template literals are literals delimited with backtick (`) characters, allowing for multi-line strings, string interpolation with embedded expressions, and special constructs called tagged templates.
xjanex
xjanexOP2y ago
what is this
treble/luna
treble/luna2y ago
thats basic js becauqe putting your value between {} wont magically make it appear
xjanex
xjanexOP2y ago
so betwenn what? () or []
treble/luna
treble/luna2y ago
Read.
xjanex
xjanexOP2y ago
` this?
treble/luna
treble/luna2y ago
Literally just read
xjanex
xjanexOP2y ago
k i dont understant can u just tell me where do i put config.ownersRoleid
treble/luna
treble/luna2y ago
this is rather basic js the docs cannot be more clear, it even has examples
xjanex
xjanexOP2y ago
just tell FeelsBadMan tried and didnt work
treble/luna
treble/luna2y ago
how did you try
xjanex
xjanexOP2y ago
it said ${}
treble/luna
treble/luna2y ago
Yes, and backticks
xjanex
xjanexOP2y ago
where do i put the backticks
treble/luna
treble/luna2y ago
around your string at this point this is not djs anymore, this is basic js
Want results from more Discord servers?
Add your server