Tony
Explore posts from serversuseFetch refresh failing to recognise new query params
I have a simple page with this useFetch code at the start:
However refresh() won't use the new route query param. If I put
{{ route.query.q }}
in the page it shows the new query param but refreshing through the watch OR a button with refresh() manually shows the API as recieving the old query param
What's happening???7 replies
SIASapphire - Imagine a framework
•Created by Tony on 2/24/2024 in #sapphire-support
Throwing errors in commands/subcommands
Just curious if there is a way to throw an error in an application command/subcommand and have it handled by the
chatInputCommandDenied
listener, similar to how preconditions work. Some kind of this.error
that can be sent and handled by the listener. Does this exist or can I write something to do that?17 replies
SIASapphire - Imagine a framework
•Created by Tony on 2/23/2024 in #sapphire-support
Limit command to specified roles?
I honestly haven't done this in a while (not since pre-application commands) and am new to using Sapphire. Looking to restrict a command to only be visible/usable by the server's owner and any roles they define. How is this best handled with Sapphire and application commands? The bot in question has a database to store roles if that's needed.
Using TypeScript, here's a basic command I wrote that I want to restrict as described:
Already looked over docs and previous questions, though maybe I've missed something, call me out if I have haha
16 replies
Server /api returning 404, but still working
I have a server route in
/server/api/download.post.ts
. When fetching it, the route seems to return a 404 Cannot find any route matching /api/download.
However, this makes no sense as the route works fine and the code inside the route actually works - just when it finishes (it's non-sync code I believe, tried promisify-ing it to no luck) the event.node.res.end
won't work. Any help?9 replies