interaction deferreply
i used interaction.deferReply but console tells me haven't
const { SlashCommandBuilder, PermissionFlagsBits, EmbedBuilder } = require('discord.js');
module.exports = {
data: new SlashCommandBuilder()
.setName('eve')
.setDescription('Select status of event.')
.addSubcommand(subcommand =>
subcommand
.setName('status')
.setDescription('The status of the event.')
.addStringOption(option =>
option
.setName('sta')
.setDescription('Status of event.')
.setRequired(true)
.addChoices(
{ name: 'Accept', value: 'acc' },
{ name: 'Deny', value: 'deny' },
{ name: 'Pending', value: 'ped' },
)
)
)
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.setDMPermission(false),
async execute(interaction) {
const sta = interaction.options.getString('sta');
const error = new EmbedBuilder()
.setColor('Red')
.setTitle(`Error`)
.setDescription(`Commmand error`);
function Accept() {
interaction.deferReply();
interaction.editReply('222222');
interaction.channel.send('111');
}
function Deny() {
interaction.channel.send('111133331');
interaction.editReply(
`Status of this ticket has been changed to 🟢 - **ACCEPT**.
We will offer Supervisions, when we are free to do that.
:pushpin: Our Staff are notified about this event at the right time !
>Please modify your event rules to the rules we need, and add our banner on the TMP event page
Thanks for your choose us understanding! :huge:
**Kind Regards,**
**1111**
**Marking | Event Manager / Event Supervisions**`);
}
function Pending() {
interaction.channel.send('222222');
interaction.deferReply();
interaction.editReply({ content: 'Success!', ephemeral: true });
}
if (sta == 'acc') {
Accept();
}
else if (sta == 'deny') {
Deny();
}
else if (sta == 'ped') {
Pending();
}
else
{
interaction.deferReply();
interaction.editReply(
{embed:[error],
});
return;
}
},
};
const { SlashCommandBuilder, PermissionFlagsBits, EmbedBuilder } = require('discord.js');
module.exports = {
data: new SlashCommandBuilder()
.setName('eve')
.setDescription('Select status of event.')
.addSubcommand(subcommand =>
subcommand
.setName('status')
.setDescription('The status of the event.')
.addStringOption(option =>
option
.setName('sta')
.setDescription('Status of event.')
.setRequired(true)
.addChoices(
{ name: 'Accept', value: 'acc' },
{ name: 'Deny', value: 'deny' },
{ name: 'Pending', value: 'ped' },
)
)
)
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.setDMPermission(false),
async execute(interaction) {
const sta = interaction.options.getString('sta');
const error = new EmbedBuilder()
.setColor('Red')
.setTitle(`Error`)
.setDescription(`Commmand error`);
function Accept() {
interaction.deferReply();
interaction.editReply('222222');
interaction.channel.send('111');
}
function Deny() {
interaction.channel.send('111133331');
interaction.editReply(
`Status of this ticket has been changed to 🟢 - **ACCEPT**.
We will offer Supervisions, when we are free to do that.
:pushpin: Our Staff are notified about this event at the right time !
>Please modify your event rules to the rules we need, and add our banner on the TMP event page
Thanks for your choose us understanding! :huge:
**Kind Regards,**
**1111**
**Marking | Event Manager / Event Supervisions**`);
}
function Pending() {
interaction.channel.send('222222');
interaction.deferReply();
interaction.editReply({ content: 'Success!', ephemeral: true });
}
if (sta == 'acc') {
Accept();
}
else if (sta == 'deny') {
Deny();
}
else if (sta == 'ped') {
Pending();
}
else
{
interaction.deferReply();
interaction.editReply(
{embed:[error],
});
return;
}
},
};
7 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
but await can't use in distribute step
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
let me try
still that
const { SlashCommandBuilder, PermissionFlagsBits, EmbedBuilder } = require('discord.js');
module.exports = {
data: new SlashCommandBuilder()
.setName('eve')
.setDescription('Select status of event.')
.addSubcommand(subcommand =>
subcommand
.setName('status')
.setDescription('The status of the event.')
.addStringOption(option =>
option
.setName('sta')
.setDescription('Status of event.')
.setRequired(true)
.addChoices(
{ name: 'Accept', value: 'acc' },
{ name: 'Deny', value: 'deny' },
{ name: 'Pending', value: 'ped' },
)
)
)
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.setDMPermission(false),
async execute(interaction) {
const sta = interaction.options.getString('sta');
const error = new EmbedBuilder()
.setColor('Red')
.setTitle(`Error`)
.setDescription(`Commmand error`);
async function Accept() {
interaction.deferReply();
await interaction.editReply('222222');
interaction.channel.send('111');
}
async function Deny() {
interaction.channel.send('111133331');
await interaction.editReply(
`Status of this ticket has been changed to 🟢 - **ACCEPT**.
We will offer Supervisions, when we are free to do that.
:pushpin: Our Staff are notified about this event at the right time !
>Please modify your event rules to the rules we need, and add our banner on the TMP event page
Thanks for your choose us understanding! :huge:
**Kind Regards,**
**1111**
**Marking | Event Manager / Event Supervisions**`);
}
async function Pending() {
interaction.channel.send('222222');
await interaction.deferReply();
interaction.editReply({ content: 'Success!', ephemeral: true });
}
if (sta == 'acc') {
Accept();
}
else if (sta == 'deny') {
Deny();
}
else if (sta == 'ped') {
Pending();
}
else
{
interaction.deferReply();
interaction.editReply(
{embed:[error],
});
return;
}
},
};
const { SlashCommandBuilder, PermissionFlagsBits, EmbedBuilder } = require('discord.js');
module.exports = {
data: new SlashCommandBuilder()
.setName('eve')
.setDescription('Select status of event.')
.addSubcommand(subcommand =>
subcommand
.setName('status')
.setDescription('The status of the event.')
.addStringOption(option =>
option
.setName('sta')
.setDescription('Status of event.')
.setRequired(true)
.addChoices(
{ name: 'Accept', value: 'acc' },
{ name: 'Deny', value: 'deny' },
{ name: 'Pending', value: 'ped' },
)
)
)
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.setDMPermission(false),
async execute(interaction) {
const sta = interaction.options.getString('sta');
const error = new EmbedBuilder()
.setColor('Red')
.setTitle(`Error`)
.setDescription(`Commmand error`);
async function Accept() {
interaction.deferReply();
await interaction.editReply('222222');
interaction.channel.send('111');
}
async function Deny() {
interaction.channel.send('111133331');
await interaction.editReply(
`Status of this ticket has been changed to 🟢 - **ACCEPT**.
We will offer Supervisions, when we are free to do that.
:pushpin: Our Staff are notified about this event at the right time !
>Please modify your event rules to the rules we need, and add our banner on the TMP event page
Thanks for your choose us understanding! :huge:
**Kind Regards,**
**1111**
**Marking | Event Manager / Event Supervisions**`);
}
async function Pending() {
interaction.channel.send('222222');
await interaction.deferReply();
interaction.editReply({ content: 'Success!', ephemeral: true });
}
if (sta == 'acc') {
Accept();
}
else if (sta == 'deny') {
Deny();
}
else if (sta == 'ped') {
Pending();
}
else
{
interaction.deferReply();
interaction.editReply(
{embed:[error],
});
return;
}
},
};
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
3 actually :dogeHaHa: