admin管理员组文章数量:1313916
So I've just pleted writing a ping.js, echo.js, guildMemberAdd.js, and guildMemberRemove.js and I'm moving on to writing a ban.js and kick.js and currently all slash mands work except the latest mands which is kick and ban. I keep getting the error that "The reply to this interaction has not been sent or deferred." and I have no idea how to find a solution to it. I originally had it written "return interaction.followUp" and I switched them all to "await interaction.followUp" hoping it'd be the solution the problem, but it seems like that wasn't it. I originally also had it written "run: async (interaction) => {" but then I get the error that "mand.execute" is not a function so I switched it to "async execute (intereaction) {" I've also tried a couple of other things, but still can't seem to find a fix, does anyone have any idea on this? I'll leave my interactionCreate.js and kick.js below
interactionCreate.js
module.exports = {
name: "interactionCreate",
async execute(interaction) {
if (!interaction.isCommand()) return;
const mand = interaction.clientmands.get(interactionmandName);
if (!mand) return;
try {
await mand.execute(interaction);
} catch (err) {
if (err) console.error(err);
await interaction.reply({
content: "An error occured while executing that mand.",
ephemeral: true
});
}
}
}
kick.js
const { SlashCommandBuilder } = require('@discordjs/builders');
const { MessageEmbed } = require("discord.js")
module.exports = {
data: new SlashCommandBuilder()
.setName("kick")
.setDescription("Allows the admin or owner to kick the member.")
.addUserOption((option) => option.setName('user').setDescription('The person who you want to kick').setRequired(true))
.addStringOption(option => option.setName('reason').setDescription('Reason to kick member').setRequired(true)),
async execute (interaction) {
if(!interaction.member.permissions.has("KICK_MEMBERS")) return interaction.followUp({ content: "You do not have the power to kick that member.", ephemeral: true })
const user = interaction.options.getUser('user')
const member = interaction.guild.members.cache.get(user.id) || await interaction.guild.members.fetch(user.id).catch(err => {})
if(!member) return interaction.followUp({ content: "
本文标签:
版权声明:本文标题:javascript - "The reply to this interaction has not been sent or deferred." Is an error I keep getting on disc 内容由网友自发贡献,该文观点仅代表作者本人,
转载请联系作者并注明出处:http://www.betaflare.com/web/1741960841a2407268.html,
本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论