#application command permissions

1 messages · Page 1 of 1 (latest)

hasty mauve
#

So, what do you exactly with this property? You have to do an API call with it somewhere

bronze root
#

this is really just a template i got since im quite new to typescript and im not 100% sure how it works

#

but that CommandType is being used in another file

import { CommandType } from "../typings/Command";

export class Command {
    constructor(commandOptions: CommandType) {
        Object.assign(this, commandOptions);
    }
}
#

and the commands use this

import { Command } from "../../structures/Command";

export default new Command({
    ...
    run: async ({ client, interaction }) => {
        ...
    }
})
hasty mauve
#

and how do you deploy the permissions? Just adding them to a class won't register them in the API

bronze root
#

thats the thing

#

im not like deploying the permissions in the javascript bot i have either

#

or wait

#

i have this deploy command from my js bot that i think i deployed all commands and the permissions to them

#

and i used this in the ready event instead of using the this.guilds.cache.get(guildId)?.commands.set(commands);

            this.guilds.cache.get(guildId)?.commands.set([]);
        
            const commandData = {
                name: "deploy",
                description: "Deploy command Setup",
                options: [
                    {
                        name: "command",
                        type: "STRING",
                        description: "Command to deploy",
                        required: false,
                    },
                ],
            }

            this.guilds.cache.get(guildId)?.commands.create(commandData);
hasty mauve
#

that's a not a good idea. Please refer to the guide on how to deploy commands and permissions

bronze root
#

will it work in TS tho?

hasty mauve
#

sure

#

TS is not the problem here

bronze root
#

because im getting all kinds of errors

hasty mauve
#

you should be fairly familiar with TS when using it

#

If there's a typing issue with d.js you can ask about it here, but so far that was not related