When used it will send an embed to a user which will warn them for their issues. Please be sure to set everything up correctly though.
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
await lib.discord.users['@0.2.0'].dms.create({
recipient_id: `${context.params.event.data.options[0].value}`,
"content": "",
"tts": false,
"components": [
{
"type": 1,
"components": [
{
"style": 1,
"label": `${context.params.event.member.user.username}`,
"custom_id": `row_0_button_0`,
"disabled": true,
"emoji": {
"id": null,
"name": `❕`
},
"type": 2
}
]
}
],
"embeds": [
{
"type": "rich",
"title": `Warned`,
"description": "",
"color": 0x6a0909,
"fields": [
{
"name": "\u200B",
"value": `You were warned for the following reason stated below. `
},
{
"name": "\u200B",
"value": `\`\`\`\nModerator: ${context.params.event.member.user.username}\n\nOffender: @${context.params.event.data.options[0].value}\n\nReason: ${context.params.event.data.options[1].value}\n\`\`\``
}
],
"footer": {
"text": `Please do not reapeat your actions`
}
}
]
});
await lib.discord.channels['@0.3.0'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: `<@${context.params.event.data.options[0].value}> was warned`
});
await lib.discord.channels['@0.3.0'].messages.create({
channel_id: "1034300657697566740",
"content": "",
"tts": false,
"components": [
{
"type": 1,
"components": [
{
"style": 1,
"label": `${context.params.event.member.user.username}`,
"custom_id": `row_0_button_0`,
"disabled": true,
"emoji": {
"id": null,
"name": `❕`
},
"type": 2
}
]
}
],
"embeds": [
{
"type": "rich",
"title": `Warned`,
"description": "",
"color": 0x6a0909,
"fields": [
{
"name": "\u200B",
"value": `You were warned for the following reason stated below. `
},
{
"name": "\u200B",
"value": `\`\`\`\nModerator: ${context.params.event.member.user.username}\n\nOffender: @${context.params.event.data.options[0].value}\n\nReason: ${context.params.event.data.options[1].value}\n\`\`\``
}
],
"footer": {
"text": `Please do not reapeat your actions`
}
}
]
});