#development
1 messages · Page 283 of 1
Which can be done on the server/nextjs api?
Partially yes
but the client still needs to call those api and respond to it / get the data returned
I guess I could possibly offload everything to the server and mitigate my need for async on the client
but i'd still need async to some degree
One idea I thought of is to cut off what I need to do in half but just creating stripe connected accounts on signup instead of doing it all at once when they want to make a seller account
WHAAAATTTTT HOWWWW i literally just removed a macro 😭
well i'd go the route that creates the least amount of client promises and then use .then or try and create a async hook which just returns a wrapped function

can you access the return value of the Page function on the client side?
so you never access its return value anywhere? does it have to return raw html?
nextjs handles whatever the return value of the page function is
I dont do it myself
can't you do whatever you need to with direct dom manipulation within a component?
i see, then you need to find somehwere else to use your async functinos
That's not the problem Belligerent Engine
Manipulating the dom isn't what im even trying to do
yeah I kind of undertand the issue, but doesn't the framework you are using have an "out" to just use raw html/js to solve a problem?
What I did when I needed to use async, is i had a server component be the main, which did all of the data manipulation or api handling, and then returned a client component, which passed down the data as parameters

I really hate how im currently doing things tbh
Even if I get it to work its not ideal

If you don't judge the code:
https://github.com/Cinnamonsroll/bkmrks/blob/main/app/[username]/[bookmark]/page.tsx
Is the server component
https://github.com/Cinnamonsroll/bkmrks/blob/main/app/[username]/[bookmark]/components/BookmarkPage.tsx is the client component
😭
sveltekit has await html blocks
{#await promise}
<!-- promise is pending -->
<p>waiting for the promise to resolve...</p>
{:then value}
<!-- promise was fulfilled or not a Promise -->
<p>The value is {value}</p>
{:catch error}
<!-- promise was rejected -->
<p>Something went wrong: {error.message}</p>
{/await}
xD
Love that, jealous of that
I think I need to rethink how i do everything tbh
@pulsar roost you're a big brain on how to use async with next
according to nextjs docs, they suggest putting async code in a server component, and access it from the client
Right now I have a button (which is its own component) that creates a stripe account, then redirects to a different page with a query param with the account id In it
then that page handles creating the session and embedding the stripe onboarding component

I am hating frontend work can someone else do it for me plez
See I would, but from all of today with how much you've complained about stripe, I no no wanna
I will pay 1 schmeckle an day
Realistically its not bad
if you know hwo to do frontend shit
I just dont
😭
I do like 45%
Yeah but then I can't do certain things
We believe in you, you got this
I dont
I think the first step is to remove all stripe integration so far in the pages
and redo it all
Start from scratch with a different approach
Cause how im doing it now is going to be aids to maintain
real
I don't do a lot of frontend but used to write a lot of tooling and build/integration stuff during the fun period when React was new and shiny. JS frameworks tend to be very overdesigned and opinionated.
The point of JS frameworks is to be so bad, someone builds one to compete which has it's own issues, rinse and repeat and eventually there is a good one
xD
I like to point out that one of the best websites I've ever used is Mcmaster-carr. And its built with aspx pages and popsicle sticks.
How does one send an ephemeral message using the new v2 components?
Considering the same flag field is used for both V2 / Ephemeral?
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /home/runner/ScarceExcellentVariables/node_modules/canvas-constructor/package.json
at new NodeError (node:internal/errors:371:5)
at throwExportsNotFound (node:internal/modules/esm/resolve:440:9)
at packageExportsResolve (node:internal/modules/esm/resolve:692:3)
at resolveExports (node:internal/modules/cjs/loader:482:36)
at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18) any help?
how are you importing/requiring canvas-constructor?
you combine the flags
flags: ephemeralflag + componentsv2flag
I thought for sure they were additive, but I wasn't entirely certain. Thank you!
huh
man just default export function async Page() { /*** stuff... **//}
nah man, just function Page export async default static class readonly { stuff }
I thought async exports didn't work with next
Can client components be async?
From what I've seen and experienced they cannot be
no
why do you need async tho
Yeah thats the approach ima take
Ima mimic pancake and have a server page that renders a client component of the page and just pass data to it as needed as child props
lmao
10/10
Yeah that’s exactly what ima do
I do similar when rendering the navbar
I prefetch the session and pass it
Granted I think I can make the navbar a server component now that I’m not using hooks anymore in it but I can’t remember
yeah right
what the hell
.data.data 😭
Give me my mod
Anyone can suggest me a good Ai model
That is free
Rn i am using gemma2
From groq
axios moment 
-# sorry guys i use axios 🙏pls dont bully thx
blocked /s
pain
🥺🥺🥺🥺
hi
what
yes and no
it uses a user-definable character table of 30 characters that are mapped to 5 bits each
31 and 32 are reserved values for characters not in the table
lmao
there are many attempts and variations on utf5 out there
i just saw another interesting one that uses a sliding window
im gonna test it out later
but this one is pretty ok, only about 30% slower than naive utf8
best case scenario it uses on average 2 bytes for every 3 characters
and worst case it uses more than utf8, no?
characters in range 00 to FF use 13 bits each, characters in range 00FF-FFFF use 21 bits each
utf8 already uses 16 bits for chars above 127, so its not that bad
me when 嗨
that would take 3 bytes in either one
hmm
24 bits in utf8 and 21 bits on mine
not horrible then
but if you put it in the character table, it will take 5 bits
well yes but thats cheating
well duh
working with 8, 16, 32 and 64 bits is always faster (tho 32 and 64 are always fastest)
idk rust
learn it then sir
i hate var in c# because i associate it with var in javascript which is a bad practice
rust did the right thing calling it let
lettables >
groovy: def
dynamic 
@charred nest that's not fair
Huh?
?
My bot needs both manage channel and role perms
please dm for disputes on declines.
alright, come
Ready to throw hands
dam @quartz kindle
real 0m6.986s
user 0m2.171s
sys 0m4.815s
root@HDE-03:/var/lib/pterodactyl/volumes/42d10e6f-8189-45ce-a603-5d856e46bbc1# cd ../../backups/
root@HDE-03:/var/lib/pterodactyl/backups# time ddup-bak backup fs ec4de486-b594-4fdf-b1bf-37117a03f443 ls g > /dev/null
real 0m2.376s
user 0m1.988s
sys 0m0.322s
root@HDE-03:/var/lib/pterodactyl/backups#```
nice
Should I do a stepper ui when people signup for my project?
Are those even good UX/UI wise?
well depend on how many data you ask
so my discord bot has two plans that are both lifetime one gives 10 channels access and one gives unlimited channels, now the way I have it set up is when they have 10 channels premium they can't upgrade to unlimited and idk if thats good or bad bcz I dont want them to pay twice
well, just charge the difference
yeah, make a new plan that acts as an upgrade between them
first extended sftp command 🔥 https://pastes.dev/Inef6gwlKi (not done yet)
Hahaha botghost did some fked up shit with their system.
- Hidden command blocks that could be hidden and shared with malicious requests and token exposed.
- Parsing variables by default so you can get any variable such as intetaction_token with any user input command that echos the output e.g a note command.
I managed to gaslight a Discord bot into giving me it's password, but it works on more than one bot...
BotGhost, a website meant for beginners to make their own Discord bots, has a vulnerability and it affects a ton of bots on their platform. Bug hunters exploited a couple of smaller vulnerabilities which combined together resulted in this big ...

hello, so i want to ask a question. if you're making a mobile app prototype that works, and have a page that's long enough for scrolling, do you make the frame long to cover all the contents or keep it cropped to the phone size? like in the picture, is it preferred to do the long one or short? and also for fixed element at the bottom of the phone, if i choose the long one, i need to put it in the middle where the actual bottom phone position is at
I'm probably not the greatest person to answer this and maybe don't perfectly understand, but if something is fixed to the bottom it should stay there, so if it's like infinite scrolling it should always stay the bottom, depending on what it is, it might scroll and change positions like go to the top, or to the left and right
But also like I said I might be completely misunderstanding your question and you can just ignore me
oh it's fine, the main question from me is that, is it preferred to have long frame to fit all contents or have phone-sized frame and have the contents hidden below it?
the squared element on the long frame is required to be at that position like in the screenshot or else it's hidden because it's out of phone's size range
sorry if my question is not clear enough
when i run my bot
all cogs load up
bot prints .env token is there and loaded
but it does not print logged in as bot
any solution how ?
is it supposed to automatically print that or do you have a print to say that?
does this look like a bad profile concept?
this is quite nice plus the hierarchy is well done but maybe make the badges in a row and on hover show a tooltip what the badge is about because personally it's taking too much space and align location, created at and the badges maybe to the left instead of center
you need to add
@bot.event
async def on_ready():
print(f'Logged in as {bot.user} (ID: {bot.user.id})')
this is the rest and im gonna change out some boxes for different things this isnt final
also I suggest to edit the navbar left/right spacing to the spacing on the main content container
I am not the best when it comes to UI but it looks clean to me
it def is
the concept is almost 1,000 lines 😭
not the bg 😭
if you want you can put svgs in a file (something.svg) and load it with <img> but then it's only static ig
as well as we are doing this concept too - Most likely will get printed out irl
So i got bored. Tried to make my bot a website. What do yall think?
The docs page is a bit buggy. Im working on it.
tbh quite nice, but you don't want to move stats on a website since this iritates users and the buttons background are blending too much into the background, maybe add a few images of your bot or even a nice video about it. But else good job 👍
looks good, but you need contract between the blue background and the buttons, plus the stats containers moving feels weird
i recommend you make the primary buttons not have the same gradient color as the background
make them stand out
@radiant kraken this is what I mean
can you show that line in errors.py?
on github it's already fixed but I shipped it to PyPi with the error, when I have components v2 support it'll be all good again
ohh cool!

i recommend you use a linter like ruff
super useful! i use it in every python project i maintain
Ic, will look into it, thanks for the recommendation 👍

It’s fixed one cog file had an loop event in end don’t know how but it was the imposter
https://pricepeek.vercel.app/ thoughts? ui wise
Track cryptocurrency prices in real-time with voice channels on Discord. Support for 1000+ cryptocurrencies with 10-minute updates.
clean but on mobile the hero and navbar is a bit weird behaving
yeah I will improve the mobile at some point
Just made my first dashboard for a bot!! It’s for a private bot and it’s only for staff members so they can change stuff without me needed to restart the bot
Nice web dev is always scary the first time
very small struct
tyty
@compact condor I fixed the mobile ui and the blinding white, I added dark and light theme toggle
https://pricepeek.vercel.app/
Track cryptocurrency prices in real-time with voice channels on Discord. Support for 1000+ cryptocurrencies.
check it out and tell me what u think 
One thing I can say
Typewriter effect needs work
Set the min/max height so it doesn't move the content as it types it out
Looks weird otherwise, especially on mobile
yeah you are right let me fix it
Not sure how to feel about the responsive menu for the nav
It's just styles buttons that don't really fit
Then again styling responsive navs were never my thing either so I can't really say
It just looks a bit weird
I think a lot of it contributes to the large open space thats just dead
Good work, it looks very well done! 
thank you all for the feedback
no problem 🤝
Config base
What is the best hosting platform for postgres databases?
I personally would put the db on the same platform as your service
Putting it in the same machine or even datacenter is the best thing you can do
Usually dbs use more ram than cpu so not really best platform but better specs really
my point was latency
Latency isnt an issue if you have stuff on the same machine and even then that's trivial for DBs
How to flex lol
emojis reserved for rust 🔥🚀🦀
Hi! I just built a web dashboard for my Discord moderation bot (still a noob at bot dev, so go easy on me 😅). Would love your honest thoughts—what’s cool, what’s missing, or what needs fixing!
👉 Peep it here: https://discord.mbingsdk.my.id/
Hit me with your hottest takes—features, UI, anything!
Thanks, legends! 🚀
how does that fix a memory leak?
pending requests could get stuck
and were never cleared if their initial cleanup was skipped (server error/timeout/aborted/...)
which caused me to have 1GB of pending requests on all 6 production servers
ah so you are imposing a time limit to clear it regardless of status?
yes
what could cause requests to get stuck tho?
no
if the request is aborted, my future will be dropped
aka no code will be executed further
theres probably a way to hook into that process but this is a lot simpler and safer
doesnt sound safe to me, i mean, using timers to handle async work is not really ideal
but yeah, i guess its simpler
hi
Is there anyone who needs dev help with their bot? I'm open to offering assistance!
I've half a gig of permission overrides in memory, how can I fix that mess without breaking permissions 
What Language are you using for your bot?
js
Create a temporary role, give it access, and add the user to that role.
Your hosting storage is full or what?
no but I'd rather not use 4gb of memory with just 17k servers
but djs is a memory hugging piece of software
What’s the client cache settings?
biggest caches rn are text channel manager and permission override manager
but limiting chose in some way will prob break shit
And they’re taking up 4gb?? That’s insane
love the UI on the site.
Have you looked into hybrid cluster sharding or whatever the package is called
I use a fork of it
blame widgetbot
okay
its been like that for idk
3 months
asked support but no help rly
it sometimes works
also, your review redirects to a dead page
yeah havent gotten around to change that xd
no worries XD just wanted to make sure you knew
Might just have to beg for more moneys from your users for a bigger server
throwing more hardware at an issue is not a good solution
I dread the day I start running out of memory again
should have written the bot in a real language
Would you rather do that or make your own library
my own
What are you waiting for then
go get out of hospital
the problem is not the language but djs
you can keep using js and use the discord api directly, create and manage your own caches
im aware but I got to love golang
my bot uses 100-150mb at 10k servers
im just rly frustrated about djs in general
yeah, i moved away from djs years ago as well
but if you prefer go over js then go for it
language preference is more important than performance/efficiency
all my microservices for wamellow are in go so
and they use like, idk, 10 micro cpu %??
and 3mb
cool
i like js the most so i stay with it
but manually accessing api's feels much better than using opinionated wrappers every single time
i generally like the dx - mostly
same with databases, i rather query them directy rather than using orms
never tried it, i like using sqlite directly
I’m the opposite. I’m bad at writing sql, EF Core is a life saver
i've been using diesel recently and yeah, i don't like how confusing some stuff is now
i would much rather write sql queries myself
Writing sql by hand for your own projects is fine, but I’ve found that writing it by hand when you’re working on enterprise projects is time consuming
I always write my own SQL wrapper for each project
Once you start querying using LINQ your life will change
to each their own :)
Type safety
also diesel isn't async by default which is quite annoying 
Rust diesel?
yeah
Bru no async by default?
Tf
I was considering diesel a few months back but I found it too annoying
Sqlx was a lot simpler
i tried rewriting my utf5 encoder into a cpp node module and apparently its faster than TextEncoder lol, but it still needs more testing
xD
indeed its annoying
but at least utf8/utf16 are the same everywhere
but since node 23.4 latin1 in node is not the same as it is in browsers
which is the stupidest thing
also, why the fuck doesnt TextEncoder support anything other than utf8, but TextDecoder does
what is the use case?
sounds interesting
facets for text, I get like an array of byteStarts and byteEnds that have a type of like bold
but its utf8
and js strings are utf16
i dont quite follow but sounds interesting lol
is it sort of like a .charAt() / .charCodeAt() for utf8 and utf16?
or like an .indexOf(char) ?
i like working with binary encodings, its so much fun
I have a string like
hello world
facets[]
byteStart: 6byteEnd: 11type: 'bold'
which I basically then convert to
hello **world**
oh
but to properly add the markdown features like **, I have to use the byte start/end, which are in utf8
you cant use simple string replacement / regex?
but javascripts .slice(i, i) is utf16
how would that work with a regex lol
what am I going to match for
i mean, applying transformations based on pattern matching, not byte positions
so how is there byte patterns? like how do you arrive at which bytes you want to transform?
is it not based on the content of those bytes?
I get the bytes from the same source as the string
its just their way of storing rich text
ohh, you run it through an api that requires input in byte indexes
im consuming data from an api yes
that makes more sense yeah
Depressive graph moment
oh my god javascript not having tuples is pissing me off bad
@solemn latch
tyty
edittt

dafuq is this lol
@zinc fable spam
Mannnn I wanted to read that
NO
it's not value typed
i need value typed tuples so bad
Why is website UI actually hard to figure out.
like coding it is EZ but the actual UI/UX is a pain
Opinions?
Too bland
There's nothing there that is visually appealing
Its just bright text on a dark background
I dont really know what to add to make it pop. Thats the issue rn
i dont really have testamonies.
And what images would pop. I dont mind the idea of pics.
Uhm
Anything related to your bot?
Could be screenshots of it in action
relatable pictures you find on the internet
Anything really so long as it's in theme
The bot is kinda hidden. I could take a clip of it deleting a scam message?
I like the idea. Im just trying to think what would work
I'd say its not the worst idea if you did that
I like the idea. I just am not sure past its image what to add pic wise.
I can take a clip of it deleting and reporting.
But thats all i can think of
@sharp geyser Do you think this looks ok?
Turn it into a gif
How?
Using a converter or something
or export it as a gif in whatever video editing software you have available
I just used snip to record lol
use an online converter then
Deep frying my brain atm rewriting a bunch of websocket stuff >_>
Having to implement both Client -> Server and Server -> Client modes for my docker agent program for dev space.
good luck
i still dont get whats the deal with the mask bits in websocket frames, so i just ignore that part altogether
I don't even know what you just said
Way beyond my brain
If Tim can't figure it out, what hope do us mere mortals have
it shows i am mortal too
perchance is transcript option for a live chat feature a good idea?
not really, sorry
my name was Tahmid GS
the guy who kept coming for some random noob errors 🙏
not anymore tho
Tim has helped so many people that it would be a miracle if he remembered this situation
Even I would have a problem with that
ah that name sounds familiar
ngl
that's enough :)
Does this look good? (has a fullscreen mode thats what im in, in the video)
looks good
you listen to music 24/7? xD
basically yes
even at school i have my earbuds in
i cant deal with noises :{
I have ADHD and get overstimulated :{
rip
hell idfk how im gonna do in the police
blast some hardcore music while shooting
😭
im literally applying to my local police next september im screwed
nah u got this
I just have airpods in and work with that the entire day
I work in a place where I need to hear so lmao
is this too many?
I really wish you'd stop recording your music as well
or at least put a warning so I dont get earraped
i dont mean to
i record with OBS...
Why?
i use OBS for streaming
Also obs has a way to turn audio channels off
MY WINDOWS RECORDER BROKE
no, everytime i try to use it i get an error code
Have you tried resolving it using your AI tools
huh??
(its only loud bc i was recording sirens)
i forgot to turn it down
sharex recordings >
just plug one ear
no 60 fps :(
Does anyone know if discord lists their IPs for incoming webhooks? I was hoping not to have to expose my HTTP API to the world for Discord.
Not really unless Discord uses cloudflares IP range? other than that you can check the User-Agent header to block most requests.
Friend, in every video you post the song you forgot is starting exactly the same time as the video. Respect people & their intelligence more; They tell you it bothers them, you do it deliberately then act like it was an accident as if everyone is stupid. Come on.
🤨
™️
.NET has worked on Linux for a long while now, it’s just funky when you deal with UI and such
It’s also a major PITA to install, or at least I had trouble with it
I only miss to programs on linux
paint.NET and shareX
well I got paint.NET working in wine, but only a 13yo version
not anymore
dotnet-install is a thing now
Its not the same song??
so far ive liked lightshot the best, but it doesnt record gifs and it randomly stopped working after some windows update, so im using flameshot as well
but lightshot's UI was much cleaner and better UX than flameshot
sharex is much more powerful but i dont like its UI/UX, i use it for gifs/mp4 only
Hey I'm making a server core bot. What commands should I add?
anyone integrated paypal?
or does anyone use kofi?
im wondering how can i connect someone's paypal on my website to send them money from 3rd party
like how kofi or pateron does it
i've been out of the scene for a while, what apis are out there that assist with dealing with spam bots and the like
i know anti fish is good to check links against, but is there anything that focuses on known hacked accounts and the like?
does smb have a good go-lang library to build nice CLI apps
I want to have a nice interface for progress and successful/failed steps
this looks meh
I think that looks alright for a terminal interface
was going to use it, but sadly they dont return the discord id
idk abt paypal, but they rates are a little too high imo
yeah, quite simple
when you pay the pal, whose pal is getting paid? your pal or their pal?
just don't play the video, its that easy 
does this look good for a connecting ui?
yeah im using email connected with discord with it
but just curious what APIs do they use?
patreon
when you connect your paypal and you receive money when someone donates on patreon 
so basically, someone donates via patreon to you, and you give the money to someone through paypal?
afraid to fail understanding your case
holy fucking shit npm website flashbang at 2am
cpp guys what is the best way to store a simple key value thing?
both keys and values are ints, keys are 0-64k and values are 0-255
only around 30 items will actually get stored
tried std::map and performance was abysmal
std::unordered_map
Standard std::map is a treemap iirc
C++’s standard lib naming conventions are abysmal
lmao
im using an array[64k] rn, performance is good but im allocating a 64k array on the stack to store only like 30 items lol
I mean tbf that’s only 256kb of memory
Actually that’s kinda big ig
unordered map is probably the best bet for standard lib afaik
lemme try
yes!
Depending on your use case, you might be able to get away with some dynamic resizing
Thank you.
unordered map was even worse
Really?
That’s surprising
You can initialize it with a bucket size I believe btw
Avoid some unnecessary reallocs
with map im getting 3 second for a million iterations
with stack array i get 400ms
Hmmmm
Your perf on the stack with direct array access will be pretty much unbeatable
That’s like the most ideal scenario for a lookup
But it’s just the downside of using a bunch of memory
yeah but if i want to use this in a class and run multiple instnces, each instance is gonna take 64k stack memory, isnt stack limited to like 2mb?
Not to mention that arrays are just fantastic for CPU cache
If you want, try heap allocating
See how much of a perf hit you take
If you’re concerned about memory try the unordered map solution but use .reserve after creation
Might help a bit with reallocation overhead
Fair enough, didn’t know how much you wanted to optimize ;^)
definitely perf in this case
although im pretty bad at cpp, so im sure there are things i could improve that i dont know aboujt
Yeah direct array access is about as fast as you can get
i constantly get confused with pointers
Pointers are confusing
lemme just make sure this is correct
You get a hang of it though
// in class definition
private:
char16_t charmap [31];
char16_t * keymap;
// in class constructor
Utf5::Utf5(char16_t * c) {
env = nullptr;
wrapper = nullptr;
wcsncpy((wchar_t *)charmap, (wchar_t *)c, 30);
keymap = (char16_t*)malloc(256*256);
for(uint8_t i = 0; i < 30; i++) {
keymap[charmap[i]] = i;
};
}
is this right?
i mean, it compiles and works
but idk about semantics xd
I would avoid using malloc and free in C++, prefer new and delete instead
It shouldn’t matter as long as you don’t mix them though
how do i create a 64k block using new?
Also make sure that your malloc sizes are consistent across platforms. Sometimes sizes vary, using sizeof() is usually better than a constant unless that’s your intended behavior
actually i need a 128k since i cast it to char16
new T[size] returns a pointer just like malloc but without needing to cast
Afaik, been a while since I’ve used C++
Oh shoot sorry it would be new[] T[size] I think?
i mean, this compiles keymap = new char16_t[256*256];
Yeah after consulting ChatGPT the first way is correct
To free the memory you would use delete[] ptr
delete[] keymap;?
Yeah
If keymap were just a single heap allocated object, then you would do delete keymap, but since it’s an array you need the square brackets
C++ is weird man
Rust ftw
yeah i dont feel like learning rust rn lmao
Blazing fast without the UB dogshit just because I didn’t know that Linus Torvalds shit his pants in 1985 which caused the C++ consulate to change the behavior of some obscure and unknown language feature that also isn’t properly implemented by MSVC but is on GCC and Clang
Once you go rust you barely ever go back
i need to have two sets of constructors and destructors
one for cpp, another for js
Ouch
class Utf5 {
public:
static void Destructor(napi_env env, void* nativeObject, void* finalize_hint);
static napi_value Init(napi_env env, napi_value exports);
private:
Utf5(char16_t * c);
~Utf5();
static napi_value New(napi_env env, napi_callback_info info);
static napi_value GetCharmap(napi_env env, napi_callback_info info);
static napi_value EncodeInto(napi_env env, napi_callback_info info);
// static napi_value Decode(napi_env env, napi_callback_info info);
static napi_ref constructor;
napi_env env;
napi_ref wrapper;
char16_t charmap [31];
char16_t * keymap;
};
well, there probably is a better way to do things, but this is how they do it in their official napi examples
rn its just an experient out of curiosity
but it could be
I have a feeling that the overhead for napi is going to make it not worthwhile for smaller payloads but 100% worth it for large payloads
Anything string related sounds like js is going to make 10 million allocations
yeah, even TextEncoder and Buffer are slower than for loops for small strings
Well either way good luck on your endeavors 🫡
ty
Ah yes
sorry A.J for the ghost ping, your @ wasnt showing in #mod-logs and I wanted to see who that was 
no worries
not the right place or server to post this
anyone else experiencing lag and getting this error?
discord.errors.DiscordServerError: 503 Service Unavailable (error code: 0): upstream connect error or disconnect/reset before headers. reset reason: overflow
oh dang
check discordstatus.com
how do i limit the topgg stats sending to like only one time? because it keeps running and even throws errors sometimes
nvm found it
Google cloud is 'down' rn
yh i just saw
go to downdetector, literally everything is going down rn 🤣
yeh
atleast it's somewhat readable
somewhat
intersting how this code
automatically turns the arrow around for rtl languages
no idea that was a thing
interesting, what if you put “hello world a -> b” , will it become “b <- a world hello”?
i dont think so
for example
Changed Italian (it) translation for Grand Est (FR.GES) region: Grande Est -> Grand Est
Changed Hebrew (he) translation for Charente-Maritime (FR.17) region: השראנט הימי -> שראנט-מריטים
these are the strings i am generating
the arrow changed for the hebrew part but not the rest, i think its based on the text being surrounded by rtl text
scammer?
wait but now i have no idea if the arrow is pointing in the right direction there lmao
apparently its not js doing it, its this markdown visualization im using
oh wow, interesting
my vscode md file also shows the rtl arrow
but a js console.log doesnt
it seems to be an utf8 thing
there are unicode characters to override text direction
removed it by doing this lmao
now all my arrows are left to right
this edditor has weird fonts, this one looks better
So im trying to figure out how to store the assigned agent to a live chat should it be stored via id?
Depends on your intentions, I’d say an ID is probably your best bet
An even better option would be using a relational db like postgres instead ;^)
account id is corelated to the ObjectId in the Database
wait that should be a string hold on
fixed that one
yeah bc thats a string

am I insanely stupid? I don't know what I am doing wrong
What exactly is the action you are performing
It looks like sending a message
Yeah I see that
My only guess is that you are still trying to send a message in the channel despite you checking for it
I am bailing out of the function early
There's some {} which I feel like are redundant especially when there's one statement after the if? 👀
https://cdn.hamoodihajjiri.com/sY97geO5vy - something like this (does it make a difference, absolutely not).
please help, In production, after logging in via Discord OAuth, the session doesn't persist, the frontend still shows the login screen instead of redirecting to the dashboard.
check your network and console tab first and see if you have any error in there
i am a strict bracket user
i already refactored it anyway
I am a strict code simplifier. 🌝
you there dismissing brackets while pythongrammers are starving
xD
btw is google shitting itself or is my isp sucking rn?
everything google is slow af and often not even loading
works normally for me
How big of a performance difference would it be if you used like an object look up here to make this smaller?
https://discord.mx/i/9VR7T6XYCi.png
negligible, as this is not a performance-sensitive part
did you just do the if statements for readability?
initially i do them the long way and lay out every possibility separately
then if there is room for it, i can take another look and shorten it out
since there was a different message for each option i put them all separate, but now that its done and there are similar patterns on each message there is room for refactoring
lmao
What is it for?
im working on automating this
now i need to setup a github actions to automatically run the updater
Oh that's awesome
i think i'll make an extended version which includes 3-digit language codes and dash codes
idk how big it will be
What is the best way to implement premium commands?
It depends on your architecture. There is no universal best way, only the best way for you but we don't know what that is since your app is different from ours
This is the code I want to emplement premium commands on https://github.com/BrandgrandRealMe/OptiCore
And I have a buymeacoffee set up but I could switch to something else
does bymeacoffee have an api or a webhook?
fyi, discord dev terms force you to (also) use in-app purchases if u live in us/uk/eu
Guys can somebody rate my website?
when i select the yellow at the bottom they all turn yellow. is that supposed to happen
Normally no but I'll fix it
same with purple the top becomes pink
Hmm
but i like the design very clean
Thanks
lol im sorry but that is ai generated 😭
?
Its not
Do u have any proof then that it is ai?
is it fully done tho? your website
Having done a bit of vibe coding myself, you might want to clean up the ai-generated comments after it generates code for you. It speaks better English than you do 🤣
that footer is also a dead giveaway 😆
Yup, lovable
The amount of software vulnerabilities created by lovable is embarrassing
Also the correct use of html tags like section, which sounds like a small thing but often people just div * 1000
@solemn latch scam
Also pseudo element to place background?
With an unneeded z-index
Link to source
I think so
"Discord's Developer Terms of Service and related monetization policies do not explicitly force developers in the US, UK, or EU to use Discord's in-app purchase system exclusively. However, if you choose to monetize your app through Discord's Premium Apps (e.g., via App Subscriptions or One-Time Purchases), you are required to use Discord's monetization platform for those transactions."
if it has a webhook, you configure it so that your bot receives a signal when someone subscribes/purchases something, use that to update your database
if they dont have a webhook but have a rest api, you can query their api to obtain a user's subscription status
Is there something specifically for discord bots?
their api doesnt say anything specific for discord bots, so you'd need to build an interface yourself
I am switching to gumroad becuase it feels better
Added a blur effect to modals idk how good it looks tbh

Nice
helloü
yeah i fw it
What does everyone think of the slight rework to the docs page? I do know the sidebar is screwed up. Thats somthing with top.gg's code i havent solved yet. https://github.com/Antiscammer-Dev-team/docs
Top.gg documentation website. Contribute to Antiscammer-Dev-team/docs development by creating an account on GitHub.
theres no error showing up on console except the 401 unauthorized but that comes on everytime
Idk cant help without context
What are you using for sessions?
use jsonwebtoken
yeah just noticed that
took me a min to realize after looking through other projects
wtf is this source code (it's jwt)
jesus
I hope it's just some polyfill or shit but still
pretty standard minified code, why?
oh you're literally trying to install malware, congrats
that really doesnt work in a module?
import.meta.dirname or smth
i just did this to fix it...
its really dumb
oh that worked
that worked so much eaiser
you shouldn't use express as it's the slowest http framework, jfyi
(and I hate ejs but that's personal)
i just like using it bc its what ive been using for years and i know how to cretae systems so well in it
create*
(plus im behind on basically everything so i want to get it all done and deployed)
fair
used to be much on ejs but started to hate it and got intro react
then typescript as well
lmfao my first ever dashboard is built using ejs
actually fine, but it'll be a mess once the app is big
and react is much easier and save much time
im still working on the live chat dashboard any suggestions?
You can take some ideas from https://www.tawk.to/
tawk.to is 100% free live chat software to monitor and chat with visitors on your website or from a free customizable page.
You got a link to it?
link to what
me when v0
This actually looks rather sick
I love that they are also completely transparent in how it operates and is able to make money despite being a free software at its core
Rarely see that in SaaS companies now a days
Yup their web widget is also pretty neat
Might have to cop that for myself instead of rolling out my own system

More I can offload somewhere else the better
Inb4 i add support chat to dev space 
I honestly haven't looked at devspace in a hot minute
I've put stuff on it and haven't needed to look at it since it just runs 😭
I'm adding a different agent mode to it now by default it was website -> agent vps now theres gonna be a agent -> website just like how portainer does edge agents
🙂 i asked for suggested ones in here and a few servers and my own recommendations too
After this i'll be working on status features to monitor web/servers/containers with public pages and alerts with webhooks/discord will be nice to use without hetrixtools login every 14 days requirement.
I just used ffmpeg to compress a video's size from 855mb to 72mb
783025kb difference to be exact
👀
And the quality doesn't really seem lost either
It's a tad bit more grainy but other than that
what was the original format?
?
We wanted to congratulate you on creating the one billionth repository on GitHub! ➜ curl -s https://api.github.com/repositories/1000000000 { "id": 1000000000, "node_id": "R...
i wonder what id 1 is
according to the api, its this: https://github.com/mojombo/grit
It is with these types of things that I realize how fucking old I am
Im older than GitHub's first repo
dude...
Hm?
thanks but i got it fixed
it was conflicting with how brave was handling cookies when i tried with chrome it worked
thanks again for help @frosty patio @hidden gorge ❤️
mfw you guys are even younger than my youngest sibling who is 10 years younger than me
2008 🥀
Hey boys i have a problem.
I have a js file calling a py script. So it’s awaiting till the py script is done.
Thiugh this blocks the whole script and no other people can use the bot then eventhough they are not affilitated to this request
you use execSync ?
Why are you doing this weird process in the first place 🙃 surely there is a better way
maybe ml? who knows
Machine learning
I dont like using js libraries
and tensorflow js doesnt work on apple silicon
use exec or better, spawn
Wouldnt that still block until the subprocess exists
Cuz i am awaiting a pipeline output
heres some info that might help https://stackoverflow.com/questions/69328592/can-i-listen-for-a-specific-output-with-child-process
you can also combine spawn with readline to process data as it comes in, in case you have a process that gradually outputs data
my bot giving multiple responses any help?
whats your environment? pc/vps/server/library/language/etc
Hey tim
I have a port issue with ssh I haven't ran into before
I set the port in sshd_config to something different, but for some reason its still using the old port despite doing a hard reset of the system & also restarting ssh
I remember you helped me with this before a while back iirc
This might be your answer https://askubuntu.com/a/1439482
Instead of the ssh config it uses the systemd control config which overwrites that
^
Ah I forgot about fucking sockets and shit
Apologies if this isn't the right place, but is there a way I can change my bots profile image on the top.gg site? I can't seem to find an option anywhere
it should get it automatically from your bot's discord profile
you should be able to change it in your discord developers bot page
Ah ok I didn't know/remember that when I first set it all up. I've gone and updated it there, any idea how long before I see the changes reflected?
You need to click "refresh data" button every time you change the bot avatar
does anyone have a tutorial on how to setup the webhook for topgg using python?
or can anyone walk me through it cuz i have no idea what im doing
@_@
Good link
how'd I ensure quality control with translations? while I have proofreaders on crowdin, idk how well they do their job, as, well, I don't know the languages
if you dont trust them, hire a 2nd proofreaders
still unsure? 3rd, 4th, 5th, ∞
I only have volunteers lmao
xD sorry for my joke, might not be funny. but if i were you, i might do tests on them, maybe like in 1 category you have 20, check 5 random translations, and ask them to AI. if happen to have a mistake, add more checks. yeah i'd be utilizing AI for translation related.
yeah I used to check every few translations with deepl if they aren't nonsense
but I cannot really check the quality itself or if it misses the point or context
ah, that's why i usually use chatgpt/gemini. i can tell it what's the context and they will understand for the rest of chat
Damn i just created my own crypto project and started a free open beta but honestly i ahould’ve stress tested it more
Within 1 day i used over 3.5k api credits of my 50k plan
i will go back to my code and try and cache to reduce the amount of fetchrs made 😭
If we assume there's a messaage like "@neon flicker", would it be possible to extract the user from the message?
from the mention?
either use the mentions field in the API data or regex match the content
Sorry for the poor explanation, I was curious what the string would look like and it turns out that the mentions are simply replaced with <@id>
Guys does anyone know how to fix that
wikipedia apis are so damn confusing holy...
Oh no if he thinks it's confusing were all screwed
broo i know right
they don't have a single api endpoint to scrape a single page.
they fucking segmented it
lints, media-lists, mobile-html..., parsoids or whatever that was.
i tried working with it once and gave up
its even worse than that
they have three major systems: wikipedia, wikidata and wikibase
all of them with separate api groups
and one of them uses a weird database system called SPARQL
i spent the last 5 days working on this shit, figuring out what all of these apis can do and how to do these weird queries lmaop
but i did figure out how to do what i wanted in only 3 requests, which previously took me hundreds of individual reqs lmao
the SPARQL query alone took me 3 days to figure out
You should see if chatgpt can one shot it for fun
(it probably can't)
But it'd be interesting to see how many requests it takes
Looks less awful than GraphQL lol
though a bit similar in theory
I'd actually be optimistic about LLMs being able to spit out simple queries in stuff you're unfamiliar with.
Speeding up the zero to "working app" stage in a brand new toolset/framework/whatever is one of the better uses for it.
it actually worked pretty well
half of the query works, the other half doesnt lmao
now my vsc is freezing from writing/reading a 200mb json file
Ofc that's gonna freeze lol
scraping tons of data from wikipedia lmao
most of it is redundant
i split it into 3 files, 6mb 34mb and 141mb
just do constants.js smh
sure sure :^)
Holy shit
biggest file i ever had was similar in size, but it was for a dictionary
and that was just until i loaded it into db
this is basically a datadump from geonames+wikipedia
i will still process it, dedupe it and what not
will it go away like are you putting it into a db?
nope, it will remain a json file to be imported by libs
but the final one will be much smaller
i'll make a few different variations, final sizes will probably range from <1mb to 20+mb
xD
i wonder how much data i've downloaded from them in the last few days total
been testing this thing for like 5days now, and every time i test it i re-download everything xD
well 90% of the script is handling the download itself
so i can only test it by redownloading
because its not like im downloading a single file, its hundreds of requests to various wikipedia/geonames endpoints
and combining the data and what not
if there is one mistake somewhere, i need to run the whole thing again after fixing to see if it worked
I had to do that when I built my dictionary db
And I didn't add continuing, so if I stopped the script it'd complete restart, checking every word again
and I went to run it overnight and didn't turn my computer to where it doesn't turn off, so it just turned off, ending it
rip-
It proceeded to end 4 more times throughout the day before I add a system to continue through restarts
this is sort of mesmerizing to watch lmao
FTP moment
are you uploading node modules lmao
thats just the speed being slow
1.45 KB/s is rough
What
I like to zip things and then upload that
Having to process multiple files for ftp uploads usually takes so much longer than just one
Yea, there is still a function to enable that allows you to send multiple files at once but still sending one zip will be faster I guess

Nah it’s Minecraft mods 😭
Hi guys um trying to fix my task commend which cant understan d due time (tommorow, in 30 mins etc) can somebody tell me why?
not without seeing the code behind it
U need the code?
yes
Tim is so good that he can analyze the code through discord message
lies
i dont have x ray vision
sadly
awh that sucks :(

