module.exports = {
data: new SlashCommandBuilder()
.setName('echo')
.setDescription('Repeat what the user says in the form of a webhook.')
.addStringOption(option =>
option.setName('prompt')
.setDescription('The message content to be echoed')
.setRequired(true)),
async execute(interaction) {
const content = interaction.options.getString('content');
const user = interaction.user;
const { username, avatarURL } = user;
const webhook = await interaction.channel.createWebhook({
name: username,
avatar: avatarURL,
});
await webhook.send(content);
await interaction.reply({ content: 'Success', ephemeral: true });
},
};
module.exports = {
data: new SlashCommandBuilder()
.setName('echo')
.setDescription('Repeat what the user says in the form of a webhook.')
.addStringOption(option =>
option.setName('prompt')
.setDescription('The message content to be echoed')
.setRequired(true)),
async execute(interaction) {
const content = interaction.options.getString('content');
const user = interaction.user;
const { username, avatarURL } = user;
const webhook = await interaction.channel.createWebhook({
name: username,
avatar: avatarURL,
});
await webhook.send(content);
await interaction.reply({ content: 'Success', ephemeral: true });
},
};