are context menus supposed to be created automatically?

question in title
17 Replies
Lioness100
Lioness100•2y ago
They're registered the same way slash commands are
-Carlos👑
-Carlos👑OP•2y ago
looks like the context menu is not getting created
Lioness100
Lioness100•2y ago
Can you send your code?
-Carlos👑
-Carlos👑OP•2y ago
https://pastebin.com/cBS58aGf forgot to add a .sort to the user roles here's the updated version
Pastebin
const { Command } = require("@sapphire/framework");const { Applicat...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Favna
Favna•2y ago
if it doesnt show up on a user then refresh/update your client. code looks fine.
-Carlos👑
-Carlos👑OP•2y ago
i'm using browser, would that affect anything i already reloaded the page
Favna
Favna•2y ago
it shouldnt
-Carlos👑
-Carlos👑OP•2y ago
just tried again and still not working
Favna
Favna•2y ago
Look at the guide or other bots that use Sapphire. Validate that other things of the command do work, i.e. try registering a slash command. Validate what Sapphire logs about the registered commands. And undo whatever you did in https://discord.com/channels/737141877803057244/1152041112161239181 because that change makes it so you don't get any information from Sapphire. Like I said in the reply, you're shooting yourself in the foot super hard there.
-Carlos👑
-Carlos👑OP•2y ago
oh yeah yesterday I saw what you used and removed it looks like registering a slash command also doesn't work @Favna what does this exactly do?
ApplicationCommandRegistries.setDefaultBehaviorWhenNotIdentical(
RegisterBehavior.BulkOverwrite
);
ApplicationCommandRegistries.setDefaultBehaviorWhenNotIdentical(
RegisterBehavior.BulkOverwrite
);
actually I got this problem (bot not creating slashes/context menus) a while ago, I asked about and someone told me to use the code above idk if this is the problem but I remember making a test slash command, then I deleted it using a djs funtion, then I tried to make an actual slash command and it just didn't work
Lioness100
Lioness100•2y ago
That makes it so it will set all the bot's commands instead of updating them. This ensures that your bots commands are always up to date with, and only with, what's in your command files. If you just use RegisterBehavior.Overwrite, the following situation could occur: 1. Create command A and B (they are both registered) 2. Delete A file and edit B (B is updated, but sapphire doesn't know A exist, so it stays registered on discord) With BulkOverwrite, it overwrites all your past commands every time, so A would be deleted if the file doesn't exist. If it's an issue with loading the command, you can find out by assigning Store.logger = console.log in your main file before logging in (Store can be imported from framework)
-Carlos👑
-Carlos👑OP•2y ago
how can I know if there is an issue with it
Lioness100
Lioness100•2y ago
Read through the logs mentioning your file See if it's getting unloaded for some reason
-Carlos👑
-Carlos👑OP•2y ago
would this be
No description
-Carlos👑
-Carlos👑OP•2y ago
I also have a userinfo command but with prefix
Lioness100
Lioness100•2y ago
Yes Name the two differently
-Carlos👑
-Carlos👑OP•2y ago
it created the context menu but returns The application did not respond gonna try with a try and catch to see if it returns anything no errors

Did you find this page helpful?