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
Favna2y 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
JarvoOP2y ago
Because it’s bugged… I have to clear it to remove commands the bot registered, but don’t exist…
Solution
Lioness100
Lioness1002y 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
JarvoOP2y ago
Thanks This only removes the commands that do not exist, right?
Lioness100
Lioness1002y ago
It overwrites all of your commands with the latest data
Jarvo
JarvoOP2y ago
Okay. Good Thanks 🙂

Did you find this page helpful?