#development
1 messages Β· Page 237 of 1
maybe my stackoverflow man is wrong too
Perl has an undefined value (often abbreviated "undef") separate from null or 0. It can be tested for with defined, and generally indicates a runtime error occurred (when exceptions are not in use). In a boolean context, it is considered false. You can get it by...
declaring, but never initializing, a variable: my $foo;
returning nothing from a subroutine: sub foo { return; }
explicitly setting a variable to undef: $foo = undef;
SQL has the NULL value. Unlike the undefined value, it is not false. It is a 3rd boolean state neither true nor false. This trinary logic often trips up people who may confuse NULL with false.
lmao
oh, that SQL's null not Perls
so if you use SQL with JavaScript you need to make sure to use the right null. extra confusing
No??
Unless you're writing the statement yourself
Prepared statements that accept variables convert the js value of null to the SQL value of NULL just fine
Why would you inject things directly in your statement though
because you think you know what youre doing and end up breaking everything
JS is too easy to pick up
and sometimes it doesn't do what you would think
Like what
all the wtfjs stuff
None is more close to undefined/null
yeah, that stackoverflow guy expected something different
Although None also has no correlation to undefined/null as well
but they only have one thing for it
None simply means it doesn't exist
like Perl
Also why are we arguing whether null/undefined is useful
just accept it exists and has its uses in the languages it is defined in
π
I can relent that JS is a deceptively hard language when you get into the nitty gritty, but everyone has to start somewhere and I wouldn't wish a low level language upon my worst enemy as a first language
goto has it's uses too
π
I tell people to try rust as their first language
that way I can torment them
Uninstall
i had to figure out how to debug it
zig build -Dtarget=aarch64-linux-musl -Dcpu=baseline -Doptimize=Debug
-Doptimize=Debug
took me awhile to figure out this flag
my god the amount of idiots in that thread
its like reading luca code
you think every bad js code is lucas code
:^)
I never understood compilers making it harder on you to compile
I mean sure its cool to have such level of control
but cmon, at least set a standard / default
zigs default is to remove all info/debug logs
I really do not see the appeal behind zig
it just looks like a knockoff rust that tries its hardest to make it better
but all it has going for it is "faster" build times
which honestly mean nothing to me if it brings nothing else to the plate
i mean, on paper zig looks pretty amazing
it feels like a major improvement over many of C/C++'s problems
and its much closer to C than rust is
so if you wanna stay near the C/C++ world, zig is a better choice than rust
otherwise rust has more maturity, larger community, more support/docs, and the package manager
as someone on reddit said: Zig is better C and Rust is better C++
Indeed
But people compare zig to rust more than they do C
which is where I disagree
just be a chad and use null pointers instead

yeah and people are stupid
Indeed
is there any way i can use pnpm workspaces in CD/CI?
as there is no lockfile in a monorepo's 'package' directory
and when you build with docker you usually set the root project dir
Does it make sense to try to create a std.StringHashMap([]const u8) or std.json.Value or something like that from a JSON file at comptime in Zig? Those things live in runtime memory so creating them at comptime doesn't make sense right? my best bet would be to generate a zig file from the JSON during the build right?
const std = @import("std");
pub const ApplicationKey = struct {
id: []const u8,
public_key: [64]u8,
};
pub const application_keys = [_]ApplicationKey{
.{ .id = "xxxxxxxxxxxxxxxxxxx", .public_key = "f47c8exxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx5a61cd".*, },
.{ .id = "xxxxxxxxxxxxxxxxxxx4", .public_key = "430dbxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxe2a66a0".*, },
.{ .id = "xxxxxxxxxxxxxxxxxxx9", .public_key = "c1194xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx9ca50da".*, },
.{ .id = "xxxxxxxxxxxxxxxxxxx8", .public_key = "8e67exxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx152713a".*, },
.{ .id = "xxxxxxxxxxxxxxxxxxx", .public_key = "6787b8xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx3d18d8".*, },
.{ .id = "xxxxxxxxxxxxxxxxxxx", .public_key = "bc77bbxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx7f29de".*, },
.{ .id = "xxxxxxxxxxxxxxxxxxx", .public_key = "ec1016xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxd54e41".*, },
.{ .id = "xxxxxxxxxxxxxxxxxxx", .public_key = "bd9f7exxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx690bd2".*, },
};
pub fn getPublicKey(id: []const u8) ?[64]u8 {
for (application_keys) |key| {
if (std.mem.eql(u8, key.id, id)) return key.public_key;
}
return null;
}
or can i just parse the JSON at runtime? the JSON file is loaded at comptime so there is no runtime file io, only parsing.
does zig have a file format for configs?
if you did it at compile time wouldn't you have to rebuild every time you change a config value
yeah, but i only build when i push code to github.ref == 'refs/heads/main'
everytime the lambda coldstarts it just needs to load the binary
good thing zig builds fast
i always have to compile anyways since i need a binary to test the runtime
isnt it counter intuitive to use json files at compile time?
the whole purpose of config files is to have flexible hot-swappable configuration without requiring rebuild
what do i tell someone when they try to start a docker compose and get network errors, but when i try it with the same configuration on a fresh server: it works fine
skill issue
git gud
i swear this is the best discord channel in history
everything gets compiled into the binary so the json file isn't really a file it's a string in the binary.
zig doesn't have a config file type from what i can tell
no object literals
it is possible
const application_keys = .{
.@"12341234" = "sdfg",
.@"123412341234" = "sdfgsdfg",
};
it would be very strange if it didnt have object literals / structs lol
looking good, congrats!
i thought i needed to define a struct class first. isn't the .@ syntax tricky?
very weird indeed
i can do application_keys.@"12341234" to get "sdfg", but i dont think there is a way to use a dynamic string. there must be
https://ziglang.org/documentation/0.13.0/#Anonymous-Struct-Literals
you guys helped me out a lot! lots more work to do with it though
there is no way to lookup dynamic keys with Anonymous-Struct-Literals. this is the best you can do and it requires looping over all the entries in the struct
pub fn get(id: []const u8) ?*const [64:0]u8 {
inline for (@typeInfo(@TypeOf(application_keys)).Struct.fields) |field| {
if (std.mem.eql(u8, field.name, id)) {
return @field(application_keys, field.name);
}
}
return null;
}
yeah anonymous structs will just make a new type
you'd need runtime reflection to be able to look them up
this looks dumb
it is dumb
common zig L
im just going to parse json and call it a day
bro wtf even is this
why is that code so ugly and unreadable
also wtf is the point of inline there
unless inline doesnt do what I think
becuase there's no reason to ever do this
it's compile time reflection
yeah, it's looping over all the keys so it's O(n) instead of O(1)
it's always going to be shitty because you're basically doing codegen too
if you're going to be doing smth like that you're better off using a dictionary/map
those require runtime memory so they would need to be serialized in some way right?
then loaded at runtime
well whatever you're doing is going to be using memory if you're trying to dynamically load fields, no?
there is apparently a compile time string map
ai hallucinates a lot
did ai tell you that?
what
i think it used to exist
it's pointed to on stack overflow but when you go there on github it's 404 https://github.com/ziglang/zig/blob/master/lib/std/comptime_string_map.zig
it links to the PR
it seems like they might have merged it then decided against it later?
no idea i didn't read over the code at all
i am curious why a standard object wouldn't work for you though
ig are you trying to represent like nested JSON objects?
i am getting the application_id from discord when they invoke my interaction URL. i need to take that application_id and get the public_key so i can verify the signature
.@"661xcxxxxxxxx6511" = "f47c8e6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx0bbde3cb5a61cd",
.@"108xcxxxxxxxx85884" = "430dbbxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxd4ea5fbae2a66a0",
.@"108xcxxxxxxxx37009" = "c1194bxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx8cd432fd9ca50da",
.@"112xcxxxxxxxx61018" = "8e67eaxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxd43ed41b152713a",
.@"882xcxxxxxxxx2705" = "6787b84xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxc3584c7b3d18d8",
.@"918xcxxxxxxxx4829" = "bc77bb3xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxad1a0a647f29de",
.@"889xcxxxxxxxx2724" = "ec10160xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxc2a96064d54e41",
.@"935xcxxxxxxxx6752" = "bd9f7e1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx15a93c64690bd2",
};```
i need to do something like this in JS
const app_id = "661xcxxxxxxxx6511";
const pub_key = application_keys[app_id] ;
i can do this in Zig
const public_key = application_keys.@"661xcxxxxxxxx6511"
but i can't look up a value based on a dynamic string
const public_key = application_keys.@"{app_id}" // nothing like this exists
this looks stupid
how do we get this checkmark?
I doubt this is possible
This is custom css
ooo xD mb
i am trying to create a dashboard for my verification bot.
uhhm.. does anyone know how to fix this aesthetic
it looks like dookie
its for my verification gang it's needed π
π cant user just type it normally?
is there a way to move the enter button to the right?
yeah but i like to be β¨ extra β
nope, unless you add few more buttons
those buttons will make mobile client suffer lmao, tho it's up to you
i don't think so, not sure
i see
thanks for the help though!!
btw a quic side quest:
i kinda want to look into react as i make all my personal websites using plain html bootstrap and vanillajs.
Is it smart to learn react? Does it make the whole development easier?

i can't handle the fucking margin the embed has at the left
it's not aligning bro π
i will
I mean itβs okay
yeah no its ugly af
is there a way to know whether a user is on mobile or not, cuz then i can dynamiclly add or remove 1 button from the last row?
I mean there is such an option in discord.js
But you need to read the server member's presence for this
Unfortunately
ooo
fair fair
oh yeah my bad, it's because there's only label and it's single character
unless it's a link button, a button with emoji, or with unorganized label length, it'd be a mess 
too clunky
you need less characters
plus interactions might be a bit too slow and unreliable for this which can get annoying
you could probably make a select with max options and one of them is right
i have a question tho, what exactly does this verificatrion solve?
what does it protect against?
"are you blind"
yes
it protects against raids
autoamted bots can't click buttons π£οΈ
(unless they are using discord on web and puppeteer to mimick actions)
and it protects against ppl that are dumb
to protect against that you only need a single button :^)
"if you are not a bot, click here"
people can automate that though
join server -> wait for dm -> scan for button -> click button.
unless it's an actual captcha button
ye but how often are people actually going to do that?
bro what π
:^)
never
unless the server is valuable to raid
i know but this will be a public bot.
so i can't just say, fuck it it will never happen
id opt in for different forms of captcha though
the one you're using already likely has models that are trained specifically to bypass it
what'd be the worst-case scenario if you didn't have a captcha?
seriously
that's true indeed
no i have no clue, it's just a public verification bot. If i advertise it as secure, i want it to be secure.
not security by ignorance lmao
I am adding 3 levels of verifications.
- Random simple math questions. 2. captcha, 3. Verification by clicking on a weblink that is bound to a single user request
so user clicks -> creates a link for you specifically by using subpaths.
the cocacola recipe
dashaboard
discord is however working on this problem anyways
theyre best suited to solve it
they started giving captcha's before you can join a server (in suspicious joins)
and have these new mod and raid tools
fort knox
@quartz kindle or anyone do you know if you can disable eval in nodejs?
im getting very serious on tightening security and one of the logical steps would be to disable eval in applications that dont need it
to make rce much more difficult
i was thinking about replacing it with something else but im not sure
i dont think theres an experimental node permission for it either
luckily i can disable child process to prevent shell commands with permissions too
for fun i would happily make a nodejs patch that hardens eval if there isnt one already
can someone explain me how substring works cuz it ain't making sense to me:
let test = "test"
console.log(test.substring(0, test.length))```
this returns me "test". test.length -1 returns me "tes".
Strings are basically arrays of characters, so we start at index 0...
test.length in this case is 4, how the fuck is 0,4 even a valid indice.
and why is 0,3 not simply "test"
0 = t
1 = e
2 = s
owh hehehe substring starts with index 1
yeah that aint it
no it doesn't
How the fuck would 0 - 3 return test
wrong
The substring() method of String values returns the part of this string from the start index up to and excluding the end index, or to the end of the string if no end index is supplied.
that's weird
i guess this can work unless theres another way to get eval?
so 0,3 would be tes
ooowh dayum that's dumb ngl
tell them to change that in the next es
super.eval("")
super is unexpected
let mut iter = s.char_indices();
let (start, _) = iter.nth(10).unwrap();
let (end, _) = iter.nth(5).unwrap();
let slice = &s[start..end];
here is one of the ways (albeit a little clunkier) to get a substring in rust
whatever js uses to reference the superclass then
ahh helll nah
in reality you can just do let slice = s[start..end] afaik
i could harden node itself with apparmor too but problem is theres only one node executable so id have to apply apparmor policies to all node programs
and i dont feel like having 5 different copies of node
would it work if u did Object.prototype.eval = () => {}?
this is how it is in haskell: to get index 2-5.
let list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
sublist = take (5 - 2 + 1) (drop 2 list)
mf's got not loops, only rescurive calls π
even rust is end exclusive
it goes up to that index but doesn't grab it
That's where it stops
i cant use the super keyword anyways unless its a REPL thing
yes but this would disable it globally
and eval is a global func dont think its part of object prototype
c, c++, java and c# are end-inclusive
"get from index A to index B"
haskell as well... just need to select it manually lmao
i mean, 0,0 = empty string, so, 0,1 = 1char, 0,2 = 2char, 0,3 = 3 char, etc...
Well yea because in C you literally have to fucking do it yourself
so you can make it end inclusive or end exclusive
its up to you
nodejs has an experimental permissions thing, but its still very ealy in development
node --experimental-permission --allow-fs-read=* --allow-fs-write=* index.js
i dont think it supports eval yet
for now it only supports these
otherwise you can use a native addon to toggle v8 options from cpp
v8Isolate->SetModifyCodeGenerationFromStringsCallback(nullptr);
some npm libs claim to do that, but they are outdated and use older v8 calls which idk if they still work
wait, apparently there is also --disallow-code-generation-from-strings
ye it works lmao
yea
I wasn't sure if that was legit or not
it was given to me by the google ai in the search results
π
although it says this This does not affect the Node.js node:vm module.
thats interesting
shouldnt be an issue since thats sandboxed anyways i think
ye vm bypasses the restriction
but an attacker wouldnt be able to create a vm in the first place without eval
@quartz kindle wat font you use in tabby?
hey so
i have a timezone offset in hours
e.g india
is utc+5:30
that would be 5.5 in hours
is there anything that lets me convert that back easily
(5.5 > 5:30)
format-duration maybe hm
60 * fraction
subtract the integral part, multiply 60 by the remainder
on a side note, this is the first time I'm seeing a timezone with minute offset
x / 100 * 60 no?
no
60 * 0.5 is 30
if you divide 0.5 by 100 you'd get 0.005, which is 0.3 minutes (18 seconds)
ops, I see the issue lul
it's multiply, not divide
idk whatever the default one is
consolas 14pt
that screenshot is not tabby tho, its windows 11 terminal
i only use tabby for ssh lel
seems like its an ongoing issue
dates are just glorified numbers
iirc it's Unix timestamp
depends on the database, some use floating point, some use biginteger
if I tell you "open your book at page 63, read topic 3"
ah okay I see
you'd average where it would be and then flip some pages to find it
and if you were looking for a specific topic but didn't know the page, you'd have an index table (first page in most books) to quickly find which page it's in
okay thanks yes this makes sense
@lyric mountain any advice on how to learn frontend with flutter
I'm gonna start back up on that project
But I have no idea how to use containers and such, I find it really difficult to think about the structure of frontend
It hasn't clicked for me yet
my face when I only realized yesterday that you need to manually make the indexes
it's basically the same as doing with html
you have 2 types of "flex" containers: row and column
then you have divs, which are Container
and divs made for sizing purposes, SizedBox
Scaffold is the skeleton of the app pages, giving you areas for AppBar (the bar at the top of every app), body, bottomNavigation, drawer, etc
it's very similar to react native if you've used it before
I haven't done much frontend at all
best tip is to try and make something out of it, then searching on documentation what you're looking for
Which I am starting to realize is going to hurt me since I have nothing to really "show off" on my resume
@lyric mountain will this work if a build can have multiple hashes or does primary key make it unique or something?
export const hashes = sqliteTable('hashes', {
buildId: integer('build_id').primaryKey().notNull(),
primary: integer('primary', { mode: 'boolean' }).notNull(),
sha1: text('sha1', { length: 40 }).notNull(),
sha224: text('sha224', { length: 56 }).notNull(),
sha256: text('sha256', { length: 64 }).notNull(),
sha384: text('sha384', { length: 96 }).notNull(),
sha512: text('sha512', { length: 128 }).notNull(),
md5: text('md5', { length: 32 }).notNull()
}, (hashes) => ({
buildIdx: index('build_idx').on(hashes.buildId),
sha1Idx: index('sha1_idx').on(hashes.sha1),
sha224Idx: index('sha224_idx').on(hashes.sha224),
sha256Idx: index('sha256_idx').on(hashes.sha256),
sha384Idx: index('sha384_idx').on(hashes.sha384),
sha512Idx: index('sha512_idx').on(hashes.sha512),
md5Idx: index('md5_idx').on(hashes.md5)
}))```
it'll click after u make a couple of pages
primary keys are inherently unique, not null and indexed
okay, do I need a primary key on this or will it be fine?
well, it depends
all tables in sqlite do have a primary key ROWID
but if you have a field that's guaranteed to be unique, you can use it as a PK for querying purposes
hm
I think the indexes should be enough
I usually either want all hashes for a buildid, or the build of a given hash
just note that if a columns isn't declared as UNIQUE, it'll iterate till the end of the table for matches
no, for example, if you were looking for a buildId abcde1234 it'd go till the end to see if there are any more matches
limiting to 1 might prevent this, but it'd make composite queries difficult
interesting
well im trying to save as many rows as possible since I have a limited amount before I pay
for sqlite?
the table will have 810k rows
cloudflare d1
why dont you host the database on the same server as your app?
the app is a worker
the former doesn't matter, but the second yeah that's a valid reason
I get 25 billion row reads per month
you'll need a cache at some point
additional million are 0.001$ so its not the end of the world but keeping it down would be nice
I have one
cloudflare kv
its unlimited keys and unlimited reads
nvm they forgot to change it on some sites
1gb storage, 10mil reads per month
well I will see
i never knew this
if you have an iframe which is sandboxed and click a link which opens a new tab
that tab is also sandboxed
there is absolutely no indication that the tab is part of the sandbox which is why i was surpsied
anything from inside an iframe stays in the iframe
it's like, the whole thing with it, it cannot escape containment
does .findAll still work? I'm getting errors with it
In mongodb?
Try .find()
Thank you!
massive downgrade :^)
The file database was getting messy and I need to be able to configure it easier
why would you go from a sql db to mongo though
would it not be easier to go to another sql db
It's easier for me to access the database from a website, plus the bot is being rewritten anyways
Now I get:
Uncaught MongooseError MongooseError: Operation `users.find()` buffering timed out after 10000ms
whats with these undescriptive confusing errors
come on lib devs it takes a few extra seconds to write a better error message
does it not just mean the query took too long
I think but it's putting it offline
mongoose ew
tim the biggest mongo hater
lmao
mongoose is the only saving grace for mongodb tbh
it actually enforces a strict schema on collections
isnt one of the big things about mongo being schemaless
const storedBalances = await Users.find();
storedBalances.forEach(b => client.currency.set(b.user_id, b));
});```
Same error everytime
yeah but its rarely a good idea for this to be the case since it leads to many problems
did you run the connect function or whatever mongoose uses to connect?
with mongoose you still get some flexibility though
mongoose has a really weird way or operating, it allows you to call all of its methods without actually being connected
you can compare schemaless databases to javascript, you can very rapidly create and set something up but you get a lot more runtime errors in return
What function is that? I think soo but I'm honestly confused
mongoose.connect()
Does that just go into index
sure
yeah
I have got it
Uncaught MongooseError MongooseError: Operation users.find() buffering timed out after 10000ms
how many users is there
mongoose.connect(process.env.MONGODB_URI, {
useNewUrlParser: true,
useUnifiedTopology: true,
useCreateIndex: true, // Add this line to use `unique: true` in your schema
}).then(() => console.log('MongoDB Connected'))
.catch(err => console.log(err));
thats just a side effect of not being connected
None right now, it's just been setup
oh
does it show "mongodb connected"?
are you using a service like atlas or a selfhosted mongo?
No
atlas
did you white list your ip address?
thats not it
god I love drizzle syntax
export default function(router: GlobalRouter) {
buildRouter(router)
buildsRouter(router)
versionRouter(router)
router.get('/api/v1/types', async({ req, env }) => {
const data = await req.cache.use('types::all', () => req.database.select({
type: req.database.schema.builds.type,
builds: countDistinct(req.database.schema.builds.id),
versionsMinecraft: countDistinct(req.database.schema.builds.versionId),
versionsProject: countDistinct(req.database.schema.builds.projectVersionId)
})
.from(req.database.schema.builds)
.groupBy(req.database.schema.builds.type)
.all(),
time(10).m()
)
return Response.json({
success: true,
types: Object.fromEntries(types.map((type) => [
type,
{
...extraTypeInfos[type],
icon: `${env.S3_URL}/icons/${type.toLowerCase()}.png`,
builds: data.find((d) => d.type === type)?.builds ?? 0,
versions: {
minecraft: data.find((d) => d.type === type)?.versionsMinecraft ?? 0,
project: data.find((d) => d.type === type)?.versionsProject ?? 0
}
}
]))
})
})
}```
The IP address is fixed

Anyone here uses Mongoose?
used to
My database says client not connected like it can't perform the operation
But in console says mongoDB connected
I'm on phone right now
So I can't send the proper error
did the operation get 'requested' before the db connected perchance
perchance
you can't just say perchance
I requested it after it said mongoDb connected
triple check this
- some config fucked up on client and/or db server
- wrong order of calls
triple caution, triple caution
This is the full error:
you sure you didn't do smth like mongoose.connection.close() anywhere in your code?
Nope
Wait
One second
going to use ctrl f
Yeah, I just checked the dbInit and it closed it in there
Now I get this error:
```Error connecting to MongoDB: MongooseError: The uri parameter to openUri() must be a string, got "undefined". Make sure the first parameter to mongoose.connect() or mongoose.createConnection() is a string.
(Sending it here so I can read it π)
pretty obvious..
I know it obvious... I didn't know where the error was coming from as it returned connected...
*did it really return connected? *
I don't need assistance with this, I am using env
Yup "MongoDb connected", "database synced"
most smooth mongodb setup experience
Buddy I cant read that
neither can i lol
not sure if this command is made properly but it works
not sure my bot having this would let me get it approved lol
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
im willing to remove it for verification lol
ye all dev commands are locked to me only
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
the other commands i have for it
yes, those libs are required to build canvas, these are the deps for mac:
pkg-config cairo pango libpng jpeg giflib librsvg pixman python-setuptools
we have a blacklist command for people who abuse any commands
One message removed from a suspended account.
One message removed from a suspended account.
the server list was to make sure if i had reports of a server abusing the bot i could investigate
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
π€·ββοΈ
One message removed from a suspended account.
ah
One message removed from a suspended account.
ill switch it to server id instead
One message removed from a suspended account.
you cannot invite yourself to random servers
One message removed from a suspended account.
ik thats being removed for server id
so i can remove bot from guild
also, is that a global slash command? if so, make it a guild-only slash command, and set it to your guild only
or a hidden test guild you own
so it doesnt show up on other servers
that is gonna blow up if your bot grows
nah sending a 800k line embed to discord is fine
:^)
btw @quartz kindle I have rereredecided on using workers
honestly, i wouldnt even try doing a list command like that, way too much work
much easier to have an eval command or something
progress is slow but performance is okay
its like +50ms but I am guaranteed to not have people screaming for downtime often
for some reason I didnt think of using indexes before
with indexes its so much better for db queries to d1
how would i add buttons to the botss status
Ima be real tracking something like that makes no sense.
ahh i see
guys why is it illegal for for managers/supervisors to work me in properly.
i ain;t even lying i am arriving at the job this mf tells me to access this database at xxx and do xxx on the data on a hfds.
Tries for 4h, fails, went to manager, find out you got missing keys, cry
lol
if being paid by the hour: yay
nay for the frustration though xd
I am paid by the hour but still if I have to push my findings by a certain deadline π
"yeah it'll take 1 week to add this button"
first progress π₯ https://github.com/mcjars/versions-worker
where the eslint at
no

π you are so real for that
nah honestly my coworkers thing that i am π special π«
cuz i always take too long
"i do qa myself, it's why i take so long"
who invented gifs
and why did they fuck up so bad
that the filesize is larger than normal videos
3 weeks
3 weeks in working hours
gif is lossless
and pretty much has no inter-frame interpolation
each frame is a full lossless png
apng for the win
videos on the other hand are lossy jpegs further compressed by interleaving frames and shit
:^)
1000x1000 canvas frame = 4mb
hmmmm
i wonder if you can extrude a shape in css
possible yes, but complicated
you cant extrude a cube from a plane, but you can create 6 planes and build a cube with them
π
what i wanted to do was a bit more complicated
wanted to do edges alongside segment display
your css is way overengineered lmao
almost
here's what i have atm
if i can bridge between two layers, that will be nice
thats all css?
yes
damn your css is amazing as always
that's all with css and svg
ah so there is svg as well
the texts are all done with text element, but i kept segmented display as-is for glitch
you want to add thickness to these edges?
yeah
yeah the only way is to create new planes for them
here's a clearer one
as css is pretty much 2d only
maybe you can do some haxoring with shadows
as shadows have enough parameters to simulate depth
ima try that
You can do 3d with css
translate3d 
i don't have to
also just 3d is not enough
you will need perspective as well
I wish it could, even if it was a simple single-color extrusion
im working on a multipurpose discord bot and i need suggestions for more commands to add
dont
why
Multi purpose bots are useless.
Theres thousands of them
At this point its not worth it unless you're making it only for one server
youre wrong hes gonna make a revolutionary new multi purpose bot
Impossible
itll take over the world
With our ideas and Tim's optimization it will be the best bot in the world 
I just finished the dev commands lol

you have any ideas
No, I rather do things that are useful to me personally
The thing about multipurpose bots is that you can put anything into them, which is why they are not "unique" at all
Such bots have a lot of functions that most people will not use at all
if you want it to be good/successful its best to focus on a specfic niche/feature and make it super good and unique
hey guys i am deadass colorblind so i got a question here
what color did they use to fill the inner circle
cuz i know they use opacity, but i see fucking pink and that cant be right
Runescape gold huh
https://scs.twilightgamez.net/j/D9Tmc.jpeg me right now actually
I dont got shit lol Im just farming a minigame for a specific drop atm. But, in regards to your question I know using a color drop tool wouldn't work well here since opacity technically changed the color. I do know I had the transparent png of the gold stack however.
in my opinion it looks like a white / gray color. Not pink
np
aaaa ahttps://github.com/mcjars/versions-worker/commit/74874d4530e5d7adae42b0ac587b774d6e42cd78
I love sql
can someone look over my bingo code and give me some suggestions?
iβm hoping to improve board generation speed and button reply speeds
did you measure the board generation?
how many ms
theres nothing you can do to improve the speed of the button itself, as thats discord + network ping essentially
but if board generation is taking 100ms+, you can improve that
whoa wait
im just looking at the errors im hetting
Unhandled promise rejection: HTTPError [AbortError]: The user aborted a request.
at RequestHandler.execute (C:\Users\Maurice\Desktop\Click War Bot\node_modules\discord.js\src\rest\RequestHandler.js:201:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async RequestHandler.push (C:\Users\Maurice\Desktop\Click War Bot\node_modules\discord.js\src\rest\RequestHandler.js:51:14)
at async InteractionWebhook.editMessage (C:\Users\Maurice\Desktop\Click War Bot\node_modules\discord.js\src\structures\Webhook.js:328:15)
at async ButtonInteraction.editReply (C:\Users\Maurice\Desktop\Click War Bot\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:150:21)
at async InteractionCollector.<anonymous> (C:\Users\Maurice\Desktop\Click War Bot\commands\bingo.js:172:17) {
code: 500,
method: 'patch',
path: '/webhooks/1250437664587649025/aW50ZXJhY3Rpb246MTI2MjE0MTk5ODIyODQzOTE4NDprTkIzeE80UnBpa29MbVlDYXRkYVBtVnoxRjc4MFpZR3Zta1oxSUdOY2dxYTlKOWVLWnpDdzJiNW56dmRPalVjYjJqWmRIbFM4NlFRcXlVdTQxWTc1aUt0ODNWUk4zN3RkMVR4aWhqV1pDRjUzb1hsejE3NEhLR3V6NWZnR1hrcQ/messages/@original',
requestData: {
json: {
content: undefined,
tts: false,
nonce: undefined,
embeds: undefined,
components: undefined,
username: undefined,
avatar_url: undefined,
allowed_mentions: undefined,
flags: undefined,
message_reference: undefined,
attachments: [Array],
sticker_ids: undefined,
thread_name: undefined
},
files: [ [Object] ]
}
}
never seen this one before
opTIMizing glasses
no ty
- first of all give measurements:
const timer = performance.now();
await generateBoardImage();
console.log(performance.now() - timer);
- does the image really need to be 1428, 2000? check if you can make it smaller
- images dont need to be loaded every time, you can store and reuse images
Why not make a bunch of premade boards before hand?
yeah, make premade boards for every possible combination
only 5524464740611248601600000 possibilities
:^)
Tim lemme give you a combinatorics question to test your mind
Suppose you have 5 red and 5 blue balls. You randomly select a ball each time without replacement. What is the minimal balls you need to draw to ensure 3 consecutive blue balls
blue balls is the worst.
but I only have 2 balls
the minimal balls?
like the minimal possible is 3 if you're lucky, but you mean how many do you have to take out to get 100% chance of getting 3 blues in a row?
i have no idea what that means
I am very excited for when I deploy my mcvapi worker soon
cloudflare d1 is suprisingly fast
lol
but we have typescript now
I mean.....why not
you're not supposed to use header and body tags
your html will be inserted into the top.gg existing html, it already has the topgg's header and body tags
your style.css file will also not load
because it will look for a style.css inside topgg's servers
Gotta embed the css
also this doesnt look like valid css
It's SCSS
I see
Quick question, how can I get images to be in my long description?
how so?
this is how it looks with just 2 players.
that's actually cool goddamn
do you use discord.js?
I do, why?
Also, how could I fix this?
the dots are not next to the sentences...
### Partnership Features
##### 1. Partnering with a Random Server
- How it works: Bridgify randomly selects a server for you to partner with, providing details like member count, category, name, and unique ID. You can choose to Accept or Decline
- Accept: A request is sent to the chosen server. If they agree, both servers exchange ads in their partnership channels, and you'll be notified of their decision. `(Note: Yes, the bot will post the exchanged ads in to appropriate channel!)`
- Decline: Wait for the cooldown to expire before using `/partner` again.
And does Top.gg has discord.js installed in it's system?
no?
I see, then how am I able to use discord.js?
oh i thought you were talking about embed description in your bot
I'm trying to show case the embed on my bot's page ^
my bad
You're good
Okay
Any website recommendations?
how to improve it? i gave you a few pointers -> #development message
yes sir! so far i have the images preloaded, both the board and the dab markers, thatβs whatβs happening in the video!
how much of an effect does the size of the lobby have on the games functionality?
thank you
negligent effect
the thing that has the most effect is the image size
canvas performance degrades exponentially with image size
ah
I'm using Imgur and my banner isn't loading for some odd reason
you dont need <html>
One message removed from a suspended account.
I got it figured out now
One message removed from a suspended account.
One message removed from a suspended account.
oh I see.
One message removed from a suspended account.
One message removed from a suspended account.
Hey, do you like my bot's page? Any suggestions? https://top.gg/bot/1193672589428654120
Bridgify: Connect, Advertise, Grow! π The All-in-One Bot for Your Server. [10+ Languages Supported]
steam?
idk i got that list off of some reddit thread
from 5 years ago
xD
π
Dang advertising your bot

I'm not trying to lol. I was asking for suggestions
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
akamai seems so expensive for what it offers
akamai targets business customers mostly
why do large businesses buy overpriced shit i dont know
probably money laundering
π
Fair enough ig
As a business i'd try to save money
cloudflare offers good features even on their free plan that most businesses should survive long enough before needing to upgrade
i guess once you get to a certain point, you dont really care about saving money
you only care about pocketing it
tell that to all those companies that do layoffs
they saving that money for themselves
π
yup
financially speaking a lot of companies dont need to do layoffs
they only do so because they realize they are giving too much money to employees and not getting enough for themselves
honestly i wouldnt be surprised if people trade services like that, company A buys overpriced service from company B, half the money disappears and is pocketed by both A and B CEOs and/or used as a tax deductible
its crazy
businesses can buy things "for" the busiensses
and write off majority of the cost
"Oh the company needs x? Write it off on next years taxes"
it gets worse, company A and B are both owned by the same people
so they pay themselves and pay no taxes
Dont CEOs pay themselves in donations to avoid paying higher busienss taxes and personal taxes?
Donations cant be taxed at least in the US
or they will outright buy things and write it off as company expenses
like houses, cars, etcetc
yup
and use their "earnings" to pay off the loans, and it counts as an expense, not as income
take loans they dont need just to buy something they could of bought outright
purely to evade taxes and what not
pretty much
Its insane how corporate america works
and im sure it functions similarly in other places in the world too
i screwed up in getting my bot verifed lol
messed up a singal command forgeting to make it dev only
Change it and ask the reviewer to re-review
I did lol
its a business at the end of the day
the main goal is to make profit and minimise loss
they dont employ people for fun or because theyre kind
I just finished writing my zig replacement for a rust lambda. zig is looking a bit faster so far
Zig cold start response time
Billed Duration: 36 ms Memory Size: 128 MB Max Memory Used: 12 MB Init Duration: 10.94 ms
Rust cold start response time
Billed Duration: 141 ms Memory Size: 128 MB Max Memory Used: 18 MB Init Duration: 36.92 ms
zig
rust
build time with rust
build time with zig
last week of duration metrics for Rust code.
π¦
rust btw*
Not too bad for Mac at least.
Do you need to use a macos machine to build? Or do you use the zig toolchain to cross compile?
Yes I know
such a goat

u can support over a dozen of targets with little effort
using tauri π
is tauri only limited to those targets?
idk
tauri should be able to. build to just about any target
cloudflare d1
if you have a VPS, then u can simply selfhost it
(or access to permanent storage on local disk (when using a bot hosting))
I need an online one
then use d1
do note btw, it's not recommended to use an online sqlite host with a sharded bot
while sqlite has WAL mode, it works poorly with many threads writing at the same time
d1 is likely to use queueing tho, so you'll probably have no concurrency issues, but still
I am thinking of d1, going to see if I can fix Mongo first, however I just keep having issues with writing/reading with Mongo that would usually work and has been setup to work and no errors that's all but the file method is really hard to transfer when I move hosts.
I think the issue is constantly moving hosts then
because any cloud database will be slower than local
by a good amount
ideally you'd have a local cache of the remote database and use that for reading/writing
and then periodically push changes to remote
also mongo is largely different to sqlite, don't attempt to use the same structure for both databases
I have 2, I got the file on my PC (Which is for when I push the updates) then I swapped host from one to another as the other one I am on now is way better.
However, the files don't upload without corrupting so I have to reset and re-install and manually add everything back via override commands by extracting the db
do your hosts not include a mariadb database option
No I am moving one to mongo, that's seperate. The one currently on sqlite is staying.
No just database then you add one
Ahh, is it easy to implement?
Thank you! Might try it, would it work to write to as part of tests from my PC VSC? As I have to push everything from VSC as deploy-commands doesn't work on the host unless I script it to run everytime index is refreshed which I could do
you can connect to their database from anywhere
Thank you! Let me have a quick look!
Is it easy to move/manage?
also you can run deploy commands by just requiring it in the index file or putting it there
most mariadb clients have built in backup/restore features
That's what I was thinking of doing. I do that to refresh the currencyShop everytime I update it. So I don't have to push that via VSC
would something like:
const deploy = require('./deploy-commands.js');
require('./deploy-commands.js');
should be enough
no need to assign it to something you wont use
unless you do
idk
Thank you!
const sequelize = new Sequelize('primary_test', 'REDACTED', 'REDACTED', {
host: 'localhost',
dialect: 'sqlite',
logging: false,
storage: 'database.sqlite', // What goes here? Just the connection link?
});
Would this still work and where it has database what would I put? The name?
See Releases to see which versions of MariaDB are supported.
Maria is what I use. Quite nice
Thanks
Thank you! I'll try now saves me alot of time
actually thiis might be the correct example for v6 https://sequelize.org/docs/v6/getting-started/#connecting-to-a-database
In this tutorial, you will learn to make a simple setup of Sequelize.
v7 seems to be beta
so replace dialect and remove storage
Ty!
and add this:
I might use a connection URI
Which would you recommend? URI or the current layout I have?
your choice
im my experience urls are less reliable
because some dont en/decode passwords properly
Yeah, thank you!!!
Plus if I wanted to use .env it's a nightmare
I'm having an issue with the error detector it's self π
Since I've implemented it, it's flagging errors with .find and .findAll
I changed .findAll to .find and it flags an error again
well whats the error
It worked this time?
Idk what's happening. It just spammed console saying .find is not a function
Then I removed some code that wasn't needed anymore and it worked
and pushed all the database tables
please take some time to sanitize your code, if you removed something seemingly unrelated and stuff started working then it means you have some loose ends there
I am looking at it now.
Right, it seems to be working other than one database isn't registering.
Would you mind assisting me, I am having an issue with the publishing of one database:
parent: [Error: SQLITE_ERROR: no such table: AvailableBadges] {```
But it says it published the db
it seems like its still trying to use sqlite somewhere
Odd
since it's an online database, you can download some dbm and connect to it
just make sure to disconnect before starting the bot
this way u can check what's really inside the database
It is setup
why is it using sqlite now?
It's MariaDB
the dialect is still sqlite
what did you enter in the bottom field
It's just an IP
also port
Unless it's in the pre-made URI link which says mySQL
Ty
Uncaught HostNotFoundError SequelizeHostNotFoundError: getaddrinfo ENOTFOUND REDACTED
make sure to remove :3306 from the end
Sorry for bothering you, never used a db like this π
Hello dev channel
Whatever you are connecting to isn't open and or accepting connections
In the URL thingy it has this jdbc:mysql
sir
I have set it up to accept from anywhere
π
For dialect?
you need to leave it blank
Leave it blank
o wait nvm its fine





