deserialize string-store snowflake to string
Hey! I just started using @sapphire/string-store, and it seems to make the most sense to store all discord IDs as snowflakes, as they take less space in the custom ID than the string (im pretty sure, right?), however, this means i now need to call .toString() on all the stored snowflakes to use them with the rest of my code (or refactor everything to use bigints instead)
Is there some way to have .deserialize automatically turn bigints into strings? or is that functionality that would be worth adding?
14 Replies
that sounds like it could be a nice-to-have for the library, but as of right now, the library is in a bit of a limbo as it will basically not work properly and my rewrite of it has been paused until whenever. so I'd recommend to not use it right now, unfortunately.
Ouuh really? whats wrong with it currently?
seemed to work pretty well in the lil test i did
it'll work a bit, but- you'll likely hit the issue eventually depending on what you're going for. I can't confirm exactly the full scope what will 100% not work other than the serializer makes the wrong assumption about how the data needs to serialized and create invalid UTF-8 characters that the API doesn't like.
ahhh i see, yeah i havent actually tested it with the api yet haha
thats unfortunate, guess ill hold off for now :p
sorry for the inconvenience, when it's resolved, there'll be an announcement about it
No problem at all :) no need to apologize
Oh btw, ill drop another small suggestion then if theres a rewrite coming sometime, i saw theres quite a few exported utility types already, but i think something like
DataForCustomId would be nice to have, i ended up putting it together myself, but might be useful for others too:
Lets me define a button with a generic type and automatically have the deserialized data typed in my button, which is called from somewhere else
No idea if its actually useful for anyone else, but who knows :)
any help you'd need with this btw? Id be interested if possible :)I'm rewriting it with the serialization/deserialization being done in Rust, so there's that, plus I'd like to use this as a learning journey for me, which is why there's a delay, because I had to take a pause to focus on some studies as I was having a bit of a block with what I was trying to do.
ohh nice nice, like with node bindings?
yes
interesting
wouldnt that be annoying with having to build dependencies? or is it easy enough to just add prebuilt binaries?
wdym, are you asking if the user has to build it?
yea like on the node side, i remember having issues with some packages that needed node gyp builds in the past
it'll be a prebuilt binary
ahh nice
also sounds like a fun learning journey :) ill wait till the announcement
@SirH do you mind actually if i make a pr for a temporary fix in js? until youre done with a rust rewrite :)
wait ill take this to #utilities-development , seems more appropriate