#development
1 messages · Page 287 of 1
i just wont ask message intent
question
all my bot does is use
slash commands
and MAYBE i will add dms notification
what intents are those
nothing
ok
dm intents are not priviledged, you can just turn them on in your code
nope
ok
No intent
nope, you get it from the user object
unless you're listing a guild's member
lmao
step 1: turn off the intent
(im joking ofc)
step 2: test your commands
step 3: if something doesnt work, fix it with slash commands
thing is
my whole bot runs on 1 command
told you
/login
anything else is buttons
im not a fan of either
- 274294 commands
- star wars intro chat
/command <command name>
inter seting

thats exactly what i did
but thats more than one no?
its been years and its still that way
no, i literally only made 1 slash command
and use it as if it was the prefix
subcommands or just a match case with argument?
before:
.abc 1 2 3
.xyz 10 20 30
after:
/command abc 1 2 3
/command xyz 10 20 30
my prefix was .
@quartz kindle im gonna make an enemy in my game and im going to call him tim
lmao awesome
make me the final boss
Make him a jester please
lmao
okay okay gotchu
reminds me of deoxys
i made a golem
a jester named "tim", definitely makes sense
hahahah
i can hear this gif
Nah just make Tim a computer guy
His attacks are messing with another’s attack by rewriting the code behind it
bc i suck at drawing
lmao, sure
Honestly seeing a Tim laying down attacking is scary enough
hacking real life
Uganda
lmao
hahahahah
but has -99% accuracy
well, im not brazilian but i live in brazil, so you can use the huehuehuehuehue
Ayo?
football ball
or a banana
i need to study brazil stereotype to make the most accurate one
make it so when im defeated i say "huehuehuehuehue"
this is all the info you need:
jester seems like a perfect fit for a tim
jester is a fun class
glasscannon build no defense with random chance of crit and random chance of crit multiplier
you either deal 5 dmg or 500
or miss 5 turns in a row
gambling addiction class
xDDD
@solemn latch ^^
Hey, I wanted to ask from where you get the server_count of bots...
UnicodeEncodeError: 'charmap' codec can't encode character '\u2618' in position 213: character maps to <undefined>
today i learned that if im logging an error in console
and someone's username has emojis in it i get an error bc the console doesnt accept ashi characters by default
ffs XD
@quartz kindle tell me this is good
print(f"[ERROR] {self.__class__.__name__} encountered an error: {str(error).encode('ascii', 'ignore').decode()}")
i made it ignore ascii
looks like k8s is something i can’t learn in 1 day xD
Yeah absolutely not
K8s is a full time career
lmfao, i can see why
The undefined final boss 💀
lame

not running android
wouldnt run android on a dedicated server like ever lmao
why do you have 6 of them
not 6 of the same ones obv
surely that costs an arm and a leg
ye around 2.4k€
damn
not horrible
we got a good deal
thank you hetzner
this is the main one
ahhh
the one we had doesnt luckily
we got a /28 tho
and 3 out of 14 ips were blacklisted somewhere
just picked one that wasnt 
bro ngl discord is getting fucking annoying with all this added bullshit
all i want is a place where i can chat, voicechat and that's it
i don't need damn quests or videos or games or whatever.
adware cuh
gotta remember
nothing is ever free
and if it it
either they're showing ads or YOU are the product
id rather sell my data
uhh, why? doesnt python support utf8?
why python*
not by default
i have to import a library for emoji
but i cba
i just filter them out
lets go it works :D
Welcome to Cloudflare's home for real-time and historical data on system performance.
1.1.1.1 is down
explains me having issues lmao

i dont understand it at all but it looks cool
Essentially error logging aka Sentry
👍
nothing like docker image builds taking 8m
Using docker wrong
Yea you're using docker wrong
@quartz kindle whats your opinion on this code
uh....
is that js even?
the code is as bad as yo mama is fat
Tis not but principals behind it still remain the same
What's so bad about it tim
please explain

idk the semantics of whatever language that is
Its C++ technically (or GML)
but globals = bad
switch with essentially nothing inside = bad
you heard of yandev?
xDDD
Even yandev is better than this dude
Tim do not even try to defend the guy
I mean sure, but its fucking terrible code that can be replaced with an if statement
"make this a switch because i will need to add cases in the future"
but then he never does
He has TONS of switch case statements that are useless
lmao
he also uses 2 dimensional arrays that are global and uses magic numbers to index them
Yeah...but he has THOUSANDS
xDD
😭
Not to mention
Using a map or an object is quite literally not any worse
than a 2D array
slightly worse
Negligable
did you know that in js, in some cases, array.indexOf can be faster than if(obj[key])
How is that faster than a direct whatever
exactly
its 12am im tired brain no think of word
Is it because its precompiled its sometimes faster?
its because objects actually suck
Interesting
js does a whole lot of shit when accessing an unknown key of an object
Honestly tim, how did you learn all this shit about the internals of the language and performance stuff
its not just a simple lookup
I try but I can never wrap my head around it
and i feel like I am missing a lot of theoretical knowledge when it comes to programming
like algos and shit
stumble upon things i never heard about, google them, learn
Yeah I guess
I just don't know where to start. I've really refined my basics
but I feel stuck in anything else
and going to uni for it seems pointless since I want programming to be fun and stress free
not like an obligation
programming? fun and stress free? HAHAHAHAHAHAHAHAHAHA
well
I want to program for myself cause thats where I found enjoyment
tbh i never had an actual job as a programmer, so idk how it actually works
😭
like an office job
Can you just implant your knowledge into my brain
im dumb af
im a master procrastinator
WEll yeah still waiting on that astrology api
exactly
literally worked on it last night
GTA 6 gonna come out before your api does
see this is why i procrastinate so much, i hate spending hours looking at shit like this
i hate balancing
Anyone can help me how custom css of long desc work or how we use image n here
You don't need custom css to use images there, css is used to style elements
In short, to apply css you can either use <style> tag inside which you enter your css or you can also use the so-called "inline css", i.e. the style value of individual elements
To display images you just need to use <img> tag
https://www.w3schools.com/tags/tag_img.asp
w3schools has an explanation of each element and examples of its use. Just remember not to use tags like <html>, <head> or <body> because top.gg already has them on their website
Have anyone explained before for votes tracking?
To linking top.gg with my bot to track realtime votes and to make a leaderboard
Honestly from what I’ve experienced so far it’s pretty chill
Every time I get a better job, things get easier
I mean sure
But my point is I don’t want something I found love for as a hobbyist to turn into an obligation
And that’s what I find the worst
Mostly because of a lack of time and I want to be spending more time with family
If I get a job in that field I’ll hardly have any time for my own shit
Which imo is terrible since that means I’m never actually doing what I want
Part of it is the result of getting married, another part is the result of not wanting to burn out
Yeah that’s fair
But yeah I totally get what you mean
Make a shitty low effort roblox game and make a million dollars
Boom
Then you can do whatever you want
Ahaha that’s not even my goal anymore. At first it was supposed to be a cash grab but my perfectionism and thirst to learn won’t let me make something half assed
Something that you have to learn in SWE is that no system is ever perfect. It’s good to spend time on design, but ultimately you are going to run into problems you couldn’t anticipate anyways, so it’s best to not overengineer things that are not predictable
Speaking of which I had a question about ECS if you’re available to answer
Sure
Ah yeah I know that. Perfectionism is probably the wrong word. It’s just I can’t stand anything that’s done half assed I wanna do it properly
Basically I’m wondering about querying
When I was embarrassingly making that game about cleaning up after animals
I had 3 components Animal, Poop and Model. I was wondering if when I needed to do something with those entities I was wondering if I needed to query for all 3 components even if I wasn’t needing any of the stored data in them
Generally speaking, your systems will query components with either the need to access their data, or to update their data
Entities themselves are not very useful, they just denote an ID that points to a collection of components
Yeah
It’s hard for me to form a question exactly how I want to ask it
I was basically wondering if there was a need to query for every component attached to an entity or just the components I need
You usually don’t care about a specific entity, you care about the behavior that a component or collection of components provides
Hm have I been using an ECS all wrong then
For example, a physics system might query for a TransformComponent and a VelocityComponent (completely fictional, just making this up for the purpose of an example). The physics system doesn’t care about which entities this applies to, it just wants to say “Hey, your new Transform = Transform + Velocity * dt”
Systems act upon groups of specific components, hence why they query for them. They don’t usually care about the specific behavior an entity has. If you’re trying to compare it akin to something like Unity’s game scripts, the scripts themselves are components
Ah I see
guys, i wanna ask a funny question.
is having our app manage it's load balance by itself (e.g. cassandra) the same as using k8s? as of my limited understanding about k8s rn, what k8s do is "just" picking which pod on a cluster to handle that request, while still having the request sent to the picked node. example: cf -> node a -> [pick a pod to handle]. if cf always choose node a, then it's always node a that gets traffic but with additional proxy traffic from another node.
while making an app that manages it's own load balance using pool of ips and ports of the instance, and select which instance the app to choose then proxy it. which is the same as what k8 does, but yes it increases the development time and "reinvent the wheel(?)"
or k8 is better because k8 is known for "many" users so we standardize it, production-ready, and trusted instead of giving a random app their private ips?
I'd say if something exists and you trust it to do its job, you should give it a try to reduce development time. But if you have specific use cases or find that you have to bend it to your will in certain cases, it may make sense to build something that fits your needs lest you become like xkcd standards
xD, that explains enough my question. thank you for the opinion 
Is it normal to do this kinds of thing in an ecs or is this usually split into 2 systems
import { useEvent, World } from '@rbxts/matter';
import { Players } from '@rbxts/services';
import { components } from 'shared/ecs/components';
function spawnPlayer(world: World) {
for (const [_, player] of useEvent(Players, 'PlayerAdded')) {
world.spawn(components.Player({ player }));
}
for (const [id, { player }] of world.query(components.Player)) {
if (player.Character) world.insert(id, components.Model({ model: player.Character }));
}
}
export = spawnPlayer;
I handle both adding the Model component and Player component in the same system
I'd usually do it in the same for loop, but player.Character can be null if the Character hasn't spawned yet
Probably fine. I’m not super well versed in the usage of ECS patterns, I just know how they work and the basic idea of using them
average goland experience
*average go experience

average experience
W variable name btw
s
when we gonna use the invis charcode character
eh that’s what 99% go devs use, even the official wiki
because its not an actual average variable (like params, variables), its a receiver. it just a way to access the type, nothing else
it acts like “this” in other languages
back to personal preference ig, but yes mostly people use abbreviation for this specific case
Ah ok
@quartz kindle how do some bots have buttons inside embeds?
and yes i default pinging you because youre the voice of truth
components v2
something tells me this isnt a thing in .py yet
it is
Summary Discord API now supports complete customization of message designs and layouts. What is the feature request for? The core library The Problem Traditional message designing options restrict ...
@queen needle You were interested in my other game, so maybe you will be interested in this one.
Current Commit history.
Currently implemented : Plots spawn at designated locations when a player joins. Player automatically claims an Unclaimed plot when they join the game. Basis for data storage is laid out, outlining player data like coins and pets and inventory.
In the attached video you will see a semi-transparent block, that is the plot itself. Player is moved there on join after it is claimed.
What needs to be done next is destroying the plot on leave, and marking the plot spawn point as unclaimed
Hell yeah!!
poop wins
shame
Conventionally speaking, the Go creators also pushed for smaller variable names in general
wild concept coming from "code should speak for itself"
they're giving into the 500 magic numbers
Does anyone have unreal Engine agent?
could have done this much shorter, simpler in js 
would be impossible in rust™
only if you serialize and then deserialize into an intermediary type
lmao, if it's alr hard in go, p much sure it'll be much harder in rust
I mean I guess technically you could write a procedural macro (takes in raw tokens, processes them with rust code, outputs new tokens)
but thats cheating tbh
aka in real code I just construct the struct from scratch if i need to censor it (no do-it-all function sadly)
yeah, that'd be a pain if have a lot of structs and a lot of fields
It's basically finished development but we're waiting for Danny (d.py founder guy) to go through it all
Shame it's taken so long
The entire thing started February 28th I think
Discord.py will start supporting components v2? We won't be able to laugh anymore that it's taking them this long 😔
Just implement it yourself then 
Yes but the average person asking on ddevs either doesn't want to or can't do it and prefers to wait until the library officially supports them. It is a bit awkward to answer “discord.py doesn't support them yet”
@queen needle @radiant kraken Found a new bug, thankfully roblox has a way to test with multiple fake clients or I never would of found itSo it spawns both plots properly but for whatever reason, only 1 of the players get put into their designated plot
I see why now
Never I do not see why
💀
💀
That's a new one.
Unsure if right channel, but I am wondering when long descriptions will have documentation for customizing the buttons and stuff.
For label u defined the type a normal string but for description u defined the type as a pointer (*string). Why 
I doubt it will. You can identify what the classes / ids are for buttons and other things using inspect or an extension and then add the .css to the long description to customize them.
I'll try that at some point
/play didi
yes, pointer is nilable. just like x?: string
Found out why but I love fixing things only to find new problems and holes in my logic
What now
Basically when a player leaves the plot isn’t "unclaimed" or it fails to claim it when a new player joins
😄 More details and a floating jump to section bar
@queen needle @radiant kraken May have taken an hour AND a lot of code refactoring and changing how things work, but finally I can officially state that the bug where when a player leaves and another joins the plot is not despawned / spawned again is squashed

YEAH WOOO
I honestly
Want to kick myself in the ass for how i was doing it prior
I was giving myself a bigger headache
I thought "Oh, well why don't I just use 1 SINGULAR component to represent both the plot & the plot spawn point what could go wrong"
"I can just patch the component to change the model from the spawner to the plot then back again when a player leaves"

Turns out, a lot harder than just separating them into their own components
Same xD trying to implement big things while getting as much features possible while also not breaking shit or causing more headaches down the line.
Same here
I am not trying to make something perfect
but I don't want to regret my decision later when I realize I have to refactor 3+ things to make my one addition work

Well while recording this I found a new bug BUT that's besides the point. It "works"
Really not sure how I can insure the player's Character exists
I mean I am already doing that in one system. Which I have this system set to run AFTER that system that ensures the player's character exists
For now it works 99% of the time, there's a very rare edge case the character doesn't exist in time
when in doubt sleep your way out
If anything I put moving them to the plot in another system 
Decided not to sleep
Squashed that new bug
Found out that task.spawn and task.defer exist, and that they do not yield the current thread like task.wait does
So I used it to wait until the character existed and moved them to the plot
It's virtually instant still, so there doesn't appear to be any latency problems
Also added a Character component separate from the Model component to better differentiate between a player's character & enemies' models
Now I sleep goodnight folks
i mean as in like sleep(3000)
Ah
Yeah you can't do that
sleep or anything equivalent yields the thread
and ECS systems can't be yielded
Made it even better for the character & data portion
import { useEvent, World } from '@rbxts/matter';
import { Players, RunService } from '@rbxts/services';
import { getPlayerData } from 'shared/charm/datastore';
import { components } from 'shared/ecs/components';
import { SystemTable } from 'types/Ecs';
function spawnPlayer(world: World) {
for (const [_, player] of useEvent(Players, 'PlayerAdded')) {
const id = world.spawn(components.Player({ player }));
player.SetAttribute('serverEntityId', id);
task.defer(() => {
let data;
let tries = 0;
while (!data && tries < 5) {
data = getPlayerData(player.UserId);
if (!data) {
tries++;
RunService.Heartbeat.Wait();
}
}
if (!data) {
warn(`Data not found for player ${player.Name}`);
return;
}
const character = player.Character ?? player.CharacterAdded.Wait()[0];
world.insert(id, components.Player({ player, data }), components.Character({ character }));
});
}
}
export = {
system: spawnPlayer,
} as SystemTable;
Now I handle setting the data & character in the spawnPlayer system
and just do a if(!data || !character) check in any other systems that rely on the Player & Character components
guys, if aws s3 bucket have all Block Public Access settings disabled but have no bucket policy, will public users able to get the object from direct url? or we must have "principal * action get object" policy to unlock it to public?
Pretty sure you need to set a policy that allows public access
May be wrong cause I haven't used S3 in ages
c# developer discovers typescript:
that's how I wrote it before before becoming prisoner to js coding style
xD iirc that package is a port for roblox's lua
so maybe it follows the official's naming to prevent confusion
do u guys think its harder to make a discord bot in js or python and how much is the difference of performance between the 2?
difficulty is roughly the same
js is slightly more performant than python on average
ok stop yelling at me now
im not yelling lol
its kinda the same
as tim said js performs better than python but not a significant amount at least for smaller bots
python will be perfect for a ai bot
if thats what youre making then sure go with python
for other projects though i usually prefer typescript
🙂 time to get this working fully
cool, I've been looking for a good library. I tried mudblazor and it's clunky
There’s nothing really special about python compared to other languages for an AI chatbot, unless you’re training from the ground up (which likely nobody is doing)
i wanted to mention this
You’re really just going to be making calls to some other model provider like OpenAI or Claude or whatever
Use whatever language you feel comfortable with
its pay as you go
Depends how much you use it
All of the major AI models have API pricing that is based on how many tokens you send/receive in a month
for 99% of the cases, your own logic will be the bottleneck long before language performance start mattering
ofc frameworks should also be taken into account, but I'd not worry about raw language performance
I think that languages should be taken into account if you intend to scale, but if it's a personal project, just use whatever language makes you happy
arguably even at scale it matters much less than we think
as long as its well designed and optimized, the difference between languages will not be that big
it just depends on you, what language you prefer and what languages have a better ecosystem for what youre making
even between js and c++ we can see differences as small as 1 to 1.3
Not sure what im doing wrong but when posting stats with top.gg I can make the request and get status 200 however the data on the page itself doesnt actually change?
architecture is a lot more important than language choice for most applications
but it is important to choose an appropriate language for what your goal is at the end of the day
probably not going to be writing a game engine in python as opposed to C++
I mean... you can, just a matter of whether or not you should
as an aside, I HATE parsing excel files and processing them
but thats basically c++ and not js
please save me from web dev hell
I usually just use the standard language for the project, website typescript, ai/automation python, anything OS related like desktop app or similar I use rust
god I wish I got to use typescript
I wish the internal libs here had jsdoc at the very least
Elixir or go for backend or ts somwtimes
What're you using?
been looking through the fucking de-minified source files for props that may or may not exist in these react libs lmfao
lmao
I don't even get autocomplete on props because they don't have ANY typedefs or jsdoc
I have to literally f12 into the source of the component and hunt for the props
nothing is inferred at all?
So it's JavaScript with no comments jsdoc or example usage?
they just put props like so
const SomeComponent = (props) => {
const { someProp, anotherPropIWontFuckingUse, ...rest } = props;
// Oh yeah and down here just because fuck you we're gonna use props.someHiddenProp instead of destructuring it above
}
so glad that my coworker is the one mainly in charge of frontend
someone would actually have to euthanize me if I had to work on that stuff all the time
cant be worse than reverse enginnering google meet webrtc
Who TF does thst
i did
Why
for a chrome extension
this stuff is pretty difficult to do because we aren't allowed to use pretty much ANY external libs
and there is little to no internal docs on the libraries we have
What does it do
so I'm hunting through decompiled source files half of my day
rip
tracking some usage statistics, but once i got it working i kinda lost interest in finishing it
lmao
oh even better, my API types are all defined in a separate repo/project, and I'm not allowed to add new types because that would require a whole review process and upgrading the nuget package for every micro-api that uses it
so I have to make helper DTOs and so I'm using DTOs from two different projects at any given time
rip
still better than my last internship lmfao
hijacking WebRTC lmao
const ___onmessage = Object.getOwnPropertyDescriptor(RTCDataChannel.prototype, "onmessage");
Object.defineProperty(RTCDataChannel.prototype, "onmessage", {
get() {
return ___onmessage.get.call(this);
},
set(val) {
const fn = function(d) {
if(d.target.label === "collections" || d.target.label === "reactions") {
document.dispatchEvent(new CustomEvent('@_@', { detail: { type: d.target.label, data: d.data } }));
} else if(d.target.label === "audioprocessor") {
if(d.data.byteLength > 2) {
document.dispatchEvent(new CustomEvent('@_@', { detail: { type: "audio", data: "self" } }))
}
}
return val(d);
}
return ___onmessage.set.call(this, fn);
}
});
The more you describe the happier I am Im not majoring in comp sci
forgot you were a js wizard for a minute there
thank you for reminding me
were??!
more like a necromancer than a wizard
comp sci as a major isn't hard
with the amount of zombie/dead projects i have
honestly my least favorite part of SWE is having to deal with the bureaucracy of it
But the internships
what should i cook for lunch
hindsight is always 20/20, I can complain about design decisions but it's really difficult to foresee these sorts of things when you're the one writing things
meth ramen
the CS internship job market is kinda cooked but if you work hard you can land one
my first internship paid me 19 an hour and I drove 80 miles each day that I worked (3 days a week during the semester)
I plan to be a french teacher anyway so, but I did think about comp sci for a little
awesome
I have experience with actual production software now, got to be involved very closely in the process of creating new features, etc.
It was an intern mill but at the same time there's not a lot of internships that give you the opportunity to work on real software
that's awesome tho
Now my internship is at a big company, I get paid significantly more, the drive is 1/6 of what I used to drive, and I get hybrid as well
it's been a great experience so far, just wish I got the chance to work on more technical things than web dev
been pushing to be a part of a kafka project they're working on but I might have to wait until the fall before I can get involved on that
Working 🙂
@quartz kindle how does Array.isArray work under the hood?
It does more than that
"
The abstract operation IsArray takes argument argument. It performs the following steps when called:
If Type(argument) is not Object, return false.
If argument is an Array exotic object, return true.
If argument is a Proxy exotic object, then
a. If argument.[[ProxyHandler]] is null, throw a TypeError exception.
b. Let target be argument.[[ProxyTarget]].
c. Return ? IsArray(target).
Return false"
^ This is why JS scares me
Also what is that an exception on a bool return function
pirate software would like a piece of that
Arrays have a hidden private field when created
It performs a branded check, similar to the in operator, for a private field initialized by the Array() constructor.
essentially something like this
class MyClass {
#isMyClass = true;
static isMyClass(instance) { return instance.#isMyClass; }
}
const mc = new MyClass();
console.log(MyClass.isMyClass(mc))
maybe actually convert to bool tho
(for false)
MyClass.isMyClass([])
Uncaught:
TypeError: Cannot read private member #isMyClass from an object whose class did not declare it
at MyClass.isMyClass (REPL4:3:50)
lmao
isnt fs/promises good enough?
doesnt it only use 1 extra thread for the blocking ops?
node has a threadpool of like 4 threads minimum
ah ok
and i think it scales with available cpus
wasnt quite sure, since uh I havent used nodejs in about 1 year
when rust/c like streams in js
const reader = new StreamReader(fs.createReadStream('whatever.bin'))
const data = new StreamData(512) // essentially just uint8array with "fixed" length
while (true) {
const read = await reader.read(data)
if (read === 0) break
console.log('Read Data: ', data.slice(0, read))
}
const reader = new StreamReader(fs.createReadStream('whatever.bin'))
while (true) {
const len = await reader.readVarInt()
const data = new StreamData(len)
const read = await reader.read(data)
if (read === 0) break
console.log('Read Data: ', data.slice(0, read))
}
its so much more convenient in my opinion
const stream= fs.createReadStream('path/to/your/file.txt', 'utf8');
for await (const chunk of stream) {
console.log(chunk);
}
yea but u cant read custom sizes easily
its been very useful to me when working with tcp stuff like minecraft
since I can just read the exact packet easily
no extra logic
stream.on("readable", () => { // stream has new data
const chunk = stream.read(512); // read 512 bytes, returns null if not enough bytes available
if(!chunk) { return; }
});
cursed
here's a js custom websocket using it:
_onReadable() {
const socket = /** @type {NonNullable<typeof this._socket>} */ (this._socket);
while(socket.readableLength > 1) {
let length = readRange(socket, 1, 1) & 127;
let bytes = 0;
if(length > 125) {
bytes = length === 126 ? 2 : 8;
if(socket.readableLength < 2 + bytes) { return; }
length = readRange(socket, 2, bytes);
}
const frameSize = 2 + bytes + length;
/** @type {Buffer | null} */ const frame = socket.read(frameSize);
if(!frame || frame.length !== frameSize) { return; }
const fin = frame[0] >> 7;
let opcode = frame[0] & 15;
let payload = frame.subarray(2 + bytes);
if(fin === 0) {
this._wsFragments.buffers.push(payload);
if(opcode > 0) {
this._wsFragments.opcode = opcode;
}
return;
}
if(opcode === 0) {
const frag = this._wsFragments;
frag.buffers.push(payload);
payload = Buffer.concat(frag.buffers);
opcode = frag.opcode;
frag.buffers = [];
frag.opcode = 0;
}
this._processFrame(opcode, payload);
}
}
yes, its kinda cursed
lmao
lmao

import { LuminaColorScheme } from '../theme';
import { isLuminaColorScheme } from './is-lumina-color-scheme';
import { LuminaColorSchemeManager } from './types';
let currentScheme: LuminaColorScheme = 'dark';
export function createMemorySchemeManager(): LuminaColorSchemeManager {
const subscribers = new Set<(value: LuminaColorScheme) => void>();
return {
get: (defaultValue) => {
return isLuminaColorScheme(currentScheme) ? currentScheme : defaultValue;
},
set: (value) => {
currentScheme = value;
subscribers.forEach((fn) => fn(value));
},
subscribe(callback) {
subscribers.add(callback);
return () => {
subscribers.delete(callback);
};
},
clear: () => {
currentScheme = 'dark';
},
};
}
Anyone wanna guess why this causes severe lag
hint the ubsubscribe is called 20,000 times
:))
export function useProviderColorScheme({
manager,
defaultColorScheme,
forceColorScheme,
}: UseProviderColorSchemeOptions) {
const [value, setValue] = useState(() => manager.get(defaultColorScheme));
const colorSchemeValue = forceColorScheme || value;
const setColorScheme = useCallback(
(colorScheme: LuminaColorScheme) => {
if (!forceColorScheme) {
setValue(colorScheme);
manager.set(colorScheme);
}
},
[manager.set, colorSchemeValue, forceColorScheme],
);
const clearColorScheme = useCallback(() => {
setValue(defaultColorScheme);
manager.clear();
}, [manager.clear, defaultColorScheme]);
useEffect(() => {
const unsubscribe = manager.subscribe(setColorScheme);
return () => unsubscribe();
}, [() => manager.subscribe(setColorScheme)]);
return { colorScheme: colorSchemeValue, setColorScheme, clearColorScheme };
}
Found the culprit
Fixed with a simple task.defer
peak
New Call of Duty looks wild
these games are stretched way too long
from 1am to 3:30am
with 20 rounds (minimum choice
im the only one able to run eval but even so, gotta have safeguards
Client id redacted??
I never redacted things I just made it use tio if a none owner used it
it redacts alot more than just client id
🔒 Redacted sensitive data: DB_URI, DISCORD_TOKEN, CLIENT_ID, OWNER_ID, BOT_ERRORS, API_KEY, NODE_ENV, VERIFICATION_TOKEN_EXPIRY_MS, VERIFICATION_BASE_URL, CLEANUP_INTERVAL_MS, RATE_LIMIT_WINDOW_MS
it check similar regex patterns so anything that fits any pattern just gets redacted
Idk if the command is only for you I personally don't believe in redacting, as if you expose something that is your fault for not being careful of what you run and where you run it but I understand the point
If they have access to eval, they can bypass your redaction
guys, am i just that dumb in math or what...
that * 100000000 doesnt do anything, whether i remove it or not
have you tried converting to floating point numbers before doing the arithmetic
auto mood
I tried to share https://tio.run/#
I had an eval but unless you were the owner it used tio(linked above) to run the code inputted
@ivory siren
Send me bot link and just watch what can i do 🙂
What?
Me when i add a space between each character of the token to bypass said limit 
Or you know just http request it to your own api logger xD
Hey <@&817055174613794826> I have an app in review, but it's behind a paywall. I have a coupon code for you to get it for free, just need to speak with me!
Bot: https://top.gg/bot/1295547296208916500
Website: https://www.notesbot.io
you should put that in the notes of your submission, and the support team can't help with that
also #support 
ok thanks
I mean you arguably must be pretty stupid to leak it regardless — would either disable eval in prod or just, well, know what you run
i wonder why websocket opcodes distinguish between text and binary payloads
they are sort of the same thing on a fundamental level
ig text is standardized to be utf8
id leave that up to the application to worry about outside of the protocol but thats just my low level thinking
yea I agree
Finally done sentry error logging, still needs a bunch of work/features but hey it works
i dont know either, but i know it is often used to detect whether the payload is compressed or not
for example discord api sends uncompressed json as text and compressed json as binary
which libs use as a hint to whether or not they should decompress
Yea compression and also file binary data too.
how do i check if my bot was approved
You'll be notified via carrier pigeon
so many bots are getting declined it's scaring me
If you read the bot guidelines and the "how we review" article you should have no issues.
@queen needle so nothing major but I have found a new love for making UI in roblox.
https://cdn.discordapp.com/attachments/1276415351474884691/1396346677824323605/20250720-0422-28.2206716.mp4?ex=687dc0ae&is=687c6f2e&hm=215e2f49975588048985e801f4f4079caf908858f002e496e3ce0968ee9b3ff0&
Remaking https://mantine.dev in roblox as much as possible
Currently only have Container and Button (TextButton) ported over
But it's responsive
Container grows based off child elements
So it's height will grow as more elements are added
Tes
ayyyy hype!
great job aaron!

yeah i saw you creating that repo and organization on github
Stalker
Is there an API to change a bot's status if it's only using webhooks and not gateway? 👀
I don't think so. The status is related to the gateway connection. Without it, there is no status
dang, lame
throwing this out there in case anyone can offer any tips
for some reason intermittently when i access my site running on nginx with a letsencrypt cert i am getting this error in nginx logs:
2025/07/20 10:06:18 [crit] 3003836#3003836: *5722 SSL_do_handshake() failed (SSL: error:0A00006C:SSL routines::bad key share) while SSL handshaking, client: xx.xx.xx.xx, server: 0.0.0.0:443
from the browser/curl perspective you get an ssl error:
curl: (35) schannel: failed to receive handshake, SSL/TLS connection failed
but right after a refresh the site works completely fine, so i have no idea what could be wrong with my ssl config if that
has been happening for months and its starting to drive me insane
the only thing i saw on stackoverflow was that its probably russian hackers hitting my site but im not russian unless theres something i dont know 😕
ssl labs also gives me a good score
strange issue
i think i experience this some times as well but usually only on one device and its fine after i clear cache
have you tried on other devices
🔥🔥🔥
yep, i think i isolated it to windows devices, but not sure if its all, when i try doing it on linux the curl always succeeds, its always on windows where its having issues
its such a bizarre issue i am absolutely stumped, and on top of that nginx claims that the client closed the connection but curl claims that the server closed it?
maybe i can get some info running a wireshark on it, but im definitely trusting nginx at this point
actually same issue is happening on termux on my android, now im fully confsued
wireshark it is i guess
that sounds like a common 2 servers 1 port problem
may be running another server without knowing
that would explain a lot, i'll do some more digging on that
this error occurs because safari 6 / iOS 6.0.1 to safari 8 / OS X 10.10 clients do not support TLS 1.3 at all. So if your server requires or aggressively prioritizes TLS 1.3, it can break compatibility with older clients even if TLS 1.2 is supported.
yeah i figured after looking into it further, not related to the issue at hand it seems
can you elaborate why it is not related to the issue?
ah i thought you meant something else, but i did try disabling tls 1.3 fully and only leaving tls 1.2 and the issue seems to persist
confirmed it was disabled via ssl labs
will see if i can find anything interesting on wireshark but it does look like im only running one ssl server, nginx config also looks fine
$ sudo lsof -nP -iTCP:443 | grep LISTEN
nginx 3163374 root 7u IPv4 11517713 0t0 TCP *:443 (LISTEN)
nginx 3163375 www-data 7u IPv4 11517713 0t0 TCP *:443 (LISTEN)
nginx 3163376 www-data 7u IPv4 11517713 0t0 TCP *:443 (LISTEN)
$ sudo ss -tlnp | grep :443
LISTEN 0 511 0.0.0.0:443 0.0.0.0:* users:(("nginx",pid=3163376,fd=7),("nginx",pid=3163375,fd=7),("nginx",pid=3163374,fd=7))
I think you're just micromanaging something that shouldnt really be micromanaged?
Got it. Tell me which OpenSSL version you are using because TLS 1.3 is only supported in OpenSSL 1.1.1+ so if it's still active, you may need to recompile NGINX or alter your NGINX build or use a different method to disable TLS 1.3. Also check if you are using a reverse proxy or CDN because a proxy terminating TLS with TLS 1.3 enabled might interfere with NGINX if the backend doesn't match expected settings.
what do you mean?
Noones really gonna care about supporting older safari versions unless they complain
using debians openssl
$ openssl version
OpenSSL 3.0.16 11 Feb 2025 (Library: OpenSSL 3.0.16 11 Feb 2025)
although i did try disabling tls 1.3 as mentioned before and the issue did persist, so not sure if thats the cause here, but i did confirm it was fully disabled
as for reverse proxies or cdns, im not using cloudflare, the only thing i have is a hetzner firewall -> directly to nginx -> nginx routes to app via proxy_pass
oh i wouldnt care either lmao the issue is that its happening to me and other clients as well
so all modern browsers and operating systems which is very unusual
So then it's something else nothing to do with ssl or older browsers then
If it was an ssl issue you would usually get a browser warning too
for some reason i cant replicate the issue on my wsl on the same machine, but on my android termux and chrome/brave on windows it keeps happening
yeah and its intermittent too which makes things much more confusing
its like a dice roll whenever i make a request for it to happen
What's your domain or what are you trying to test?
Also are you using Clouflare maybe it's a ssl setting that needs fixing
You could also use cloudflare ssl certs instead of lets encrypt too
i was originally on namecheap but switched over to cloudflare, both had the same issue, although i am hesitent on moving to cloudflare
i did do a wireshark and for some reason it looks like the failing request attempts to use tls 1.0?? it would explain why it would fail but im not sure the client tries to use tls 1.0 right after successfully using tls 1.3, will try look into this
i wonder if temporarily enabling tls 1.0 on my server will fix the issue, only to debug
Depends what program you're using it will check tls 1.0 and then upgrade to a newer version or can be forced to use a specific tls version
I see. Make sure you are using secp256r1 as the curve which is widely supported and OpenSSL 3 introduces provider architecture so disable default providers which can block certain ciphers or curves. You should also double check for conflicting ssl_ directives because sometimes they can be set in both http {} and server {}. Last thing you can try is disable TLS 1.3 at OpenSSL system level.
log tls protocol version
in your log_format in NGINX add
log_format tlsdebug '$remote_addr - $ssl_protocol - $ssl_cipher - $status';
and use it in your access log
access_log /var/log/nginx/access.log tlsdebug;
now you'll see if a request came in as TLS 1.0 or not.
don't do it it's insecure, deprecated, and rejected by most browsers and compliance standards.
i understand, but only to test to see if it would solve the issue
i will try this, but it does look like it does an actual hello as tls v1.0 during the failing request in wireshark
and it doesnt try to follow it up with tlsv1.3, i have no idea why it would do this
i notice the issue tends to happen with rapid subsequent requests
it does not follow up because its not supposed to
its supposed to fall back from tls 1.3
not the other way around
though now i did force tls 1.3 with my curl client and it does send the request under tls 1.3 but still fails, hmm
i wonder if this is something to do with some kind of tls connection reuse config, i can now reproduce it almost every time when i do an initial request and immediately try another request, will see if i can disable tls reuse to see if it helps
I just told you that the clients do not support 1.3 but 1.2
my curl and browser does support tls 1.3 fine but the issue persists, i have also tried to force tls 1.2 but the issue still happens on tls 1.2
I told you what to do if it still persists on 1.2
this.
and if it still shows 1.0 or 1.1 in wireshark just log it
to make sure
i see what the underlying issue is now after looking at wireshark dumps, for some reason sometimes when establishing the TLS connection, the server doesn't send a serverhello and sends a fin effectively ending the connection
i cant see how the issue would be to do with the ciphers or protocol if it happens intermittently, if it happened consistently then sure
i wonder if this is some strange hetzner or server config bug that goes beyond nginx
i'll run a wireshark trace on the servers end, its possible the hello's are being lost somehow
i've fed the dumps into chatgpt, if its some rate limiting that's happenign somewhere that would explain a lot as to why nginx thinks the client closed the connection while the client thinks the server did
it looks the problematic https request doesnt even receive a clienthello from the servers perspective, i'll test this from my work pc and network and if the issue persists, im starting to think hetzner has some kind of weird dos protection that drops the packets
im making a client bot rn. its finished but i got 2 hrs left soooo, made a animated ping command because im so bored
discord API ratelimits are gonna love this
yes they will
i mean its for a private server so not really gonna be an issue
none of them will be checking the ping
I have a feature that analyzes chat conversations (usually 30 minutes to 2 hours long). During live chats, I cache the messages temporarily, then periodically dump the cache into JSON files to clear memory. After the chat ends, I run AI analysis on the complete conversation stored in the JSON. This works fine.
Now I'm building a website to share these processed chats, but storing them as JSON files isn't ideal for a web platform. After the AI finishes processing, should i
Delete the JSON and save everything to a database, or
Keep the processed chat content on a CDN?
The chats are finalized after AI processing and won't change anymore. I'm trying to figure out the best approach for serving this content which is basically static to users on the website.
if its displayed statically then a file is better than db
do you use ssr?
is the json file loaded server side or client side?
you could store them in a folder configured to be served as static files by your webserver, and add caching headers to them as well
shouldnt be expensive unless your files are huge
The only problem i was thinking was the pfps since they change and the likes (the messages can have likes) so im guessing i save the message id, content and user id and display the other things slowly?
pfps can be served directly from discord's cdn
Ye so all i need is their user id
And then i can store the likes in db linked to messages that have likes
Thats confusing
But sounds good in my mind
yeah just be sure to add caching if possible
specifically browser caching with etags
Cdn has that by default but if u are talking about the rest of the site
I will really need caching
I could be wrong?
why is it so easy to aquire tech debt
u write code in a rush once and suddenly modifying that code and everything around it is awful and will never get fixed due to it being annoying to
You just have to get good at reworking and organizing code better, i'm getting a bit of tech debt but i have it fairly organized
yeah, my debt is in places I think Ill never have to modify again
and then I have to modify them
It's easier to write code than delete it
AI 
the age old question for software engineers
good architecture from the start tends to acquire less tech debt in my experience
de-couple your services as much as possible
IMO testing without properly implementing does it too
"eh, this works, let's just slap it into a function and ship it"
I'd say it's more of an architecture question
lack of knowledge of a certain matter can accelerate it. Hacking code together
There's stupid tech debt which is more like "this is a bad practice and I know it but I don't care right now", then there's genuinely bad tech debt like "I designed this system poorly from the start, now it would be hell to redesign"
yeah for sure
e.g. making a giant monolith application for a web app when a few micro backends/frontends would be a better choice for modularity and team collaboration
system design is underrated and underappreciated
not sure where to but suggestions, but one i have is to somehow provide an average decision time of bots by taking the average elapsed time from submission to decision of the last 10 bots or something like that
just suggesting this because it seems to be taking longer than 2 weeks 😔
Unfortunately this isn’t going to be a very useful metric. Bots are reviewed by a small team and often times the average review time is not consistent enough to give an estimate
Giving time estimates makes users upset when the actual time is longer than the estimate, and overestimating timing to compensate makes users angry with feeling like it’s going to take a long time
ah i see that makes sense
(don't worry, im not angry its taking longer than usual, more just paranoid something will break last-minute)
has anyone here used alacritty? what do you guys think of it?
i just made a error look up for my support bot and i like it ngl. I've never actually used modals before this
https://synz.rocks/uploads/nxCbljCLGK.gif
How the fuck does pnpm link work
Like both local and global linking don't do shit
The test project still can't resolve the package for either
and now I feel like i've fucked it up beyond repair cause it wont even unlink now

pnpm is a scam
its cool in theory but in practice it has so many issues its not even funny
but blazingly fast 🚀
but yeah no im realizing that
I first swapped to pnpm because it's features seemed cool
but like you said in theory
in practice its becoming a huge issue 
did the same years ago
regretted it so much i went back to npm and never looked back
i tried yarn as well
legit npm fixed it
npm link & npm link package-name
💀
I used yarn for like 2 years before just going back to npm
Everyone comes back to npm in productionalized systems.
im trying to make a filter for crafting recipes using modals
rn it just levels but i want to add like "can be crafted" , "class specific" , "slot specific"
shouldn't be that bad <= clueless
I mostly use npm but Ive switched to bun recently and its quite nice
but for most things npm is better
ik why i'm in css jail
lol
i wish there's a cleaner way - will do later in optimization stage
wtf is this
Cleaner way: Don't use css
no, not neccesarily if you would want to set a rpc for ur bot it would have to be coded. so to answer ur question , no there isnt a way to set rich presence using browser. im not sure if ur talking about an bot or ur rpc.
You technically can but you need to run a program on your computer that uses Discord and the website can communicate with said program to set your Discord clients status
There was a service that did this but for some weird reason i can't find it on google 
Ah that was it premid https://premid.app/ they have a lot of website specific rpc status like youtube, instagram, etc
PreMiD is a simple, configurable utility that allows you to show what you're doing on the web in your Discord now playing status.
not a bot, i mean on a website
@sharp saddle
ok, i'll take a check
You can use browser extensions to use IPC to communicate with your Discord client, so just develop your own extension i guess 😄
or he could use the extension thats already made yeah premid works!
what the fuck
i mean, it actually makes sense if you pay attention
but it looks terrible at first hahaha
well you could make your own variable with that, at least you dont pollute your classes
There is technically .less that lets you put css inside each other
.class1 {
.class2 {
}
}
Depends on what lang/lib you use to convert that to css though
you can already do that with pure css
yes, css supports that now
in the most recent browsers
which honestly what took them so long
fucking finally
and most frameworks should support that in raw css files and still transpile it for older browsers anyway
they had to wait the old man to die (IE)
didnt old man die a decade ago already
nah, 3 years ago
lmao
The best alternative would be @apply with custom css variables at that point I think
nice, node path renderer seems to be working perfectly
recursion ftw
while we're at that, does anyone know any tabletop map backdrop creation tool to recommend?
please end me (I am reboxing a box to downcast it back to a box)
punishment for not using async everywhere yet
reboxing a box back to a box
yes
this happens when you work with dynamic data in rust and just want to get it done quick
There have to be a better way to do this
looks pretty normal
the most you could do would be something like ```js
const user = pk.d.user;
const tag = user?.primary_guild;
if(!user || !tag) return;
thanks
and
switch (event) {
case "":
case "": {
} break;
}
using ors can getting annoying
ye if you have a long list
I got into the habbit of just refusing to do ors/else ifs
lol
hi
this morning i pushed a change that broke one of the key features of my service and i had no idea until now (its night time) 💔
for this, it is necessary for users to immediately report errors that they have noticed. Even if it seems like an error to them, but it is not an error, then let them still write. Thanks to users, you can see a lot "from the outside"
yeah i found out when someone told me about it
but still quite tragic
it was just a save button that was broken
its supposed to be disabled if theres no detected changes
but it stayed disabled even after changes were made
so someone asked me whether it has autosave
and then i realized the mistake i had made
nice try scammer
aight, update on the generation thing
now it highlights only paths reachable by the player
I need to make a path's color consistent lmao
Just landed a new job 😄
congrats
The pay is wild $225k/yr 😮
america?
Yeah ofc. To my knowledge, it's the only country that pays this much haha
yea, what I was thinking too
My skill is purposed to Generative AI / building agentic workflows ... so it makes sense for the company imo
I'll likely build them something that makes millions of dollars...
hey if you need an assistant let me know xD
Man I WISH
Average game of league
I was today years old when I found out my app isnt leaking memory, its just really fragmented
switched to jemalloc, will see if it helps
Are you US? We've talked before about this, but I admittedly forgot 🤦
Texas maybe?
Does Discord not have an API to get a list of members with x role? Only way I see to do this currently is to pull every member of a guild and check them for the role. All fine until you start reaching guilds with 10k+ members. Also doesn't really help if the guild is popular and members are always joining/leaving, might skip over some since it'll definitely end up getting rate limited.
I don't think they do unfortuantly
use member updates to track it rather than doing it all at once
if you are doing large checks then split it into chunks
Listen to events like:
guildMemberUpdate (to track role changes),
guildMemberAdd / guildMemberRemove.
use cache where you can
Dang I should've specified. I'm not using gateway, just webhooks and HTTP lol
You aren't wrong about the events, but I can't use those here lol
I'm using this as well
theres really no way to accurately track roles, but to get members in bulk you can connect to the websocket only to retrieve those and then disconnect, its cheaper and faster than using the rest api
My problem is that if I need to do this for one guild but my not is in thousands, it's going to be quite difficult to do this. Unless you can connect to specific guilds only instead of shards, but I don't think Cloudflare workers will support this.
The goal is a webhook only bot. It's dumb that I can't get the list of members with a role from the not API but users can from the user API.
you can connect to a single guild only, there is a trick for it
you need to spawn a shard with a large shard count value (i believe the limit is 32 bit unsigned int), and calculate the shard id based on the guild id
the issue is you can only do this 1000 (2000+ for large bots) times per day, due to shard identify limits
hi~ how do y’all store your .env values?
since we don’t push them to github, how do you make sure they’re available when pulling the repo on another device?
do you keep them in google drive, a usb, or something else?
I just copy and paste them from my VSC
So I just make a new file on the production machine wether it be, shared web hosting, vps, vds
Even though they are not stored on GitHub, when pulling the latest from GitHub it will not delete the file
I think I should have both .env (ignored) & .env.example (pushed w/ empty values), correct since it's best practice?
issue is~ I want somewhere to store all the env values
i was told a password manager like 1password is good?
I do that for my projects
Oops ping
Do you also copy-paste your env values?
I also do that, yes with copy paste
Thanks a ton @radiant kraken 🔥
Will test while in the train later today ^^
i use bitwarden

but i also have all my code mirrored/synced into a Mega cloud storage
i genuinely didn't expect you looking at my project lmao!
ah fair~ they don't have a free plan tho
they do
Funnily I have a fair use-case for it and remembered it :)
the free plan is very generous, just no 2fa support afaik
im using Ente for 2fa now, after Authy shutdown their desktop client
Ente is pretty nice, they have mobile, desktop and web clients so you can access your 2fa from anywhere
they also have a privacy-focused image hosting service
Mostly
@quartz kindle sir, do you have anything planned on <t:1753639200:F>
lmao idk yet
mm, you should totally join my mc event
I'm just needing a solution to store the .env values for different projects.
I'm using Google Authenticator for 2FA generation for all my accounts.
Anyhow, I'm going with Bitwarden; 1Password & Nordpass lack in some features.
cool
you can also selfhost your own bitwarden
they have a free open source server
and a rust alternative 🔥🚀
maybe, who knows
mm, if you look at prizes you may consider
discord is on my website
how does that differ than storing on their server?
you get all paid features
and you have all data on ur servers
ohh, so i don't pay for the paid features if i self host?
yes
alr, i'll look into the docs then
crab version https://github.com/dani-garcia/vaultwarden
its mostly for privacy freaks who refuse to hand over their data to third parties
you just have to manage your dafa yourself and the risks it imposes (like your vps terminating you and not giving your data back)
user.0.0 🥀
I also do. Bitwarden is great and free. I do pay for a family plan
i just pay for bitwarden, it's extremely cheap
i'd rather not lose all my passwords because of a bad rm -rf or something alike
yeah, its actually crazy
well, that would be a massive skill issue for not doing backups
even with backups sometimes stuff can happen :p
yea I also dont selfhost bitwarden anymore
unlikely but something could happen that knocks off your homeserver and backup at the same time
i use proton pass, free, simple and convenient
there's also the whole thing with that a vulnerability in vw is more likely just due to being open source and the ability for bad actors to submit real prs that could introduce vulns
see: xz situation
Oh dam bitwarden actually lowered their prices a lot wtf
i'd rather just pay the 10$/yr or whatever it costs rather then deal with all that stuff
Yeah, I was shocked to
@radiant kraken now i understand what you meant with the size of the files 
Small question though, haven't used the lib a lot - won't be that huge the resulting compiled binary?
lovely



