Job102|The Little Universe
Job102|The Little Universe
DIAdiscord.js - Imagine an app
Created by Job102|The Little Universe on 6/22/2023 in #djs-questions
interaction.reply and web3 library issue
I receive an error during interaction.reply . I use discord.js (ver. 13.16) and web3 library to send transaction from one account to another and transaction is passed, but after doing it my bot turn off and show me an error:
\node_modules\discord.js\src\rest\RequestHandler.js:350
throw new DiscordAPIError(data, res.status, request);
^

DiscordAPIError: Unknown interaction
\node_modules\discord.js\src\rest\RequestHandler.js:350
throw new DiscordAPIError(data, res.status, request);
^

DiscordAPIError: Unknown interaction
this is code what I use:
if (availableQuantity >= quantity) {
async function withdrawBNB(wallet, quantity) {
// ...
// Transaction logic using web3
// ...
};
withdrawBNB(wallet, quantity)
.then((response) => {
interaction.reply(`You have successfully withdrawn ${quantity} ${cryptoName} to wallet ${wallet}. TxHash: ${response.txHash}`);
})
.catch((error) => {
console.error(error);
interaction.reply('Failed to withdraw BNB. Please try again later.');
});
}
if (availableQuantity >= quantity) {
async function withdrawBNB(wallet, quantity) {
// ...
// Transaction logic using web3
// ...
};
withdrawBNB(wallet, quantity)
.then((response) => {
interaction.reply(`You have successfully withdrawn ${quantity} ${cryptoName} to wallet ${wallet}. TxHash: ${response.txHash}`);
})
.catch((error) => {
console.error(error);
interaction.reply('Failed to withdraw BNB. Please try again later.');
});
}
7 replies
DIAdiscord.js - Imagine an app
Created by Job102|The Little Universe on 6/6/2023 in #djs-questions
Icon in embed .addFields msg
How I may input this teeny-weeny icon to value in .addField in my embed msg. For example I have something like this: .addFields({ name: 'Account:', value: You have [here I want input my icon] }); Is it possible in djs v.13 ?
6 replies