module.exports = { data: new SlashCommandBuilder() .setName('version') .setDescription('Provides information about the game server.'), async execute(interaction) { request({ url: `https://${restIp}:${restPort}/v1/version`, headers: { 'Authorization': `Bearer ${restToken}`, }, rejectUnauthorized: false, }, function(err, res) { if(err) { console.error(err); } else { let server_version = (res.body), // interaction.user is the object representing the User who ran the command // interaction.member is the GuildMember object, which represents the user in the specific guild await interaction.reply(`${server_version}.`); }, };
fix invalid codeSat, 12 Nov 2022