Sapphire - Imagine a framework
Sapphire - Imagine a framework

sapphire-support

Root Question Message

Rhys
Rhys11/29/2022
Has Anyone Used Reacord With Sapphire?

Not really a support question more of a discussion question just curious, it's a way of writing Discord menus with React - did a quick test with it on my bot I'm developing and holy cow it is such a nice way of making these UIs I got to delete a bunch of boilerplate code

Only downside is that the buttons don't continue to work after you restart which I'll have to use Sapphire interaction handlers for

Relevant Repo Links:
Reacord - https://github.com/itsMapleLeaf/reacord
Some WIP Code I'm doing - https://github.com/AnswerOverflow/AnswerOverflow/tree/Turbo-Repo-Base/apps/discord-bot
Favna
Favna11/29/2022
Never heard of the library but the concept is familiar. It's really interesting how they make buttons stateful like this.
24
2411/29/2022
That guy who created the lib is also kinda cool
24
2411/29/2022
I wouldn't want to pull in react JUST for that though
Rhys
Rhys11/29/2022
I suppose this is a factor but imo since you're not shipping your bot code to any clients it doesn't effect it too much right?
Rhys
Rhys11/29/2022
Other than possibly longer build times on testing / CI / deployment
Favna
Favna11/29/2022
This tbh. Also React is very tiny. Only 330 KB @176457969465163776
Favna
Favna11/29/2022
It's the packages people install besides React that are large
24
2411/29/2022
True
Rhys
Rhys11/29/2022
There's also Preact if it's a concern, although not sure if it'd work with this lib
24
2411/29/2022
Seems odd though
24
2411/29/2022
Just feels wrong
24
2411/29/2022
if that makes sense
Favna
Favna11/29/2022
I.e. if you use create react app that pulls in over 300 transient dependencies
24
2411/29/2022
CRA is a disgrace to humanity
Rhys
Rhys11/29/2022
Oh yeah it feels wrong but works so well 😅
Rhys
Rhys11/29/2022
I'd love it if this could handle button interactions between bot restarts, gonna take a peek into the code and see if that's possible at all
Rhys
Rhys11/29/2022
Otherwise I'll just use it for ephemeral menus
Favna
Favna11/29/2022
Seeing as they use react state I'm guessing it's not. They'd have to probably add a Redis caching layer somehow.
Rhys
Rhys11/30/2022
Yeah that makes sense, it looks like they make random GUIDs for the buttons when you make a component so what you could possibly do is introduce a stateless component concept purely for menus that don’t change
Rhys
Rhys11/30/2022
And use static IDs for those
Rhys
Rhys11/30/2022
At that point though I think it’s possibly over complicating things and you’re better off mixing it with something like sapphire for handling long running button interactions
Rhys
Rhys11/30/2022
Looking at you #1038884471811879096
ContactFrequently Asked QuestionsJoin The DiscordBugs & Feature RequestsTerms & Privacy