© 2026 Hedgehog Software, LLC
Invalid Form Body
Scheme "attachement" is not supported. Scheme must be one of ('http', 'https').
const { MessageEmbed, MessageAttachment } = require("discord.js"); const countries = require("svg-country-flags/countries.json"); module.exports = { data: new SlashCommandBuilder() .setName("guess") .setDescription("Guess a random flag"), async execute(interaction) { let randomProperty = function (obj) { let keys = Object.keys(obj); let num = keys.length * Math.random() << 0; return `${keys[num]}, ${obj[keys[num]]}`; }; let randCountry = randomProperty(countries); randCountry = randCountry.split(", "); const file = new MessageAttachment(`./node_modules/svg-country-flags/png1000px/${randCountry[0]}.png`); const guessEmbed = new MessageEmbed() .setColor("GREEN") .setTitle("Guess that Flag!") .setDescription(`<t:${countdown}:R>`) .setImage({ url: `attachement://${randCountry[0]}.png`, size: 256 }) interaction.reply({ embeds: [guessEmbed], files: [file] }) }; };