Bot does not update commands

so i deleted my ping.ts with was generated from the cli and i restarted the bot and it is still having the commands and i waited more then a day
Solution:
is it somehow still in your dist folder? the logging makes it seem like the piece is being loaded.
Jump to solution
18 Replies
WhacK
WhacK15mo ago
That won’t delete it from the command registry unless you use bulk overwrite. You can remove it manually or use the overwrite behavior for all commands.
WhacK
WhacK15mo ago
Sapphire Framework
Registering Chat Input Commands | Sapphire
To register a Chat Input Command (also known as a Slash Command) with Discord, you need to acquire an application
ryzm
ryzmOP15mo ago
where do i need to put it? my setup.ts have it already
WhacK
WhacK15mo ago
I guess hard to say without the code I use it exactly as the docs say and it does work for me
ryzm
ryzmOP15mo ago
wait
WhacK
WhacK15mo ago
mine looks like this:
import { SapphireClient, container, ApplicationCommandRegistries, RegisterBehavior } from '@sapphire/framework';

ApplicationCommandRegistries.setDefaultBehaviorWhenNotIdentical(RegisterBehavior.BulkOverwrite);
import { SapphireClient, container, ApplicationCommandRegistries, RegisterBehavior } from '@sapphire/framework';

ApplicationCommandRegistries.setDefaultBehaviorWhenNotIdentical(RegisterBehavior.BulkOverwrite);
ryzm
ryzmOP15mo ago
GitHub
GitHub - Blazecord/blaze: Blaze: The Guardian of Moderation!
Blaze: The Guardian of Moderation! Contribute to Blazecord/blaze development by creating an account on GitHub.
ryzm
ryzmOP15mo ago
ye but was like this but it doesnt work
WhacK
WhacK15mo ago
The only thing I do differently than yours is I extended the Sapphire Client into a custom class. Here's my full code. I used Dragonite as guide for this if I remember correctly because Favna points to it a lot.
import { AVRAE_USER_ID, BeholderEmojis } from '../../constants/constants';
import { CLIENT_OPTIONS, PROD, parseConfig } from '../../setup';
import { SapphireClient, container, ApplicationCommandRegistries, RegisterBehavior } from '@sapphire/framework';
import { GraphQLClient } from '../outgoing/graphqlClient';
import { WebhookManager } from '../incoming/webhookManager';
import { EncounterManager } from '../../modules/DynamicEncounter/encounterManager';
import { RedisCacheClient } from '../storage/RedisClient';
import { CharacterManager } from '../../modules/Character/CharacterManager';

ApplicationCommandRegistries.setDefaultBehaviorWhenNotIdentical(RegisterBehavior.BulkOverwrite);

export class BeholderClient extends SapphireClient {
readonly #AVRAE = AVRAE_USER_ID;
readonly #PROD = PROD;
readonly #CONFIG = parseConfig();

constructor() {
super(CLIENT_OPTIONS);

container.prod = this.#PROD;
container.avraeUserId = this.#AVRAE;
container._config = this.#CONFIG;
container.graphql = new GraphQLClient();
container.redis = new RedisCacheClient();
container.webhooks = new WebhookManager();
container.encounter = new EncounterManager();
container.character = new CharacterManager()
}

public override async destroy() {
await container.redis.clearScheduledTasks()
return this.destroy();
}

}
import { AVRAE_USER_ID, BeholderEmojis } from '../../constants/constants';
import { CLIENT_OPTIONS, PROD, parseConfig } from '../../setup';
import { SapphireClient, container, ApplicationCommandRegistries, RegisterBehavior } from '@sapphire/framework';
import { GraphQLClient } from '../outgoing/graphqlClient';
import { WebhookManager } from '../incoming/webhookManager';
import { EncounterManager } from '../../modules/DynamicEncounter/encounterManager';
import { RedisCacheClient } from '../storage/RedisClient';
import { CharacterManager } from '../../modules/Character/CharacterManager';

ApplicationCommandRegistries.setDefaultBehaviorWhenNotIdentical(RegisterBehavior.BulkOverwrite);

export class BeholderClient extends SapphireClient {
readonly #AVRAE = AVRAE_USER_ID;
readonly #PROD = PROD;
readonly #CONFIG = parseConfig();

constructor() {
super(CLIENT_OPTIONS);

container.prod = this.#PROD;
container.avraeUserId = this.#AVRAE;
container._config = this.#CONFIG;
container.graphql = new GraphQLClient();
container.redis = new RedisCacheClient();
container.webhooks = new WebhookManager();
container.encounter = new EncounterManager();
container.character = new CharacterManager()
}

public override async destroy() {
await container.redis.clearScheduledTasks()
return this.destroy();
}

}
Just noticed your's says overwrite and not bulk overwrite
ryzm
ryzmOP15mo ago
ye but why do my commands not update ye i changed it jus to test none of these work for me
WhacK
WhacK15mo ago
ok then I guess I cannot be much help. Hopefully someone else can, I just know this implementation definitely works for me.
ryzm
ryzmOP15mo ago
this is the console
No description
ryzm
ryzmOP15mo ago
and when i change the NODE_ENV = to 'production' it wont change anything
Solution
WhacK
WhacK15mo ago
is it somehow still in your dist folder? the logging makes it seem like the piece is being loaded.
WhacK
WhacK15mo ago
TS doesn't remove them on delete
ryzm
ryzmOP15mo ago
hmm ima check OMG IT WORKED thank you now the other commands wont load thank you
WhacK
WhacK15mo ago
no prob
Want results from more Discord servers?
Add your server