This command generates a random 32 digit minecraft seed in discord - a /mcseed command in the autocode discord slash command builder is necessary to ensure this command works! Thanks to Rico for the help on this one : )
// connects you with the standard library API (stdlib.com)
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
const event = context.params.event; // defines event
const msg = event.content; // defines message
let array = [];
for (let i = 1; i <= 32; i++) {
let number = Math.floor(Math.random() * 9 + 0);
let num = number.toString();
array.push(num);
let neg = [' ', '-'];
let random = Math.floor(Math.random() * neg.length);
if (i === 32) {
await lib.discord.channels['@0.2.2'].messages.create({
channel_id: event.channel_id,
content: '',
embed: {
type: 'rich',
title: `Good luck on your adventure!`,
description: `<@${event.member.user.id}>, Your random minecraft seed is: \`${(random, neg[random])}${array[0]}${array[1]}${array[2]}${array[3]}${array[4]}${array[5]}${array[6]}${array[7]}${array[8]}${array[9]}${array[10]}${array[11]}${array[12]}${array[13]}${array[14]}${array[15]}${array[16]}${array[17]}${array[18]}${array[19]}${array[20]}${array[21]}${array[22]}${array[23]}${array[24]}${array[25]}${array[26]}${array[27]}${array[28]}${array[29]}${array[30]}${array[31]}\``, // sends the generated seed in an embed
color: 0x0d6efd,
},
});
}
}
console.log(array);
console.log(number);
console.log(num);