Better Welcomer! You need to turn on privileged intents from Discord Developer Settings for it to work!
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
let fileRequest = await lib.http.request['@1.1.5']({
method: 'GET',
url: "https://r3al-dev.public.files.stdlib.com/_stdlib/provider/R3al-Dev/images/welcome!.gif"
});
let file = fileRequest.body;
/*
Note to aseboldt aka the cat:
For some reason, when I copied *copy.id* it didnt copy the ID that I wanted to copy.
Instead, I had an old id meaning I probably pasted the wrong ID
Thanks for helping btw.
*/
let guild = await lib.discord.guilds['@0.1.0'].retrieve({
guild_id: `${context.params.event.guild_id}`,
with_counts: true
});
await lib.discord.users['@0.1.1'].dms.create({
recipient_id: `${context.params.event.user.id}`,
"content": "",
"tts": false,
"embed": {
"type": "rich",
"title": "Hey there! 👋",
"description": `Thanks for joining our server, <@!${context.params.event.user.id}>! **Heres A List Of Rules:**`,
"color": 0x00FFFF,
"fields": [
{
"name": "📰 │ Rules - Info",
"value": "• Don't forget to check the rules!"
},
{
"name": "📢 │ Announcements",
"value": "• Check our server daily for every announcement made!"
},
{
"name": "❤️ │ Respect Others - Be Kind",
"value": "• Please respect others and don't use any foul language! Use of foul language will result in a punishment."
},
{
"name": "❓ │ Questions?",
"value": "• Do you have any questions? Then you can ask them to the mods!"
}
],
"image": {
"url": "https://media.giphy.com/media/xUPGGDNsLvqsBOhuU0/giphy.gif",
"height": 100,
"width": 100
},
"footer": {
"text": `Sent from ${guild.name}`
}
}
});