#development

1 messages · Page 285 of 1

queen needle
#

plus one db multiple tables would allow easier cache integration with something like redis

wheat mesa
#

^^

queen needle
#

well at least you've learned a lot from the downfall of this project

#

I know how much it sucks to learn months/years of projects

wheat mesa
#

Plus, you might have to start dealing with distributed transactions. E.g. you are updating something on database 1, and it succeeds, but then you update something on db 2 as a part of the same service, and it fails. You'd want db 1 to know about this failure and not commit the changes, but this is a very difficult problem to solve in practice

queen needle
wheat mesa
#

Not sure, never had this issue before

queen needle
#

Of using multiple databases for one project lol

wheat mesa
#

Considering this app is a monolith, if it requires distributed transactions, I'd be astonished

queen needle
#

What is the app anyway

wheat mesa
#

Some sort of website

queen needle
#

That narrows it down lol

pearl trail
queen needle
#

How did the failure originally occur? I read some earlier but

hidden gorge
#

thats only part of it...

queen needle
#

Intriguing

hidden gorge
#

our Support system is just different

#

we have incident dispatching, live calls maps and a few other things we wanna do

#

all this info is useful for community policing and we send it to the police

#

our job is to not only document these incidents but release them publicly

queen needle
wheat mesa
#

Didn't take it the wrong way, dw 🙂

#

Just working rn lol

queen needle
#

Can't create a breakfast war

wheat mesa
#

hahaha

#

on an unrelated note, I despise having to handle data imports from excel files

#

Especially when I have to do string comparison for database items instead of including the damn ID in the excel file

neon leaf
#

oom.. I'm way too drunk

#

I 10vvbèrt

#

10 beer

quartz kindle
#

10 bier bitte

gilded ice
#

i finished the thing i was working on

prime cliff
#

Pog got it working fully now

prime cliff
prime cliff
#

Lets goo

#

I should add components v2 to this soon Sweaty

quartz kindle
#

are you actually no-coding a bot?

prime cliff
#

Maybe Smug

quartz kindle
#

or making your own no-coder?

prime cliff
#

It's gonna be part of Dev Space

quartz kindle
#

xD

prime cliff
#

It was one of my old projects this bot maker that was 2 years ago

#

So i'm basically merging it into Dev Space which means self hostable and no discord trouble

quartz kindle
#

nice

prime cliff
#

This UI for it was very bad when it was in demo, i've improved a lot xD with Dev Space

queen needle
#

why is the items per page so big

prime cliff
#

Hasn't been tweaked like the action bar stuff above

pearl trail
#

wow i didn't realized this until now

neon leaf
#

ok I dont think I can explain this

pearl trail
#

xD i found this

  • isNaN converts the argument to a Number and returns true if the resulting value is NaN.
  • Number.isNaN does not convert the argument; it returns true when the argument is a Number and is NaN.
    > https://stackoverflow.com/a/33165410
neon leaf
#

ah

thick hazel
#

umm like im using open source code

#

and i want to list it on topgg

#

how many commands did i need to add in bot to get approved?

quartz kindle
#

you use Number.isNaN() to directly check if a value is the actual NaN value or not

#

isNaN is misleading and shouldnt be used in general

#

but you can use isNaN to check if a value is coercible to a number

#

similar to if(Number(val))

#

isNaN is basically equivalent to Number.isNaN(Number(val))

pearl trail
quartz kindle
#

it gives you the impression of doing something different than it actually does

pearl trail
#

ohh

quartz kindle
#

also NaN is a falsey value in itself, so most times you dont need to use anything else

#

unless you're dealing with values that can contain 0

#
// you can do this
const n = "0";
if(isNaN(n)) {} // value can be anything that cannot be converted to a number

// but its a better idea for code readability to do this
const n = Number("0");
if(Number.isNaN(n)) {} // value can only be NaN

// bonus
if(Number.isFinite(n)) {} // value cannot be NaN nor Infinity
if(Number.isInteger(n)) {} // value cannot be NaN nor Infinity nor float
pearl trail
#

thank you master Tim, as expected from master prayge

quartz kindle
#

lmao

neon leaf
pearl trail
#

is that the new pc cooler 101

neon leaf
#

its the robert cooler 102

#

its 29°C outside and 32°C inside

#

thats what I get for running 4 pcs

prime cliff
#

Looks like something out of r/diwhy xD

gilded ice
#

are we allowed to ask css questions in here

prime cliff
#

Yup that is web development

gilded ice
#

i thought this was butt development

#

my god

#

honestly it's probably fine as in

#

disregard

#

trollface

prime cliff
#

Does this channel say #bot-development though smart

gilded ice
#

sigh

quartz kindle
#

this channel should be renamed to stackoverflow v2

#

stackoverflow is dying due to chatgpt

#

and their toxic culture

neon leaf
#

this is general-2 for me

gilded ice
#

is there a way to have a while loop spin in place until an asynchronous condition elsewhere gets fulfilled?

#

i feel like that would block the event loop

#

hmm

#

something like js let cond; websocket.on("open" () => {cond = true}) websocket.open() while (!cond) {} // do stuff with the socket with confidence that it's open

#

that just blocks forever right

prime cliff
#

Usually you would just do a new task to run something in while the main thread continues

gilded ice
#

hmmm

alpine lily
#

hello

neon leaf
#

hold on I will get to my pc

#

websocket.open()
await new Promise((resolve) => websocket.on("open", resolve))

// do stuff with the socket with confidence that it's open
quartz kindle
#

yes, just like that ^

#

its called promisifying an event

neon leaf
#

idk if this is a better version maybe but ye

const promise = new Promise((resolve) => websocket.on("open", resolve))
websocket.open()
await promise

// do stuff with the socket with confidence that it's open
#

havent done js in a while now

#

I dont think theres a diff in the case of ws tho

quartz kindle
#

both are equivalent

neon leaf
#

ye, ig open spawns an async task

#

so the promise is created instantly after

#

and neither are polled yet

quartz kindle
#

in this case i believe so yes, there are rare cases where events are emitted synchronously, but i dont believe this is the case

#

also whoever makes synchronous events should stop doing that, its really bad practice lol

gilded ice
#

okay awesome

#

thank you

#

i was wondering about this

pearl trail
#

tf webkit, what am i supposed to do with this 💀 to fix the issue, i need to toggle display flex on off 💀

pliant relic
serene root
#

Hello, I'm getting a TopGGAPIError: 404 Not Found error... I've done everything I can to make it work, updated it, and the API token is valid, but I'm still getting this error. If anyone knows how to fix it, I'd love to hear it!

Thank you very much.

raven token
serene root
raven token
alpine lily
#

Bro

#

The comm works

gilded ice
#

hahahahahahaha

gilded ice
neon leaf
#

you may need to make sure shocker isnt already open

#

unless you never set the promise again, then its be fine

gilded ice
#

mmmm

#

i had a better idea

#
init(): Promise<void> {
    let socket = new WebSocket(this.brokerUrl)
 
    this.socket = socket
    
    return new Promise((resolve) => this.socket.on("open", resolve))
}```
#

in the main file it just does shockers.forEach(async s => await s.init())

#

i'm so cool

neon leaf
#

that wont work

#

you will have to use

for s in shockers {
  await s.init()
}
#

forEach doesnt wait for the callbacks to complete

pearl trail
#

await Promise.all(shockers.map(s => s.init())) >>> sunglaso

#

it may be bad may be good, use with caution™

alpine lily
feral aspen
#

I'm cooked.

quartz kindle
feral aspen
#

I just noticed my yarn.lock file was corrupted - I deleted it, cleaned cache & re-installed.

Apparently, npx tsc used to return 0 errors; however, I received 16 fresh errors now.

quartz kindle
gilded ice
#

makes sense

#

in my usecase, stuff only gets closed when the program ends

#

i should probably write a handler for it regardless

quartz kindle
#
init() {
  this.socket = new WebSocket();
  this.socket.on("open", this.openListener);
  this.socket.on("close", this.closeListener);
  this.readyPromise = Promise.withResolvers();
  return this.readyPromise.promise;
}
openListener() {
  this.readyPromise?.resolve();
}
closeListener() {
  this.socket.off("open", this.openListener);
  this.socket.off("close", this.closeListener);
  this.socket = null;
}
quartz kindle
#

no idea if websockets use the same on/off event listener that nodejs uses

gilded ice
#

it's an EventListener

#

i'd imagine

quartz kindle
#

then yeah it should work

#

also worth adding guards against running init() when a socket already exists

gilded ice
#

yeah, ws uses eventlisteners

gilded ice
#

i can just check if this.socket is not a websocket

quartz kindle
#

Promise.withResolvers is amazing but its pretty new, it was added on node 22

gilded ice
#

i'm gonna read up on it

#

NEVER seen that before

#

oh it's literally just a destructed promise

#

that's cool

quartz kindle
#

yeah

#

otherwise you would need to do it like this

#
let resolver;
let rejector;
const promise = new Promise((resolve, reject) => {
  resolver = resolve;
  rejector = reject;
});
return {
  promise,
  resolve: resolver,
  reject: rejector
}
gilded ice
#

yep yep

quartz kindle
#

its basically defering/offloading a promise

neon leaf
#

thats a nice feature

quartz kindle
#

yeah, since node 22

gilded ice
#

makes sense

deep cedar
#

Yo does somebody know how to do an vercel slash website like example

https://myname.vercel.app/help

How do tk the /help after the vercel.app is it that you need to put some code in index.html?

quartz kindle
#

otherwise if you have a backend with routing, then you need to create a new route

deep cedar
#

Ohh so I need to create an help.html file and connect in om the code and then it will work as .app/help ?

quartz kindle
#

if its a static website yes

#

index.html is an alias for /

#

everything else is the name of the html file

#

including folders

#

how did you create the website? did you use a template?

queen needle
#

tim you have more patience than me

prime cliff
#

Yay i love updating a javascript library that's 2 major versions ahead with a ton of my own now broken customization/hooks/extensions/plugins 🙃

neon leaf
#

hah jokes on you for updating anything

#

some of my projects use fixed versions from 2 years ago

#

because I depend on bugs

#

🔥

prime cliff
queen needle
#

😦

#

are you going to fix it all or just scrap it

prime cliff
#

XD like hell i'm gonna scrap it

#

I've already comitted a lot the UI is done for managing commands and apps just this workspace part needs fixing

#

Now fully functional 😃

queen needle
#

howcome it doesn't just say disable if it's enabled and then enabled if it's disabled instead of being two different actions

prime cliff
#

I could maybe do that yea, but the workspace is a priority atm

queen needle
#

that's fair

prime cliff
#

Got it working and updated a bunch of plugins vibecat

queen needle
#

Awesome

prime cliff
queen needle
#

The minimap is a bit cursed

prime cliff
queen needle
#

well it was showing things wrong

#

idk if thats css based on its implementation

prime cliff
#

Wait really hu

queen needle
#

don't mind the good mythical morning in the corner

#

i only have one miku but minimap shows two

#

I think i know the cause

#

Reload, press m 3 times before focusing on window/clicking anything, it'll place a miku in minimap but not on screen

sharp geyser
#

I think I finally understand how an ECS works (to a point)

#

I am also realizing just how much I understand code even when its not in a language I don't always use

#

I am looking at how this ECS used in roblox development, and its quite interesting.

sharp geyser
#

Entity component System

dusk hollow
#

Hello i need help!

I was working on kick command and i was forget to add action in it and when i was try, bot crash. After fixing it now it stuck on deploy global command. Is anyone can help me please.

deft wolf
#

You do realize that there is a limit of 200 iirc command creations (creations, not edits) per day? Depending on how your bot is programmed, you may have exceeded that limit

#

Without the code it's hard to tell

dusk hollow
wheat mesa
dusk hollow
pearl trail
#

log doesnt show anything important

feral aspen
#

https://codeshare.io/5XLYnK - Type 'Element' is not assignable to type 'undefined'. ts(2322) [Ln 16, Col 13]

Could it be an issue from my LayoutPage? I don't know where to look:

import { CustomSeo } from '@/components/CustomSeo';
import type { CustomSeoProps } from '@/components/CustomSeo';

import { Footer } from '@/UI/common';

import { twclsx } from '@/libs/twclsx';

import type { NextPage } from 'next';

export type LayoutPageProps = {
    className?: string
    children: React.ReactNode
} & CustomSeoProps;

export const LayoutPage: NextPage<LayoutPageProps> = ({ children, className, ...props }) => {
    return (
        <>
            <CustomSeo {...props} />

            <main className={twclsx('layout', className)}>{children}</main>
            <Footer />
        </>
    );
};
#

This issue suddenly popped after I deleted my yarn.lock file, cleaned cache & re-installed. ^

sharp geyser
prime cliff
sharp geyser
#

@wheat mesa I assume you've used an ECS before right? You've made your own iirc

#

I am attempting to make a game using an ecs some roblox devs made (matter-ecs) and I am wondering what my first steps should be in a typical ECS usage.

#

I know I should spawn my player somehow and assign components to it I think?

wheat mesa
#

Components define shared behavior, systems are used to update sets of components

sharp geyser
#

Well right now I have a system that will listen to the PlayerAdded event and spawn a Player component in the world

local Players = game:GetService("Players");
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Matter = require(ReplicatedStorage.Packages.matter)
local Components = require(ReplicatedStorage.Shared.components)

local function spawnPlayer(world: Matter.World) 
    for _, player: Player in Matter.useEvent(Players, "PlayerAdded") do
        world:spawn(Components.Player({ player = player }))
    end
end

return spawnPlayer
wheat mesa
#

For example, you may have a Player that has a TransformComponent that stores the location of said player. Then, you might have a system, say PhysicsSystem, that acts on all TransformComponents and updates their state in accordance with physics rules for your game

sharp geyser
polar bough
sharp geyser
#

it's lua

wheat mesa
#

Some systems will have more advanced criteria for figuring out which components they wish to update

sharp geyser
polar bough
sharp geyser
#

Spawning components in a system based off a game event

sharp geyser
wheat mesa
#

Hey don't judge my roblox knowledge

#

I was playing grow a garden 45 minutes ago

sharp geyser
#

😭

#

My fault g, didn't know you were chill like that

polar bough
sharp geyser
#

It's...roblox?

wheat mesa
polar bough
#

ask chatgpt weirdsip

sharp geyser
#

Well yeah cause idk what the fuck im doing 😭

#

Right now I am just trying to do player stuff

#

and I have never used an ECS before

wheat mesa
#

Generally speaking you would probably have an entity that is spawned with an attached PlayerComponent or ideally a set of components describing its properties

queen needle
#

ECS is interesting

#

I didn't understand it last time you mentioned it but seeing the usage and what waffle says it makes sense

sharp geyser
#

It seems they do world:spawn which spawns an entity with that component attached?

wheat mesa
#

Entity Component System ;^)

#

Perhaps that's what it is

sharp geyser
#

Yeah

#

It is

#

Duh

#

😭

#

Should I even be doing this in a system waffle?

#

Systems run every frame

#

Cause I assume either in a system or somewhere else, I have to spawn the player entity with components like Player, Health, Stamina for example

#

With the Player component containing a reference to the actual player

wheat mesa
#

I mean it's going to depend on the setup of your game

#

For the gaame I've made with my own ECS, I have had entities being spawned in systems iirc

#

It's been a while

#

Might be a question for AI in terms of figuring out the general arch

sharp geyser
#

Gotcha

#

Guess I will use chatgpt after all even though I wanted to avoid it

wheat mesa
#

It's okay for asking general questions

queen needle
#

Or if there's other games you could look at the source for?

sharp geyser
#

The problem is, if you've never used an ECS before then its hard to understand whats going on ECS wise

#

So looking at source for already made games using matter doesn't help me much ESPECIALLY when the code is terrible

queen needle
#

That makes sense

wheat mesa
#

You can take a look at the test folder of this if you want to see a barebones impl

#

Keep in mind I made this when I was in high school so take the code with a grain of salt

sharp geyser
#

Made game when in high school 2 years ago

#

Where's the actual ECS part

#

Cause I don't see it

wheat mesa
#

You can look at the actual code folder if you want the impl

sharp geyser
#

According to chat gpt what im doing right now by spawning it in a system is perfectly fine ig?

wheat mesa
#

Should be fine

#

Systems are meant to be mostly lightweight afaik

autumn geyser
quartz kindle
#

ESM folder index files be like

small tangle
#

More stars than in the observable universe

deep merlin
#

How can I update the server count of my bot listed on Topgg? Currently I am using Topggpy and Discord.py for the bot.

#

huh?

#

Are you some sort of a spammer?

#

I'm not clicking anything.

pearl trail
#

hi Door

quartz kindle
#

not sure if its up to date, it hasnt been updated in 4 years

prime cliff
#

WOOO i've done it vibecat
Successfully merged my 2 year old project into my main project (Dev Space) with Discord App creation.
Demo: https://devspace.fluxpoint.dev/workspaces/demo

Taken me 7 days (and 40,000 lines) but it has finally paid off and this will be good to create simple slash commands and user apps with button and modal interaction support.
-# Components v2 soon™

quartz kindle
#

nice

#

congrats

loud canopy
#

bro it took me some time to find this and the comment killed me 😭

#

this is one of those "its a future me problem"

quartz kindle
#

lmao

autumn geyser
crystal wigeon
#

anyone know how much top.gg makes with ad revenue?

quartz kindle
#

US

crystal wigeon
deep merlin
#

I'm curious how does Top.gg verify the guild count on bot listed on their website? Can't I just fake the count to attract more users?

deep merlin
quartz kindle
#

but if you're caught you'll get banned

deep merlin
acoustic bough
#

yes

deep merlin
#

Can a moderator verify it?

quartz kindle
#

they dont verify it

#

but anyone can check it and report it to them

acoustic bough
#

the oauth2 flow shows the number of guilds your bot is in

#

roughly*

deep merlin
pearl trail
#

but not all

crystal wigeon
crystal wigeon
#

I tried googling and there concrete number

quartz kindle
#

it depends on the content type and regions targeted

#

but their calculator mostly shows around 1k per year for 50k monthly views (so $1k per 600k views)

#

which would mean about 2 bucks for 1k views

#

but depending on the type of content and region it can range from like 1 to 4 per 1k idk

radiant kraken
quartz kindle
#

LSOD

#

linker/lto screen of death

sharp geyser
#

Good luck have fun

neon leaf
#

(I should maybe start commiting more often instead of each decade)

queen needle
#

Lmfao

loud canopy
#

you cant make this shit up i have random print("meow") statements left somewhere in my bode 😭

loud canopy
loud canopy
#

but but meow

acoustic bough
sharp geyser
#

Don't judge the UI's contents Me and my gf and some friends are making a game to get bunch of robux from kids.

queen needle
#

Can I please judge the UI(jk I respect the grind),

sharp geyser
#

Honestly go ahead, I put 0 effort in it beyond the grid and placement

queen needle
#

So what exactly is the game about

#

I see poop and coins

sharp geyser
#

Well

#

Bit embarassing but chatgpt gave me a poop collecting simulator 😭

#

So I said fuck it

#

I see those kinds of games get millions of vists on roblox

#

Might as well join in

queen needle
#

Collecting from, I dont want to know

sharp geyser
#

The ground

queen needle
#

But I'll play it when you finish it

sharp geyser
#

We aren't that disgusting 😭

#

I drew a line

queen needle
#

Dev log in here

loud canopy
#

man i hate game balancing

#

i make focus a bit stronger and evasion is useless

#

i buff evasion cost so its stronger and now evasion is op

#

😭

quartz kindle
#

it feels so good when you finally get a complex ts type working as intended

queen needle
#

What'd you get working

sharp geyser
#
const ReplicatedStorage = game.GetService("ReplicatedStorage")
const Players = game.GetService("Players")
const LocalPlayer = Players.LocalPlayer;
const PlayerGui = LocalPlayer.WaitForChild("PlayerGui")
const EconomicsEvent = ReplicatedStorage.WaitForChild("EconomicsEvent") as RemoteEvent
const EconomicsFunction = ReplicatedStorage.WaitForChild('EconomicsFunction') as RemoteFunction

async function waitForEconomics(): Promise<{ coins: number, poop: number }> {
    let result: {coins:number, poop: number} | undefined = undefined;
    while (!result) {
        try {
            result = EconomicsFunction.InvokeServer(LocalPlayer)
        } catch (e) {
            print("Server didn't return data yet, retrying...")
        }
        if (!result) {
            await Promise.delay(0.5)
        }
    }
    return result
}

let econConnection: RBXScriptConnection | undefined;

function SetupEconomicsUI(economicsGui: ScreenGui) {
    const Container = economicsGui.FindFirstChild("Container")
    if (!Container) return

    const PoopText = Container.FindFirstChild("Poop") as TextLabel
    const CoinsText = Container.FindFirstChild("Coins") as TextLabel

    if (econConnection) {
        econConnection.Disconnect()
        econConnection = undefined
    }

    econConnection = EconomicsEvent.OnClientEvent.Connect((econType: string, newAmount: number) => {
        print("Event Fires on Client:", econType, newAmount)
        if (econType === "Poop") {
            if (PoopText) PoopText.Text = `Poop: ${newAmount}`
        } else if (econType === 'Coins') {
            if (CoinsText) CoinsText.Text = `Coins: ${newAmount}`
        }
    })


    task.spawn(async () => {
        let economics: { coins: number, poop: number } | undefined = await waitForEconomics();

        CoinsText.Text = `Coins: ${economics.coins}`
        PoopText.Text = `Poop: ${economics.poop}`
    })
}


const maybeGui = PlayerGui.FindFirstChild("Economics") as ScreenGui
if (maybeGui) {
    SetupEconomicsUI(maybeGui)
}

PlayerGui.ChildAdded.Connect((child) => {
    if (child.Name === "Economics" && child.IsA("ScreenGui")) {
        SetupEconomicsUI(child)
    }
})
#

Check out how I handle updating the UI for the player

#

Also yeah, this is typescript

#

One of the Roblox devs (actual developer of roblox) made a Typescript to Luau (roblox lua) transpiler/compiler

pearl trail
#

i thought i was tripping

sharp geyser
#

How come

pearl trail
#

yeah you developed game roblox and see the ts code xD until i see your message after the code

sharp geyser
#

Lmaooo

#

Ima be so real

#

I haven't developed on roblox in so long I just used this

#

and even then

#

I am still stupid and could probably do this all better

#

😭

pearl trail
#

eh that’s fine ig, it was made for a reason mmLul

sharp geyser
#

Next on the docket

#

Cows that spawn poop to collect 💀

queen needle
#

Crazy

sharp geyser
#

Hey man

#

If kids love it

#

and will spend robux in those kinds of games

#

Who am I to shame it

#

Robux = real money if you get enough of it

#

And it gives me experience in a field I wanted to step in for ages

crystal wigeon
#

did discord update their user object to show server tag info?

queen needle
#

Yes

quartz kindle
queen needle
#

Jesus

quartz kindle
#

for example i have an object {a:10, b:20, c:30}

#

and i want to copy the object (ie { ...obj } or Object.assign()), except specific keys

#

in ts you can do Omit<obj, "b">

#

there is no actual function in js that does that

queen needle
crystal wigeon
#

screw discordjs. too many breaking changes I havent updated at all

quartz kindle
#

so i made one, and made it typed, it shows the object keys as selectable values in the second parameter, and returns the correctly typed new object

crystal wigeon
#

was looking for official discord apis

crystal wigeon
quartz kindle
queen needle
#

beat me just barely tim

quartz kindle
#

lmao

crystal wigeon
#

true

#

what is this tho "collectibles": { "nameplate": { "sku_id": "2247558840304243311", "asset": "nameplates/nameplates/twilight/", "label": "", "palette": "cobalt" } },

quartz kindle
crystal wigeon
#

im so outdated with these discord updates

queen needle
#

these

quartz kindle
queen needle
#

the backgrounds

crystal wigeon
crystal wigeon
queen needle
#

impressive

crystal wigeon
#

he is Tim for a reason

#

he's TIM
he's HIM

#

see how it all rhymes together

quartz kindle
queen needle
#

he's 50

crystal wigeon
#

bro he 25

#

or 30

#

idk

queen needle
#

50

crystal wigeon
#

fr?

#

i mean i been here since 7 years now

#

kekchika and so is tim

queen needle
#

or are those the values you keep

quartz kindle
queen needle
#

oh that's awesome

queen needle
quartz kindle
#

lmao im not 50

#

im old but not that old

queen needle
#

49

quartz kindle
#

34

queen needle
#

Math.floor(Math.random() * 30) + 39

quartz kindle
#

xD

queen needle
#

i did that wrong but you get it

crystal wigeon
#

you guys know anyone who uses ai agents?

#

or any business that use agents?

queen needle
#

tim.llc

quartz kindle
#

lmao

queen needle
#

he is the ai agent

quartz kindle
#

im the AS agent

#

artificial stupidity

queen needle
#

bro in what universe are you stupid

#

learning rust makes me feel stupid

quartz kindle
#

i need to fix an old clusterfuck of a function i wrote a year ago

queen needle
#

What is it

quartz kindle
queen needle
#

bro

#

why don't you use ts again

quartz kindle
#

i dont like having to run tsc

queen needle
#

don't

quartz kindle
#

jsdoc is quite nice, since vscode actually uses ts inside jsdoc

queen needle
#

compile it yourself

quartz kindle
#

so i can do almost everything ts does

queen needle
#

look it and be like "hmm it should be this"

queen needle
quartz kindle
#

lmao

#

actually

#

jsdoc supports markdown, links, images and videos

sharp geyser
#

Tim

queen needle
#

That's cheating

sharp geyser
#

Don’t you have to run npm and node to run js code

#

What’s the difference between that and using tsc then node

queen needle
#

he just runs the js in his brain

sharp geyser
#

Fair enough

queen needle
#

he IS the v8 engine

sharp geyser
#

My fault

#

Didn’t know he was chill like that

queen needle
#

how are the cows coming along

quartz kindle
#

requires a ton of setup

#

doesnt allow you to easily test stuff

sharp geyser
#

No?

#

tsc —init

queen needle
#

^

sharp geyser
#

tsc .

#

Boom done

quartz kindle
#

not that simple

sharp geyser
#

It is though?

quartz kindle
#

there is a lot of configuration in there that needs tweaking

sharp geyser
#

What kind of setup are you doing

quartz kindle
#

also when i want to test functionality of code, i cant run it without having to type them first

#

unless i configure it to ignore types

#

which then i have to revert again

queen needle
#

couldn't you have a command that runs it ignoring type errors

quartz kindle
#

and i cant copypaste the code into chrome dev tools

queen needle
#

how often are you testing in chrome dev tools?

quartz kindle
#

quite a bit

sharp geyser
#

It’s tim

#

That’s his debugger

quartz kindle
#

i also use the node repl a lot

#

another place i cant copypaste ts code

sharp geyser
#

Honestly Tim a lot of these issues you bring up I’ve never faced then again I don’t develop like you do

#

I follow the principal of if it works it works

queen needle
#

retweet

quartz kindle
#

well, im weird like that

queen needle
#

oh we know

quartz kindle
#

btw i do have a tsconfig file

#

jsdoc uses it

queen needle
#

bruh

quartz kindle
#

jsdoc can do almost everything ts does, without needing to compile

queen needle
#

make your own chromium browser that can run ts

sharp geyser
#

Honestly sounds like something Tim would do

quartz kindle
#

lmao

sharp geyser
#

Would not be surprised if we get TsBrowse before astrology api

queen needle
#

one day tim is just going to switch to php

quartz kindle
#

php was one of the first things i started with

queen needle
#

well yeah

quartz kindle
#

not going back to that thx

queen needle
#

you coded in it while riding your dinosaur to school

quartz kindle
#

php makes you explode and implode things

queen needle
#

this is true

sharp geyser
quartz kindle
#

56 actually

sharp geyser
#

Damn

#

It went up

queen needle
#

with or without interest

quartz kindle
#

without :^)

sharp geyser
#

Has a 5% interest

queen needle
#

oh god

quartz kindle
#

i wont ever affort to pay

#

so i hide

sharp geyser
#

Moses will find you

#

He always does

queen needle
#

is that why you never finish the astrology api

quartz kindle
#

im good at hiding

queen needle
#

so then you don't cause attention to yourself

sharp geyser
#

He’ll split you open like the Red Sea

quartz kindle
#

im behind 7 proxies

queen needle
#

last time i counted 4

sharp geyser
#

Last time I counted 0

#

I’m already in

queen needle
#

oop

quartz kindle
#

xD

queen needle
#

you got further than me

sharp geyser
#

Yeah they were weirdly held together with scotch tape and Elmer’s glue

queen needle
#

i thought theyd be held together with those giant jsdoc blocks

sharp geyser
#

Oh yeah those were easy to handle

#

Just burned em

quartz kindle
#

jsdoc is better than typescript at designing intellisense documentation

sharp geyser
#

Wrong

#

I love making my 4 line long types that are more cursed than Bloody Mary

queen needle
#

Retweey

#

Making whole js functions in just a type

sharp geyser
#

Ever make such a complex type not even typescript knows what you made

queen needle
#

Yes

sharp geyser
#

Correction

#

Discord js

quartz kindle
#

xD

sharp geyser
#

Their lib is typescript hell

#

And also

#

If I may say so myself

#

Terribly coded

#

And that’s saying a lot since I suck at coding

#

It’s inheritance hell

queen needle
#

I agree

sharp geyser
#

Want to know how to access your message?

#

Go through 5 levels of properties

quartz kindle
queen needle
#

Each with a null operator check

sharp geyser
#

And don’t forget the cache that’s most certainly empty

quartz kindle
#

certainly

sharp geyser
#

That you also have to null check

neon leaf
#

🙏 send prayers

polar bough
#
  if (!message.content) return;

const escapeRegex = str => str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');

let prefixes = [prefix, `<@!${client.user.id}>`, `<@${client.user.id}>`];
let mentionprefix;

if (noPrefixEntry) {
  prefixes.push('');
  mentionprefix = new RegExp(`^(${prefixes.map(p => p ? escapeRegex(p) : '').join('|')})\\s*`);
} else {
  mentionprefix = new RegExp(`^(${prefixes.map(escapeRegex).join('|')})\\s*`);
}

const match = message.content.match(mentionprefix);
if (!match) return;

const [, matchedPrefix = ''] = match;
const args = message.content.slice(matchedPrefix.length).trim().split(/ +/);
const cmd = args.shift()?.toLowerCase();
if (!cmd) return;
#

@clear field

#

if your bot has a ping command

#

it will only look for that cmd

#

If you did

#

ping

#

Or prefix + ping

clear field
#

bot has to read every message in the channel to check if someone typed the command. It doesn't respond to everything, but it must see all messages to know when to react.

#

so if you have kept no prefix command then your bot has to read all the messages

polar bough
clear field
#

see

polar bough
#

or how will it know if prefix was used or no

clear field
#

Prefix commands - bot will see only that messages where the message start with your prefix

Mention - bot will only read messages with mention of that bot

No prefix - bot has to read all messages to check for that keyword to respond to

clear field
#

it does

polar bough
#

until you're logging all those messages

polar bough
#

many bots having that feature

#

why they aren't banned?

clear field
#

only if your bot work like bot

#

if you make a chatgpt bot then yes

polar bough
#

what if it's just a simple bot and offering no prefix only for premium users?

clear field
#

unless your bot is limited to you and your group or limited to a specific channel where people know that bot is going to see

empty dust
polar bough
#

@empty dust bro wrote discord's tos

#

🤣.

light vine
#
module.exports = {
    name: 'songquiz',
    description: 'Gives you a random lyrics to gues the song!',
    async execute(message, args){
     console.log(`[SONGQUIZ] Command received from ${message.author.tag} in ${message.guild?.name || 'DMs'}`); // here it is

const questions = [
    {question: 'I wish i could pretend i didnt need ya but every touch is ooh-la-la', answer: Senorita},
    {question: 'Oh i love it and i hate it at the same time', answer: Daylight},
    {question: 'Shaking falling onto my knees and that im without your kisses', answer: Stitches},
    {question: 'Shoot me down but i get up im bulletproof nothing to lose fire away fire away', answer: Titanium},
    {question: 'I found the love for me darling just dive right in follow my lead', answer: Perfect},
    {question: 'Go ahead and ruin someone elses life cry cry go bug someone else so i can sleep at night', answer: Cry},
    {question: 'And the bombs and the guns and the guns they still fighting', answer: Zombie},
    {question: 'If dug 2 graves for us my dear', answer: Revenge}
];

const random = questions[Math.floor(Math.random() * questions.length)];

await message.channel.send('🧠 Solve this is 15 seconds: **${random.question}**');

const filter = response => {
    return response.author.id === message.author.id && ! isNaN(response.content);
};

try {
    const collected = await message.channel.awaitMessages({
        filter,
        max: 1,
        time: 15000,
        errors: ['time']
    });

    const answer = parseInt(collected.first().content);
    if (answer === random.answer){
        message.channel.send('✅ Correct, ${message.author.username!}');
    } else {
        message.channel.send('❌ Oops! The correct answer was **${random.answer}**.');
    }
} catch (error){
    message.channel.send('⏰ Time is up! The correct answer was **${random.answer}**.');
}
    }
}; 
quartz kindle
# clear field Prefix commands - bot will see only that messages where the message start with y...

with MESSAGE_CONTENT intent:

Prefix commands - bot will see all messages and check if the message starts with your prefix
Mention - bot will see all messages and check if the message mentions the bot
No prefix - bot will see all messages and check if the message contains the keyword

without MESSAGE_CONTENT intent:

Prefix commands - bot will not see the content of the message and cannot check if the message starts with your prefix
Mention - bot will see the content of the message if the message mentions the bot
No prefix - bot will not see the content of the message and cannot check if the message contains the keyword

pearl trail
#

might be true might be not

lyric mountain
#

both require reading every single message

#

it'd be good if discord supported emitting events only for messages that start with a certain sequence

neon leaf
#

ok query works now

#

masterpiece

quartz kindle
neon leaf
#

yes

neon leaf
#

@quartz kindle do you know any cheap south american server hosts?

quartz kindle
neon leaf
#

hmm

#

I got africa already

#

just south america missing smh

#

paid ~6€ for 2 cores and 4gb ram

#

nothing for that price in sa?

neon leaf
#

amazing

#

ty

quartz kindle
#

35 if you pay for 1 year

#

monthly its 47

neon leaf
#

ah

quartz kindle
#

also

#

check their windows pricing

#

LMAO

neon leaf
#

ah yes

quartz kindle
#

literally 10x the price

#

what the fuck

neon leaf
#

for some reason the african vps made the default username afinfram and use sh instead of bash

#

no clue what thats about

quartz kindle
#

xD

neon leaf
#

dam

neon leaf
quartz kindle
neon leaf
#

ig ill hope for the best then

quartz kindle
neon leaf
#

which benchmark?

#

was planning to run one after update finishes

quartz kindle
#

can try this one curl -sL https://yabs.sh | bash

#

i like this one as well curl -sS https://raw.githubusercontent.com/jgillich/nixbench/master/nixbench.sh | sh
but it hasnt been updated in 8 years and it breaks on newer machines sometimes

neon leaf
#

well the cpu here is ~13 years old

quartz kindle
#

@_@

neon leaf
#

not a bad cpu tho

#

i used a similar one for my homeserver some time ago

#

alr im starting yabs

quartz kindle
#

still running? thats a slow as machine lmao

neon leaf
#

maybe

#

I went to cinema 5min ago

#

so no result for 2h

pearl trail
quartz kindle
#

shots fired

#

macaroni cooked

sharp geyser
#

@queen needle you wanted a dev log of my poop collecting simulator

#

Currently collecting & spawning cow poop is a thing

quartz kindle
#

wat

sharp geyser
#

Funnily enough there's a bug if you collect 1 you get 4 million

queen needle
#

How tf did that happen

sharp geyser
#

Poop is a popular theme right now on roblox where those games are getting millions of vists

quartz kindle
#

?-?

sharp geyser
#

iara_shrug I dont judge

#

Im here to make robux then turn it into actual money

quartz kindle
#

slowly leaves

sharp geyser
#

Nah tim

#

Come back

quartz kindle
#

🏃‍♂️‍➡️

sharp geyser
#

I might actually need your help

#

Your coding genius

#

😭

#

I don't know how or why this bug occurs, you might be able to figure it out

quartz kindle
#

g2g do something else

sharp geyser
#

No you dont

#

Don't lie

#

Your life is this server

sharp geyser
#

But I should be negating this

quartz kindle
#

gotta sift 3 carts of sand to make concrete tomorrow morning

sharp geyser
#
import { World } from "@rbxts/matter";
import components from "shared/components";
import { PlayerStore } from "shared/playerstore";

const ProxService = game.GetService("ProximityPromptService")
const ReplicatedStorage = game.GetService("ReplicatedStorage")
const EconomicsEvent = ReplicatedStorage.FindFirstChild('EconomicsEvent') as RemoteEvent

function collectPoop(world: World) {
    for(const [id, poop] of world.query(components.Poop)) {

        ProxService.PromptTriggered.Connect((prompt, player) => {
            if(prompt.Name !== "CollectPoop") return;

            print(poop.model)

            poop.model?.Destroy();

            EconomicsEvent.FireClient(player, 'Poop')

            PlayerStore.GiveItem(player, 'C001', poop.amount)

            world.remove(id, components.Poop)
        })
    }
}

export = collectPoop

Because I

  1. Destroy the model if they are collecting
  2. Give them the item
  3. Remove it from the world so it should no longer be querried
#

Ideally I need to move the event firing to the GiveItem method but that's tomorrows me problem and really idgf about this game

#

its a robux trap the code doesn't have to be perfect

#

this function runs ever Heartbeat though

#

Which I suspect is the problem since it doesn't have time to destroy the model maybe?

pearl trail
#

thats what my dad would do on his holiday

sharp geyser
#

@queen needle Dev Update #3 Cow poop now respawns, problem is it's collected out of order instead of collecting the one im at it collects some other one

queen needle
#

Lmfaooo

#

How does that happen

sharp geyser
#

Good question

#

I suspect it has to do with the entity ids

#

I am not good at using an ECS though

#

Maybe @wheat mesa could answer this

#
import { useEvent, World } from "@rbxts/matter";
import components from "shared/components";
import { PlayerStore } from "shared/playerstore";

const ProxService = game.GetService("ProximityPromptService")
const ReplicatedStorage = game.GetService("ReplicatedStorage")
const EconomicsEvent = ReplicatedStorage.FindFirstChild('EconomicsEvent') as RemoteEvent

function collectPoop(world: World) {
    for(const [id, poop, cow] of world.query(components.Poop, components.Cow)) {
        for(const [_, prompt, player] of useEvent(ProxService, "PromptTriggered")) {
            if(prompt.Name !== "CollectPoop") return; 
            poop.model?.Destroy()

            EconomicsEvent.FireClient(player, 'Poop')

            PlayerStore.GiveItem(player, 'C001', poop.amount)

            world.remove(id, components.Poop)
            world.insert(id, cow.patch({ spawnTimer: 5 }))
        }
    }
}

export = collectPoop

Based off this code could you see how the above video is being produced?

#

I see

#

I now understand what's happening

#

It doesn't care what cow the prompt belongs to

#

It is going based off entity order

#

Fixed it

#

Basically just had to make sure the prompt that was being fired was from the model I was currently intereacting with

#

Because I was running the useEvent on ANY prompt that matched "CollectPoop" since all poop models had it it was going to run based off the order of the entity it found

#

So I just had to check if the currently running prompt was the one at the poop I was at

#

I am starting to regret this game...I hate myself for it

deep merlin
#

Is there a function in Topggpy to get the user id and time when the user voted for a bot?

lament rock
#

You should be storing that info if you really need it from when you receive the webhook notification for a vote

deep merlin
lament rock
#

For which there are rate limits

neon leaf
#

hi @quartz kindle

#

im back

#

had to run from cops

#
root@af-01:~# curl -sL https://yabs.sh | bash
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #
#              Yet-Another-Bench-Script              #
#                     v2025-04-20                    #
# https://github.com/masonr/yet-another-bench-script #
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #

Wed Jul  2 19:26:18 CEST 2025

Basic System Information:
---------------------------------
Uptime     : 0 days, 0 hours, 0 minutes
Processor  : Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz
CPU cores  : 2 @ 2599.996 MHz
AES-NI     : ✔ Enabled
VM-x/AMD-V : ✔ Enabled
RAM        : 3.9 GiB
Swap       : 3.9 GiB
Disk       : 77.4 GiB
Distro     : Ubuntu 24.04.2 LTS
Kernel     : 6.8.0-63-generic
VM Type    : KVM
IPv4/IPv6  : ✔ Online / ❌ Offline

IPv4 Network Information:
---------------------------------
ISP        : Host Africa (Pty) Ltd
ASN        : AS329184 Host Africa (Pty) Ltd
Host       : HA VPS
Location   : Johannesburg, Gauteng (GP)
Country    : South Africa

fio Disk Speed Tests (Mixed R/W 50/50) (Partition /dev/sda1):
---------------------------------
Block Size | 4k            (IOPS) | 64k           (IOPS)
  ------   | ---            ----  | ----           ----
Read       | 25.21 MB/s    (6.3k) | 165.88 MB/s   (2.5k)
Write      | 25.23 MB/s    (6.3k) | 166.75 MB/s   (2.6k)
Total      | 50.45 MB/s   (12.6k) | 332.64 MB/s   (5.1k)
           |                      |
Block Size | 512k          (IOPS) | 1m            (IOPS)
  ------   | ---            ----  | ----           ----
Read       | 308.21 MB/s    (601) | 356.25 MB/s    (347)
Write      | 324.59 MB/s    (633) | 379.97 MB/s    (371)
Total      | 632.81 MB/s   (1.2k) | 736.23 MB/s    (718)

iperf3 Network Speed Tests (IPv4):
---------------------------------
Provider        | Location (Link)           | Send Speed      | Recv Speed      | Ping
-----           | -----                     | ----            | ----            | ----
Clouvider       | London, UK (10G)          | 89.8 Mbits/sec  | 90.9 Mbits/sec  | 158 ms
Eranium         | Amsterdam, NL (100G)      | 92.3 Mbits/sec  | 85.6 Mbits/sec  | 164 ms
Uztelecom       | Tashkent, UZ (10G)        | 46.7 Mbits/sec  | 86.9 Mbits/sec  | 262 ms
Leaseweb        | Singapore, SG (10G)       | 49.7 Mbits/sec  | 76.0 Mbits/sec  | --
Clouvider       | Los Angeles, CA, US (10G) | 68.9 Mbits/sec  | 84.9 Mbits/sec  | 291 ms
Leaseweb        | NYC, NY, US (10G)         | 78.0 Mbits/sec  | 88.7 Mbits/sec  | 233 ms
Edgoo           | Sao Paulo, BR (1G)        | busy            | 81.3 Mbits/sec  | 347 ms

Geekbench 6 Benchmark Test:
---------------------------------
Test            | Value
                |
Single Core     | 640
Multi Core      | 1133
Full Test       | https://browser.geekbench.com/v6/cpu/12692895

YABS completed in 22 min 2 sec
root@af-01:~#
quartz kindle
#

wat

neon leaf
#

ignore

quartz kindle
#

why the heck did it take so long

neon leaf
#

I mean I mainly care about iops

#

its just gonna be another pop for mcjars, so just pg + api

quartz kindle
#

its not too bad, could be better but ive seen worse

#

also dayum Amsterdam already running 100g links

neon leaf
#

well I still need to get the south america one

pearl trail
#

||44 minutes ||

#

i mean yeah sure it’s cheap

#

not gonna complain

quartz kindle
queen needle
#
use rdev::Key;

pub fn key_to_char(key: Key) -> Option<char> {
    use Key::*;

    match key {
        KeyA => Some('a'),
        KeyB => Some('b'),
        // ...
#

someone who is more knowledgable in rust, please tell me there is a better way to do this

#

@radiant kraken I know you fancy in rust

radiant kraken
#

there's also caps lock and other things, what are you using this key_to_char function for?

queen needle
#

Text expander

#
if let EventType::KeyPress(_) = event.event_type {
            if let Some(name) = event.name {
                if name.len() == 1 {
                    let c = name.chars().next().unwrap();``` I found out there is another way to get the key
#

ill need to rework it all tomorrow anyway i just wanted a small proof of concept

#

im using this to help learn/expand rust knowledge

#

some things are confusing but im understanding a decent amount of it

radiant kraken
queen needle
#

yes

radiant kraken
#

nice!

queen needle
#

but like backspace and such isn't handled lmfao

radiant kraken
#

😭

#

then i guess you could write your logic for it

#

btw, you could shorten that to just:

if let (EventType::KeyPress(_), Some(name)) = (event.event_type, event.name) {
  if name.len() == 1 {
    ...
  }
}
queen needle
#

That's what ill be working on tomorrow, understanding rust more and trying things like that

#

wtf

#

magic

radiant kraken
queen needle
#

Some confuses me lowkey

radiant kraken
queen needle
#

Oh wait i read it wrong

#

it just checks if the type is what it's compared to

#

in the parameter

#

right?

#

I just meant the funtion in general

radiant kraken
#

oh

#

Some(name) matches if event.name is Some(). name is your new variable name containing the value contained in this Some()

#

in this case, name is a String

queen needle
#

w h a t i thought I understood rust way more than I do

#

but that made me realize not

radiant kraken
#

you're learning

radiant kraken
queen needle
#

but like what exactly does it do that's what im confused on

#

coming from languages mainly like ts js python java

queen needle
radiant kraken
#

if let Some("a") = event.name is the same as if event.name.is_some() && event.name.unwrap() == "a"

queen needle
#

So it's like creating an anonymous function with the variable name, checking if name has "a" in it?

#

Sorry the Some("a") and the equality were meant to be two different things

radiant kraken
#

no no no

#

there are no functions involved here

#

think of it like an if statement

queen needle
#

In rust it's not a function I was trying to translate the thinking to something like javascript

radiant kraken
#

yeah i understand where you're coming from since javascript does not have these types of enums

queen needle
#

so when it's Some(name) = event.name

radiant kraken
# queen needle so when it's `Some(name) = event.name`
/*
optionEnum can be:
{
  {
    type: "Some",
    value: "a"
  },
  {
    type: "None",
    value: null
  }
}
*/
const myEnum = {
  type: "Some",
  value: "a"
};

// if let Some(name) = myEnum 
if (optionEnum.type === "Some") {
  const name = optionEnum.value;
  // do things with name
}
queen needle
#

so event.name is an enum, im getting the value of it, and checking if that type is a some and if so, continuing on?

#

Or sorry

#

Wait

radiant kraken
queen needle
#

I'm making sure it's valid

#

That's all it is?!

radiant kraken
queen needle
#
function Some(value) {
  return { kind: "Some", value };
}

const None = { kind: "None" };

let age = Some(30);     
let name = None;         
radiant kraken
#

yeah, pretty much!

queen needle
#

That makes SOOO much more sense

#

I'm just making sure it's not undefined/null aka not None before I try using it

radiant kraken
#

precisely!

#

there's also Result<T, E> types for types that can contain errors: ```rs
pub struct Result<T, E> {
Ok(T),
Err(E),
}

queen needle
#

I'm also a bit confused on it's parameters then

#

Some(name) = event.name

#

because name is only accessible in that some enum/only exists there

radiant kraken
#

yes, name is only accessible in the scope of your if-statement

queen needle
#

so it's event.name but I'm checking the .name of that by doing Some(name)

radiant kraken
#

.name of that?

queen needle
#
const name = event?.name```
queen needle
radiant kraken
#

basically you are always required to check if event.name is nullable (None) or not (Some)

radiant kraken
queen needle
#

The only thing that can be in that enum is name because it's being compared to event.name

radiant kraken
#
if let Some(asdjisdjifdsjfisf) = event.name {
  println!("{asdjisdjifdsjfisf}");
}
#

just like how you would declare any variable

queen needle
#

Oh the parameter in some is just creating the variable I can use to address it in the if

radiant kraken
queen needle
#

I'm making sure it exists, to then use it

radiant kraken
#

YES

#

same thing:```rs
if event.name.is_some() {
let asdjisdjifdsjfisf = event.name.unwrap();
}

queen needle
#
let name;
if(event.name) name = event.name

if(name){
console.log(name)
}```
radiant kraken
queen needle
#

Okay yeah I had the right idea

#

That makes way more sense lmao the docs were confusing me

radiant kraken
#

haha it's fine!

#

it's normal

#

i could always help explain it to you as simple-to-understand as i can

queen needle
#

And then unwrap gets the value from the some, because if the if statement passed, I know for a fact the value exists so it's safe to unwrap

radiant kraken
#

yes, this is what unwrap() does

#

unwrap_failed() is essentually just a panic

queen needle
#

Yup

#

Which I should only use unwrap if I'm SURE the value inside exists

radiant kraken
#

YES

#

if you're 100% sure

queen needle
#

If I'm not sure, use something like a Some first then unwrap inside

radiant kraken
#

you would rarely use it tbh (unless you're 100% sure that it's not none/err)

#

i always use an if-let or match statement

queen needle
#

unwrap_or

radiant kraken
#

yeah

queen needle
#

I have to go to bed because it's almost 5 am, but I'll be in here over the next little bit as I learn and get used to rust!

radiant kraken
#

aw

#

appreciate the dedication ❤️

queen needle
#

I'll be working on this text expander

#

Getting the basic engine

#

And then mixing it with tauri for a great ui experience

radiant kraken
#

niceeee!!

#

hype

queen needle
#

Soon I'll be on the rust cult train, only using rust 🚀

neon leaf
#

(rust cult)

radiant kraken
#

one of us one of us

#

soon enough you will rewrite everything in rust, encourage your friends to use rust, and the cycle repeats

neon leaf
#

why can I not just configure it to use route name

radiant kraken
#

wtf

neon leaf
#

I cannot find any working openapi codegen for rust 😭

#

all the ones Ive tried now either dont have enums in query strings for some reason or just throw syntax errors

neon leaf
#

just made my own 🔥

loud canopy
sharp geyser
neon leaf
radiant kraken
neon leaf
#

y

#

it works

#

also I overhauled it

radiant kraken
#

omg sure 😍

neon leaf
radiant kraken
#

ads!!! /s

neon leaf
#

will I get arrested for this @radiant kraken

fn string_to_t<T>(s: String) -> T {
    let mut result = unsafe { std::mem::MaybeUninit::<T>::uninit().assume_init() };

    let s_ptr = &s as *const String as *const u8;
    let t_ptr = &mut result as *mut T as *mut u8;

    let bytes_to_copy = std::cmp::min(std::mem::size_of::<String>(), std::mem::size_of::<T>());

    unsafe {
        std::ptr::copy_nonoverlapping(s_ptr, t_ptr, bytes_to_copy);
    }

    std::mem::forget(s);

    result
}
sharp geyser
#

Yes

neon leaf
#

very memory safe

radiant kraken
#

this is what i do all the time

#

i am more of a C instead of a Rust guy

#

my rust project(s) used to be like this, "safe" functions that had unsafe code(s) in them

neon leaf
#

well its not very optimal

#

in this case its just the cleanest solution sadly

radiant kraken
#

you might as well just turn that entire function to an unsafe fn tbh

neon leaf
#

nah, only used once in safe code, so just adds an unused unsafe { block

neon leaf
#

bruh

#

I found a safe way

#
                        Ok(text) => Ok(*(Box::new(text) as Box<dyn std::any::Any>).downcast::<T>().unwrap()),
#

im a lot more fine with this solution

queen needle
#

I understand all of these words

neon leaf
#

This crate is a fork of edera-dev/tokio-tar, which was a fork of vorot93/tokio-tar, which was a fork of dignifiedquire/async-tar, which is based on alexcrichton/tar-rs.

#

ah yes amazing

quartz kindle
#

and then people say npm is bad

neon leaf
#

I mean this is quite a bad example tbh

#

but it sadly exists and I have to use it

quartz kindle
#

xD

neon leaf
quartz kindle
neon leaf
#

i edited

quartz kindle
#

lmao

neon leaf
#

I forgot an s

neon leaf
waxen flame
#

Unsure if this is the right channel or not, but I added the top.gg widget from my bot settings (on the edit part of my top.gg page unchanged), and it looks crispy.

spark pebble
#

is dev portal giga broke atm?

#

cant generate invite link

acoustic bough
waxen flame
small tangle
neon leaf
#

kind of

#

tho my function would be too unsafe for std

spark pebble
#

oh, i had enabled "requires oath grant" by accident ffs

feral aspen
neon leaf
#

peak code

sharp geyser
#

but why

neon leaf
#

yes

prime cliff
#

Limit testing be like

pine willow
#

lmfao, Another platform getting terminated by discord

quartz kindle
#

lmao

pine willow
#

All that because of 1 NTTS video

neon leaf
#

me when I use a chrono::NaiveDateTime instead of chrono::DateTime<chrono::Utc> and dates in the frontend break

queen needle
#

Lmfaoo

waxen flame
autumn geyser
queen needle
pearl trail
neon leaf
#

use httpie 🥀

pearl trail
lament rock
#

Make your own application/testing suite

#

You can do better than everyone else

#

[insert xkcd standards]

quartz kindle
#

im using Bruno now

pearl trail
quartz kindle
#

so pretty much the same thing xD

pearl trail
quartz kindle
pearl trail
#

interesting

fervent turtle
#

So role reward and vote tracks are not in top.gg now?

deft wolf
#

Not for servers afaik

#

Maybe someday they'll bring it back, they're apparently still working on developing server list

acoustic bough
lyric mountain
quartz kindle
#

:^)

fervent turtle
deft wolf
#

¯_(ツ)_/¯

fervent turtle
neon leaf
#

WHAT is happening to my syntax highlighting 🙏

queen needle
#

Stolen

acoustic bough
#

about as good as gmail

long marsh
#

I recall reading somewhere at some point, that Discord was pushing for bot owners to use the marketplace functionality – going as far as making it against TOS to do off platform pricing or something?

Am I hallucinating like LLMs, or have they retracted this sentiment?

prime cliff
#

Hu what are you on about

quartz kindle
#

for example if you had a premium feature for $5 inside discord marketplace, you were not allowed to price it differently outside of it

#

considering discord's fees are much higher

long marsh
quartz kindle
#

i believe it does

long marsh
#

Or is it just that if you have both, they must match?

long marsh
sharp geyser
#

If you have it on patreon for 10$ you have to have it on discord for 10$ or less

#

Your price can never outprice discord though

maiden swift
#

spanish

clever tundra
#

discord aint even gonna know as well

sharp geyser
#

I mean they have all the right to enforce them

#

Technically you don’t own your bot

#

You’re just leasing it out mmLol

#

Discord shuts down so does your bot

#

Only thing you own is the code behind it

long marsh
#

You do own your bot, it's just rendered useless if architected / coupled with Discord.

sharp geyser
#

Well not necessarily

#

You simply own the code behind it. Your bot doesn’t exist if not coupled with discord

#

The code is useless otherwise

#

Without the discord gateway or api you can’t exactly make your bot do what’s its coded to do

quartz kindle