How to make an "Authorized App"?

Hey there! So recently someone who's better than me at coding showed me they made a "self-bot" of sorts that allowed slash commands in any chat they were in, and they told me that Discord made it so you could add your own "slash commands" of sorts where the App you authorized basically works. I already had my own bot, so I added it as an Authorized App (it shows up just fine on the list), but how do I proceed? How do I make it so its slash commands show up on my client? How do I handle them? I was wondering where I could get more information on this, and how to do it. Thanks!
DT
d.js toolkit15d ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
N
NyR15d ago
1. It's not a self bot, it's weird to describe it as such and also a misrepresentation. 2. It is still in beta so it is not supported by discord.js yet, you can however check this announcement by discord https://discord.com/channels/222078108977594368/992166350640386090/1219333156486778944, there's also a guide on how to make them linked there, you just need to use json structures for you commands and include the two new properties mentioned in the docs, if you use builders for commands, you can convert them into json using toJSON() method and then pass the new properties and register you commands using REST
Discord
Discord - A New Way to Chat with Friends & Communities
Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.
A
andy15d ago
gotcha, i appreciate it so much. is there an estimated time for when discord.js will support them? i'm assuming when it gets out of beta?
N
NyR15d ago
It'll most likely be after beta, there's no estimate on when though
A
andy15d ago
so i think i figured it out, but i'm getting an error i've never seen before 🤔
DiscordAPIError[50001]: Missing Access
at handleErrors (D:\Andy\Coding\AndyBot\node_modules\@discordjs\rest\dist\index.js:687:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async SequentialHandler.runRequest (D:\Andy\Coding\AndyBot\node_modules\@discordjs\rest\dist\index.js:1072:23)
at async SequentialHandler.queueRequest (D:\Andy\Coding\AndyBot\node_modules\@discordjs\rest\dist\index.js:913:14)
at async _REST.request (D:\Andy\Coding\AndyBot\node_modules\@discordjs\rest\dist\index.js:1218:22)
at async DMMessageManager.edit (D:\Andy\Coding\AndyBot\node_modules\discord.js\src\managers\MessageManager.js:177:15
)
at async Object.query (D:\Andy\Coding\AndyBot\functions\slashCommands.js:181:12)
at async Client.<anonymous> (D:\Andy\Coding\AndyBot\index.js:124:13) {
requestBody: {
files: [],
json: {
content: 'bla bla',
tts: false,
nonce: undefined,
embeds: undefined,
components: undefined,
username: undefined,
avatar_url: undefined,
allowed_mentions: undefined,
flags: 0,
message_reference: undefined,
attachments: undefined,
sticker_ids: undefined,
thread_name: undefined
}
},
rawError: { message: 'Missing Access', code: 50001 },
code: 50001,
status: 403,
method: 'PATCH',
url: 'https://discord.com/api/v10/channels/862374724154556426/messages/1225191651144892518'
}
DiscordAPIError[50001]: Missing Access
at handleErrors (D:\Andy\Coding\AndyBot\node_modules\@discordjs\rest\dist\index.js:687:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async SequentialHandler.runRequest (D:\Andy\Coding\AndyBot\node_modules\@discordjs\rest\dist\index.js:1072:23)
at async SequentialHandler.queueRequest (D:\Andy\Coding\AndyBot\node_modules\@discordjs\rest\dist\index.js:913:14)
at async _REST.request (D:\Andy\Coding\AndyBot\node_modules\@discordjs\rest\dist\index.js:1218:22)
at async DMMessageManager.edit (D:\Andy\Coding\AndyBot\node_modules\discord.js\src\managers\MessageManager.js:177:15
)
at async Object.query (D:\Andy\Coding\AndyBot\functions\slashCommands.js:181:12)
at async Client.<anonymous> (D:\Andy\Coding\AndyBot\index.js:124:13) {
requestBody: {
files: [],
json: {
content: 'bla bla',
tts: false,
nonce: undefined,
embeds: undefined,
components: undefined,
username: undefined,
avatar_url: undefined,
allowed_mentions: undefined,
flags: 0,
message_reference: undefined,
attachments: undefined,
sticker_ids: undefined,
thread_name: undefined
}
},
rawError: { message: 'Missing Access', code: 50001 },
code: 50001,
status: 403,
method: 'PATCH',
url: 'https://discord.com/api/v10/channels/862374724154556426/messages/1225191651144892518'
}
do you recognize it?
A
Aduhmazbro15d ago
does the bot have permission to change channels there? or do you use user apps for this?
D
darp15d ago
1. its usually joke
A
andy15d ago
it's a user app here's the JSON i used to create it:
A
Aduhmazbro15d ago
then you can't edit the channel
A
andy15d ago
{
"name": "query",
"description": "Runs a query on the AI",
"options": [
{
"name": "prompt",
"description": "The prompt to use",
"type": 3,
"required": true
}
],
"integration_types": [
1
],
"contexts": [
0,
1,
2
]
}
{
"name": "query",
"description": "Runs a query on the AI",
"options": [
{
"name": "prompt",
"description": "The prompt to use",
"type": 3,
"required": true
}
],
"integration_types": [
1
],
"contexts": [
0,
1,
2
]
}
what do you mean? i'm editing the message, which i tried before and it works
A
Aduhmazbro15d ago
show your code
A
andy15d ago
alrighty, one sec
async function query(interaction, getBotReply, model) {
const reply = await interaction.reply({ content: "Thinking...", fetchReply: true })
const prompt = await interaction.options.getString('prompt');
const res = await getBotReply(model, [prompt]);
if (res.error) {
utils.system.logger("There seems to have been an error. Check for details.", "red", "bold");
return await reply.edit(`There seems to have been an error. Please try again, or contact @lancito01 if the issue persists.\nError details:\n\`\`\`${res.error}\`\`\``);
}
return await reply.edit({ content: res.replyText, ephemeral: false });
}
async function query(interaction, getBotReply, model) {
const reply = await interaction.reply({ content: "Thinking...", fetchReply: true })
const prompt = await interaction.options.getString('prompt');
const res = await getBotReply(model, [prompt]);
if (res.error) {
utils.system.logger("There seems to have been an error. Check for details.", "red", "bold");
return await reply.edit(`There seems to have been an error. Please try again, or contact @lancito01 if the issue persists.\nError details:\n\`\`\`${res.error}\`\`\``);
}
return await reply.edit({ content: res.replyText, ephemeral: false });
}
that's the function i'm calling with the "slash command" and it works fine if i use it in the bot DM channel
A
Aduhmazbro15d ago
try interaction.editReply()
A
andy15d ago
No description
A
andy15d ago
gotcha, one sec
A
andy15d ago
:pepe_woo:
No description
A
andy15d ago
seems to have worked :] thank you <3
Want results from more Discord servers?
Add your server
More Posts
Bot stops playing when rejoining another channelMy bot plays in channel1. He uses `connection.disconnect()` to leave a voice channel, but the connecautomatically obtain guildIdhow do i obtain guildId automatically ? i'm tired of setting the guildId manually in configHow can I send a message to this channel?Hey, how can I send a message to this channel? ```js const { Events, EmbedBuilder } = require("discBot Online indicatorHow can I get rid of the green dot on a bot, like how "d.js docs" bot has no online green dot indicaHow do I do this?How do I make it so that I can make a vehicle registration. Ex: Plate: UZP Vehicle Colour: Blue VehERROR DISCPRDAPI/Handlers/Commands.js ```js const { Client } = require("discord.js"); const { GUILDID } = require(".roleUpdate Logs Entires Roles List For A Small Change On One RoleWhenever I Change The Slightest Thing On A Role It Fires The Event And Logs ALL The Roles Is There Problem with Modal Buildersnode:events:497 throw er; // Unhandled 'error' event ^ DiscordAPIError[50035]: Invalid How to send files through broadcastEval?the error is due to an invalid file, the same does not happen when it is sent in the current client Unknown interaction, sometimesThe problem is that sometimes it works and sometimes it generates an error, and I've already tried iI need help with this errorcustom per-guild welcome messagehii, so i wish to make a customized welcome message system for each guild wherein users can customizEmbed and console desyncHello. Im trying to make a reaction role like system for my server. On startup it sends an embed on can anyone help me revise the set position command```ts setPosition(role: MockRole, position: number) { if (position < 0) position = 0; consApplication not responding errorI followed the steps in this website: https://discordjs.guide/creating-your-bot/#using-config-json, command handlermy code in 01registercommands.js ```const { testServer } = require('../../../config.json'); const arSend Embed to Channel with IDI would like to send my embed to a channel specified by ID. Unfortunately it doesn't work in my codeServer Deafen and Mutecan i remove the server deafen and server mute statuses from a user even if they aren't connected tofetch the new created channel```const { SlashCommandBuilder,PermissionFlagsBits } = require('discord.js'); module.exports = { Voice receiver doesn't pick up soundboard soundsI have a pretty fancy discord bot that uses a voice receiver to pick up audio from users. `const au