update
This commit is contained in:
25
commands/main/weather.js
Normal file
25
commands/main/weather.js
Normal file
@ -0,0 +1,25 @@
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
name: "weather",
|
||||
description: "Get the weather for a location",
|
||||
private: false,
|
||||
options: [{
|
||||
name: "location",
|
||||
description: "The data you would like inside of the QR",
|
||||
required: true,
|
||||
type: 3 // 6 is type USER
|
||||
}],
|
||||
run: async (client, interaction) => {
|
||||
let encodedLocation = encodeURIComponent(interaction.options._hoistedOptions[0].value);
|
||||
let location = interaction.options._hoistedOptions[0].value;
|
||||
|
||||
const embed = new EmbedBuilder()
|
||||
.setColor("#FF0000")
|
||||
.setTitle(`The weather for: ${location}`)
|
||||
.setTimestamp()
|
||||
.setImage(`https://wttr.in/${encodedLocation}.png`)
|
||||
.setFooter({ text: `Requested by ${interaction.user.tag}`, iconURL: `${interaction.user.displayAvatarURL()}` });
|
||||
await interaction.editReply({ embeds: [embed] });
|
||||
},
|
||||
};
|
Reference in New Issue
Block a user