Not Toby
Not Toby
DIAdiscord.js - Imagine an app
Created by Not Toby on 10/13/2023 in #djs-questions
I need help load all items definition from .json files
here is data definition
4 replies
DIAdiscord.js - Imagine an app
Created by Not Toby on 10/12/2023 in #djs-questions
Button does not reflect newest data when use next or previous page
also my back button in detail view also does not update, for some reason only back page and next page update data?
4 replies
DIAdiscord.js - Imagine an app
Created by Not Toby on 10/12/2023 in #djs-questions
Button does not reflect newest data when use next or previous page
from left to right, image 1 is start, if i use details button it work fine but when i change to page 2, and use detail button, it doesnt flect on that data
4 replies
DIAdiscord.js - Imagine an app
Created by Not Toby on 10/12/2023 in #djs-questions
The reply to this interaction has already been sent or deferred.
thanks it work now
7 replies
DIAdiscord.js - Imagine an app
Created by Not Toby on 10/9/2023 in #djs-questions
Slash Command Error - I have no idea why
uhh i have no idea, let me try rewrite it
14 replies
DIAdiscord.js - Imagine an app
Created by Not Toby on 10/9/2023 in #djs-questions
Slash Command Error - I have no idea why
@TAEMBOO you can check this source
14 replies
DIAdiscord.js - Imagine an app
Created by Not Toby on 10/9/2023 in #djs-questions
Slash Command Error - I have no idea why
but now i have new error
root@API:~/discord_bot# node index.js
Bot is now online!
/root/discord_bot/node_modules/discord.js/src/managers/ApplicationCommandManager.js:236
if ('default_member_permissions' in command) {
^

TypeError: Cannot use 'in' operator to search for 'default_member_permissions' in undefined
at Function.transformCommand (/root/discord_bot/node_modules/discord.js/src/managers/ApplicationCommandManager.js:236:38)
at /root/discord_bot/node_modules/discord.js/src/managers/ApplicationCommandManager.js:172:48
at Array.map (<anonymous>)
at ApplicationCommandManager.set (/root/discord_bot/node_modules/discord.js/src/managers/ApplicationCommandManager.js:172:22)
at Client.<anonymous> (/root/discord_bot/index.js:51:31)
at Client.emit (node:events:513:28)
at WebSocketManager.triggerClientReady (/root/discord_bot/node_modules/discord.js/src/client/websocket/WebSocketManager.js:388:17)
at WebSocketManager.checkShardsReady (/root/discord_bot/node_modules/discord.js/src/client/websocket/WebSocketManager.js:371:10)
at WebSocketShard.<anonymous> (/root/discord_bot/node_modules/discord.js/src/client/websocket/WebSocketManager.js:201:16)
at WebSocketShard.emit (node:events:513:28)
root@API:~/discord_bot# node index.js
Bot is now online!
/root/discord_bot/node_modules/discord.js/src/managers/ApplicationCommandManager.js:236
if ('default_member_permissions' in command) {
^

TypeError: Cannot use 'in' operator to search for 'default_member_permissions' in undefined
at Function.transformCommand (/root/discord_bot/node_modules/discord.js/src/managers/ApplicationCommandManager.js:236:38)
at /root/discord_bot/node_modules/discord.js/src/managers/ApplicationCommandManager.js:172:48
at Array.map (<anonymous>)
at ApplicationCommandManager.set (/root/discord_bot/node_modules/discord.js/src/managers/ApplicationCommandManager.js:172:22)
at Client.<anonymous> (/root/discord_bot/index.js:51:31)
at Client.emit (node:events:513:28)
at WebSocketManager.triggerClientReady (/root/discord_bot/node_modules/discord.js/src/client/websocket/WebSocketManager.js:388:17)
at WebSocketManager.checkShardsReady (/root/discord_bot/node_modules/discord.js/src/client/websocket/WebSocketManager.js:371:10)
at WebSocketShard.<anonymous> (/root/discord_bot/node_modules/discord.js/src/client/websocket/WebSocketManager.js:201:16)
at WebSocketShard.emit (node:events:513:28)
14 replies
DIAdiscord.js - Imagine an app
Created by Not Toby on 10/9/2023 in #djs-questions
Slash Command Error - I have no idea why
i change client.application.commands.set(commands); to client.application.commands.set(commands.map(c => c.data)); and it work...
14 replies
DIAdiscord.js - Imagine an app
Created by Not Toby on 10/9/2023 in #djs-questions
Slash Command Error - I have no idea why
how can i fix it, is there any example
14 replies
DIAdiscord.js - Imagine an app
Created by Not Toby on 10/9/2023 in #djs-questions
Slash Command Error - I have no idea why
Error log:
root@API:~/discord_bot# node index.js
Bot is now online!
/root/discord_bot/node_modules/@discordjs/rest/dist/index.js:687
throw new DiscordAPIError(data, "code" in data ? data.code : data.error, status, method, url, requestData);
^

DiscordAPIError[50035]: Invalid Form Body
0.name[BASE_TYPE_REQUIRED]: This field is required
at handleErrors (/root/discord_bot/node_modules/@discordjs/rest/dist/index.js:687:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async SequentialHandler.runRequest (/root/discord_bot/node_modules/@discordjs/rest/dist/index.js:1072:23)
at async SequentialHandler.queueRequest (/root/discord_bot/node_modules/@discordjs/rest/dist/index.js:913:14)
at async _REST.request (/root/discord_bot/node_modules/@discordjs/rest/dist/index.js:1218:22)
at async ApplicationCommandManager.set (/root/discord_bot/node_modules/discord.js/src/managers/ApplicationCommandManager.js:171:18) {
requestBody: {
files: undefined,
json: [
{
name: undefined,
name_localizations: undefined,
description: undefined,
nsfw: undefined,
description_localizations: undefined,
type: undefined,
options: undefined,
default_member_permissions: undefined,
dm_permission: undefined
}
]
},
rawError: {
message: 'Invalid Form Body',
code: 50035,
errors: {
'0': { name: { _errors: [ [Object] ] } }
}
},
code: 50035,
status: 400,
method: 'PUT',
url: 'https://discord.com/api/v10/applications/1044260619894931506/commands'
}
root@API:~/discord_bot# node index.js
Bot is now online!
/root/discord_bot/node_modules/@discordjs/rest/dist/index.js:687
throw new DiscordAPIError(data, "code" in data ? data.code : data.error, status, method, url, requestData);
^

DiscordAPIError[50035]: Invalid Form Body
0.name[BASE_TYPE_REQUIRED]: This field is required
at handleErrors (/root/discord_bot/node_modules/@discordjs/rest/dist/index.js:687:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async SequentialHandler.runRequest (/root/discord_bot/node_modules/@discordjs/rest/dist/index.js:1072:23)
at async SequentialHandler.queueRequest (/root/discord_bot/node_modules/@discordjs/rest/dist/index.js:913:14)
at async _REST.request (/root/discord_bot/node_modules/@discordjs/rest/dist/index.js:1218:22)
at async ApplicationCommandManager.set (/root/discord_bot/node_modules/discord.js/src/managers/ApplicationCommandManager.js:171:18) {
requestBody: {
files: undefined,
json: [
{
name: undefined,
name_localizations: undefined,
description: undefined,
nsfw: undefined,
description_localizations: undefined,
type: undefined,
options: undefined,
default_member_permissions: undefined,
dm_permission: undefined
}
]
},
rawError: {
message: 'Invalid Form Body',
code: 50035,
errors: {
'0': { name: { _errors: [ [Object] ] } }
}
},
code: 50035,
status: 400,
method: 'PUT',
url: 'https://discord.com/api/v10/applications/1044260619894931506/commands'
}
14 replies
DIAdiscord.js - Imagine an app
Created by Not Toby on 10/9/2023 in #djs-questions
Slash Command Error - I have no idea why
Lastest code
14 replies
DIAdiscord.js - Imagine an app
Created by Not Toby on 10/9/2023 in #djs-questions
Slash Command Error - I have no idea why
fixed first one, still no have idea why invalid form body
14 replies
DIAdiscord.js - Imagine an app
Created by Not Toby on 10/9/2023 in #djs-questions
Slash Command Question
so command i want is /data <option> option is: create, delete, showraw. In delete and showraw command will have 1 more option /data <option1> <option2_optional>
11 replies
DIAdiscord.js - Imagine an app
Created by Not Toby on 10/9/2023 in #djs-questions
Slash Command Question
still need help
11 replies
DIAdiscord.js - Imagine an app
Created by Not Toby on 10/9/2023 in #djs-questions
Slash Command Question
/root/discord_bot/node_modules/@discordjs/rest/dist/index.js:687
throw new DiscordAPIError(data, "code" in data ? data.code : data.error, status, method, url, requestData);
^

DiscordAPIError[50035]: Invalid Form Body
0.name[BASE_TYPE_REQUIRED]: This field is required
at handleErrors (/root/discord_bot/node_modules/@discordjs/rest/dist/index.js:687:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async SequentialHandler.runRequest (/root/discord_bot/node_modules/@discordjs/rest/dist/index.js:1072:23)
at async SequentialHandler.queueRequest (/root/discord_bot/node_modules/@discordjs/rest/dist/index.js:913:14)
at async _REST.request (/root/discord_bot/node_modules/@discordjs/rest/dist/index.js:1218:22)
at async ApplicationCommandManager.set (/root/discord_bot/node_modules/discord.js/src/managers/ApplicationCommandManager.js:171:18) {
requestBody: {
files: undefined,
json: [
{
name: undefined,
name_localizations: undefined,
description: undefined,
nsfw: undefined,
description_localizations: undefined,
type: undefined,
options: undefined,
default_member_permissions: undefined,
dm_permission: undefined
},
{
name: 'ping',
name_localizations: undefined,
description: 'Replies with "pong!"',
nsfw: undefined,
description_localizations: undefined,
type: undefined,
options: undefined,
default_member_permissions: undefined,
dm_permission: undefined
}
]
},
rawError: {
message: 'Invalid Form Body',
code: 50035,
errors: {
'0': { name: { _errors: [ [Object] ] } }
}
},
code: 50035,
status: 400,
method: 'PUT',
url: 'https://discord.com/api/v10/applications/1044260619894931506/commands'
}
/root/discord_bot/node_modules/@discordjs/rest/dist/index.js:687
throw new DiscordAPIError(data, "code" in data ? data.code : data.error, status, method, url, requestData);
^

DiscordAPIError[50035]: Invalid Form Body
0.name[BASE_TYPE_REQUIRED]: This field is required
at handleErrors (/root/discord_bot/node_modules/@discordjs/rest/dist/index.js:687:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async SequentialHandler.runRequest (/root/discord_bot/node_modules/@discordjs/rest/dist/index.js:1072:23)
at async SequentialHandler.queueRequest (/root/discord_bot/node_modules/@discordjs/rest/dist/index.js:913:14)
at async _REST.request (/root/discord_bot/node_modules/@discordjs/rest/dist/index.js:1218:22)
at async ApplicationCommandManager.set (/root/discord_bot/node_modules/discord.js/src/managers/ApplicationCommandManager.js:171:18) {
requestBody: {
files: undefined,
json: [
{
name: undefined,
name_localizations: undefined,
description: undefined,
nsfw: undefined,
description_localizations: undefined,
type: undefined,
options: undefined,
default_member_permissions: undefined,
dm_permission: undefined
},
{
name: 'ping',
name_localizations: undefined,
description: 'Replies with "pong!"',
nsfw: undefined,
description_localizations: undefined,
type: undefined,
options: undefined,
default_member_permissions: undefined,
dm_permission: undefined
}
]
},
rawError: {
message: 'Invalid Form Body',
code: 50035,
errors: {
'0': { name: { _errors: [ [Object] ] } }
}
},
code: 50035,
status: 400,
method: 'PUT',
url: 'https://discord.com/api/v10/applications/1044260619894931506/commands'
}
11 replies
DIAdiscord.js - Imagine an app
Created by Not Toby on 10/9/2023 in #djs-questions
Slash Command Question
but it seem to break everything
11 replies
DIAdiscord.js - Imagine an app
Created by Not Toby on 10/9/2023 in #djs-questions
Slash Command Question
i planned to replace first part with this
const data = new SlashCommandBuilder()
.setName('data')
.setDescription('Commands related to user data.')
.addSubcommand(subcommand =>
subcommand
.setName('create')
.setDescription('Creates a new user account.')
.addSubcommand(subcommand =>
subcommand
.setName('delete')
.setDescription('Deletes all data of the specified user.')
.addUserOption(option => option.setName('target').setDescription('The user')))
.addSubcommand(subcommand =>
subcommand
.setName('showraw')
.setDescription('Shows all data of a specified user.')
.addUserOption(option => option.setName('target').setDescription('The user')));
const data = new SlashCommandBuilder()
.setName('data')
.setDescription('Commands related to user data.')
.addSubcommand(subcommand =>
subcommand
.setName('create')
.setDescription('Creates a new user account.')
.addSubcommand(subcommand =>
subcommand
.setName('delete')
.setDescription('Deletes all data of the specified user.')
.addUserOption(option => option.setName('target').setDescription('The user')))
.addSubcommand(subcommand =>
subcommand
.setName('showraw')
.setDescription('Shows all data of a specified user.')
.addUserOption(option => option.setName('target').setDescription('The user')));
11 replies
DIAdiscord.js - Imagine an app
Created by Not Toby on 10/9/2023 in #djs-questions
Slash Command Question
which is wrong
11 replies
DIAdiscord.js - Imagine an app
Created by Not Toby on 10/9/2023 in #djs-questions
Slash Command Question
here is mine old code
11 replies
DIAdiscord.js - Imagine an app
Created by Not Toby on 10/9/2023 in #djs-questions
Slash Command Question
ye i still not able to do it so, im testing around
11 replies