Simple report command, make sure to go setup the slash command in https://autocode.com/tools/discord/command-builder/ and set it up with `USER` `STRING` `STRING` in the options menu once that is done, you are already to go! Happy Hacking :D
// authenticates you with the API standard library
// type `await lib.` to display API autocomplete
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
const now = new Date();
const m = now.getMonth() + 1; // 0 index based
const d = now.getDate();
const h = now.getHours();
const min = now.getMinutes();
const dateText = `${m}/${d}, ${h}:${min}`; // -> "6/6, 15:19"
let userId = context.params.event.data.options[0].value;
let proof = context.params.event.data.options[1].value;
let reason = context.params.event.data.options[2].value;
await lib.discord.channels['@0.1.0'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: `Successfully reported <@!${userId}>`,
});
await lib.discord.channels['@0.1.1'].messages.create({
channel_id: `${process.env.REPORTCHANNEL}`,
content: '**Report**',
tts: false,
embed: {
type: 'rich',
title: 'Reports',
description: `A User was reported on the ${process.env.SERVERNAME}`,
color: 0xe09f3e,
fields: [
{
name: 'User Reported',
value: `<@!${userId}>`,
},
{
name: 'Proof',
value: `${proof}`,
},
{
name: 'Reason',
value: `${reason}`,
},
{
name: 'Reported by',
value: `<@!${context.params.event.member.user.id}>`,
},
{
name: 'Time |',
value: `${dateText} UTC`,
},
],
},
});