GustyCube
DIAdiscord.js - Imagine an app
•Created by GustyCube on 8/4/2024 in #djs-questions
Emojies not working with select
9 replies
DIAdiscord.js - Imagine an app
•Created by GustyCube on 7/28/2024 in #djs-questions
Interaction returning undefined
Any idea why my interaction is returning undefined? I can't check if its a select because it is just returning Client:
2 replies
DIAdiscord.js - Imagine an app
•Created by GustyCube on 7/6/2024 in #djs-questions
bot just crashes
with this code my bot just crashes
3 replies
DIAdiscord.js - Imagine an app
•Created by GustyCube on 7/4/2024 in #djs-questions
Bot stuck on thinking
here is my code:
the bot is just stuck on thinking...
3 replies
DIAdiscord.js - Imagine an app
•Created by GustyCube on 5/27/2024 in #djs-questions
Error with bot
Hey. I'm using the pterotacy; api: and I got this error:
with this code:
Their documentation: https://dashflo.net/docs/api/pterodactyl/v1/#req_802e27a56fe142c99db4106d8e8e8892 You go to
API/Application > /users > POST create user
3 replies
DIAdiscord.js - Imagine an app
•Created by GustyCube on 5/24/2024 in #djs-questions
Error with a command
Here is my code:
I get: There was an error running this command: TypeError: commandObject.callback is not a function. Why is that?
5 replies
DIAdiscord.js - Imagine an app
•Created by GustyCube on 4/17/2024 in #djs-questions
Button Interaction
Hey, heres my code: buttonCollector.on('collect', async buttonInteraction => {
console.log(buttonInteraction.customId);
if (buttonInteraction.customId === 'accept') {
const paymentMethods = allowedUsers[freelancerId];;
const paypalButton = new ButtonBuilder()
.setCustomId('paypal')
.setLabel('PayPal')
.setStyle(ButtonStyle.Primary);
const cashAppButton = new ButtonBuilder()
.setCustomId('cashapp')
.setLabel('CashApp')
.setStyle(ButtonStyle.Primary);
const paymentActionRow = new ActionRowBuilder()
.addComponents(paypalButton, cashAppButton);
const acceptEmbed = new EmbedBuilder()
.setTitle('Payment Options')
.setDescription('Please select a payment method:')
.setColor('Blue');
await buttonInteraction.update({ embeds: [acceptEmbed], components: [paymentActionRow] });
} else if (buttonInteraction.customId === 'decline') {
buttonInteraction.reply({ content: 'Payment request declined.', ephemeral: true });
} else if (buttonInteraction.customId === 'decline') {
buttonInteraction.reply({ content: 'Payment request declined.', ephemeral: true });
}
});. It doesnt seem to be getting here, did I do smth wrong?
31 replies
DIAdiscord.js - Imagine an app
•Created by GustyCube on 4/16/2024 in #djs-questions
A few errors.
Hey, I have a few erros, I havent encountered some because of my initial problem. Heres my code attached. Basically, I want it to only show users from the freelancer.json file like this: {
"1162498330908180500" :{
"PayPal": "",
"CashApp": ""
}
}, however its showing everything and no matter what i try i get an error. Any other bug catching would be appreciated too!
13 replies
DIAdiscord.js - Imagine an app
•Created by GustyCube on 4/15/2024 in #djs-questions
Error with commands
Hey, here is my code: const {
ApplicationCommandOptionType,
PermissionFlagsBits,
} = require('discord.js');
module.exports = { deleted: false, name: 'embed', description: 'Embed a certain message!', // devOnly: Boolean, // testOnly: Boolean, options: [ { name: 'embed', description: 'The embed to send.', required: true, type: ApplicationCommandOptionType.String, choices: [ { name: 'rules', value: '1', }, ], }, ], permissionsRequired: [PermissionFlagsBits.Administrator], botPermissions: [PermissionFlagsBits.Administrator],
callback: (interaction) => { console.log('Interaction options:', interaction.options);
const category = interaction.options.getString('embed'); console.log('Embed option:', embed);
if (embed && embed.value === "rules") { // Perform actions specific to the embed command with the whyimbetter option value of 1 interaction.reply('Embed with whyimbetter option value of 1'); } else { // Perform actions specific to the embed command without the whyimbetter option interaction.reply('Embed without whyimbetter option'); } }, }; It generates: ⏩ Skipping registering command "ban" as it's set to delete. Interaction options: { closeTimeout: 5000, waitGuildTimeout: 15000, shardCount: 1, makeCache: [Function (anonymous)], partials: [], failIfNotExists: true, presence: { status: 'online', user: { id: null } }, sweepers: { threads: { interval: 3600, lifetime: 14400 } }, ws: { large_threshold: 50, version: 10, presence: { activities: [], afk: false, since: null, status: 'online' } }, rest: { agent: null, api: 'https://discord.com/api', authPrefix: 'Bot', cdn: 'https://cdn.discordapp.com', headers: {}, invalidRequestWarningInterval: 0, globalRequestsPerSecond: 50, offset: 50, rejectOnRateLimit: null, retries: 3, timeout: 15000, userAgentAppendix: undefined, version: '10', hashSweepInterval: 14400000, hashLifetime: 86400000, handlerSweepInterval: 3600000, makeRequest: [AsyncFunction: makeRequest] }, jsonTransformer: [Function: toSnakeCase], intents: IntentsBitField { bitfield: 33283 }, shards: [ 0 ] } There was an error running this command: TypeError: interaction.options.getString is not a function
module.exports = { deleted: false, name: 'embed', description: 'Embed a certain message!', // devOnly: Boolean, // testOnly: Boolean, options: [ { name: 'embed', description: 'The embed to send.', required: true, type: ApplicationCommandOptionType.String, choices: [ { name: 'rules', value: '1', }, ], }, ], permissionsRequired: [PermissionFlagsBits.Administrator], botPermissions: [PermissionFlagsBits.Administrator],
callback: (interaction) => { console.log('Interaction options:', interaction.options);
const category = interaction.options.getString('embed'); console.log('Embed option:', embed);
if (embed && embed.value === "rules") { // Perform actions specific to the embed command with the whyimbetter option value of 1 interaction.reply('Embed with whyimbetter option value of 1'); } else { // Perform actions specific to the embed command without the whyimbetter option interaction.reply('Embed without whyimbetter option'); } }, }; It generates: ⏩ Skipping registering command "ban" as it's set to delete. Interaction options: { closeTimeout: 5000, waitGuildTimeout: 15000, shardCount: 1, makeCache: [Function (anonymous)], partials: [], failIfNotExists: true, presence: { status: 'online', user: { id: null } }, sweepers: { threads: { interval: 3600, lifetime: 14400 } }, ws: { large_threshold: 50, version: 10, presence: { activities: [], afk: false, since: null, status: 'online' } }, rest: { agent: null, api: 'https://discord.com/api', authPrefix: 'Bot', cdn: 'https://cdn.discordapp.com', headers: {}, invalidRequestWarningInterval: 0, globalRequestsPerSecond: 50, offset: 50, rejectOnRateLimit: null, retries: 3, timeout: 15000, userAgentAppendix: undefined, version: '10', hashSweepInterval: 14400000, hashLifetime: 86400000, handlerSweepInterval: 3600000, makeRequest: [AsyncFunction: makeRequest] }, jsonTransformer: [Function: toSnakeCase], intents: IntentsBitField { bitfield: 33283 }, shards: [ 0 ] } There was an error running this command: TypeError: interaction.options.getString is not a function
5 replies
DIAdiscord.js - Imagine an app
•Created by GustyCube on 4/12/2024 in #djs-questions
Making a /command
Hi, how would I go about making a command where any .js file in the folder /commands gets registered, and how do I register commands? I can’t get them to work. I want it to be guild only.
7 replies