Clear Command Cache?

Since the other one removed his message... How to clear the cache using Sapphire?
Solution:
You should set add this line to your index file before you log in, which will overwrite all commands each time. ```ts import { SapphireClient, container, ApplicationCommandRegistries, RegisterBehavior } from '@sapphire/framework'; ApplicationCommandRegistries.setDefaultBehaviorWhenNotIdentical(RegisterBehavior.BulkOverwrite);...
Jump to solution
6 Replies
Favna
Favna8mo ago
Why... Would you want to do that? We only use the cache to know which commands exist. If you clear it then you can't run commands anymore.
Jarvo
Jarvo8mo ago
Because it’s bugged… I have to clear it to remove commands the bot registered, but don’t exist…
Solution
Lioness100
Lioness1008mo ago
You should set add this line to your index file before you log in, which will overwrite all commands each time.
import { SapphireClient, container, ApplicationCommandRegistries, RegisterBehavior } from '@sapphire/framework';

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

ApplicationCommandRegistries.setDefaultBehaviorWhenNotIdentical(RegisterBehavior.BulkOverwrite);
Jarvo
Jarvo8mo ago
Thanks This only removes the commands that do not exist, right?
Lioness100
Lioness1008mo ago
It overwrites all of your commands with the latest data
Jarvo
Jarvo8mo ago
Okay. Good Thanks 🙂
Want results from more Discord servers?
Add your server