jamiedubs
Explore posts from serversDIAdiscord.js - Imagine an app
•Created by jamiedubs on 8/22/2023 in #djs-questions
Dynamic options for a slash command? Wizard-esque UI
is it possible to create a slash command that uses a technique similar to Autocomplete for the subsequent arguments (options) for the command?
e.g. if I have
/summon <monster>
and there are bunch of options for monsters
- some have size
or power
- some have color
- some have other options
Ideally it'd almost be like filling out a form, with each step populated as the user does it
- /summon dragon
- "fire"
- from a "volcano" (because fire)
- specifically "Hawaii" (because volcanos)
How does one do a dynamic wizard-esque interface like this using a slash command? Would an alternative idea be posting multiple epehmeral messages with the followup questions?5 replies
TTCTheo's Typesafe Cult
•Created by jamiedubs on 5/1/2023 in #questions
Best practices for data migrations/historical data changes?
I'm using t3 + Vercel + Planetscale and would like to add a field like
user.apiToken
as an example. A new field that every user should have pre-generated and ready to use
So I need to generate tokens for my existing users.
- Prisma migrations are SQL-only by default (right?) so that doesn't play nice
- Planetscale doesn't really like Prisma migrations anyway
Should I just be making a scripts/
directory and figuring out to run something like that against Vercel? Maybe a temporary API endpoint? What's a good best practice for one-off data migrations like this?5 replies
TTCTheo's Typesafe Cult
•Created by jamiedubs on 4/14/2023 in #questions
API token authentication w/ NextAuth
have any of you tried implementing something like this? Wondering if it's time for me to swap to Clerk or Auth0 or another solution or if this will work well enough.
Private API, just provisioning my own tokens to access some privileged endpoints
I've implemented a CredentialsProvider that works well enough, but it feels strange to be doing a cookie-session exchange and passing a (short-lived) cookie with requests, rather than, say, a long-lived Bearer auth token
I'm specifically trying to use the API token auth with edge functions, which require NextAuth as middleware and aren't as easily side-stepped as a normal API function. In those cases I could do simple
if(useSession || validApiToken)
5 replies