#development

1 messages · Page 283 of 1

sharp geyser
#

and all those calls require async

#

😭

queen needle
#

Which can be done on the server/nextjs api?

sharp geyser
#

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

radiant kraken
#

WHAAAATTTTT HOWWWW i literally just removed a macro 😭

queen needle
sharp geyser
quartz kindle
#

can you access the return value of the Page function on the client side?

sharp geyser
#

wym

#

Page is the function that renders the html elements

quartz kindle
#

so you never access its return value anywhere? does it have to return raw html?

sharp geyser
#

nextjs handles whatever the return value of the page function is

#

I dont do it myself

willow ether
#

can't you do whatever you need to with direct dom manipulation within a component?

quartz kindle
#

i see, then you need to find somehwere else to use your async functinos

sharp geyser
#

That's not the problem Belligerent Engine

#

Manipulating the dom isn't what im even trying to do

willow ether
#

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?

queen needle
#

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

sharp geyser
#

I really hate how im currently doing things tbh

#

Even if I get it to work its not ideal

sharp geyser
#

My code isn't any better

#

im a backend dev trying to make frontend shit work

#

😭

radiant kraken
#

😭

quartz kindle
#

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

queen needle
#

Love that, jealous of that

sharp geyser
#

I think I need to rethink how i do everything tbh

queen needle
#

@pulsar roost you're a big brain on how to use async with next

quartz kindle
sharp geyser
#

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

queen needle
#

See I would, but from all of today with how much you've complained about stripe, I no no wanna

sharp geyser
#

I will pay 1 schmeckle an day

sharp geyser
#

if you know hwo to do frontend shit

#

I just dont

#

😭

queen needle
#

I do like 45%

quartz kindle
#

doesnt stripe have managed checkout pages?

#

like iframes and shit

sharp geyser
#

Yeah but then I can't do certain things

quartz kindle
#

so you dont have to fully integrate it

#

rip

queen needle
#

We believe in you, you got this

sharp geyser
#

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

queen needle
#

real

willow ether
#

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.

queen needle
#

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

quartz kindle
#

xD

willow ether
#

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.

long marsh
#

How does one send an ephemeral message using the new v2 components?

#

Considering the same flag field is used for both V2 / Ephemeral?

ashen quail
#

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?

quartz kindle
quartz kindle
#

flags: ephemeralflag + componentsv2flag

long marsh
pulsar roost
#

man just default export function async Page() { /*** stuff... **//}

quartz kindle
#

nah man, just function Page export async default static class readonly { stuff }

queen needle
lament rock
#

Its always Tim with the most cursed code

#

Need an exorcism A_HuMonkaSCross

quartz kindle
#

someone exorcise me

#

and my cursed utf5 encoding

sharp geyser
#

From what I've seen and experienced they cannot be

pulsar roost
pearl trail
pulsar roost
#

probably to do something like this

#

aka get data server side

sharp geyser
#

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

pearl trail
queen needle
#

10/10

sharp geyser
#

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

pearl trail
civic scroll
civic scroll
echo berry
#

Give me my mod

somber turtle
#

Anyone can suggest me a good Ai model

#

That is free

#

Rn i am using gemma2

#

From groq

pearl trail
pearl trail
glass ridge
#

hi

neon leaf
#

Rust cat

quartz kindle
neon leaf
#

why utf5

#

doesnt that mean each scalar value is 5 bits

#

so 4 actual data bits?

quartz kindle
#

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

neon leaf
#

least cursed thing ive heard from you

quartz kindle
#

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

neon leaf
#

and worst case it uses more than utf8, no?

quartz kindle
#

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

neon leaf
#

me when 嗨

quartz kindle
neon leaf
#

hmm

quartz kindle
#

24 bits in utf8 and 21 bits on mine

neon leaf
#

not horrible then

quartz kindle
#

but if you put it in the character table, it will take 5 bits

neon leaf
#

well yes but thats cheating

quartz kindle
#

yup

#

the only problem is performance, its slower than utf8

neon leaf
#

well duh

#

working with 8, 16, 32 and 64 bits is always faster (tho 32 and 64 are always fastest)

quartz kindle
#

maybe if i make a c++ addon for it

#

:^)

neon leaf
#

make it in rust

#

i dare u

quartz kindle
#

idk rust

neon leaf
#

learn it then sir

frosty gale
#

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

queen needle
#

lettables >

lyric mountain
#

groovy: def

prime cliff
#

dynamic mmLol

crude hound
#

@charred nest that's not fair

deft wolf
#

Huh?

charred nest
#

?

crude hound
charred nest
#

please dm for disputes on declines.

crude hound
frosty patio
#

Ready to throw hands

neon leaf
#

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#```
sharp geyser
#

Should I do a stepper ui when people signup for my project?

#

Are those even good UX/UI wise?

pearl trail
#

well depend on how many data you ask

frosty patio
#

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

lyric mountain
#

well, just charge the difference

quartz kindle
#

yeah, make a new plan that acts as an upgrade between them

neon leaf
prime cliff
#

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.

https://youtu.be/lUiLBBab1RY

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 ...

▶ Play video
dusk tangle
pearl trail
#

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

queen needle
#

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

pearl trail
#

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

crystal plover
#

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 ?

lament rock
#

is it supposed to automatically print that or do you have a print to say that?

hidden gorge
#

does this look like a bad profile concept?

compact condor
# hidden gorge 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

frosty patio
hidden gorge
compact condor
frosty patio
compact condor
#

it def is

hidden gorge
#

the concept is almost 1,000 lines 😭

real rose
#

not the bg 😭

compact condor
hidden gorge
#

as well as we are doing this concept too - Most likely will get printed out irl

warped glacier
#

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.

compact condor
# warped glacier

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 👍

frosty patio
# warped glacier

looks good, but you need contract between the blue background and the buttons, plus the stats containers moving feels weird

radiant kraken
# warped glacier

i recommend you make the primary buttons not have the same gradient color as the background

#

make them stand out

compact condor
radiant kraken
compact condor
radiant kraken
#

i recommend you use a linter like ruff

#

super useful! i use it in every python project i maintain

compact condor
#

Ic, will look into it, thanks for the recommendation 👍

radiant kraken
crystal plover
frosty patio
compact condor
frosty patio
dapper gorge
#

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

prime cliff
#

Nice web dev is always scary the first time

neon leaf
#

very small struct

neon leaf
#

@zinc fable

#

@zinc fable

zinc fable
#

tyty

frosty patio
#

check it out and tell me what u think onionpray

sharp geyser
#

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

frosty patio
sharp geyser
#

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

compact condor
frosty patio
#

thank you all for the feedback

compact condor
#

no problem 🤝

hollow pebble
long marsh
#

What is the best hosting platform for postgres databases?

acoustic bough
#

I personally would put the db on the same platform as your service

lament rock
#

Putting it in the same machine or even datacenter is the best thing you can do

prime cliff
#

Usually dbs use more ram than cpu so not really best platform but better specs really

acoustic bough
#

my point was latency

prime cliff
#

Latency isnt an issue if you have stuff on the same machine and even then that's trivial for DBs

prime cliff
#

How to flex lol

neon leaf
#

emojis reserved for rust 🔥🚀🦀

hollow pebble
#

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! 🚀

quartz kindle
neon leaf
#

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

quartz kindle
#

ah so you are imposing a time limit to clear it regardless of status?

neon leaf
#

yes

quartz kindle
#

what could cause requests to get stuck tho?

neon leaf
#

server error/timeout/aborted/...

#

aborted being what happened most I would assume

quartz kindle
#

dont you have events for that?

#

like onAborted

neon leaf
#

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

quartz kindle
#

doesnt sound safe to me, i mean, using timers to handle async work is not really ideal

#

but yeah, i guess its simpler

amber wraith
#

hi

#

Is there anyone who needs dev help with their bot? I'm open to offering assistance!

acoustic bough
amber wraith
#

What Language are you using for your bot?

acoustic bough
amber wraith
#

Create a temporary role, give it access, and add the user to that role.

acoustic bough
#

what

#

idk how that would solve anything with the memory issue xd

amber wraith
acoustic bough
#

no but I'd rather not use 4gb of memory with just 17k servers

#

but djs is a memory hugging piece of software

digital swan
acoustic bough
#

biggest caches rn are text channel manager and permission override manager

#

but limiting chose in some way will prob break shit

digital swan
#

And they’re taking up 4gb?? That’s insane

acoustic bough
#

2,7gb rn

knotty night
#

love the UI on the site.

digital swan
#

Have you looked into hybrid cluster sharding or whatever the package is called

acoustic bough
#

I use a fork of it

knotty night
#

your home docs page endlessly loads, the rest are fine

acoustic bough
#

blame widgetbot

knotty night
#

okay

acoustic bough
#

its been like that for idk

#

3 months

#

asked support but no help rly

#

it sometimes works

knotty night
#

also, your review redirects to a dead page

acoustic bough
#

yeah havent gotten around to change that xd

knotty night
#

no worries XD just wanted to make sure you knew

digital swan
acoustic bough
#

throwing more hardware at an issue is not a good solution

digital swan
#

I dread the day I start running out of memory again

acoustic bough
#

should have written the bot in a real language

digital swan
acoustic bough
#

my own

digital swan
#

What are you waiting for then

acoustic bough
#

go get out of hospital

digital swan
#

Oh damn

#

Good luck

quartz kindle
#

you can keep using js and use the discord api directly, create and manage your own caches

acoustic bough
#

im aware but I got to love golang

quartz kindle
#

my bot uses 100-150mb at 10k servers

acoustic bough
#

im just rly frustrated about djs in general

quartz kindle
#

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

acoustic bough
#

all my microservices for wamellow are in go so

#

and they use like, idk, 10 micro cpu %??

#

and 3mb

quartz kindle
#

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

acoustic bough
#

i generally like the dx - mostly

quartz kindle
#

same with databases, i rather query them directy rather than using orms

acoustic bough
#

for that kysely is the best

#

imo

quartz kindle
#

never tried it, i like using sqlite directly

acoustic bough
#

its a query builder

#

not an orm directly

#

basically just typesafe sql queries

wheat mesa
covert gale
#

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

quartz kindle
#

i create the types myself in the same file that creates the tables

#

for example

wheat mesa
#

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

neon leaf
#

I always write my own SQL wrapper for each project

wheat mesa
#

Once you start querying using LINQ your life will change

quartz kindle
#

to each their own :)

wheat mesa
#

Type safety

covert gale
neon leaf
#

Rust diesel?

covert gale
#

yeah

neon leaf
#

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

quartz kindle
#

i tried rewriting my utf5 encoder into a cpp node module and apparently its faster than TextEncoder lol, but it still needs more testing

acoustic bough
#

oh my god I had so much pain with utf8 <-> utf16

#

😭

quartz kindle
#

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

acoustic bough
quartz kindle
#

also, why the fuck doesnt TextEncoder support anything other than utf8, but TextDecoder does

acoustic bough
#

lmao

#

all I needed is just converting byte indexes

quartz kindle
#

sounds interesting

acoustic bough
#

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

quartz kindle
#

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

acoustic bough
#

I have a string like
hello world
facets[]

  • byteStart: 6
  • byteEnd: 11
  • type: 'bold'

which I basically then convert to
hello **world**

quartz kindle
#

oh

acoustic bough
#

but to properly add the markdown features like **, I have to use the byte start/end, which are in utf8

quartz kindle
#

you cant use simple string replacement / regex?

acoustic bough
#

but javascripts .slice(i, i) is utf16

acoustic bough
#

what am I going to match for

quartz kindle
#

i mean, applying transformations based on pattern matching, not byte positions

acoustic bough
#

there is no pattern

#

lmao

quartz kindle
#

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?

acoustic bough
#

I get the bytes from the same source as the string

#

its just their way of storing rich text

quartz kindle
#

ohh, you run it through an api that requires input in byte indexes

acoustic bough
#

im consuming data from an api yes

quartz kindle
#

that makes more sense yeah

prime cliff
#

Depressive graph moment

scenic kelp
#

oh my god javascript not having tuples is pissing me off bad

neon leaf
#

@solemn latch

solemn latch
#

tyty

oblique jay
#

edittt

pearl trail
quartz kindle
#

dafuq is this lol

prime cliff
#

@zinc fable spam

zinc fable
#

💀

#

tyty

#

@oblique jay pls dont spam your harry potter fanfic

sharp geyser
scenic kelp
#

it's not value typed

#

i need value typed tuples so bad

warped glacier
#

Why is website UI actually hard to figure out.

#

like coding it is EZ but the actual UI/UX is a pain

warped glacier
sharp geyser
#

Too bland

#

There's nothing there that is visually appealing

#

Its just bright text on a dark background

warped glacier
#

I dont really know what to add to make it pop. Thats the issue rn

sharp geyser
#

Images are a good start

#

testimonies from users if you have them

warped glacier
#

i dont really have testamonies.

#

And what images would pop. I dont mind the idea of pics.

sharp geyser
#

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

warped glacier
#

The bot is kinda hidden. I could take a clip of it deleting a scam message?

sharp geyser
#

All I can give you is ideas, what you do from here is up to you

warped glacier
#

I like the idea. Im just trying to think what would work

sharp geyser
#

I'd say its not the worst idea if you did that

warped glacier
#

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?

sharp geyser
#

Turn it into a gif

warped glacier
#

How?

sharp geyser
#

Using a converter or something

#

or export it as a gif in whatever video editing software you have available

warped glacier
#

I just used snip to record lol

sharp geyser
#

use an online converter then

warped glacier
#

Done

prime cliff
#

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.

quartz kindle
#

good luck

#

i still dont get whats the deal with the mask bits in websocket frames, so i just ignore that part altogether

queen needle
#

I don't even know what you just said

quartz kindle
#

this part

#

so i always set it to 0

#

:^)

queen needle
#

Way beyond my brain

lament rock
#

If Tim can't figure it out, what hope do us mere mortals have

quartz kindle
#

it shows i am mortal too

dusk tangle
#

crazy

#

tim dyu remember me

#

i was around here some years ago

hidden gorge
#

perchance is transcript option for a live chat feature a good idea?

quartz kindle
dusk tangle
#

the guy who kept coming for some random noob errors 🙏

#

not anymore tho

deft wolf
#

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

quartz kindle
dusk tangle
dusk tangle
hidden gorge
quartz kindle
#

you listen to music 24/7? xD

hidden gorge
#

even at school i have my earbuds in

#

i cant deal with noises :{

quartz kindle
#

interesting, im totally the opposite

#

i rarely ever listen to music

hidden gorge
#

I have ADHD and get overstimulated :{

quartz kindle
#

rip

hidden gorge
#

hell idfk how im gonna do in the police

quartz kindle
#

blast some hardcore music while shooting

hidden gorge
#

im literally applying to my local police next september im screwed

quartz kindle
#

nah u got this

acoustic bough
#

I've adhd and I can't live without music either

hidden gorge
#

hold up lemme get mine

hidden gorge
#

its only low bc im busy a lot at stuff where i can't have my phone

acoustic bough
#

I just have airpods in and work with that the entire day

hidden gorge
hidden gorge
#

is this too many?

sharp geyser
#

or at least put a warning so I dont get earraped

hidden gorge
sharp geyser
#

You do it every time

#

💀

hidden gorge
#

i record with OBS...

sharp geyser
#

Why?

hidden gorge
#

i use OBS for streaming

sharp geyser
#

Also obs has a way to turn audio channels off

hidden gorge
sharp geyser
#

womp womp?

#

I doubt its broken

#

you just cant use it properly

hidden gorge
sharp geyser
#

Have you tried resolving it using your AI tools

hidden gorge
hidden gorge
#

i forgot to turn it down

queen needle
#

sharex recordings >

acoustic bough
pearl trail
acoustic bough
#

I loved sharex but no Linux support :/

#

even though .NET now works on Linux iirc

covert gale
#

yeah it's unfortunate

#

i've resorted to flameshot + peek for gifs

long marsh
#

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.

prime cliff
#

Not really unless Discord uses cloudflares IP range? other than that you can check the User-Agent header to block most requests.

wintry storm
# hidden gorge i dont mean to

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.

deft wolf
#

🤨

pearl trail
#

™️

wheat mesa
#

It’s also a major PITA to install, or at least I had trouble with it

acoustic bough
#

I only miss to programs on linux

#

well I got paint.NET working in wine, but only a 13yo version

sharp geyser
#

dotnet-install is a thing now

quartz kindle
#

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

keen obsidian
#

Hey I'm making a server core bot. What commands should I add?

crystal wigeon
#

anyone integrated paypal?

#

flork_think 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

covert gale
#

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?

acoustic bough
#

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

lament rock
#

I think that looks alright for a terminal interface

lyric mountain
#

idk abt paypal, but they rates are a little too high imo

pearl trail
quartz kindle
#

when you pay the pal, whose pal is getting paid? your pal or their pal?

frosty patio
hidden gorge
#

does this look good for a connecting ui?

crystal wigeon
#

but just curious what APIs do they use?

#

patreon

#

when you connect your paypal and you receive money when someone donates on patreon flork_think

pearl trail
#

so basically, someone donates via patreon to you, and you give the money to someone through paypal?

#

afraid to fail understanding your case

surreal sage
#

holy fucking shit npm website flashbang at 2am

quartz kindle
#

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

wheat mesa
#

Standard std::map is a treemap iirc

#

C++’s standard lib naming conventions are abysmal

quartz kindle
#

lmao

wheat mesa
#

std::list is also misleading

#

It’s a linkedlist

#

Enjoy your O(n) random access

quartz kindle
#

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

wheat mesa
#

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

quartz kindle
#

lemme try

golden pawn
wheat mesa
#

Depending on your use case, you might be able to get away with some dynamic resizing

hidden gorge
quartz kindle
wheat mesa
#

Really?

quartz kindle
#

yeah lmao

#

i mean, its pretty similar to map

wheat mesa
#

That’s surprising

#

You can initialize it with a bucket size I believe btw

#

Avoid some unnecessary reallocs

quartz kindle
#

with map im getting 3 second for a million iterations

#

with stack array i get 400ms

wheat mesa
#

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

quartz kindle
#

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?

wheat mesa
#

Not to mention that arrays are just fantastic for CPU cache

wheat mesa
#

See how much of a perf hit you take

quartz kindle
#

lemme try with heap

#

oh nice i also get 400ms with heap

wheat mesa
#

If you’re concerned about memory try the unordered map solution but use .reserve after creation

#

Might help a bit with reallocation overhead

quartz kindle
#

nah i'll keep it on the heap, its fine

#

64k is nothing for heap

wheat mesa
#

Fair enough, didn’t know how much you wanted to optimize ;^)

quartz kindle
#

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

wheat mesa
#

Yeah direct array access is about as fast as you can get

quartz kindle
#

i constantly get confused with pointers

wheat mesa
#

Pointers are confusing

quartz kindle
#

lemme just make sure this is correct

wheat mesa
#

You get a hang of it though

quartz kindle
#
// 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

wheat mesa
#

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

quartz kindle
#

how do i create a 64k block using new?

wheat mesa
quartz kindle
#

actually i need a 128k since i cast it to char16

wheat mesa
#

Afaik, been a while since I’ve used C++

#

Oh shoot sorry it would be new[] T[size] I think?

quartz kindle
#

i mean, this compiles keymap = new char16_t[256*256];

wheat mesa
#

Yeah after consulting ChatGPT the first way is correct

#

To free the memory you would use delete[] ptr

quartz kindle
#

delete[] keymap;?

wheat mesa
#

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

quartz kindle
#

yeah i dont feel like learning rust rn lmao

wheat mesa
#

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

quartz kindle
#

xDDD

#

also napi is a pain

wheat mesa
#

Yeeeeep

#

Anything FFI related is a pain

quartz kindle
#

i need to have two sets of constructors and destructors

#

one for cpp, another for js

wheat mesa
#

Ouch

quartz kindle
#
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;
};
wheat mesa
#

Js deconstructor sounds cursed

#

Is this for your ultra fast encoding/decoding lib?

quartz kindle
#

well, there probably is a better way to do things, but this is how they do it in their official napi examples

quartz kindle
#

but it could be

wheat mesa
#

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

quartz kindle
#

yeah, even TextEncoder and Buffer are slower than for loops for small strings

wheat mesa
#

Well either way good luck on your endeavors 🫡

quartz kindle
#

ty

small tangle
#

Ah yes

frosty patio
#

sorry A.J for the ghost ping, your @ wasnt showing in #mod-logs and I wanted to see who that was okeh

next storm
#

cls_emoji_lol no worries

languid shale
#

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

dusk tangle
#

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

acoustic bough
languid shale
#

go to downdetector, literally everything is going down rn 🤣

acoustic bough
#

yeh

quartz kindle
#

cursed block of code

pearl trail
#

hell yeah, one liner 🔥

#

would be better to not use { }

#

😼

quartz kindle
#

xD

#

im refactoring this crap now

delicate zephyr
quartz kindle
#

somewhat

#

intersting how this code

#

automatically turns the arrow around for rtl languages

#

no idea that was a thing

pearl trail
#

interesting, what if you put “hello world a -> b” , will it become “b <- a world hello”?

quartz kindle
#

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

quartz kindle
#

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

quartz kindle
#

removed it by doing this lmao

#

now all my arrows are left to right

#

this edditor has weird fonts, this one looks better

hidden gorge
#

So im trying to figure out how to store the assigned agent to a live chat should it be stored via id?

wheat mesa
#

An even better option would be using a relational db like postgres instead ;^)

hidden gorge
#

wait that should be a string hold on

#

fixed that one

#

yeah bc thats a string

crystal plover
acoustic bough
#

am I insanely stupid? I don't know what I am doing wrong

sharp geyser
#

It looks like sending a message

sharp geyser
#

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

acoustic bough
#

I am bailing out of the function early

feral aspen
# quartz kindle

There's some {} which I feel like are redundant especially when there's one statement after the if? 👀

clear field
#

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.

frosty patio
quartz kindle
#

i already refactored it anyway

feral aspen
#

I am a strict code simplifier. 🌝

quartz kindle
lyric mountain
#

you there dismissing brackets while pythongrammers are starving

quartz kindle
#

xD

#

btw is google shitting itself or is my isp sucking rn?

#

everything google is slow af and often not even loading

lyric mountain
#

works normally for me

queen needle
quartz kindle
queen needle
#

did you just do the if statements for readability?

quartz kindle
#

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

queen needle
#

That makes sense

#

Now I see why Tim is goat

quartz kindle
#

lmao

queen needle
#

What is it for?

quartz kindle
#

im working on automating this

#

now i need to setup a github actions to automatically run the updater

queen needle
#

Oh that's awesome

quartz kindle
#

i think i'll make an extended version which includes 3-digit language codes and dash codes

#

idk how big it will be

keen obsidian
#

What is the best way to implement premium commands?

lament rock
#

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

keen obsidian
#

And I have a buymeacoffee set up but I could switch to something else

quartz kindle
acoustic bough
deep cedar
fossil gust
fossil gust
#

same with purple the top becomes pink

deep cedar
#

Hmm

fossil gust
#

but i like the design very clean

deep cedar
woven atlas
deep cedar
#

Its not

#

Do u have any proof then that it is ai?

woven atlas
deep cedar
#

Im gonna continue tommorow

willow ether
#

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 🤣

fossil gust
wheat mesa
#

Yup, lovable

#

The amount of software vulnerabilities created by lovable is embarrassing

queen needle
#

Also the correct use of html tags like section, which sounds like a small thing but often people just div * 1000

prime cliff
#

@solemn latch scam

queen needle
#

With an unneeded z-index

keen obsidian
keen obsidian
quartz kindle
# keen obsidian I think so

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

keen obsidian
#

Is there something specifically for discord bots?

quartz kindle
keen obsidian
#

I am switching to gumroad becuase it feels better

hidden gorge
#

Added a blur effect to modals idk how good it looks tbh

autumn geyser
supple bridge
#

helloü

humble gyro
warped glacier
#

reworked how my bot stats show! (Ignore the top.gg widget below)

warped glacier
clear field
frosty patio
hidden gorge
hidden gorge
#

cant install jwt???

#

oh wait ik why

acoustic bough
#

use jsonwebtoken

hidden gorge
#

took me a min to realize after looking through other projects

acoustic bough
#

wtf is this source code (it's jwt)

hidden gorge
#

jesus

acoustic bough
#

I hope it's just some polyfill or shit but still

willow ether
#

pretty standard minified code, why?

#

oh you're literally trying to install malware, congrats

hidden gorge
#

that really doesnt work in a module?

acoustic bough
hidden gorge
#

its really dumb

acoustic bough
#

lmao

#

commonjs sucks so much

hidden gorge
#

that worked so much eaiser

acoustic bough
#

you shouldn't use express as it's the slowest http framework, jfyi

#

(and I hate ejs but that's personal)

hidden gorge
#

create*

#

(plus im behind on basically everything so i want to get it all done and deployed)

acoustic bough
#

fair

#

used to be much on ejs but started to hate it and got intro react

#

then typescript as well

pearl trail
#

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

hidden gorge
#

im still working on the live chat dashboard any suggestions?

prime cliff
fossil gust
pearl trail
sharp geyser
#

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

prime cliff
sharp geyser
#

Might have to cop that for myself instead of rolling out my own system

#

More I can offload somewhere else the better

prime cliff
#

Inb4 i add support chat to dev space Smug

sharp geyser
#

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 😭

prime cliff
#

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

sharp geyser
#

Ohhh interesting

#

What the heck

#

There's so much more

prime cliff
#

🙂 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.

sharp geyser
#

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

quartz kindle
sharp geyser
#

I deleted the original file

#

It was an mp4 file

neon leaf
hidden gorge
prime cliff
#

Actual broken sticker kek

radiant kraken
pearl trail
#

i wonder what id 1 is

quartz kindle
pearl trail
#

wow, 10th oct 2007

#

thats me living 1 year of my life

lament rock
#

It is with these types of things that I realize how fucking old I am

#

Im older than GitHub's first repo

quartz kindle
lament rock
willow ether
#

Git is like 20 years old.

#

Not github, git

clear field
radiant kraken
#

2006 gang ❤️

quartz kindle
#

mfw you guys are even younger than my youngest sibling who is 10 years younger than me

neon leaf
#

2008 🥀

eternal osprey
#

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

pearl trail
#

you use execSync ?

prime cliff
#

Why are you doing this weird process in the first place 🙃 surely there is a better way

pearl trail
#

maybe ml? who knows

eternal osprey
#

I dont like using js libraries

#

and tensorflow js doesnt work on apple silicon

eternal osprey
#

I am calling a subprocess

pearl trail
#

use exec or better, spawn

eternal osprey
#

Wouldnt that still block until the subprocess exists

#

Cuz i am awaiting a pipeline output

pearl trail
#

nope

#

those will spawn asynchronous

#

there’s a stream event available with spawn

eternal osprey
#

Damnn really

#

Ah ofc i heard something about web workers or something

pearl trail
quartz kindle
#

you can also combine spawn with readline to process data as it comes in, in case you have a process that gradually outputs data

crystal plover
#

my bot giving multiple responses any help?

quartz kindle
sharp geyser
#

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

prime cliff
quartz kindle
#

^

sharp geyser
#

Ah I forgot about fucking sockets and shit

scenic horizon
#

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

quartz kindle
#

you should be able to change it in your discord developers bot page

scenic horizon
#

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?

deft wolf
#

You need to click "refresh data" button every time you change the bot avatar

scenic horizon
#

..I feel like an idiot

#

It's updated now 😭 thanks guys

quartz kindle
#

anyone knows anything about SPARQL queries?

#

this thing is killing me

sharp geyser
#

If its killing you what you expect us to do

#

Youre 300x smarter than us

brittle kiln
#

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

quartz kindle
prime cliff
#

Good link

acoustic bough
#

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

pearl trail
#

if you dont trust them, hire a 2nd proofreaders trol still unsure? 3rd, 4th, 5th, ∞

acoustic bough
pearl trail
#

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.

acoustic bough
#

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

pearl trail
#

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

eternal osprey
#

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 😭

neon flicker
#

If we assume there's a messaage like "@neon flicker", would it be possible to extract the user from the message?

acoustic bough
#

either use the mentions field in the API data or regex match the content

deft wolf
neon flicker
stone oracle
#

Guys does anyone know how to fix that

acoustic bough
quartz kindle
#

wikipedia apis are so damn confusing holy...

queen needle
#

Oh no if he thinks it's confusing were all screwed

eternal osprey
#

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

quartz kindle
#

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

queen needle
#

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

quartz kindle
#

i didnt think of that

#

im curious now

willow ether
#

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.

quartz kindle
#

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

queen needle
#

...

#

Why does that exist

prime cliff
#

Ofc that's gonna freeze lol

quartz kindle
#

scraping tons of data from wikipedia lmao

#

most of it is redundant

#

i split it into 3 files, 6mb 34mb and 141mb

queen needle
#

just do constants.js smh

quartz kindle
queen needle
#

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

quartz kindle
#

this is basically a datadump from geonames+wikipedia

#

i will still process it, dedupe it and what not

queen needle
#

will it go away like are you putting it into a db?

quartz kindle
#

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

queen needle
#

interesting

#

ill make sure to keep checking here to see how it goes

quartz kindle
#

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

queen needle
#

jesus

#

howcome

quartz kindle
#

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

queen needle
#

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

carmine spruce
#

rip-

queen needle
quartz kindle
sharp geyser
#

What in the fuck

#

6 days?

deft wolf
#

FTP moment

grave wolf
#

Hi

#

Anyone help me ?

acoustic bough
pearl trail
#

thats just the speed being slow

carmine spruce
#

1.45 KB/s is rough

stone oracle
lament rock
#

Having to process multiple files for ftp uploads usually takes so much longer than just one

deft wolf
#

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

chrome trout
sharp geyser
deep cedar
#

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?

quartz kindle
deep cedar
quartz kindle
#

yes

pearl trail
#

Tim is so good that he can analyze the code through discord message

quartz kindle
#

i dont have x ray vision

#

sadly

pearl trail
#

awh that sucks :(