MrRober
MrRober
DIAdiscord.js - Imagine an app
Created by MrRober on 10/28/2023 in #djs-questions
Get Original message or interaction by id
ty
10 replies
DIAdiscord.js - Imagine an app
Created by MrRober on 10/28/2023 in #djs-questions
Get Original message or interaction by id
const originalInteraction = await channel.messages.fetch(order.interaction_id);
const originalInteraction = await channel.messages.fetch(order.interaction_id);
10 replies
DIAdiscord.js - Imagine an app
Created by MrRober on 10/28/2023 in #djs-questions
Get Original message or interaction by id
it works
10 replies
DIAdiscord.js - Imagine an app
Created by MrRober on 10/28/2023 in #djs-questions
Get Original message or interaction by id
ok, I check it ty
10 replies
DIAdiscord.js - Imagine an app
Created by MrRober on 10/28/2023 in #djs-questions
Get Original message or interaction by id
i will use a function to get it but i don't know if is possible with discord.js
10 replies
DIAdiscord.js - Imagine an app
Created by MrRober on 10/28/2023 in #djs-questions
Get Original message or interaction by id
i want to get the original interaction to edit it
10 replies
DIAdiscord.js - Imagine an app
Created by MrRober on 10/28/2023 in #djs-questions
Get Original message or interaction by id
// Retrieve the welcome embed.
const WelcomeEmbed = await welcomeEmbed();

// Retrieve the service embed using user and Game information.
const ServiceEmbed = await rkServiceEmbed(user, Game);

// Retrieve the service menu selection using the game's ID.
const ServiceMenuSelect = await rkServiceMenuSelect(Game.id);

// Get the original interaction from the order.
const originalInteraction = order.interaction_id;

// Edit the original interaction to update its embeds and components.
await originalInteraction.edit({
embeds: [WelcomeEmbed, ServiceEmbed],
components: [ServiceMenuSelect],
});
// Retrieve the welcome embed.
const WelcomeEmbed = await welcomeEmbed();

// Retrieve the service embed using user and Game information.
const ServiceEmbed = await rkServiceEmbed(user, Game);

// Retrieve the service menu selection using the game's ID.
const ServiceMenuSelect = await rkServiceMenuSelect(Game.id);

// Get the original interaction from the order.
const originalInteraction = order.interaction_id;

// Edit the original interaction to update its embeds and components.
await originalInteraction.edit({
embeds: [WelcomeEmbed, ServiceEmbed],
components: [ServiceMenuSelect],
});
10 replies
DIAdiscord.js - Imagine an app
Created by MrRober on 7/6/2023 in #djs-questions
Help width interactions
like a follow up
9 replies
DIAdiscord.js - Imagine an app
Created by MrRober on 7/6/2023 in #djs-questions
Help width interactions
but when the editReply "await Embeds.EditEmbed(interac, DataOrder); " and "await menuSelect.createMenuSelect(interac,"Platform");" they duplicate te embed and the menu select
9 replies
DIAdiscord.js - Imagine an app
Created by MrRober on 7/6/2023 in #djs-questions
Help width interactions
ok now i have this
DataOrder = {
service: "Not Selected",
platform: "Not Selected",
payment: "Not Selected"
}
const StartOrder = new ButtonBuilder()
.setCustomId('confirm')
.setLabel('Confirm Ban')
.setStyle(ButtonStyle.Success);

const row = new ActionRowBuilder()
.addComponents(StartOrder);



await interaction.reply({
components: [row],
});


client.on(Events.InteractionCreate, async interac => {

await Start.StartOrderCode(interac);

if (interac.customId === 'Service') {

await Embeds.EditEmbed(interac, DataOrder);
await menuSelect.createMenuSelect(interac,"Platform");

}

});
DataOrder = {
service: "Not Selected",
platform: "Not Selected",
payment: "Not Selected"
}
const StartOrder = new ButtonBuilder()
.setCustomId('confirm')
.setLabel('Confirm Ban')
.setStyle(ButtonStyle.Success);

const row = new ActionRowBuilder()
.addComponents(StartOrder);



await interaction.reply({
components: [row],
});


client.on(Events.InteractionCreate, async interac => {

await Start.StartOrderCode(interac);

if (interac.customId === 'Service') {

await Embeds.EditEmbed(interac, DataOrder);
await menuSelect.createMenuSelect(interac,"Platform");

}

});
9 replies
DIAdiscord.js - Imagine an app
Created by MrRober on 7/2/2023 in #djs-questions
Help with command!
I just want if possible a basic example of this thanks and sry for the inconvenience
10 replies
DIAdiscord.js - Imagine an app
Created by MrRober on 7/2/2023 in #djs-questions
Help with command!
but nsend the error
10 replies
DIAdiscord.js - Imagine an app
Created by MrRober on 7/2/2023 in #djs-questions
Help with command!
and y try to edit reply on the StartOrderCode
10 replies
DIAdiscord.js - Imagine an app
Created by MrRober on 7/2/2023 in #djs-questions
Help with command!
const start = new ButtonBuilder()
.setCustomId('startorder')
.setLabel('Start Order')
.setStyle(ButtonStyle.Success);

const row = new ActionRowBuilder()
.addComponents( start );

interaction.reply({
components: [row]
});
const start = new ButtonBuilder()
.setCustomId('startorder')
.setLabel('Start Order')
.setStyle(ButtonStyle.Success);

const row = new ActionRowBuilder()
.addComponents( start );

interaction.reply({
components: [row]
});
10 replies
DIAdiscord.js - Imagine an app
Created by MrRober on 7/2/2023 in #djs-questions
Help with command!
Button start order:
10 replies
DIAdiscord.js - Imagine an app
Created by MrRober on 7/2/2023 in #djs-questions
Help with command!
Error: The reply to this interacion has not been sent or deferred
10 replies
DIAdiscord.js - Imagine an app
Created by MrRober on 7/2/2023 in #djs-questions
Help with command!
client.on('interactionCreate',async interac => {
try{

if(interac.customId === 'startorder'){
await Start.StartOrderCode(interac);
}


if (interac.isStringSelectMenu()) {
if(interac.customId === 'Service'){
DataOrder.service = interac.values[0];

await menuSelect.createMenuSelect(interac,"Platform");
await Embeds.EditEmbed(interac, DataOrder);
}

if(interac.customId === 'Platform'){
DataOrder.platform = interac.values[0];
await Embeds.EditEmbed(interac, DataOrder);
await menuSelect.createMenuSelect(interac,"Payment");


}

if(interac.customId === 'Payment'){
DataOrder.payment = interac.values[0];
await Embeds.EditEmbed(interac, DataOrder);
//await MenuSelect(interaction,"Platform");
await buttons.buttonConfirmCancelOrder(interac)
await interac.deferUpdate();
}

}


if(interac.customId === 'confirm'){
await Thread.CreateTicketThreads(interaction, interac, DataOrder);
await interac.deleteReply()
}
}catch(e){
interac.reply({content: 'Error: ' + e});
}
});
client.on('interactionCreate',async interac => {
try{

if(interac.customId === 'startorder'){
await Start.StartOrderCode(interac);
}


if (interac.isStringSelectMenu()) {
if(interac.customId === 'Service'){
DataOrder.service = interac.values[0];

await menuSelect.createMenuSelect(interac,"Platform");
await Embeds.EditEmbed(interac, DataOrder);
}

if(interac.customId === 'Platform'){
DataOrder.platform = interac.values[0];
await Embeds.EditEmbed(interac, DataOrder);
await menuSelect.createMenuSelect(interac,"Payment");


}

if(interac.customId === 'Payment'){
DataOrder.payment = interac.values[0];
await Embeds.EditEmbed(interac, DataOrder);
//await MenuSelect(interaction,"Platform");
await buttons.buttonConfirmCancelOrder(interac)
await interac.deferUpdate();
}

}


if(interac.customId === 'confirm'){
await Thread.CreateTicketThreads(interaction, interac, DataOrder);
await interac.deleteReply()
}
}catch(e){
interac.reply({content: 'Error: ' + e});
}
});
10 replies
DIAdiscord.js - Imagine an app
Created by MrRober on 6/29/2023 in #djs-questions
Button that sends a form and a select menu that are updated does not work
can you give me an example please
8 replies
DIAdiscord.js - Imagine an app
Created by MrRober on 6/29/2023 in #djs-questions
Button that sends a form and a select menu that are updated does not work
DiscordAPIError[40060]: Interaction has already been acknowledged.
at handleErrors (C:\Users\Rober\Desktop\BotLocal\node_modules\@discordjs\rest\dist\index.js:640:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async BurstHandler.runRequest (C:\Users\Rober\Desktop\BotLocal\node_modules\@discordjs\rest\dist\index.js:736:23)
at async REST.request (C:\Users\Rober\Desktop\BotLocal\node_modules\@discordjs\rest\dist\index.js:1387:22)
at async StringSelectMenuInteraction.reply (C:\Users\Rober\Desktop\BotLocal\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:111:5) {
requestBody: {
files: [],
json: {
type: 4,
data: {
content: 'Error: DiscordAPIError[10062]: Unknown interaction',
tts: false,
nonce: undefined,
embeds: undefined,
components: undefined,
username: undefined,
avatar_url: undefined,
allowed_mentions: undefined,
flags: undefined,
message_reference: undefined,
attachments: undefined,
sticker_ids: undefined,
thread_name: undefined
}
}
},
rawError: {
message: 'Interaction has already been acknowledged.',
code: 40060
},
code: 40060,
status: 400,
method: 'POST',
url: 'https://discord.com/api/v10/interactions/1124059012292423711/aW50ZXJhY3Rpb246MTEyNDA1OTAxMjI5MjQyMzcxMTo2TnkzbjVhNHBsQldKend4R2Fvem9YN0ZIOHFaMExKbEhjOTdRa1h0OGhRVTlVb091STFkR3ZDbWp3TzBBbFFOSDZWQWFyOUl1VEpBVG1lVVFCRkg0RWI4WDhWV0RYU0RGdlBvOHFPYzFtN3EzZ3k0QWhuNU1xM3hQWUxCV0JaVg/callback'
}
DiscordAPIError[40060]: Interaction has already been acknowledged.
at handleErrors (C:\Users\Rober\Desktop\BotLocal\node_modules\@discordjs\rest\dist\index.js:640:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async BurstHandler.runRequest (C:\Users\Rober\Desktop\BotLocal\node_modules\@discordjs\rest\dist\index.js:736:23)
at async REST.request (C:\Users\Rober\Desktop\BotLocal\node_modules\@discordjs\rest\dist\index.js:1387:22)
at async StringSelectMenuInteraction.reply (C:\Users\Rober\Desktop\BotLocal\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:111:5) {
requestBody: {
files: [],
json: {
type: 4,
data: {
content: 'Error: DiscordAPIError[10062]: Unknown interaction',
tts: false,
nonce: undefined,
embeds: undefined,
components: undefined,
username: undefined,
avatar_url: undefined,
allowed_mentions: undefined,
flags: undefined,
message_reference: undefined,
attachments: undefined,
sticker_ids: undefined,
thread_name: undefined
}
}
},
rawError: {
message: 'Interaction has already been acknowledged.',
code: 40060
},
code: 40060,
status: 400,
method: 'POST',
url: 'https://discord.com/api/v10/interactions/1124059012292423711/aW50ZXJhY3Rpb246MTEyNDA1OTAxMjI5MjQyMzcxMTo2TnkzbjVhNHBsQldKend4R2Fvem9YN0ZIOHFaMExKbEhjOTdRa1h0OGhRVTlVb091STFkR3ZDbWp3TzBBbFFOSDZWQWFyOUl1VEpBVG1lVVFCRkg0RWI4WDhWV0RYU0RGdlBvOHFPYzFtN3EzZ3k0QWhuNU1xM3hQWUxCV0JaVg/callback'
}
8 replies
DIAdiscord.js - Imagine an app
Created by MrRober on 6/29/2023 in #djs-questions
Button that sends a form and a select menu that are updated does not work
{
"name": "discord-bot",
"version": "1.0.0",
"description": "",
"main": "src/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@paypal/checkout-server-sdk": "^1.0.3",
"discord.js": "^14.11.0",
"dotenv": "^16.0.3",
"express": "^4.18.2"
}
}
{
"name": "discord-bot",
"version": "1.0.0",
"description": "",
"main": "src/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@paypal/checkout-server-sdk": "^1.0.3",
"discord.js": "^14.11.0",
"dotenv": "^16.0.3",
"express": "^4.18.2"
}
}
8 replies