#development
1 messages · Page 285 of 1
^^
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
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
(one time I had a project that was 1.5yrs old I forgot was connected to onedrive, and I deleted everything from OneDrive)
is this possible with mongo? 
Not sure, never had this issue before
Of using multiple databases for one project lol
Considering this app is a monolith, if it requires distributed transactions, I'd be astonished
What is the app anyway
Some sort of website
That narrows it down lol
you can look to the website on their about me
How did the failure originally occur? I read some earlier but
Intriguing
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
This sounded ruder than I meant I'm sorry
Can't create a breakfast war
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
10 bier bitte
i finished the thing i was working on
Pog got it working fully now

are you actually no-coding a bot?
Maybe 
or making your own no-coder?
It's gonna be part of Dev Space
xD
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
nice
This UI for it was very bad when it was in demo, i've improved a lot xD with Dev Space
why is the items per page so big
Hasn't been tweaked like the action bar stuff above
wow i didn't realized this until now
ok I dont think I can explain this
xD i found this
isNaNconverts the argument to a Number and returns true if the resulting value is NaN.Number.isNaNdoes not convert the argument; it returns true when the argument is a Number and is NaN.
> https://stackoverflow.com/a/33165410
ah
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?
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))
oh it is a bad practice? so i should use Number.isNaN(Number(val)) instead? 
its not bad practice, but its a bad idea because of its misleading name
it gives you the impression of doing something different than it actually does
ohh
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
thank you master Tim, as expected from master 
lmao
🙏
is that the new pc cooler 101
its the robert cooler 102
its 29°C outside and 32°C inside
thats what I get for running 4 pcs
Looks like something out of r/diwhy xD
are we allowed to ask css questions in here
Yup that is web development
i thought this was butt development
my god
honestly it's probably fine as in
disregard
trollface
Does this channel say #bot-development though 
sigh
this channel should be renamed to stackoverflow v2
stackoverflow is dying due to chatgpt
and their toxic culture
this is general-2 for me
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
Usually you would just do a new task to run something in while the main thread continues
hmmm
hello
yesnt
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
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
both are equivalent
ye, ig open spawns an async task
so the promise is created instantly after
and neither are polled yet
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
tf webkit, what am i supposed to do with this 💀 to fix the issue, i need to toggle display flex on off 💀
icl we got the same fan (i think)
lmao this is dumb
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.
Yes, my bot is registered on TOP.GG: https://top.gg/fr/bot/1014510587537010728
And yes, my bot is up to date and the token is correct.
It's hard to answer a question when you can't see the code.
hahahahahahaha
so this would be valid?```js
const shocker = shockers.get(id)
if (!shocker) return
await shocker.ready()
// do stuff with shocker
```where shocker.ready() returns this._socketReady which is new Promise((resolve) => this.socket.on("open", resolve))
you may need to make sure shocker isnt already open
unless you never set the promise again, then its be fine
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
that wont work
you will have to use
for s in shockers {
await s.init()
}
forEach doesnt wait for the callbacks to complete
await Promise.all(shockers.map(s => s.init())) >>> 
it may be bad may be good, use with caution™
?
the problem there is event listener leak if you use that more than once
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.
when dealing with promisifying long running connections like websocket, you need to deal with cleaning up behind you.
init -> attach listeners
on close -> detatch listeners
makes sense
in my usecase, stuff only gets closed when the program ends
i should probably write a handler for it regardless
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;
}
no idea if websockets use the same on/off event listener that nodejs uses
then yeah it should work
also worth adding guards against running init() when a socket already exists
yeah, ws uses eventlisteners
will probably do this
i can just check if this.socket is not a websocket
Promise.withResolvers is amazing but its pretty new, it was added on node 22
i'm gonna read up on it
NEVER seen that before
oh it's literally just a destructed promise
that's cool
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
}
yep yep
oh finally that exists
its basically defering/offloading a promise
thats a nice feature
yeah, since node 22
makes sense
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?
if its a static website with no backend and no routing, then you just create a help.html file
otherwise if you have a backend with routing, then you need to create a new route
Ohh so I need to create an help.html file and connect in om the code and then it will work as .app/help ?
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?
tim you have more patience than me
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 🙃
hah jokes on you for updating anything
some of my projects use fixed versions from 2 years ago
because I depend on bugs
🔥
what lib
https://github.com/google/blockly for my Dev Space project
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 😃
howcome it doesn't just say disable if it's enabled and then enabled if it's disabled instead of being two different actions
I could maybe do that yea, but the workspace is a priority atm
that's fair
Got it working and updated a bunch of plugins 
Awesome
Ok there we go demo is back up 😄
https://devspace.fluxpoint.dev/workspaces/demo
-# Press m 3 times for a special thing
instructions unclear
The minimap is a bit cursed
Yea css is slightly messed up and there used to be a toggle for it before i had to merge it
Wait really hu
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
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.
ECS?
Entity component System
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.
For clarifying
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
That happened when i try to add moderation commands and when i log it then after too much time 1 command was successfully deployed but it takes too much long time. Other in 1 to 2 days it automatically fixed mean it deploy normally
ECS is a beautiful architecture
@deft wolf please help if you know about that problem. Now it is not deploying successful after long time it giving error
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. ^
I agree, there are some aspects I don't quite understand though
Yup it is indeed that the focus.
The minimap loads after and steals the focus of the main workspace which also marks it as the active workspace and that miku function uses that.
Already got a fix working for it 👍
@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?
Yes
Components define shared behavior, systems are used to update sets of components
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
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

what language is this? looks like ruby
it's lua
Some systems will have more advanced criteria for figuring out which components they wish to update
I know you don't know lua or roblox, but going based off a typical ECS usage is this the correct approach?
why ppl use these languages 😭
Spawning components in a system based off a game event
Ask roblox 
btw that code is of a website or what?
It's...roblox?
I mean this snippet is very small
ask chatgpt 
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
Generally speaking you would probably have an entity that is spawned with an attached PlayerComponent or ideally a set of components describing its properties
ECS is interesting
I didn't understand it last time you mentioned it but seeing the usage and what waffle says it makes sense
I don't even know if entities exist in matter ecs tbh
It seems they do world:spawn which spawns an entity with that component attached?
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
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
It's okay for asking general questions
Or if there's other games you could look at the source for?
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
That makes sense
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
Made game when in high school 2 years ago

Where's the actual ECS part
Cause I don't see it
You can look at the actual code folder if you want the impl
According to chat gpt what im doing right now by spawning it in a system is perfectly fine ig?

More stars than in the observable universe
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.
hi Door
use the top.gg api
you can also use the official python library:
https://github.com/Top-gg-Community/python-sdk
not sure if its up to date, it hasnt been updated in 4 years
WOOO i've done it 
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™
bro it took me some time to find this and the comment killed me 😭
this is one of those "its a future me problem"
lmao

woah gg~ 
relatable
1 billion dollar
US

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?
Millions probably.
yes, you can fake it
but if you're caught you'll get banned
Really?
yes
Can a moderator verify it?
Yea it does, but quite often people ignore it.
but not all
Yeah actually they’ll dm you to correct it.
Any idea how much google adsense pays? For like 1k views
I tried googling and there concrete number

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

Good luck have fun
Lmfao
you cant make this shit up i have random print("meow") statements left somewhere in my bode 😭
sick desktop wallpaper
just search for it
but but meow
jesus
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.
Can I please judge the UI(jk I respect the grind),
Honestly go ahead, I put 0 effort in it beyond the grid and placement
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
Collecting from, I dont want to know
The ground
But I'll play it when you finish it
Dev log in here
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
😭
it feels so good when you finally get a complex ts type working as intended
What'd you get working
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
i thought i was tripping
How come
yeah you developed game roblox and see the ts code xD until i see your message after the code
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
😭
eh that’s fine ig, it was made for a reason 
Me too, I was very confused
Crazy
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
did discord update their user object to show server tag info?
Yes
a typed implementation of the Omit<> type
Jesus
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
screw discordjs. too many breaking changes I havent updated at all
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
was looking for official discord apis
how do you get the server tag for a user via api?
Show it I'm interested
should be user.primary_guild
beat me just barely tim
lmao

true
what is this tho "collectibles": { "nameplate": { "sku_id": "2247558840304243311", "asset": "nameplates/nameplates/twilight/", "label": "", "palette": "cobalt" } },
its actually dead simple, but it took me a while to make it work, and seeing it in action feels good
im so outdated with these discord updates
the backgrounds
i thought something like zod or arktypes had this
ah gotcha thanks
he's 50
50
what is being omitted? or is the second value the omitted
or are those the values you keep
oh that's awesome
yes, he hasn't said otherwise because he is embarrassed
49
34
Math.floor(Math.random() * 30) + 39
xD
i did that wrong but you get it
tim.llc
lmao
he is the ai agent
i need to fix an old clusterfuck of a function i wrote a year ago
What is it
i dont like having to run tsc
don't
jsdoc is quite nice, since vscode actually uses ts inside jsdoc
compile it yourself
so i can do almost everything ts does
look it and be like "hmm it should be this"
make doom in jsdoc
Tim
That's cheating
Don’t you have to run npm and node to run js code
What’s the difference between that and using tsc then node
he just runs the js in his brain
Fair enough
he IS the v8 engine
how are the cows coming along
its annoying
requires a ton of setup
doesnt allow you to easily test stuff
^
not that simple
It is though?
there is a lot of configuration in there that needs tweaking
What kind of setup are you doing
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
couldn't you have a command that runs it ignoring type errors
and i cant copypaste the code into chrome dev tools
how often are you testing in chrome dev tools?
quite a bit
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
retweet
well, im weird like that
oh we know
bruh
jsdoc can do almost everything ts does, without needing to compile
make your own chromium browser that can run ts
Honestly sounds like something Tim would do
lmao
Would not be surprised if we get TsBrowse before astrology api
one day tim is just going to switch to php
php was one of the first things i started with
well yeah
not going back to that thx
you coded in it while riding your dinosaur to school
php makes you explode and implode things
this is true
Tim still owes Moses 5€
56 actually
with or without interest
without :^)
Has a 5% interest
oh god
is that why you never finish the astrology api
im good at hiding
so then you don't cause attention to yourself
He’ll split you open like the Red Sea
im behind 7 proxies
last time i counted 4
oop
xD
you got further than me
Yeah they were weirdly held together with scotch tape and Elmer’s glue
i thought theyd be held together with those giant jsdoc blocks
jsdoc is better than typescript at designing intellisense documentation
Ever make such a complex type not even typescript knows what you made
Yes
discord libs
xD
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
I agree
7, give or take
Each with a null operator check
And don’t forget the cache that’s most certainly empty
certainly
That you also have to null check
🙏 send prayers
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
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
in this case, bot also has to read all messages for prefix commands
see
or how will it know if prefix was used or no
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
but it doesn't violates tos
it does
until you're logging all those messages
it doesn't
many bots having that feature
why they aren't banned?
what if it's just a simple bot and offering no prefix only for premium users?
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 bro wrote discord's tos
🤣.
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}**.');
}
}
};
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
thats what i said
some said that you need an actual feature beside prefix to get message intent, then it’s fine to have prefix system, as long as the actual feature is still there
might be true might be not
tbh the only diff between prefixed and unprefixed commands is that the latter will very often trigger at the wrong times
both require reading every single message
it'd be good if discord supported emitting events only for messages that start with a certain sequence
egg_
yes
@quartz kindle do you know any cheap south american server hosts?
nop, they are usually stupid expensive for no reason
hmm
I got africa already
just south america missing smh
paid ~6€ for 2 cores and 4gb ram
nothing for that price in sa?
ah
ah yes
for some reason the african vps made the default username afinfram and use sh instead of bash
no clue what thats about
xD
do you use them or nah?
nope, never used any brazilian vps
ig ill hope for the best then
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
well the cpu here is ~13 years old
@_@
not a bad cpu tho
i used a similar one for my homeserver some time ago
alr im starting yabs
still running? thats a slow as machine lmao
at least it gets things running 
roasted
shots fired
macaroni cooked
@queen needle you wanted a dev log of my poop collecting simulator
Currently collecting & spawning cow poop is a thing
wat
How tf did that happen
Making a roblox simulator targeted towards kids to scam get robux
Poop is a popular theme right now on roblox where those games are getting millions of vists
?-?
slowly leaves
🏃♂️➡️
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
g2g do something else
Good question, I think it has something to do with it running every frame in a system on the ecs
But I should be negating this
gotta sift 3 carts of sand to make concrete tomorrow morning
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
- Destroy the model if they are collecting
- Give them the item
- 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?
sounds fun
thats what my dad would do on his holiday
@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
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
Is there a function in Topggpy to get the user id and time when the user voted for a bot?
You should be storing that info if you really need it from when you receive the webhook notification for a vote
I was hoping there would be a function. There is a function to get last 1000 votes though.
For which there are rate limits
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:~#
ignore
completed in 22 minutes wtf
why the heck did it take so long
I mean I mainly care about iops
its just gonna be another pop for mcjars, so just pg + api
its not too bad, could be better but ive seen worse
also dayum Amsterdam already running 100g links
well I still need to get the south america one
youd be so surprised how much it took for the $4 datalix vps
||44 minutes ||
i mean yeah sure it’s cheap
not gonna complain
wtf
blazing fast™️
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
so far, the best way you could achieve this is probably through macros
there's also caps lock and other things, what are you using this key_to_char function for?
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
have you tested it to make sure that name.len() == 1 is always a keypress containing a latin character?
yes
but like backspace and such isn't handled lmfao
😭
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 {
...
}
}
That's what ill be working on tomorrow, understanding rust more and trying things like that
wtf
magic

Some confuses me lowkey
why so?
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
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
w h a t i thought I understood rust way more than I do
but that made me realize not
it's alright! if you have any questions, just don't hesitate to ask me!

you're learning
bottom line, don't think of SomeEnum::Something() like Some(), Err(), etc. as functions, they are essentially enums with values carried inside of them
see: https://doc.rust-lang.org/book/ch06-01-defining-an-enum.html
but like what exactly does it do that's what im confused on
coming from languages mainly like ts js python java
because like in the match Some("a") Some(name) = event.name
okay so Some("a") basically only matches if event.name is Some() AND the value contained inside that some is "a"
Some(name) just matches if event.name is Some() and stores the value inside of that Some() in the variable name.
if let Some("a") = event.name is the same as if event.name.is_some() && event.name.unwrap() == "a"
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
In rust it's not a function I was trying to translate the thinking to something like javascript
yeah i understand where you're coming from since javascript does not have these types of enums
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
}
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
event.name is an enum, you're checking if the enum is of type Some(). if it is, then you can freely use the value inside of it, since in Rust, Option<T>s are declared like this:
pub struct Option<T> {
Some(T),
None,
}
``` since you're declaring it as `Some(name) = event.name`, then you store the value inside of that Some() to a new variable `name`

function Some(value) {
return { kind: "Some", value };
}
const None = { kind: "None" };
let age = Some(30);
let name = None;
That makes SOOO much more sense
I'm just making sure it's not undefined/null aka not None before I try using it
precisely!
there's also Result<T, E> types for types that can contain errors: ```rs
pub struct Result<T, E> {
Ok(T),
Err(E),
}
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
yes, name is only accessible in the scope of your if-statement
so it's event.name but I'm checking the .name of that by doing Some(name)
.name of that?
const name = event?.name```
Like Some(random) = event.name is invalid
basically you are always required to check if event.name is nullable (None) or not (Some)
you can use any name you want, it doesn't have to be the same
The only thing that can be in that enum is name because it's being compared to event.name
if let Some(asdjisdjifdsjfisf) = event.name {
println!("{asdjisdjifdsjfisf}");
}
just like how you would declare any variable
Oh the parameter in some is just creating the variable I can use to address it in the if

I'm making sure it exists, to then use it
YES
same thing:```rs
if event.name.is_some() {
let asdjisdjifdsjfisf = event.name.unwrap();
}
let name;
if(event.name) name = event.name
if(name){
console.log(name)
}```
in javascript:```js
if (event.name !== null) {
const asdjisdjifdsjfisf = event.name;
}
Okay yeah I had the right idea
That makes way more sense lmao the docs were confusing me
haha it's fine!

it's normal
i could always help explain it to you as simple-to-understand as i can
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
If I'm not sure, use something like a Some first then unwrap inside
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
unwrap_or
yeah
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!
I'll be working on this text expander
Getting the basic engine
And then mixing it with tauri for a great ui experience
Soon I'll be on the rust cult train, only using rust 🚀
(rust cult)
one of us one of us
soon enough you will rewrite everything in rust, encourage your friends to use rust, and the cycle repeats
wtf
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
just made my own 🔥
this the type of shit ppl around me say
You can now convert poop to coins in the game, and bag capacities are respected
this hurts to look at 😭
y
it works
also I overhauled it
this is the final result https://pastes.dev/sUiB0S0sRA
Hey use rust
omg sure 😍
btw if anyone needs my openapi to rust converter for some reason, here https://github.com/pterodactyl-rs/panel/tree/main/wings-api/generator-src
ads!!! /s
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
}
Yes
no
very memory safe
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
you might as well just turn that entire function to an unsafe fn tbh
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
I understand all of these words
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
@_@
and then people say npm is bad
xD
i edited
lmao
I forgot an s
in ts:
return text as any as T
For now, I am cropping over the area on my site to cover the crispy parts.
isnt this exactly how the rust std lib is built?
ye but i've never ever had to do this?
oh, i had enabled "requires oath grant" by accident ffs
peak code
but why
yes
Limit testing be like
lmfao, Another platform getting terminated by discord
lmao
me when I use a chrono::NaiveDateTime instead of chrono::DateTime<chrono::Utc> and dates in the frontend break
Lmfaoo
Hello again other pancake

Hola
i love when postman refuses to open and the only way to open is reinstall it
use httpie 🥀

Make your own application/testing suite
You can do better than everyone else
[insert xkcd standards]
i got rid of it when it asked me to make an account
im using Bruno now
xD well kinda fair since it save the collections to cloud, and then you can develop in any device. but i get your point
i have my collections synced with my cloud storage
so pretty much the same thing xD
oh, does it save as a file?
yup
interesting
Not for servers afaik
Maybe someday they'll bring it back, they're apparently still working on developing server list
What about Marrone?
it was best idea tho, why did they removed it.
¯_(ツ)_/¯
i have to shift to other web for now until my bot gets approved. ah moment
WHAT is happening to my syntax highlighting 🙏
Stolen
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?
Hu what are you on about
they had a clause against using non-discord payment gateways at different prices
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
Does having an outside payment method force you to create an equivalent marketplace listing as well?
i believe it does
Or is it just that if you have both, they must match?
This makes sense to me
Correct
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
spanish
wild rules
discord aint even gonna know as well
I mean they have all the right to enforce them
Technically you don’t own your bot
You’re just leasing it out 
Discord shuts down so does your bot
Only thing you own is the code behind it
Not sure this is the correct technicality.
You do own your bot, it's just rendered useless if architected / coupled with Discord.
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
true
well, if you rent a building and run a store







