Unknown Interaction

module.exports = {
data: new SlashCommandBuilder()
.setName('hxbuy')
.setDescription('This is used by the administration when a user have bought Hx Cheats')
.addUserOption(option =>
option.setName('user')
.setDescription('The user who bought the HX Cheats.')
.setRequired(true))
.addStringOption(option =>
option.setName('key')
.setDescription('The HX Cheats key it will provide the customer with (Lifetime / Month / Week / 1day)')
.setRequired(true)),
async execute(interaction, client) {
const member = interaction.member;
if (member.roles.cache.has('1089455359921508412')) {

const channel = interaction.channel;


const UserInput = interaction.options.getUser('user') ?? 'No user was provided!'; // The error is here
const Key = interaction.options.getString('key') ?? 'No key was provided!';

interaction.reply({ content: 'The key and message was successfully send!', ephemeral: true })
module.exports = {
data: new SlashCommandBuilder()
.setName('hxbuy')
.setDescription('This is used by the administration when a user have bought Hx Cheats')
.addUserOption(option =>
option.setName('user')
.setDescription('The user who bought the HX Cheats.')
.setRequired(true))
.addStringOption(option =>
option.setName('key')
.setDescription('The HX Cheats key it will provide the customer with (Lifetime / Month / Week / 1day)')
.setRequired(true)),
async execute(interaction, client) {
const member = interaction.member;
if (member.roles.cache.has('1089455359921508412')) {

const channel = interaction.channel;


const UserInput = interaction.options.getUser('user') ?? 'No user was provided!'; // The error is here
const Key = interaction.options.getString('key') ?? 'No key was provided!';

interaction.reply({ content: 'The key and message was successfully send!', ephemeral: true })
42 Replies
d.js toolkit
d.js toolkit2y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Marcus
MarcusOP2y ago
1 sec
Marcus
MarcusOP2y ago
Marcus
MarcusOP2y ago
Further more it says Unkown interaction
d.js docs
d.js docs2y ago
Common causes of DiscordAPIError[10062]: Unknown interaction: • Initial response took more than 3 seconds ➞ defer the response *. • Wrong interaction object inside a collector. * Note: you cannot defer modal or autocomplete value responses
Marcus
MarcusOP2y ago
Marcus
MarcusOP2y ago
How can I fix it? What type would make it work.
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Marcus
MarcusOP2y ago
Because I can't find the interaction type for it Yeah, I've seen it.
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Marcus
MarcusOP2y ago
How do I defer it? O.o
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
d.js docs
d.js docs2y ago
guide Slash Commands: Deferred responses read more
Marcus
MarcusOP2y ago
instead of what?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Marcus
MarcusOP2y ago
and it would fix it?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Marcus
MarcusOP2y ago
This is all
const { SlashCommandBuilder } = require('@discordjs/builders');
const { EmbedBuilder } = require('discord.js')


module.exports = {
data: new SlashCommandBuilder()
.setName('hxbuy')
.setDescription('This is used by the administration when a user have bought Hx Cheats')
.addUserOption(option =>
option.setName('user')
.setDescription('The user who bought the HX Cheats.')
.setRequired(true))
.addStringOption(option =>
option.setName('key')
.setDescription('The HX Cheats key it will provide the customer with (Lifetime / Month / Week / 1day)')
.setRequired(true)),
async execute(interaction, client) {
const member = interaction.member;
if (member.roles.cache.has('1089455359921508412')) {

const channel = interaction.channel;


const UserInput = interaction.options.getUser('user') ?? 'No user was provided!';
const Key = interaction.options.getString('key') ?? 'No key was provided!';


interaction.deferReply()
interaction.editReply({ content: 'The key and message was successfully send!', ephemeral: true })


const hxKey = new EmbedBuilder()
.setTitle('How to get started')
.setDescription(`Your license key ||${Key}||`)
.setColor('#2b2d31')
.setTimestamp()
.setFooter({ text: 'This bot was developed by Marqus#1552', iconURL: 'https://media.discordapp.net/attachments/665912408396660746/1093250384430116994/98550b5d2bf516a0370ddbd463e9f46f.png?width=671&height=671' })
interaction.deferReply()
interaction.editReply({ content: '', embeds: [hxKey] })



channel.send((Key));
} else {
interaction.deferReply()
interaction.editReply({ content: 'You dont have permission to use this command!', ephemeral: true })
}
}
}
const { SlashCommandBuilder } = require('@discordjs/builders');
const { EmbedBuilder } = require('discord.js')


module.exports = {
data: new SlashCommandBuilder()
.setName('hxbuy')
.setDescription('This is used by the administration when a user have bought Hx Cheats')
.addUserOption(option =>
option.setName('user')
.setDescription('The user who bought the HX Cheats.')
.setRequired(true))
.addStringOption(option =>
option.setName('key')
.setDescription('The HX Cheats key it will provide the customer with (Lifetime / Month / Week / 1day)')
.setRequired(true)),
async execute(interaction, client) {
const member = interaction.member;
if (member.roles.cache.has('1089455359921508412')) {

const channel = interaction.channel;


const UserInput = interaction.options.getUser('user') ?? 'No user was provided!';
const Key = interaction.options.getString('key') ?? 'No key was provided!';


interaction.deferReply()
interaction.editReply({ content: 'The key and message was successfully send!', ephemeral: true })


const hxKey = new EmbedBuilder()
.setTitle('How to get started')
.setDescription(`Your license key ||${Key}||`)
.setColor('#2b2d31')
.setTimestamp()
.setFooter({ text: 'This bot was developed by Marqus#1552', iconURL: 'https://media.discordapp.net/attachments/665912408396660746/1093250384430116994/98550b5d2bf516a0370ddbd463e9f46f.png?width=671&height=671' })
interaction.deferReply()
interaction.editReply({ content: '', embeds: [hxKey] })



channel.send((Key));
} else {
interaction.deferReply()
interaction.editReply({ content: 'You dont have permission to use this command!', ephemeral: true })
}
}
}
I got 1000/1000 internet 💀
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Marcus
MarcusOP2y ago
Marcus
MarcusOP2y ago
new err
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Marcus
MarcusOP2y ago
yea
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Marcus
MarcusOP2y ago
and I've alr made the deferReply
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Marcus
MarcusOP2y ago
Marcus
MarcusOP2y ago
const { SlashCommandBuilder } = require('@discordjs/builders');
const { EmbedBuilder } = require('discord.js')


module.exports = {
data: new SlashCommandBuilder()
.setName('hxbuy')
.setDescription('This is used by the administration when a user have bought Hx Cheats')
.addUserOption(option =>
option.setName('user')
.setDescription('The user who bought the HX Cheats.')
.setRequired(true))
.addStringOption(option =>
option.setName('key')
.setDescription('The HX Cheats key it will provide the customer with (Lifetime / Month / Week / 1day)')
.setRequired(true)),
async execute(interaction, client) {
const member = interaction.member;
if (member.roles.cache.has('1089455359921508412')) {

const channel = interaction.channel;


const UserInput = interaction.options.getUser('user') ?? 'No user was provided!';
const Key = interaction.options.getString('key') ?? 'No key was provided!';


await interaction.deferReply()
interaction.editReply({ content: 'The key and message was successfully send!', ephemeral: true })


const hxKey = new EmbedBuilder()
.setTitle('How to get started')
.setDescription(`Your license key ||${Key}||`)
.setColor('#2b2d31')
.setTimestamp()
.setFooter({ text: 'This bot was developed by Marqus#1552', iconURL: 'https://media.discordapp.net/attachments/665912408396660746/1093250384430116994/98550b5d2bf516a0370ddbd463e9f46f.png?width=671&height=671' })
await interaction.deferReply()
interaction.editReply({ content: '', embeds: [hxKey] })



channel.send((Key));
} else {
await interaction.deferReply()
interaction.editReply({ content: 'You dont have permission to use this command!', ephemeral: true })
}
}
}
const { SlashCommandBuilder } = require('@discordjs/builders');
const { EmbedBuilder } = require('discord.js')


module.exports = {
data: new SlashCommandBuilder()
.setName('hxbuy')
.setDescription('This is used by the administration when a user have bought Hx Cheats')
.addUserOption(option =>
option.setName('user')
.setDescription('The user who bought the HX Cheats.')
.setRequired(true))
.addStringOption(option =>
option.setName('key')
.setDescription('The HX Cheats key it will provide the customer with (Lifetime / Month / Week / 1day)')
.setRequired(true)),
async execute(interaction, client) {
const member = interaction.member;
if (member.roles.cache.has('1089455359921508412')) {

const channel = interaction.channel;


const UserInput = interaction.options.getUser('user') ?? 'No user was provided!';
const Key = interaction.options.getString('key') ?? 'No key was provided!';


await interaction.deferReply()
interaction.editReply({ content: 'The key and message was successfully send!', ephemeral: true })


const hxKey = new EmbedBuilder()
.setTitle('How to get started')
.setDescription(`Your license key ||${Key}||`)
.setColor('#2b2d31')
.setTimestamp()
.setFooter({ text: 'This bot was developed by Marqus#1552', iconURL: 'https://media.discordapp.net/attachments/665912408396660746/1093250384430116994/98550b5d2bf516a0370ddbd463e9f46f.png?width=671&height=671' })
await interaction.deferReply()
interaction.editReply({ content: '', embeds: [hxKey] })



channel.send((Key));
} else {
await interaction.deferReply()
interaction.editReply({ content: 'You dont have permission to use this command!', ephemeral: true })
}
}
}
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Marcus
MarcusOP2y ago
Idk It's just a pure beta ver / test atm Ig it's a mistake Waaait How can I send a dm to the person who I put into the userInput of my slashcommand? 🙂
d.js docs
d.js docs2y ago
method User#send() Sends a message to this user.
Marcus
MarcusOP2y ago
Why does it give me this err again'
Marcus
MarcusOP2y ago
Marcus
MarcusOP2y ago
const { SlashCommandBuilder } = require('@discordjs/builders');
const { EmbedBuilder } = require('discord.js')


module.exports = {
data: new SlashCommandBuilder()
.setName('hxbuy')
.setDescription('This is used by the administration when a user have bought Hx Cheats')
.addUserOption(option =>
option.setName('user')
.setDescription('The user who bought the HX Cheats.')
.setRequired(true))
.addStringOption(option =>
option.setName('key')
.setDescription('The HX Cheats key it will provide the customer with (Lifetime / Month / Week / 1day)')
.setRequired(true)),
async execute(interaction, client) {
const member = interaction.member;
if (member.roles.cache.has('1089455359921508412')) {

const channel = interaction.channel;


const UserInput = interaction.options.getUser('user') ?? 'No user was provided!';
const Key = interaction.options.getString('key') ?? 'No key was provided!';


interaction.reply({ content: 'The key and message was successfully send!', ephemeral: true })


const hxKey = new EmbedBuilder()
.setTitle('How to get started')
.setDescription(`Your license key ||${Key}||`)
.setColor('#2b2d31')
.setTimestamp()
.setFooter({ text: 'This bot was developed by Marqus#1552', iconURL: 'https://media.discordapp.net/attachments/665912408396660746/1093250384430116994/98550b5d2bf516a0370ddbd463e9f46f.png?width=671&height=671' })
// interaction.deferReply()
// await interaction.editReply({ content: '', embeds: [hxKey] })
UserInput.user.send({ content: '', embeds: [hxKey] });


channel.send((Key));
} else {
interaction.reply({ content: 'You dont have permission to use this command!', ephemeral: true })
}
}
}
const { SlashCommandBuilder } = require('@discordjs/builders');
const { EmbedBuilder } = require('discord.js')


module.exports = {
data: new SlashCommandBuilder()
.setName('hxbuy')
.setDescription('This is used by the administration when a user have bought Hx Cheats')
.addUserOption(option =>
option.setName('user')
.setDescription('The user who bought the HX Cheats.')
.setRequired(true))
.addStringOption(option =>
option.setName('key')
.setDescription('The HX Cheats key it will provide the customer with (Lifetime / Month / Week / 1day)')
.setRequired(true)),
async execute(interaction, client) {
const member = interaction.member;
if (member.roles.cache.has('1089455359921508412')) {

const channel = interaction.channel;


const UserInput = interaction.options.getUser('user') ?? 'No user was provided!';
const Key = interaction.options.getString('key') ?? 'No key was provided!';


interaction.reply({ content: 'The key and message was successfully send!', ephemeral: true })


const hxKey = new EmbedBuilder()
.setTitle('How to get started')
.setDescription(`Your license key ||${Key}||`)
.setColor('#2b2d31')
.setTimestamp()
.setFooter({ text: 'This bot was developed by Marqus#1552', iconURL: 'https://media.discordapp.net/attachments/665912408396660746/1093250384430116994/98550b5d2bf516a0370ddbd463e9f46f.png?width=671&height=671' })
// interaction.deferReply()
// await interaction.editReply({ content: '', embeds: [hxKey] })
UserInput.user.send({ content: '', embeds: [hxKey] });


channel.send((Key));
} else {
interaction.reply({ content: 'You dont have permission to use this command!', ephemeral: true })
}
}
}
What? What do you mean by that So you can't make coin systems? It's not using real money
souji
souji2y ago
discord does not allow the distribution of cheats, hacks and cracked accounts on the platform
Marcus
MarcusOP2y ago
Alr
souji
souji2y ago
and unless your product is called "Hx Cheats" for some other reason, yes, what you are doing is not allowed on this platform and we do not provide support for any toolkits related to it
Marcus
MarcusOP2y ago
so I got reported?
souji
souji2y ago
i don't know what people report, this is a public server, i am iterating on the question above
Marcus
MarcusOP2y ago
Alr well, thx you can just close this then
Want results from more Discord servers?
Add your server