Bene
DIAdiscord.js - Imagine an app
•Created by Bene on 9/23/2023 in #djs-questions
Attachment to Embed
4 replies
DIAdiscord.js - Imagine an app
•Created by Bene on 9/16/2023 in #djs-questions
Can't Edit Message in DM
I can't edit a message in DM
Code:
https://pastebin.com/PQ2n0gvZ
Error:
https://pastebin.com/MZcrkSzP
Obliviously the error indicates that the message isn't in a channel so it also isn't in the cache. I know this but I also couldn't find any working solution for this problem online.
Thanks for any help ^^
2 replies
DIAdiscord.js - Imagine an app
•Created by Bene on 1/18/2023 in #djs-questions
Interaction already been acknowledged
Code:
Error:
Unhandled promise rejection: DiscordAPIError: Interaction has already been acknowledged.
at RequestHandler.execute (C:\Users\freie\Desktop\Strandbots\nightbot\node_modules\discord.js\src\rest\RequestHandler.js:350:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async RequestHandler.push (C:\Users\freie\Desktop\Strandbots\nightbot\node_modules\discord.js\src\rest\RequestHandler.js:51:14)
at async ButtonInteraction.update (C:\Users\freie\Desktop\Strandbots\nightbot\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:218:5)
at async Client.<anonymous> (C:\Users\freie\Desktop\Strandbots\nightbot\main.js:36:3) {
method: 'post',
path: '/interactions/1065263126636937216/aW50ZXJhY3Rpb246MTA2NTI2MzEyNjYzNjkzNzIxNjo0WFpEOVlNNTdhUFQ1SGNGUWRUM1VIR3Z5cnB5bFEwUFp0dkhvMWFhd0pLSDlRRWIwMmY0QmZXMWxnNVpmelBGU
FNvWUVSMzFNNFZwM29TVUkzeXM1TGFFMVNFWWRTeVNZM0s0NDE0N0hpbDFHMG5rTmtZUEVUa3ZaWHg2NzZkRQ/callback',
code: 40060,
httpStatus: 400,
requestData: { json: { type: 7, data: [Object] }, files: [] }
}
3 replies
DIAdiscord.js - Imagine an app
•Created by Bene on 1/14/2023 in #djs-questions
DiscordAPIError: Interaction has already been acknowledged.
At this part of my code the Bot should reply to the interaction and also should ban the member (I got the id of the member in the interaction custom id)
Error:
16 replies
DIAdiscord.js - Imagine an app
•Created by Bene on 1/7/2023 in #djs-questions
Button UserID push through
So I have a Event where the Bot sends a Welcome-Message with a Button to Welcome the User, similar to the Discord in-build function so to get like the name into the InteractionCreate Event I need to push it through with the button ID I guess. But how can I Filter the button Interaction then bc I have multiple and normally you would filter it with the interaction.customid but here I can't I guess so how do I filter it?
30 replies
DIAdiscord.js - Imagine an app
•Created by Bene on 12/9/2022 in #djs-questions
roleMembers.slice is not a function
So I have a problem: I wan't to fetch members and see if they have a role and then get the first then and splice them so I can do something with every single members of those 10 but I can't even splice them
Code:
Error:
4 replies
DIAdiscord.js - Imagine an app
•Created by Bene on 12/5/2022 in #djs-questions
How to do two interaction
so i have a really dumb question, but i don't know what to do
This is my code i want to reply to the interaction and then update it but it's not working.
Discordjs v13.12.0
59 replies
DIAdiscord.js - Imagine an app
•Created by Bene on 12/3/2022 in #djs-questions
Discord Welcome Button
I try to make the Welcome Button from Discord in a Bot but i dont know how i get the ID from the Joined user to the interactionCreate of the Bot
35 replies
DIAdiscord.js - Imagine an app
•Created by Bene on 12/3/2022 in #djs-questions
MY Code is not working
client.on("guildMemberAdd", async member => {
const canvas = Canvas.createCanvas(1772, 633);
const ctx = canvas.getContext('2d');
const background = await Canvas.loadImage(
./welcome.png
);
ctx.drawImage(background, 0, 0, canvas.width, canvas.height);
ctx.strokeStyle = '#f2f2f2';
ctx.strokeRect(0, 0, canvas.width, canvas.height);
var textString3 = ${member.user.username}
;
if (textString3.length >= 14) {
ctx.font = 'bold 100px Genta';
ctx.fillStyle = '#f2f2f2';
ctx.fillText(textString3, 720, canvas.height / 2 + 20);
}
else {
ctx.font = 'bold 150px Genta';
ctx.fillStyle = '#f2f2f2';
ctx.fillText(textString3, 720, canvas.height / 2 + 20);
}
var textString2 = #${member.user.discriminator}
;
ctx.font = 'bold 40px Genta';
ctx.fillStyle = '#f2f2f2';
ctx.fillText(textString2, 730, canvas.height / 2 + 58);
var textString4 = Member #${member.guild.memberCount}
;
ctx.font = 'bold 60px Genta';
ctx.fillStyle = '#f2f2f2';
ctx.fillText(textString4, 750, canvas.height / 2 + 125);
var textString4 = ${member.guild.name}
;
ctx.font = 'bold 60px Genta';
ctx.fillStyle = '#f2f2f2';
ctx.beginPath();
ctx.arc(315, canvas.height / 2, 250, 0, Math.PI * 2, true);
ctx.closePath();
ctx.clip();
const avatar = await Canvas.loadImage(member.user.displayAvatarURL({ format: 'jpg' }));
ctx.drawImage(avatar, 65, canvas.height / 2 - 250, 500, 500);
const attachment = new MessageAttachment(canvas.toBuffer(), 'welcome-image.png');
const row = new MessageActionRow()
.addComponents(
new MessageButton()
.setTitle('Begrüßen')
.setStyle('SECONDARY')
.setCustomId('begrusn')
)
const channel = client.channels.cache.get('1037278054503956550')
channel.send({
files: [attachment],
components: [row]
})20 replies
DIAdiscord.js - Imagine an app
•Created by Bene on 11/26/2022 in #djs-questions
Change Presence Modal
So i tried changing the Bot's Presence with an Interaction Modal
But i get this Error:
Unhandled promise rejection: TypeError: Cannot read properties of undefined (reading 'user')
116 replies