계정 버림
계정 버림
DIAdiscord.js - Imagine an app
Created by 계정 버림 on 2/10/2024 in #djs-questions
Can I send a message without async?
Hey guys, i was tried to send message to channel with async But is there any way to send message without async?
const sentMessage = channel.send({ embeds: [embed] });
const sentMessage = channel.send({ embeds: [embed] });
5 replies
DIAdiscord.js - Imagine an app
Created by 계정 버림 on 8/19/2023 in #djs-questions
Add role to user
Hey guys, im trying to add role to user but it didn't work
const guild = client.guilds.cache.get("1078542061235609640");

const member = guild.members.find((m) => m.id === interaction.user.id);

member.roles.cache.add("1082536706143703060")
const guild = client.guilds.cache.get("1078542061235609640");

const member = guild.members.find((m) => m.id === interaction.user.id);

member.roles.cache.add("1082536706143703060")
But it return D:\Project\Discord\Bots\GoodLuck\GoodLuck\command\BlackJack.js:121 const member = guild.members.find((m) => m.id === interaction.user.id); ^ TypeError: guild.members.find is not a function at BlackJack.interactionCreate (D:\Project\Discord\Bots\GoodLuck\GoodLuck\command\BlackJack.js:121:36) at Object.execute (D:\Project\Discord\Bots\GoodLuck\GoodLuck\Events\interactionCreate.js:14:22) at Client.execute (D:\Project\Discord\Bots\GoodLuck\GoodLuck\Handler\eventHandler.js:13:44) at Client.emit (node:events:523:35) at InteractionCreateAction.handle (D:\Project\Discord\Bots\GoodLuck\node_modules\discord.js\src\client\actions\InteractionCreate.js:97:12) at module.exports [as INTERACTION_CREATE] (D:\Project\Discord\Bots\GoodLuck\node_modules\discord.js\src\client\websocket\handlers\INTERACTION_CREATE.js:4:36) at WebSocketManager.handlePacket (D:\Project\Discord\Bots\GoodLuck\node_modules\discord.js\src\client\websocket\WebSocketManager.js:352:31) at WebSocketShard.onPacket (D:\Project\Discord\Bots\GoodLuck\node_modules\discord.js\src\client\websocket\WebSocketShard.js:494:22) at WebSocketShard.onMessage (D:\Project\Discord\Bots\GoodLuck\node_modules\discord.js\src\client\websocket\WebSocketShard.js:328:10) at callListener (D:\Project\Discord\Bots\GoodLuck\node_modules\ws\lib\event-target.js:290:14) Node.js v20.3.1 How can I add role to user?
35 replies
DIAdiscord.js - Imagine an app
Created by 계정 버림 on 3/9/2023 in #djs-questions
Send a message every minute
I want to send message to channel every minute but,,, I want know how to do this at all how can I do this?
5 replies
DIAdiscord.js - Imagine an app
Created by 계정 버림 on 3/7/2023 in #djs-questions
Disable after a click button
HI guys, I want to know how to disable after a click? How to get a button when interaction event is detect?
2 replies
DIAdiscord.js - Imagine an app
Created by 계정 버림 on 2/13/2023 in #djs-questions
Skip Trust This Domain Button
3 replies
DIAdiscord.js - Imagine an app
Created by 계정 버림 on 2/11/2023 in #djs-questions
Guild's member by id
const guild = client.guilds.fetch("####");
console.log(guild.members.cache.get(id));
const guild = client.guilds.fetch("####");
console.log(guild.members.cache.get(id));
I can get that guild from id, but When I try to get that member by id, the error has occurred like below TypeError: Cannot read properties of undefined (reading 'cache') at Query.<anonymous> (D:\Project\minecraft\Commission\Illusion\Bot\web\server.js:64:43) at Query.<anonymous> (D:\Project\minecraft\Commission\Illusion\Bot\node_modules\mysql\lib\Connection.js:526:10) at Query._callback (D:\Project\minecraft\Commission\Illusion\Bot\node_modules\mysql\lib\Connection.js:488:16) at Query.Sequence.end (D:\Project\minecraft\Commission\Illusion\Bot\node_modules\mysql\lib\protocol\sequences\Sequence.js:83:24) at Query._handleFinalResultPacket (D:\Project\minecraft\Commission\Illusion\Bot\node_modules\mysql\lib\protocol\sequences\Query.js:149:8) at Query.EofPacket (D:\Project\minecraft\Commission\Illusion\Bot\node_modules\mysql\lib\protocol\sequences\Query.js:133:8) at Protocol._parsePacket (D:\Project\minecraft\Commission\Illusion\Bot\node_modules\mysql\lib\protocol\Protocol.js:291:23) at Parser._parsePacket (D:\Project\minecraft\Commission\Illusion\Bot\node_modules\mysql\lib\protocol\Parser.js:433:10) at Parser.write (D:\Project\minecraft\Commission\Illusion\Bot\node_modules\mysql\lib\protocol\Parser.js:43:10) at Protocol.write (D:\Project\minecraft\Commission\Illusion\Bot\node_modules\mysql\lib\protocol\Protocol.js:38:16) So How can I get guild's member by id?
40 replies
DIAdiscord.js - Imagine an app
Created by 계정 버림 on 2/11/2023 in #djs-questions
RangeError: URL and custom id are mutually exclusive
const row = new ActionRowBuilder()
.addComponents(
new ButtonBuilder()
.setCustomId('primary')
.setLabel('인증하기')
.setURL(`http://${domain}:3000/auth/${interaction.user.id}`)
.setStyle(ButtonStyle.Primary)
,
const row = new ActionRowBuilder()
.addComponents(
new ButtonBuilder()
.setCustomId('primary')
.setLabel('인증하기')
.setURL(`http://${domain}:3000/auth/${interaction.user.id}`)
.setStyle(ButtonStyle.Primary)
,
Can I Set Link on the button style is Primary? it's return the error as this thread title;
9 replies
DIAdiscord.js - Imagine an app
Created by 계정 버림 on 2/11/2023 in #djs-questions
Can I get user ip address?
I just want is there a way Cause I want to check if that user is not a second account 🙂 or the other way?
8 replies
DIAdiscord.js - Imagine an app
Created by 계정 버림 on 2/10/2023 in #djs-questions
Get subCommand value
.addSubcommandGroup((group) =>
group
.setName(`증가`)
.setDescription(`포인트를 증가 시킵니다.`)
.addSubcommand((subCommand)=>
subCommand
.setName('유저')
.setDescription('포인트를 증가할 유저를 선택합니다.')
.addUserOption((option)=>option.setName('user').setDescription("유저를 선택합니다."))
.addIntegerOption((option)=>option.setName('포인트').setDescription("포인트 만큼 지급합니다")))

.addSubcommand((subCommand)=>
subCommand
.setName('모두')
.setDescription('모든 유저에게 포인트를 지급합니다.')
.addIntegerOption((option)=>option.setName('포인트').setDescription("포인트 만큼 지급합니다"))

)
)


const target = interaction.options.getUser('유저');
console.log(target)
.addSubcommandGroup((group) =>
group
.setName(`증가`)
.setDescription(`포인트를 증가 시킵니다.`)
.addSubcommand((subCommand)=>
subCommand
.setName('유저')
.setDescription('포인트를 증가할 유저를 선택합니다.')
.addUserOption((option)=>option.setName('user').setDescription("유저를 선택합니다."))
.addIntegerOption((option)=>option.setName('포인트').setDescription("포인트 만큼 지급합니다")))

.addSubcommand((subCommand)=>
subCommand
.setName('모두')
.setDescription('모든 유저에게 포인트를 지급합니다.')
.addIntegerOption((option)=>option.setName('포인트').setDescription("포인트 만큼 지급합니다"))

)
)


const target = interaction.options.getUser('유저');
console.log(target)
I tried to get the user from subcommand option but it's return null Sooo How can I get that value?
4 replies
DIAdiscord.js - Imagine an app
Created by 계정 버림 on 2/9/2023 in #djs-questions
Get All member in guild
How can I get All member in guild?
I only know to get one member in guild.
11 replies
DIAdiscord.js - Imagine an app
Created by 계정 버림 on 2/9/2023 in #djs-questions
CombinedPropertyError: Received one or more errors
2 replies
DIAdiscord.js - Imagine an app
Created by 계정 버림 on 2/7/2023 in #djs-questions
Find a player in a client by id
4 replies
DIAdiscord.js - Imagine an app
Created by 계정 버림 on 2/7/2023 in #djs-questions
Remove String Option
I want to remove UserOption When StringOption's choice is all I don't know how to remove below part
.addUserOption((option) =>
option
.setName('user')
.setDescription('select user')
.setRequired(true))
.addUserOption((option) =>
option
.setName('user')
.setDescription('select user')
.setRequired(true))
This is the whole code of command
data: new SlashCommandBuilder()
.setName("point")
.setDescription("point description")
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)

.addStringOption((option) =>
option
.setName('option')
.setDescription('select option')
.setRequired(true)
.addChoices({name: "add", value: "add"},
{name: "sub", value: "sub"}, {name: "all", value: "all"}))

.addUserOption((option) =>
option
.setName('user')
.setDescription('select user')
.setRequired(true))

.addStringOption((option) =>
option.setName("point")
.setDescription("input point")
.setRequired(true)),

execute(interaction, client){

if(option == "all"){
//????
}
}

data: new SlashCommandBuilder()
.setName("point")
.setDescription("point description")
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)

.addStringOption((option) =>
option
.setName('option')
.setDescription('select option')
.setRequired(true)
.addChoices({name: "add", value: "add"},
{name: "sub", value: "sub"}, {name: "all", value: "all"}))

.addUserOption((option) =>
option
.setName('user')
.setDescription('select user')
.setRequired(true))

.addStringOption((option) =>
option.setName("point")
.setDescription("input point")
.setRequired(true)),

execute(interaction, client){

if(option == "all"){
//????
}
}

14 replies
DIAdiscord.js - Imagine an app
Created by 계정 버림 on 2/7/2023 in #djs-questions
Can I get only id from value?
Here's my code
module.exports = {
developer: true,

data: new SlashCommandBuilder()
.setName("point")
.setDescription("point command")
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.addStringOption((option) =>
option
.setName('user')
.setDescription('input user')
.setRequired(true))

.addStringOption((option) =>
option.setName("point")
.setDescription("input point")
.setRequired(true)),

execute(interaction, client){
if(interaction.isChatInputCommand()){
const user = interaction.options.get('user').value
const point = interaction.options.get('point').value

interaction.reply({content: "sent " + point + " to " + user});
}
}
}
module.exports = {
developer: true,

data: new SlashCommandBuilder()
.setName("point")
.setDescription("point command")
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.addStringOption((option) =>
option
.setName('user')
.setDescription('input user')
.setRequired(true))

.addStringOption((option) =>
option.setName("point")
.setDescription("input point")
.setRequired(true)),

execute(interaction, client){
if(interaction.isChatInputCommand()){
const user = interaction.options.get('user').value
const point = interaction.options.get('point').value

interaction.reply({content: "sent " + point + " to " + user});
}
}
}
And in user value it return like <@1063730517876408381> this But I Just want to user id 1063730517876408381 So I tried to using replace But not work.. D:\Project\minecraft\Commission\Illusion\Bot\Illusion\commands\Developer\point.js:34 user = user.replace("@" ,"") ^ TypeError: Assignment to constant variable. How Can I get only id from that value?
17 replies
DIAdiscord.js - Imagine an app
Created by 계정 버림 on 2/6/2023 in #djs-questions
Is there an event to detect create a server invite link?
23 replies
DIAdiscord.js - Imagine an app
Created by 계정 버림 on 2/6/2023 in #djs-questions
How to check if user has a role?
11 replies
DIAdiscord.js - Imagine an app
Created by 계정 버림 on 2/6/2023 in #djs-questions
Error [TokenInvalid]: An invalid token was provided.
const {TOKEN} = require("./config.json")

client.login(TOKEN)
const {TOKEN} = require("./config.json")

client.login(TOKEN)
I JUST DONT GET IT why this error has been occurred; I put on the right TOKEN But it still don't work
20 replies