#development
1 messages ยท Page 122 of 1
I've always known about them, just never really used them in a real setting
Super fun to play around with some functional stuff like that in java
U can also use parallelism on it, if u have too many entries
I still find features on it each time I use streams
man, I've got an insanely obscure error now
That white closed square bracket is from using Arrays.toString() btw...
Somehow it's so broken that a standard lib method couldn't even figure it out
U need to add the exception class to the logger
Nah this isn't even the logger
That's some string -> int that's failing somewhere
What's in roomloader 42?
I'm changing it around right now
I've now got the data loading correctly, it's something to do with another class now
it workeed thx
Do you have a "normal" time that it takes to verify a bot?
1-2 weeks at the moment
as far as i know
Ok thank you
Hello development, i am back to my kind of stupid questions.
Let's say i have 5 ids inserted by a user which i store in the db for up to 5 days and check their status daily, if it is completed i drop them. What would be the best way to aproach this?
like i drop one by one if at the end of this 5 days i respond to the user saying there was an issue with this [itemID]
just make a crontab task that DELETE FROM ids WHERE now() - insertion > 5 every hour or so
I mean, besides that how do i check the status of them daily even of my vps goes down at the time it's supposed to check
have another vps to check
well you can't check if your vps isn't on xD
you can't really check anything if your only server is down
perhaps to the id's i could another thing like the time it was added or the time it was last checked
so everytime the server goes down and comes back up checks it
you don't get it, if your server is down then it'll not matter at all
your bot wont be able to do anything with it as it's also down
if it's an api, it'll also be down
just make the task execute on boot up
Always makes sense for many use cases to add a created (date time/timestamp) column
yeah i will do that
or make a function inside your bot's code that checks it
I'm gonna go with created date time and last checked
like, make the cron task from inside the bot runtime
when it starts, schedule it and immediately execute
you wouldn't even need a cron task you could just use a javascript file
Could also like you said add a boolean (or tinyint) column to set true/false if a check has been performed on this row or not in cases one cronjob fails or the server is off
cron aligns to actual time
aka your bot if u use discord.js
true
If development it doesn't mean it has to be a discord bot
yup
i thought it involved a discord bot i'm sorry xD
all good lol
So the reason i also asked the question is to not put much stress in the server
as most of the users will have up to 100 Id's to be checked

Well just a bash file being executed as cronjob accessing your database and executing a query locally won't stress ur server much, nothing to worry about
okay
a DELETE operation will not have much impact
just have some column to be able to compare against current date
an API has to be inolved to check the status of the ID as it's a third party handling that
well, then it's hard to reduce strain
Make sure to not run into any limits with ur cronjob
unless the api returns a batch
then u can compose a DELETE ... WHERE ids IN (puttheidshere)
instead of that why not just store 5 most recent ids
I'll just set cooldowns between them
or you can do periodic sweep
it's gonna be daily
but adding it on the startup just incase server goes down

so I got a new domain
and the topgg webhook doesnt work anymore when voting
I updated the code and the vote webhook in the bot settings
Is your domain configured the same way the old one was?
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
you canโt change network configuration after a container is created
Yeah you need to entirely restart the container
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
I don't know much about docker but from what i know you should be able to expose the port to connect to the mysql database
One message removed from a suspended account.
One message removed from a suspended account.
you can expose any port you like from a docker container
One message removed from a suspended account.
its essentially just a mapping of outside:inside
so when making the container, using -p 3030:3030 option would mean traffic reaching 3030 outside port would go to port 3030 in container
3030 is just an example
One message removed from a suspended account.
ye
One message removed from a suspended account.
One message removed from a suspended account.
sure
Always works
But keep in mind you'll need to shut down the container first
One message removed from a suspended account.
One message removed from a suspended account.
mysql doesn't send a web page
One message removed from a suspended account.
One message removed from a suspended account.
by connecting to it with a mysql wrapper
One message removed from a suspended account.
One message removed from a suspended account.
hi
One message removed from a suspended account.
Sorry, I don't use docker at all and don't wanna use it 
One message removed from a suspended account.
Maybe... I don't really like it and don't get used to it tho
One message removed from a suspended account.
The virtual container management of Proxmox is light years better anyway
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
@deft wolf
I don't understand you
this en the bio of the bot
Yes
I can see that
</about:1098263520694522057>
Copy that and paste it here
See what happens
It's working same way
But it's not your command name and your command id
You need to change it
That was example how to do this
how to get the id of the command
Type your command and right click on box with name of the command
Darker one, there you have the name and description of the command
If you right click it will pop up option to copy id
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
INTERCAL > *
DO ,1 <- #13
PLEASE DO ,1 SUB #1 <- #238
DO ,1 SUB #2 <- #108
DO ,1 SUB #3 <- #112
DO ,1 SUB #4 <- #0
DO ,1 SUB #5 <- #64
DO ,1 SUB #6 <- #194
DO ,1 SUB #7 <- #48
PLEASE DO ,1 SUB #8 <- #22
DO ,1 SUB #9 <- #248
DO ,1 SUB #10 <- #168
DO ,1 SUB #11 <- #24
DO ,1 SUB #12 <- #16
DO ,1 SUB #13 <- #162
PLEASE READ OUT ,1
PLEASE GIVE UP
One message removed from a suspended account.
One message removed from a suspended account.
thou hast written an exquisite collection of sentences
god please don't tell me that 70 year old teacher is also teaching you COBOL
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
Not as possible, ur using using
Use full package instead
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
System.Collections.Generic.List<string> lisOfWords = new System.Collections.Generic.List<string>();
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
Don't forget async async async Async async
One message removed from a suspended account.
Parm knows the way
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
In case you are feeling evil this is potentially legal C# code
public class C {
async async await(await async) => await async;
}
249
One message removed from a suspended account.
There's a longer chain tho
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
hey don't forget the global::
extra brackets are just logical blocks
public static void Main(string[] args)
{
var x = 3;
{
var y = 4;
global::System.Console.WriteLine(x); // OK
global::System.Console.WriteLine(y); // OK
}
global::System.Console.WriteLine(x); // OK
global::System.Console.WriteLine(y); // inaccessible
}
```*
useful for switch cases since C# treats the entire switch body as one scope
One message removed from a suspended account.
switch (balls)
{
case Ballsack.Value1:
int ballCount = 2;
break;
case Ballsack.Value2:
int ballCount = 2; // <-- illegal; ballCount is already declared in scope
break;
}```
global::x is just to specify that you want to search for x in the global namespace
if you have your own namespaces declared it can mess stuff up because the compiler can't differentiate what namespace you're trying to access
you'll really only ever see it in auto-generated code
for this you have two alternatives:
switch (balls)
{
case Ballsack.Value1:
int ballCount = 2;
break;
case Ballsack.Value2:
ballCount = 2; // <-- don't redeclare ballcount, simply reassign it (assuming it can't just be moved out of the switch for whatever reason)
break;
}```
```cs
switch (balls)
{
case Ballsack.Value1:
{
int ballCount = 2;
break;
}
case Ballsack.Value2:
{
int ballCount = 2; // <-- legal; ballCount is declared in a diff scope
break;
}
}```
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
no but if you're making everything as long as it needs to be
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
L
One message removed from a suspended account.
global::System.Collections.Generic.List<global::System.String> listOfStrings = new global::System.Collections.Generic.List<global::System.String>() { };
valid code ๐
global::System.Collections.Generic.List<global::System.String> listOfStrings = global::System.Linq.Enumerable.Empty<global::System.String>().ToList<global::System.String>();
that's good too
technically might be better to use Enumerable.Empty<T> since it uses a single allocation
wait a minute
global::System.Collections.Generic.List<global::System.String> listOfStrings = new global::System.Collections.Generic.List<global::System.String>(global::System.Linq.Enumerable.Empty<global::System.String>());
One message removed from a suspended account.
One message removed from a suspended account.
what's an easy way of copying all the directories with the file names in a folder?
windows
using the file explorer
One message removed from a suspended account.
- control v
But there is hundreds of them
I only want to copy the names of the dorectories and files
In Command Prompt:
dir -s -n <PATH> | clip
In PowerShell:
Get-ChildItem -Recurse -Name <PATH> | clip
it's because it's not only Pascal-Kebab-Case, but also uses long params with single dash and full names for everything
it's as if microsoft vowed to go against how everything works in linux's bash
is svelte switching to JS from TS because TS is trash?
Deno did the same thing
apparently using TS for heavily developed projects reduces productivity from all the compilation time
SvelteKit is written in JS and distributed as source code โ no build step โ and itโs been miraculous for productivity. build steps make sense for apps, they make much less sense for libraries
I mean if it is a huge project and the devs know what they are doing you don't really need ts
ye
I often get asked what I think about TypeScript: do I use it, is it important, and so on?
TypeScript is a tool that, frankly, solves problems Iโve never had. Letโs dig in!
TypeScript creates more problems than it solves Iโve been a developer for a decade now and never run into an issue where JavaScriptโs loosely typed nature has created a proble...
relatable:
My workflow today: 15 minutes of writing code that works and does what I want. 2 hours of trying to appease the static type gods. ๐
Lol
douglas crockford was right about types
wait the pipe operator works in cmd?
i thought it was a linux-exclusive thing
Can someone try to explain this error?
Error: TypeError: isJSONEncodable is not a function at MessagePayload.resolveBody (/home/runner/hi/node_modules/discord.js/src/structures/MessagePayload.js:202:9) at ChatInputCommandInteraction.reply (/home/runner/hi/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:109:56) at Object.execute (/home/runner/hi/commands/hello.js:69:17)
Node.js version: v18.12.1
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
no because i knew that already
One message removed from a suspended account.
they're still using jsdoc?
it's got nothing to do with the type safety, it's got everything to do with tooling
by having typescript as a dependency it requires everyone who wants to build svelte to have it installed as well, so they're just using jsdoc with // @ts-check instead
lowkey i swear everytime i've seen you in chat you've been hating on statically typed languages for some reason
harris also said something along the lines of 'for end users, you need a build step anyways for minifying/webpacking etc, so you might as well have typescript in there'
did you see Tim's quote? it's quite accurate
maybe to your experience but i've always had quite the opposite
typescript can sometimes be a pain to work with, but in general and especially outside of the JS ecosystem i'd choose a statically typed language over a dynamically typed one for pretty much any project
the ONLY time i would consider a dynamic language superior is for a small script where i'm able to consider the entire codebase at one time in my head
i've also been using js+jsdoc and its pretty nice
makes everything much simpler than going full ts
you can also easily prototype without caring for types, then add types later
at the end of the day though it's basically still static typing
you're just not using a build tool for it
just IDE tools instead
yeah, but its also more flexible / less strict
oh i don't disagree on that
it wont stop you from running your code
i've worked on a few ts projects and there is nothing worse than trying to debug a runtime error caused by incorrectly typed ts code lol
my point is its just disingenuous to paint people switching from TS -> JS w/ JSDoc as people moving away from static typing
yeah
it's just that it's better for libraries
although i do embrace js's dynamic way of life, i've grown quite fond of it
i think JS is egregious whether it's dynamically or statically typed
but it's just a necessary evil at this point
who knows maybe WASM will someday replace JS
it's fun to dream
Pls
@solemn latch
Iโm not I need one Mo
too bad you're breaking the rules
@summer mortar no ads please
I want to ask if the account has a unique token that can be registered with automatically, better than doing auth every time I log in to the site 

No
if you are talking about top.gg Discord Oauth2 is the best method for what they are using it for
I know that Oauth2 is the best way, but I was wondering if there is a token for top.gg that can be logged in
Got question, does your bot need to have prefix for top.gg application? I mean mine got only / is that ok? And if yes what should I type into prefix section in bot application?
Hello everyone!
I am developer of Gamble Hub bot and i am trying to make a raffle command in it. But i need some knowledge about coding the raffle command.
I have created add raffle tickets & store the raffle tickets with user commands. But my raffle random pick winner command is not working.
I have coded those commands in BDFD.
It would be great if anyone help me in making the command!!
I doubt anyone on here is familiar with BDFD
It's a phone app where you write a bot with some script. Something like DBD on steam but a bit poorer and you host the bot by watching ads

well you need to use ===
=== is strict comparison, which compared types as well as the value, == will coerce types
Also your code is probably poorly written if youโre somehow accidentally comparing a number and a boolean
im getting data from something else
where a value can be 0
And I want to save that value if it exists
if the value is in an object, you can use x in y
otherwise yeah you have to use typeof, or isNaN if its only numbers
never used prisma, but a project i helped on used it
and it was a pain
had a few cryptic errors that were very hard to debug
Makes your life easy with typings tho
Honestly, the few projects I've used prisma on got thrown out.
Prisma I might use on very small things, but anything more than basic crud I will use anything else.
const { EmbedBuilder } = require('discord.js');
const crypto = require('crypto');
const { writeFileSync } = require('fs');
module.exports = {
name: 'guildCreate',
run: async (client, guild) => {
// Generate a random security code
const securityCode = crypto.randomBytes(4).toString('hex');
// Construct the welcome embed
const embed = new EmbedBuilder()
.setColor('#7289DA')
.setTitle(`Thanks for adding me to ${guild.name}!`)
.setDescription(`I'm a Discord bot designed to make your server more fun and efficient.\n\n` +
`To get started, type **y!help** or **/help** to see a list of my commands.`)
.addFields({ name: 'Security Code', value: `If you ever lose access to your main account and need to regain ownership of the bot, ` +
`send me a DM with the following code: \`${securityCode}\``})
.setImage("https://rare-gallery.com/mocahbig/475183-anime-2D-digital-art-anime-girls-green-eyes-coffee.jpg")
// Send the welcome message to the guild owner
const owner = await guild.fetchOwner();
await owner.send({ embeds: [embed] });
// Save the security code to a file
const data = {
guildId: guild.id,
ownerId: owner.id,
securityCode: securityCode
};
const fileData = JSON.stringify(data);
writeFileSync('/home/container/Src/data/ownercodes.json', fileData);
}
};
guild.fetchOwner is not a function
console.log(guild)
see if it's returning what u think it is
also there'll be no ownercodes, as you're overwriting the json with a single code
Hello, I have a problem with javascript.
I have this code: ```js
await fetch(?id=${response.id}&accessToken=${accessToken}&expiresIn=${expiresIn})
location.replace("http://localhost:62452/ok")
Is location defined?
of course it is
Typically, you get location by doing document.location or window.location
Not just by doing location
location works too
Huh
but even with window or document, i am not getting redirected
The URL looks fine, so this is weird.
yeah
Try placing a ; after ```js
await fetch(?id=${response.id}&accessToken=${accessToken}&expiresIn=${expiresIn})
no redirection ๐
ohhh it was my fault
the ok page wasn't working
thank you for your help
having a issue with trying to find a role
Code:
const supportRole = this.guild.roles.cache.find(r => r.name === "Ticket Support");
Error:
Cannot read properties of undefined (reading 'roles')
this.guild is undefined
how would i define it
depends on the rest of your code
Yeah, guild seems to be an instance variable of a class (from what Iโm gathering from your code whether you intended it or not), so somewhere in that class you should have something that runs and assigns a value to this.guild
lmao
Well, for starters you don't store currency as floating point
oh shit
its a decimal
i thought i changed it
would integer be ok
or just bigint
balance is basically money most likely from 1 to 10000
You can run UPDATE users SET balance = trunc(balance) to remove the decimal part, and then change the type
Or whatever ur db calls the truncate function
What's the maximum possible value?
i just changed the schema and migrated it via prisma
idk whatever a user decides to buy
but most likely not more than 10k
Don't use * unless you want every column btw
it's the short way
But higher performance impact
oh yeah i am aware this is just testing
Ah ok
I have the most unique bot on this app 

Aight so
I'm working on my site
In production
very smart of me, I know
(dev tools mobile dimensions)
actual mobile dimensions
I know what is at fault
The 3 buttons
"Banner Gen" shouldn't wrap
And on dev tools it clips into the right side (Like it should)
But it doesn't on mobile
.buttons-list {
position: absolute;
height: 50px;
width: calc(100% - 58px * 2) !important;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
justify-content: flex-start;
column-gap: 15px;
overflow-x: auto;
overflow-y: hidden;
}
.buttons-list > * {
clip-path: inset(0 0 0 0);
}
.buttons-list::-webkit-scrollbar {
display: none;
}```
Hardcoding the width in a bit
But it works on browser so yea
(removing 2 of the buttons)
Use relative units instead of pixels for dimensions
The width calc is a bit weird, you shouldn't need it as you know the amount of buttons
Even if u didn't, it ain't hard to use a flexbox
hey so since discord is removing discriminators, what would happen to the user default avatar endpoint? it used to be something like this
https://cdn.discordapp.com/embed/avatars/{user_discriminator % 5}.png
Oh shit yeah
Lol
Could always do it from their user ID?
For better variations use the last 4 digits of the ID for it
wym
does this also mean that user discriminators will also be deprecated in the future versions of the api
it'll always be 0 and possibly deprecated in the next major version (I'm not fully sure tbf)
you can find it in the source I believe. I was mostly going off of a friend's research
bigInt = require('big-integer')
bigInt(user.id).shiftRight(22).mod(defaultAvatars.length).toJSNumber()
that would be in the source apparently
you can use bigints in js ig. not sure why it uses that I'm guessing it's using it as a polyfill just in case
thanks!
Finally, I can have PapiOphidian#0000

https://www.thurrott.com/windows/windows-11/282995/first-rust-code-shows-up-in-the-windows-11-kernel
rust?!?!?!!! ๐๐๐๐๐๐๐๐
In this video, we'll be discussing the latest news about Rust's integration into the Windows kernel. This is a significant development, as it means that Rust will become a first-class language for building critical parts of the Windows operating system.
FREE Rust Cheat Sheet: https://letsgetrusty.com/cheatsheet
Chapters:
0:00 Intro
0:26 Announ...
i knew about microsoft adopting Rust but i wasn't expecting for them to literally use Rust in windows

Every end of the month i want to check for inactive accounts and delete them if they got 0 balance
Postgresql
which part you need help with? the scheduling or the deletion?
scheduling
have a field in the db called lastDeleted or something.
in app start check if lastDeleted is more than a month ago, if yes run the function to delete stuff.
then update lastDeleted and create a timer for the next month
oh that's very smart
thanks, i was a bit confused on how i could implement one lmfao
brain not worki
thanks
thank you!
(@solemn latch)
@radiant kraken henlo
anyone here has experience with btcpay?
I want to click on returning EventHandle button using puppeteer but it doesn't work
do you get any errors
Is there a good way to reselect a choice from a select menu on mobile? on desktop i can select the same choice and then hit the enter key to reselect the same choice.
maybe i should add a blank option so people can select the blank option and then select the same option again
Anyone have a good guide for working on github with multiple people? I can do a one-person workflow just fine, but I've been struggling with working with 2 people easily
disable commits to master branch
make every contributor work on their own forks, then handle PRs afterwards
Have a contributing guide outlined in a CONTRIBUTING.md file at the root of your repository so that multiple people would know how to contribute and work together effectively
To work effectively, all participants must have a fork of the repository, and work on changes on separate branches of their forks instead of the default branch
Put out good commit message guidelines like:
subsystem: short description of changes
Long description of changes, recommended to keep every line to 72 columns
And then commit with said changes and push, remember to tell the participants to sync their changes before continuing to work more and more, and do so often
It's also a good idea to recommend people to sign their commits to truly verify their identity
All changes should come in the form of pull requests instead of directly pushing changes unless absolutely necessary
ahhhhhhhhhh that's where we've been going wrong
for context I'm working with one of my friends on a school project
He forked my repo (the original), made his changes on the main branch of that, and then made PRs
But we ran into a lot of issues when we started making our own changes at the same time
Does anyone have any idea why this works just fine on my system, but returns null on my friend's system with the exact same file structure (shared from git)? ```java
public static String[] getFilesInDirectory(String path) {
URL f = Utils.class.getClassLoader().getResource(path);
if(f != null) {
File file = new File(f.getPath());
return file.list();
} else {
throw new IllegalArgumentException("File '" + path + "' could not be found!");
}
}
Logging the file object returns the correct directory on both machines, but file.list() is returning null for him rather than the list of files contained within that directory
Super weird
For reference, this is what it logs on my machine: C:\Users\myusername\IdeaProjects\PlayBrew\out\test\PlayBrew\DreDes\Rooms\Cave, and on his machine it logs this: ```
C:\Users\his%20username\IdeaProjects\PlayBrew-FuckGit\out\test\PlayBrew\DreDes\Rooms\Cave
Both paths contain the correct files within them
u can try f.getPath().toFile()
if getPath() returns a Path object
otherwise, I don't recommend using that to navigate through files
Files.list(path) returns a stream
with it u can filter out non-relevat files or go deeper in folders
I only need the paths to the files within that directory, since I'm reading the content of them as a string directly afterward. No filtering or anything is needed since I am assuming (for the sake of my sanity) that these folders will only contain txt files
Also, f.getPath() returns a string, not a Path
Man this sucks to debug because I have to send my friend the code and have him run it since I can't reproduce on my system ๐ญ
yk u can use idea's coop programming right?
lmao
That's really interesting though, that's returning true and true on my system, but false and false on his
the folder doesn't exist then
Now I'm REALLY confused, because it most definitely does
permission issue maybe?
I just looked through the exact path that doing System.out.println(file) returns, and it exists
Maybe? But all other resource files work without a problem
ะะตะฝั ะดะพะฑััะน
ะะฐะบ ั ะผะพะณั ัััะฐะฝะพะฒะธัั ััะพั ะฑะพั ะดะปั ะฟะตัะตะฒะพะดะฐ
put a clause there to recreate the folder if it doesn't exist (according to the runtime's pov)
if ((file.exists() && file.isDirectory()) || file.mkDir()) or smth
hm
For reference, this is what mine looks like (and his)
It's absolutely bizarre
I'm going to try file.getAbsoluteFile().exists()
Still false, damn
could it be something to do with the fact that his username has a space in it?
First%20Last
maybe
That's what it shows up as being
lmao
I have to use URIs instead
public static String[] getFilesInDirectory(String path) {
URL f = Utils.class.getClassLoader().getResource(path);
if(f != null) {
try {
File file = new File(f.toURI().getPath());
return file.list();
} catch (URISyntaxException e) {
throw new IllegalStateException(e);
}
} else {
throw new IllegalArgumentException("File '" + path + "' could not be found!");
}
}
Ended up working
nice
so i am setting up a btcpay server and it requires docker
i have never used docker before
Also wtf is btcpay
some cool shit man
https://btcpayserver.org/
why use coinbase commerce when you can do it on your own
btcpay gives you the ability to transfer them anywhere i think
Yup, still coinbase addresses are trusted
wym exactly by that?
yeah but does anyone care tho?
unless u are doing some shady stuff
and u wont be able to withdraw

Yeah wont matter much then
we have to make UML diagrams for our project in my class... I went a bit overboard, thank god for intellij's diagram generator
damn you're lucky, I was craving for a reason to use it
this reminds me a lot of the node editor in Blender

procedural generation is hard
the idea is intuitive but the implementation is confusing
What ur trying to generate?
(especially when you did not write the part of the code that determines the generation)
We basically have 6 by 8 "rooms" (where 1 tile is 32x32), and we're trying to generate rooms next to each other
Based on what rooms are allowed next to each other
I'm kinda just hoping my friend figures this out because he's been working on the algorithm mostly, and I cannot for the life of me understand the code he's writing atm
U could have a class with a bitfield (4 bits) representing sides
Then simply grab a random room with an ON value for the inverse of the generating side
Generating top = room with allowed bottom
Could generate the objects automatically if u verify the room sprite too
It'll be much harder if the passageways aren't aligned tho
it's a mess
like, I can't really even explain the issues we're having because I don't understand his algorithm
multiple nested for loops, even a quadruple nested for loop
(He has been very helpful through this project, but I don't think he understands the importance of testing your code piece-by-piece as you go on instead of writing a 200 line algorithm without running it at all)
@modern sable
in general and general 2 
oh and memes now too
this is getting funny
25565 is minecraft server port no?
I think so yes
But you could change it to any Port really
You have to define the port in Minecraft anyway or you could use a srv record on your domain
Not that I'm making a minecraft server but one guy put an ip on this channel with just such a port and I was wondering what is the purpose of it
Any port is minecraft port
yus
By default yes, itโs customizable though
why do you even need to do that?
lmao
i dont actually, i tried to make it work but in the end i gave up and did a different thing
the idea was to create a Promise that has a .resolve() function
but Promises are very weird in many ways
for example you can extend the Promise class, but when you call .then() you get a normal Promise, not your extended Promise
and the types for Promises are even worse to work with
Quick little gamedev question, if I have a player and a tile, both with colliders on them, how can I tell if the player is running into a wall, standing on ground, or hitting the ceiling?
Check positive/negative max position, if equal or higher/lower than the play field, has collided, standing on ground just by checking the players coordinates relative to the ground, hitting the ceiling is just the opposite
So just checking if the players position is overflowing/matching the objects matrix/box
in djs v13, how would i get the date a certain role (for example Role1) was added to a certain member.
i tried using createdAt only to find out that this is the date the role was created at lmao and not added
is that something discord even provides?
Fetch audit logs
But you're limited to 2 weeks
Or logging that yourself
there's no direct endpoint on role assigning
ahhh
So I usually don't endorse chatgpt very often, but I do appreciate how helpful it has been for solving game engine issues without having to bother humans first
Genuinely one of the most useful things I have been given by it
it is an awesome counsilor (is this how u write it?)
it helps me learning how to make a game ai
Counselor is a word for it
It's awesome to bounce ideas off of, it can point out flaws without bias
as in "someone who gives advices"?
Yeah
ty
I'd maybe prefer something like consultant
funny enough never had to use such word
consultant feels more inline, ty
gpt is horrible for solving issues, but oh boy does it give good advices
Yeah, it's nice
I'm so used to java 8, having this change is such a massive QOL for me
my god
love it too
I'm holding my breath for the new switch feature, that'll include this for cases
idk why this hasn't been a thing for like 5 years
I mean, we're also the only ones to have such features 
some jeps are also speculating about adding string interpolation
and ofc, some are also discussing about removing the need for enclosing classes
It(chatgpt) has done some really cool stuff, like explaining things I've not used before.
const { ApplicationCommandType } = require("discord.js");
const got = require("got");
module.exports = {
name: "til",
type: ApplicationCommandType.CHAT_INPUT,
description: "Learn something new from r/TodayILearned",
run: async (client, interaction) => {
try {
const response = await got("https://www.reddit.com/r/todayilearned/random/.json");
const data = JSON.parse(response.body).data;
if (!data || !data.children || data.children.length === 0) {
throw new Error("Failed to get a post from r/TodayILearned");
}
const [post] = data.children;
const embed = {
color: 0x00ff00,
title: post.data.title,
url: `https://www.reddit.com${post.data.permalink}`,
description: post.data.selftext,
thumbnail: {
url: post.data.thumbnail,
},
footer: {
text: `๐ ${post.data.ups} | ๐ฌ ${post.data.num_comments}`,
},
};
interaction.reply({ embeds: [embed] });
} catch (error) {
console.error(error);
interaction.reply({ content: "Failed to fetch the latest post from r/TodayILearned. Please try again later." });
}
},
};
TypeError: Cannot read properties of undefined (reading 'children')
at Object.run (/home/container/Src/Interactions/SlashCommands/Global/Til.js:11:58)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.run (/home/container/Src/Events/InteractionCreate.js:9:49)
there is no .data in the response body
actually, response.body itself is undefined
i fixed it
const { ApplicationCommandType } = require("discord.js");
const got = require("got");
module.exports = {
name: "til",
type: ApplicationCommandType.ChatInput,
description: "Learn something new from r/TodayILearned",
run: async (client, interaction) => {
got('https://www.reddit.com/r/todayilearned/random/.json').then(response => {
const content = JSON.parse(response.body);
let permalink = content[0].data.children[0].data.permalink;
let title = content[0].data.children[0].data.title;
let Upvotes = content[0].data.children[0].data.ups;
let Downvotes = content[0].data.children[0].data.downs;
let NumComments = content[0].data.children[0].data.num_comments;
let thumbnail = content[0].data.children[0].data.thumbnail;
let selftext = content[0].data.children[0].data.selftext;
const embed = {
color: 0x00ff00,
title: title,
url: `https://www.reddit.com${permalink}`,
description: selftext,
thumbnail: {
url: thumbnail,
},
footer: {
text: `๐ ${Upvotes} | ๐ ${Downvotes} | ๐ฌ ${NumComments}`,
},
};
interaction.reply({ embeds: [embed] });
})
}
};
Hmmmโฆ a comment on a PR one of my friends made on my game engine has appearedโฆ from an account that was created today
And it gave very professional feedback!
The name is also a palindrome, odd but Iโm all for it
interesting
hey guys can I use Puppeteer with react?
i get 100 errors when I installed puppeteer and i tried some solutions from internet but no good
most errors are like this
Module not found: Can't resolve 'url' (bunch of other libraries)
ERROR in ./node_modules/@puppeteer/browsers/node_modules/y18n/build/lib/platform-shims/node.js:3
why would you want that tho?
its explicitly a node.js library
react runs in the browser
Hi !
does anyone know an api to get the lyrics of a music by its name?
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
okay thanks you
why this website named after me fr
@lyric mountain when you see this, how do I get my resource loading to work within a jar file ๐ญ
been at it for nearly 2 hours and cannot for the life of me figure it out
Currently using this: ```java
public static String[] getFilesInDirectory(String path) {
try(InputStream in = Utils.class.getClassLoader().getResourceAsStream(path)) {
if(in != null) {
try (BufferedReader reader = new BufferedReader(new InputStreamReader(in, StandardCharsets.UTF_8))) {
List<String> fileList = new ArrayList<>();
String line;
while ((line = reader.readLine()) != null) {
System.out.println(line);
fileList.add(line);
}
return fileList.toArray(new String[0]);
} catch (IOException e) {
throw new IllegalStateException(e);
}
} else {
throw new IllegalStateException(path + " cannot be found");
}
} catch(IOException e) {
throw new IllegalStateException("Error while reading directory " + path + " in JAR file", e);
}
}
And yes, my resources are copied into the jar file
calling getFilesInDirectory("DreDes/Rooms/Cave") (and any other combination like that) always returns an empty array
I absolutely despise jarring anything
I suppose DresDes is inside resources folder?
I believe using URI in any way won't work as jar is akin to a zip file - you can't get files from it without the getResourceAsStream
Also, did you point your main class?
yeah nvm, was about to say I could help, though only worked with chartjs through canvas
Ur not sending the attachment
You must send it as an attachment for the attachment:// accessor to work
Don't worry the attachment won't show up outside the embed if you mention it's path correctly
You just fill in a rectangle with the width and height of the canvas, with any color you want, for example:
ctx.fillStyle = '#0033ff';
ctx.fillRect(0, 0, ctx.canvas.width, ctx.canvas.height);
You can change the #0033ff to any color you want
One message removed from a suspended account.
i will cry
Ah yes, reddit 
issue aint even reddit, a const data = content[0].data.children[0].data would make that much more readable
Merhaba
Ben discord sunucuma reaction roles botunu ekledim ancak komutlarฤฑnฤฑ bilmiyorum
Nasฤฑl kullanacaฤฤฑma dair yardฤฑm ederseniz mutlu olurum
@clear plinth
Yardฤฑmcฤฑ olur musun
or const { data } = content[0].data.children[0]
Show code
is there any content creators here?
or blog writers?
what for
if you wanna go further ```js
const [{ data: { children: [{ data }] } }] = content;
const upvotes = data.ups;
Half of me likes this - half of me knows someone will say its not "readable"
go all out 
const [{ data: { children: [{ data: { permalink, title, ups: upvotes, downs: downvotes, num_comments: comments, thumbnail, selfText } }] } }] = content;
permalink;
title;
upvotes;
downvotes;
comments,
thumbnail;
selfText;
the beauty of js
That's one of those things I'd do, and then come back to the project 6 months later and wanna punch myself in the face.
Open source HTML5 Charts for your website
In some use cases you would want a background image or color over the whole canvas. There is no built-in support for this, the way you can achieve this is by writing a custom plugin.
honestly, it's not that bad
just use tones that'd work both in light and dark themes
its nice in my nitro theme

you could even destructure them further
does anyone know why i cannot see the apps (right click on user -> apps) when i don't have a role equipped that has admin perms
i am pretty damn sure i selected applications as true for all roles
is this like a dc server setting or is it in the code??
@lyric mountain you know how to flip images using AffineTransform? I cannot for the life of me figure it out. Whenever I use this: ```java
AffineTransform tr = new AffineTransform();
if(s.isFlipped()) {
tr.scale(-1, 1);
tr.translate(-s.getSprite().getWidth(), 0);
}
tr.translate(finalX, finalY);
tr.rotate(-comp.rotation, 0, 0);
tr.scale(finalWidth / (float)s.getSprite().getWidth(), finalHeight / (float)s.getSprite().getHeight());
((Graphics2D)window).drawImage(s.getSprite(), tr, null);
if(Constants.DEBUG_MODE) {
window.setColor(Color.red);
window.drawRect(finalX, finalY, finalWidth, finalHeight);
}
However this seems to work on something like my main menu image
flipped version
unflipped version
Which is exactly my desired result, except for the fact that this same snippet isn't working on my little player sprite
Negative coordinate scale
?
that's what I've done (if I'm understanding what you're saying correctly)
I'm back
Wdym it isn't working on your sprite?
From what I'm seeing, ur translating by minus width, instead of scaling
U probably wanted tr.scale(-s.getSprite().getWidth(), 0) instead of translate
Ah nvm, didn't see the tr.scale(-1, 1)
If it's disappearing, it's very likely because you've translated to the wrong coordinates
Like, once you change the scale everything becomes weird, so in your case the horizontal axis is inverted
The origin is now on the top right, and positive values go to the left
You need to calculate the final coords considering this
It's quite late, so I might not answer today, but try setting all your translations to zero and seeing how changing the value affects in your local space
Got it working!
anyone experienced with css can help me pull some animation off?
im trying to have a button have this border and then when you hover over it it fills the whole border, how can i achieve this?
linear gradient animations
as far as i know they still didn't really support animation interpolation for such function
so uhhh you can try wrapping the button content inside another div and then expand the button itself so the difference can be the border
and then from there animate the button's background position
nice
it's a good thing to make a wrapper that automatically converts global coords to local coords
that way u don't need to work with negatives
๐
Can anyone tell me how to this and 19 more thingy for </role info:0> command?
(discord.js)
roles_amount
if roles.count > 10
roles_amount = roles.count-10
roles = // something to remove the first roles.count-10 elements from the roles array
text = roles + " and " + roles_amount + " more"
not too difficult to make
it annoys me that the roles list in that image is inverted
suffer
not even proper python either 
just a mockup
but I'll die inside if they do
please consider this just a theoretical example and not just copy paste kthx
I asked ChatGPT to write some basic pseudocode for an algorithm and it wrote python lol
i mean what did you expect

python is literally pseudocode
bold question
does anyone here know either a free api for EAN codes (these thingies for groceries and shit) or a large global dataset for these
seeing how most sites are either shit to scrape or dont provide every item,
Not free but: https://www.ean-search.org/ean-database-api.html
Get an acount on EAN-Search.org to get access to our API and make unlimited searches
build your buttons first, then do addComponents().
Just array.push(item)
^ - and then pass the array to addComponents
Yes
I think I usually just use camelCase names. tbh idk
not only is it not supposed to, but if it does then you have huge issues in your code
wont even work
You gonna access the components
It should be your action row (array) including your button
that means whoever is sending you that response is doing it wrong
thats not a valid json response
"
"
if it works
it works

hate it when dependencies give an option for a config
but they dont even do anything with it
just hardcoded my stuffs into it cuz idgaf 
this server is so gon crash some day
this is honestly the very reason I hate the former maintainer of the project I took after he left the company
if it works, fucking make it work better, don't leave a heap of wet sodium to whoever is gonna maintain it in the future (be it yourself or someone else)
const commandOptionsProcessor = require("../Structures/CommandOptions/Processor");
const fs = require('fs');
module.exports = {
name: 'interactionCreate',
run: async (interaction, client) => {
const guildId = interaction.guildId;
const settings = loadSettings();
const verbosityLevel = settings[guildId] || 3; // Default to level 3 if not set
if (interaction.isCommand() || interaction.isContextMenu()) {
const slashCommand = client.slashCommands.get(interaction.commandName);
if (!slashCommand) return;
const authenticatedCMDOptions = await commandOptionsProcessor(
client,
interaction,
slashCommand,
true,
"SlashCommand"
);
if (authenticatedCMDOptions) return await slashCommand.run(client, interaction);
} else if (interaction.isSelectMenu()) {
const selectMenuCommand = client.selectMenus.get(interaction.values[0]) || client.selectMenus.get(interaction.customId);
if (!selectMenuCommand) return;
const authenticatedCMDOptions = await commandOptionsProcessor(
client,
interaction,
selectMenuCommand,
true,
"SelectMenu"
);
if (authenticatedCMDOptions) return await selectMenuCommand.run(client, interaction);
} else if (interaction.isButton()) {
const buttonInteraction = client.buttonCommands.get(interaction.customId);
if (!buttonInteraction) return;
const authenticatedCMDOptions = await commandOptionsProcessor(
client,
interaction,
buttonInteraction,
true,
"Button"
);
if (authenticatedCMDOptions) return await buttonInteraction.run(client, interaction);
} else if (interaction.isMessageComponent()) {
const modalInteraction = client.modalForms.get(interaction.customId);
if (!modalInteraction) return;
const authenticatedCMDOptions = await commandOptionsProcessor(
client,
interaction,
modalInteraction,
true,
"ModalForm"
);
if (authenticatedCMDOptions) return await modalInteraction.run(client, interaction);
}
if (verbosityLevel === 1) {
// Wait for 15 seconds before deleting the command prompt
await sleep(15000);
await interaction.deleteReply();
} else if (verbosityLevel === 2) {
// Check if the interaction pings a role or user
const mentionsRoles = interaction.mentions.roles.size > 0;
const mentionsUsers = interaction.mentions.users.size > 0;
if (!(mentionsRoles || mentionsUsers)) {
await interaction.deleteReply();
}
}
},
};
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
function saveSettings(settings) {
// Save the settings to the JSON file
try {
const data = JSON.stringify(settings, null, 2);
fs.writeFileSync('/home/container/Src/data/verbosity.json', data);
} catch (error) {
console.error('Error saving settings:', error);
}
}
function loadSettings() {
// Load the settings from the JSON file
try {
const data = fs.readFileSync('/home/container/Src/data/verbosity.json');
return JSON.parse(data);
} catch (error) {
console.error('Error loading settings:', error);
return {};
}
}
It's not deleting the message after the bot sends it and no error is popuping up in the console
why can't I use scripts when customizing the top.gg page?
I want to make some buttons that display the lists of commands from each category and it doesn't let me use the scripts
security reasons
scripts can do very harmful things if you really want to, so they chose not to allow it
did you try debugging it?
also you can cut down the size of that file by like 80% if you extract the common parts of that if-else chain
It's always nice to break out big stuff into utility functions.
especially if theres a chance of reusability
use find instead
as a replacement of .filter?
Use the fetchReply option to get the bot's reply message.
Beat me too it. But yeah correct.
//example
client.on('interactionCreate', async (interaction) => {
if (interaction.commandName === 'test') {
interaction.reply({
content: 'testing...',
ephemeral: true,
})
const message = await interaction.fetchReply()
console.log(message.id)
}
})
Just in case
I need help on python code where I run !unmute @sand dragon it will remove the rank Muted but only people with the Mod rank can run it if they donโt have that rank they donโt have permission
Sorry to person I pinged called user
@ivory siren
Ok ok ok
If you just paste it here, someone will surely help
I canโt rn as Iโm at my phone
If someone could help me otherwise
Like with just a bit of the code as I canโt seem to get this
There are no errors just no response from the bot
we cant without the error or the code
witch
There is no error it just doesnโt work
just saying "doesnt work" without anything to analyse wont help us help you
we need the code
Iโll send it tomorrow
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
so basically a system inside a system
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
i had to use it today
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
is a LAMP server something to wrap the docker?
One message removed from a suspended account.
understandable
One message removed from a suspended account.
One message removed from a suspended account.
lol
cool stuff
i wouldn't want to be competing with you yet
I'll tell you when ๐ฅถ
either your code isn't saving or there is literally one element inside the array with that value
i forgot the ... 
One message removed from a suspended account.

nice font color choice ๐
safari moment
Ya... blame safari instead of the developers crafting the crap website 
At least u can read it without using glasses
font color should always stay consistent for all devices / browsers
All sarcasm aside it has nothing to do with safari at all
You can try different browsers using the dark design, too noticing the same issue (only on mobile iirc)
Hi I have a five server esx need development please, or if the number of players reaches 320, there will be crashes and drop in the game. We need a programmer to make optimize for us, and we agree on the amount. Thank you
Well.. you're wrong here
well.. you're right here
Quiet grandpa 
silence grandson

:^)
What u doin here at this time, Tim?
Ain't there anything that needs to get benchmarked? 
i just woke up
fist thing i do when i wake up is check discord
for opportunities to troll
:^)
Aye I see
its 7am, g2g shit and then work on my construction thing
Construction thing?
my house
lol
got a nice scar on my middle finger
Sadly you didn't record it
i bought 3 of these for my routers
power adapter with built in battery
so i dont lose internet when i lose power
works pretty awesome
my electricity flickered like crazy yesterday, and i didnt disconnect once
Ow... well I don't like that sort of stuff
Reminds me of many house fires I saw and heard because of burning batteries
welp
Dont u have constant electricity?
Well to be fair, you moved over there
:^)
U had the chance to live in my (warm) heating room
too expensive
Hmm, guess stealing some electricity and keeping it buckets is ur only option then 
also we should probs get off #Dev lol
well house development is still development, isn't it?
thats kinda what batteries do
:^)
arrested development
Aye you're not allowed to leave the channel anyways
They won't check your bot now. You didn't even resubmit it
The purpose of the bot is to stay online and reachable
Your bot was rejected 2 days ago. You need to resubmit it for review and wait about 2 weeks
If it has specific online times then add them in the reviewer notes
Mobile app, they need credits to keep the bot online 
Can't be something serious then
At first I thought he was having trouble finding hosting for his bot, that's why I sent him here
@
How can I get my bot approved because every one of my bots got declined
The long description on your bot's page is filled out with spam/junk to reach the 200 character minimum requirement. Please rewrite your description to include more useful information about your bot.
It's not even about your bot
Looks like you are not typing out a description for your bot when submitting
You can reach out to the reviewer who reviewed your bots for more info.
Ok
Hey mates, I submitted this simple price bot. Now I come and check but cannot see if it's rejected or not.
the docs?
There doesn't seem to be any documentation. You have to write it yourself so that people adding your bot know what it is for
okay, lemme check. Thank you guys
@commands.command()
@commands.has_role('Mod')
async def unmute(ctx, user: discord.Member):
muted_role = discord.utils.get(ctx.guild.roles, name='Muted')
if ctx.message.content.startswith('!unmute') and muted_role in user.roles:
await user.remove_roles(muted_role)
await ctx.send(f'{user.name} has been unmuted.')
else:
await ctx.send(f'{user.name} is not muted or the command is incorrect.')
bot.add_command(unmute)
Need help with that
with what exactly?
The command dosnt work the bot sends no response
did you try debugging it?
No errors
that's not what I mean
did you put some print()s in that function or followed with breakpoints to see if it's even reaching that part?
first question. what library. second question: what are you trying to do
ffmpeg
m3u8 to mp4
wait
no
subtitles
mp4 + srt
so basically conversion software?
no i do know what it is despite me not using it
worthy to note, if you get the encoding wrong it wont work in some devices
Talking about hardware?
talking about ffmpeg params
not exactly what I mean, but ok
ok
Ill do that now
i try image to text but i can't get the right result exactly
True result: IAT1ACYLUXQ2NO19I
False result: IATIACYLUXQ2NOI19I
i'm using tesseract.js
Because of the letter similarity in the font, "1" is confused with "T" and "0" with "O".
pls tag me
anyone know how to keep an interaction open after editReply()?
to allow for further editReply()'s
why are you checking if the message starts with !unmute, doesnt discord.py or whatever your using have a command handler?
Do let msg = await interaction.reply()
After that use msg.edit()
that'll be REALLY hard to get right, as (lets be honest) that's a horrible font
at least from the clarity POV
for further
you can't do "further"
additional operations must be followup edits
i know but i dont select this font. I get this image from webpage i cant do anything
are u scrapping?
i'm actually cropping from a big picture
the image is fixed in the page or it's a screenshot generated by your client?
fixed
hm, does tesseract allow supplying your own dataset of samples?
or installing custom fonts per se
yes, I registered all the letters one by one, but it still can't give the correct result, it continues.
In fact, I couldn't even find the font used.
that's pretty simple to do
If I can find the font, I can run it in a much healthier way, but I can't find the font either.
So .editReply() is a one time thing?
Yes but could use my example ^^





