Make a slash command in the builder with String Options for `Name, role, aboutu, responsibility` thats all u need to do and then save the slash command this should connect you to this snippet, only change the `id` and the `staff role` in the code, if you dont do this nothing will change, so there you go your staff about me slash command is ready to go!
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
const id = '931882582407266334';
const staffrole = '932253205801361438';
const user = context.params.event.member.user;
const imageUrl = user.avatar
? `https://cdn.discordapp.com/avatars/${user.id}/${user.avatar}.png?size=512`
: 'https://polybit-apps.s3.amazonaws.com/stdlib/users/discord/profile/image.png?1621007833204';
let name = context.params.event.data.options[0].value; //the staff name;
let role = context.params.event.data.options[1].value; //the staff role;
let aboutu = context.params.event.data.options[2].value; //the staff about me section;
let responsibilty = context.params.event.data.options[3].value; //the staff responsibility in the server;
//random color for the embed
let colors = [0xff0000, 0x00ffff, 0xadd8e6, 0x0000ff, 0x800000];
let color = colors[Math.floor(Math.random() * colors.length)];
let member = await lib.discord.guilds['@0.2.2'].members.retrieve({
user_id: `${context.params.event.member.user.id}`,
guild_id: `${context.params.event.guild_id}`,
});
//check if the command is run in the channel
if (context.params.event.channel_id == `${id}`) {
//checks if the user is a staff
if (context.params.event.member.roles.includes(staffrole)) {
//replace this with you staff id.
await lib.discord.channels['@0.2.0'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: '',
tts: false,
embeds: [
{
type: 'rich',
title: `STAFF ABOUT ME`,
description: `I am **${user.username}** and this is my about me section`,
color: color,
fields: [
{
name: `FULL NAME`,
value: `${name}`,
},
{
name: `ROLE`,
value: `${role}`,
},
{
name: `ABOUT ME`,
value: `${aboutu}`,
},
{
name: `RESPONSIBILITY`,
value: `${responsibilty}`,
},
{
name: `ROLES`,
value: member.roles.length
? member.roles.map((x) => `<@&${x}>`).join(' ')
: 'No Roles',
},
],
thumbnail: {
url: imageUrl,
height: 0,
width: 0,
},
timestamp: new Date().toISOString(),
},
],
});
} else {
await lib.discord.channels['@0.3.0'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: `<@${user.id}> you are not allowed to use this, please apply to be one of the staffs.`,
});
}
} else {
await lib.discord.interactions['@0.1.0'].followups.ephemeral.create({
token: `${context.params.event.token}`,
content: `sorry you cant run this in this channel go to the <#${id}>`,
});
}