박준서
박준서
DIAdiscord.js - Imagine an app
Created by 박준서 on 3/3/2024 in #djs-questions
Can I change the customization status of users on my server in bulk?
When I create an economy system on my server, I want to show the balance in the user's status. Is there any way to batch update it at a set time?
3 replies
DIAdiscord.js - Imagine an app
Created by 박준서 on 12/30/2023 in #djs-questions
The ability to show the balance
I made a command to show the balance by writing .setLabel on the button. But what I want is not for the balance of the person who wrote the command, but for the individual balance to be displayed differently on each screen on the button.
const button = new ButtonBuilder()
.setCutomId('balance')
.setLabel(`balance : ${balance.balance}`)
.setStyle(ButtonStyle.Secondary)
.setDisable(ture);
const button = new ButtonBuilder()
.setCutomId('balance')
.setLabel(`balance : ${balance.balance}`)
.setStyle(ButtonStyle.Secondary)
.setDisable(ture);
The balance function gets the balance of the account number from db to userid.
4 replies
DIAdiscord.js - Imagine an app
Created by 박준서 on 6/27/2023 in #djs-questions
I made it look like an image, but I get the error "something went worng!"
https://www.youtube.com/watch?v=qNB7pQBhqDQ Modal code was created as in the corresponding image. However, the error "something wrong! Try again!" occurs. Below is the code I wrote.
const { SlashCommandBuilder, ModalBuilder, TextInputBuilder, TextInputStyle, ActionRowBuilder } = require('discord.js');

module.exports = {
data: new SlashCommandBuilder()
.setName("modal")
.setDescription("Returns a modal."),

async execute(interaction, client) {
const modal = new ModalBuilder()
.setCustomId(`recd`)
.setTitle(`write`);

const textInput = new TextInputBuilder()
.setCustomId('recdInput')
.setLabel(`input code`)
.setPlaceholder('ex) xQ50Kbz6rB')
.setMaxLength(10)
.setRequired(true)
.setStyle(TextInputStyle.Short);

modal.addComponents(new ActionRowBuilder().addComponents(textInput));

await interaction.showModal(modal);
},
};
modal.js
const { SlashCommandBuilder, ModalBuilder, TextInputBuilder, TextInputStyle, ActionRowBuilder } = require('discord.js');

module.exports = {
data: new SlashCommandBuilder()
.setName("modal")
.setDescription("Returns a modal."),

async execute(interaction, client) {
const modal = new ModalBuilder()
.setCustomId(`recd`)
.setTitle(`write`);

const textInput = new TextInputBuilder()
.setCustomId('recdInput')
.setLabel(`input code`)
.setPlaceholder('ex) xQ50Kbz6rB')
.setMaxLength(10)
.setRequired(true)
.setStyle(TextInputStyle.Short);

modal.addComponents(new ActionRowBuilder().addComponents(textInput));

await interaction.showModal(modal);
},
};
modal.js
module.exports = {
data: {
name: `recd`
},
async execute(interaction, client) {
await interaction.reply({
content : `okay : ${interaction.field.getTextInputValue('recdInput')} `
});
console.log(interaction.field.getTextInputValue('recdInput'));
},
};
recd.js
module.exports = {
data: {
name: `recd`
},
async execute(interaction, client) {
await interaction.reply({
content : `okay : ${interaction.field.getTextInputValue('recdInput')} `
});
console.log(interaction.field.getTextInputValue('recdInput'));
},
};
recd.js
11 replies
DIAdiscord.js - Imagine an app
Created by 박준서 on 6/5/2023 in #djs-questions
To invoke a command from another channel
I don't understand if I find docs. How do I call a command from another channel?
6 replies
DIAdiscord.js - Imagine an app
Created by 박준서 on 4/9/2023 in #djs-questions
How do I make the code?
5 replies
DIAdiscord.js - Imagine an app
Created by 박준서 on 4/2/2023 in #djs-questions
How to use the value of .addChoices
.addStringOption(option =>
option.setName('game')
.setDescription('game')
.setRequired(true)
.addChoices(
{ name: '1', **value**: '1' },
{ name: '2', value: '2' },
{ name: '3', value: '3' },
{ name: '4', value: '4' }
)),
.addStringOption(option =>
option.setName('game')
.setDescription('game')
.setRequired(true)
.addChoices(
{ name: '1', **value**: '1' },
{ name: '2', value: '2' },
{ name: '3', value: '3' },
{ name: '4', value: '4' }
)),
How do I use the 'value' of that code?
10 replies
DIAdiscord.js - Imagine an app
Created by 박준서 on 4/1/2023 in #djs-questions
How to use the .addChoices command
.addStringOption(option =>
option.setName('game')
.setDescription('game')
.setRequired(true)
.addChoices(
{ name: '1', value: '1' },
{ name: '2', value: '2' },
{ name: '3', value: '3' },
{ name: '4', value: '4' }
)),
.addStringOption(option =>
option.setName('game')
.setDescription('game')
.setRequired(true)
.addChoices(
{ name: '1', value: '1' },
{ name: '2', value: '2' },
{ name: '3', value: '3' },
{ name: '4', value: '4' }
)),
How do I write a code that uses number 1 based on the code above?
3 replies
DIAdiscord.js - Imagine an app
Created by 박준서 on 3/26/2023 in #djs-questions
How do I write code that performs commands to other channels with '.addChannelOption'?
If I write a command from an administrator channel to another channel, how do I make the command run on a channel other than the administrator channel?
3 replies
DIAdiscord.js - Imagine an app
Created by 박준서 on 3/26/2023 in #djs-questions
Can't I fit the button size to the embed size?
6 replies
DIAdiscord.js - Imagine an app
Created by 박준서 on 10/15/2022 in #djs-questions
How do I fix session termination when running discord.bot with repl.it?
I'm trying to create a bot that works 24/7 with repl.it, but the command handler keeps registering and failing to get an error.
3 replies