Not able to ta roles in Discord

I’m trying to create a bot that sends a message to a channel in Discord and tagging a custom role for the server but I’m unable to actually get it to tag. It just shows as normal text (AKA: @mediabuyer)

Any tips on how to make it work?

Information on your n8n setup

  • n8n version:: 1.25.1
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • n8n EXECUTIONS_PROCESS setting (default: own, main): default
  • Operating system: I don’t know

WORKFLOW:
{
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “2585abe1efb938917d28de49b9d3e9c5a474780662015cadd3f33854df4f952a”
},
“nodes”: [
{
“parameters”: {
“rule”: {
“interval”: [
{
“field”: “weeks”,
“triggerAtDay”: [
1,
2,
3,
5,
0,
6,
4
],
“triggerAtHour”: 20,
“triggerAtMinute”: 30
}
]
}
},
“id”: “f3f5b1d7-c978-46e7-8122-e846c6578ce6”,
“name”: “Schedule Trigger1”,
“type”: “n8n-nodes-base.scheduleTrigger”,
“typeVersion”: 1,
“position”: [
820,
580
],
“disabled”: true
},
{
“parameters”: {
“resource”: “message”,
“guildId”: {
“__rl”: true,
“value”: “1095279318961238046”,
“mode”: “list”,
“cachedResultName”: “Byggvekst”,
“cachedResultUrl”: “Discord
},
“channelId”: {
“__rl”: true,
“value”: “1151832989395865630”,
“mode”: “list”,
“cachedResultName”: “:computer:-media-buyer”,
“cachedResultUrl”: “Discord
},
“content”: “@Mediabuyer REMINDER”,
“options”: {}
},
“id”: “5197ffaa-4387-44b4-b787-84c735f80fea”,
“name”: “Discord3”,
“type”: “n8n-nodes-base.discord”,
“typeVersion”: 2,
“position”: [
1040,
580
],
“credentials”: {
“discordBotApi”: {
“id”: “3TGl73tLi7cHrE7O”,
“name”: “Discord Bot account”
}
}
}
],
“connections”: {
“Schedule Trigger1”: {
“main”: [
[
{
“node”: “Discord3”,
“type”: “main”,
“index”: 0
}
]
]
}
},
“pinData”: {}
}

LAST OUTPUT:
[

{

“id”: “1202964851836592178”,

“type”: 0,

“content”: “@mdiabuyer REMINDER”,

“channel_id”: “1151832989395865630”,

“author”: {

“id”: “1196877737017741374”,

“username”: “ByggvekstBot”,

“avatar”: “5e672e66e00d3432b2012d5eaacae723”,

“discriminator”: “0764”,

“public_flags”: 0,

“premium_type”: 0,

“flags”: 0,

“bot”: true,

“banner”: null,

“accent_color”: null,

“global_name”: null,

“avatar_decoration_data”: null,

“banner_color”: null

},

“attachments”: [

],

“embeds”: [

],

“mentions”: [

],

“mention_roles”: [

],

“pinned”: false,

“mention_everyone”: false,

“tts”: false,

“timestamp”: “2024-02-02T13:12:50.684000+00:00”,

“edited_timestamp”: null,

“flags”: 0,

“components”: [

],

“referenced_message”: null

}

]

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hi @pkovereng, welcome to the community!

Discord expects mentions in a slightly different format. Their documentation has a full list, but if you’re looking to mention a single user the required syntax is <@USER_ID>.

In n8n this would look like so (517378703018164236 is my own user ID here):

In Discord this looks like so (compared to @tom in the line before):

image

Hope this helps!

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.