#development

1 messages ยท Page 122 of 1

lyric mountain
#

Btw, why are u doing that stream().mapToInt().toArray()?

#

Ah nvm, ur unboxing it

wheat mesa
#

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

lyric mountain
#

U can also use parallelism on it, if u have too many entries

#

I still find features on it each time I use streams

wheat mesa
#

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

lyric mountain
#

U need to add the exception class to the logger

wheat mesa
#

Nah this isn't even the logger

lyric mountain
#

That's some string -> int that's failing somewhere

wheat mesa
#

This is just the straight up output from stdout

#

No logger class involved whatsoever

lyric mountain
#

What's in roomloader 42?

wheat mesa
#

I'm changing it around right now

#

I've now got the data loading correctly, it's something to do with another class now

radiant kraken
#

rust users when Iterator mmLol

#

zero-cost abstraction!! ๐Ÿš€ ๐Ÿ’ช ๐Ÿ”ฅ

limpid estuary
#

it workeed thx

violet latch
#

Do you have a "normal" time that it takes to verify a bot?

quartz kindle
#

as far as i know

violet latch
#

Ok thank you

slender wagon
#

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?

slender wagon
lyric mountain
#

just make a crontab task that DELETE FROM ids WHERE now() - insertion > 5 every hour or so

slender wagon
#

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

lyric mountain
#

have another vps to check

peak drum
#

well you can't check if your vps isn't on xD

lyric mountain
#

you can't really check anything if your only server is down

peak drum
#

or you could do it yourself

#

but your db can't be offline xD

slender wagon
#

so everytime the server goes down and comes back up checks it

lyric mountain
#

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

slender wagon
#

Yeah but we are talking after it's back up

#

to not miss a check

lyric mountain
#

just make the task execute on boot up

boreal iron
slender wagon
#

yeah i will do that

peak drum
#

or make a function inside your bot's code that checks it

slender wagon
#

I'm gonna go with created date time and last checked

lyric mountain
#

like, make the cron task from inside the bot runtime

#

when it starts, schedule it and immediately execute

peak drum
#

you wouldn't even need a cron task you could just use a javascript file

boreal iron
#

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

lyric mountain
#

cron aligns to actual time

peak drum
#

aka your bot if u use discord.js

peak drum
slender wagon
peak drum
#

i thought it involved a discord bot i'm sorry xD

slender wagon
#

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

peak drum
boreal iron
#

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

slender wagon
#

okay

lyric mountain
#

just have some column to be able to compare against current date

slender wagon
#

an API has to be inolved to check the status of the ID as it's a third party handling that

lyric mountain
#

well, then it's hard to reduce strain

boreal iron
#

Make sure to not run into any limits with ur cronjob

lyric mountain
#

unless the api returns a batch

#

then u can compose a DELETE ... WHERE ids IN (puttheidshere)

slender wagon
#

i wish

#

i am gonna have to handle that i guess

civic scroll
#

instead of that why not just store 5 most recent ids

slender wagon
#

I'll just set cooldowns between them

civic scroll
#

or you can do periodic sweep

slender wagon
#

but adding it on the startup just incase server goes down

boreal iron
forest mist
#

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

solemn latch
#

Is your domain configured the same way the old one was?

sage bobcat
#

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.

white anvil
#

you canโ€™t change network configuration after a container is created

rustic nova
#

Yeah you need to entirely restart the container

sage bobcat
#

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.

peak drum
#

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

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

white anvil
sage bobcat
#

One message removed from a suspended account.

white anvil
#

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

sage bobcat
#

One message removed from a suspended account.

white anvil
#

ye

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

white anvil
#

sure

rustic nova
#

But keep in mind you'll need to shut down the container first

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

lament rock
#

mysql doesn't send a web page

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

lament rock
#

by connecting to it with a mysql wrapper

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

peak drum
haughty pilot
#

hi

sage bobcat
#

One message removed from a suspended account.

boreal iron
sage bobcat
#

One message removed from a suspended account.

boreal iron
#

Maybe... I don't really like it and don't get used to it tho

sage bobcat
#

One message removed from a suspended account.

boreal iron
#

The virtual container management of Proxmox is light years better anyway

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

hasty perch
#

@deft wolf
I don't understand you

deft wolf
#

What exactly?

#

I think I made that clear enough

hasty perch
deft wolf
#

Yes

#

I can see that

#

</about:1098263520694522057>

#

Copy that and paste it here

#

See what happens

hasty perch
#

Ok

#

but

#

in the description?

deft wolf
#

It's working same way

hasty perch
deft wolf
hasty perch
#

I put this

deft wolf
#

But it's not your command name and your command id

#

You need to change it

#

That was example how to do this

hasty perch
#

how to get the id of the command

deft wolf
#

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

hasty perch
#

oh yes

#

thanks!

sage bobcat
#

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.

quartz kindle
#

INTERCAL > *

lyric mountain
#

Cobol is too aggressive

#

Full caps

quartz kindle
#
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
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

quartz kindle
radiant kraken
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

lyric mountain
#

Use full package instead

sage bobcat
#

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.

lyric mountain
#

System.Collections.Generic.List<string> lisOfWords = new System.Collections.Generic.List<string>();

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

lyric mountain
#

Don't forget async async async Async async

sage bobcat
#

One message removed from a suspended account.

lyric mountain
#

Parm knows the way

sage bobcat
#

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.

lyric mountain
sage bobcat
#

One message removed from a suspended account.

lyric mountain
#

There's a longer chain tho

sage bobcat
#

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.

lyric mountain
#

Found it

#

'twass waffle after all

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

scenic kelp
#
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

sage bobcat
#

One message removed from a suspended account.

scenic kelp
#
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

scenic kelp
# scenic kelp ```cs switch (balls) { case Ballsack.Value1: int ballCount = 2; ...

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;
    }
}```
sage bobcat
#

One message removed from a suspended account.

sage bobcat
#

One message removed from a suspended account.

scenic kelp
#

no but if you're making everything as long as it needs to be

sage bobcat
#

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.

scenic kelp
#

L

sage bobcat
#

One message removed from a suspended account.

scenic kelp
#
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>());
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

slender wagon
#

what's an easy way of copying all the directories with the file names in a folder?

#

windows

sage bobcat
#

One message removed from a suspended account.

rugged bloom
#
  • control v
slender wagon
#

I only want to copy the names of the dorectories and files

earnest phoenix
# slender wagon windows

In Command Prompt:

dir -s -n <PATH> | clip

In PowerShell:

Get-ChildItem -Recurse -Name <PATH> | clip
quartz kindle
#

i'll never understand powershell commands

#

they feel so unintuitive to use

lyric mountain
#

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

proven lantern
#

is svelte switching to JS from TS because TS is trash?

quartz kindle
#

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

slender wagon
#

I mean if it is a huge project and the devs know what they are doing you don't really need ts

quartz kindle
#

ye

#

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. ๐Ÿ˜•

slender wagon
#

Lol

proven lantern
#

douglas crockford was right about types

radiant kraken
#

i thought it was a linux-exclusive thing

dry delta
#

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
sage bobcat
#

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.

radiant kraken
sage bobcat
#

One message removed from a suspended account.

radiant kraken
#

nah not an L fortunately

scenic kelp
#

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'

proven lantern
scenic kelp
#

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

quartz kindle
#

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

scenic kelp
#

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

quartz kindle
#

yeah, but its also more flexible / less strict

scenic kelp
#

oh i don't disagree on that

quartz kindle
#

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

scenic kelp
#

my point is its just disingenuous to paint people switching from TS -> JS w/ JSDoc as people moving away from static typing

quartz kindle
#

yeah

scenic kelp
#

it's just that it's better for libraries

quartz kindle
#

although i do embrace js's dynamic way of life, i've grown quite fond of it

scenic kelp
#

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

summer mortar
#

Pls

scenic kelp
#

@solemn latch

summer mortar
#

Iโ€™m not I need one Mo

scenic kelp
#

too bad you're breaking the rules

solemn latch
#

@summer mortar no ads please

nova ferry
#

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 Thonk

sharp geyser
#

No

#

if you are talking about top.gg Discord Oauth2 is the best method for what they are using it for

nova ferry
#

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

celest swan
#

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?

deft wolf
#

Type just /

#

That's all

spare crypt
#

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!!

deft wolf
#

I doubt anyone on here is familiar with BDFD

deft wolf
#

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

boreal iron
surreal sage
#

god javascript

#

0 == false

#

having to use typeof

neon leaf
#

well you need to use ===

wheat mesa
#

Also your code is probably poorly written if youโ€™re somehow accidentally comparing a number and a boolean

surreal sage
#

equivelant of it

surreal sage
#

where a value can be 0

#

And I want to save that value if it exists

quartz kindle
#

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

slender wagon
#

is prisma poggers?

#

or should i just use PG

quartz kindle
#

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

digital swan
#

Makes your life easy with typings tho

solemn latch
#

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.

wooden ocean
#
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

lyric mountain
#

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

carmine magnet
#

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")

crimson beacon
#

Is location defined?

carmine magnet
#

of course it is

crimson beacon
#

Typically, you get location by doing document.location or window.location

#

Not just by doing location

carmine magnet
#

location works too

crimson beacon
#

Huh

carmine magnet
#

but even with window or document, i am not getting redirected

crimson beacon
#

The URL looks fine, so this is weird.

carmine magnet
#

yeah

crimson beacon
#

Try placing a ; after ```js
await fetch(?id=${response.id}&accessToken=${accessToken}&expiresIn=${expiresIn})

carmine magnet
#

no redirection ๐Ÿ˜”

#

ohhh it was my fault

#

the ok page wasn't working

#

thank you for your help

earnest phoenix
#

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')
earnest phoenix
quartz kindle
wheat mesa
#

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

slender wagon
#

what have i done

#

how do i get rid of this

quartz kindle
#

lmao

lyric mountain
slender wagon
#

its a bigint

#

or smthn

lyric mountain
#

It definitely isnt

#

More likely bigdecimal

slender wagon
#

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

lyric mountain
#

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

lyric mountain
slender wagon
#

i just changed the schema and migrated it via prisma

slender wagon
#

but most likely not more than 10k

lyric mountain
#

Then use long/bigint

#

If there's no hard cap, use a big type

slender wagon
#

yeah i set it to bigint

#

so much better

lyric mountain
#

Don't use * unless you want every column btw

slender wagon
#

it's the short way

lyric mountain
#

But higher performance impact

slender wagon
#

oh yeah i am aware this is just testing

lyric mountain
#

Ah ok

haughty pilot
#

I have the most unique bot on this app smug

lyric mountain
surreal sage
#

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)

lyric mountain
#

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

surreal sage
#

ya i fixed it

#

somehow

#

i dont know how

radiant kraken
#

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

spark flint
#

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

radiant kraken
#

does this also mean that user discriminators will also be deprecated in the future versions of the api

pale vessel
pale vessel
#

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

lament rock
summer torrent
radiant kraken
#

rust?!?!?!!! ๐Ÿš€๐Ÿš€๐Ÿš€๐Ÿš€๐Ÿš€๐Ÿš€๐Ÿš€๐Ÿš€

summer torrent
# radiant kraken 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...

โ–ถ Play video
radiant kraken
#

i knew about microsoft adopting Rust but i wasn't expecting for them to literally use Rust in windows

slender wagon
#

Every end of the month i want to check for inactive accounts and delete them if they got 0 balance

#

Postgresql

quartz kindle
quartz kindle
#

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

slender wagon
#

oh that's very smart

#

thanks, i was a bit confused on how i could implement one lmfao

#

brain not worki

#

thanks

radiant kraken
#

thank you!

(@solemn latch)

solemn latch
#

@torpid tusk no ads please

#

What is going on today?

delicate zephyr
#

@radiant kraken henlo

radiant kraken
#

henlo

#

how it do?

#

how's babi

delicate zephyr
#

oof wrong channel lmao and it do meh

#

and babi is good

radiant kraken
slender wagon
#

anyone here has experience with btcpay?

rigid maple
#

I want to click on returning EventHandle button using puppeteer but it doesn't work

summer torrent
#

do you get any errors

proven lantern
#

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

wheat mesa
#

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

lyric mountain
#

disable commits to master branch

#

make every contributor work on their own forks, then handle PRs afterwards

earnest phoenix
# wheat mesa Anyone have a good guide for working on github with multiple people? I can do a ...

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

wheat mesa
#

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

wheat mesa
#

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

lyric mountain
#

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

wheat mesa
#

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

lyric mountain
#

ah ic

#

try logging file.exists() and file.isDirectory()

wheat mesa
#

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 ๐Ÿ˜ญ

lyric mountain
#

yk u can use idea's coop programming right?

wheat mesa
#

Oh yeah I forgot that existed

#

Might set that up in a sec

lyric mountain
#

lmao

wheat mesa
lyric mountain
wheat mesa
#

Now I'm REALLY confused, because it most definitely does

lyric mountain
#

permission issue maybe?

wheat mesa
#

I just looked through the exact path that doing System.out.println(file) returns, and it exists

wheat mesa
warm geyser
#

ะ”ะตะฝัŒ ะดะพะฑั€ั‹ะน

#

ะšะฐะบ ั ะผะพะณัƒ ัƒัั‚ะฐะฝะพะฒะธั‚ัŒ ัั‚ะพั‚ ะฑะพั‚ ะดะปั ะฟะตั€ะตะฒะพะดะฐ

lyric mountain
#

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

wheat mesa
#

Problem is that the folder comes with preloaded data

#

And we need that data

lyric mountain
#

hm

wheat mesa
#

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

lyric mountain
#

maybe

wheat mesa
#

That's what it shows up as being

lyric mountain
#

try using getResourceAsStream()

#

and loading the file from it, instead of the uri

wheat mesa
#

fucking christ it was because he had a space in his username

#

๐Ÿ˜ญ

lyric mountain
#

lmao

wheat mesa
#

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

lyric mountain
#

nice

slender wagon
#

so i am setting up a btcpay server and it requires docker

#

i have never used docker before

rustic nova
#

apt install dockerio

#

docker compose start

rustic nova
#

Also wtf is btcpay

slender wagon
#

why use coinbase commerce when you can do it on your own

rustic nova
#

True

#

Coinbase-adresses are more trusted, so that's the downside

slender wagon
rustic nova
#

Yup, still coinbase addresses are trusted

slender wagon
#

wym exactly by that?

rustic nova
#

Though probably doesn't matter much

#

They're known addresses

slender wagon
#

yeah but does anyone care tho?

#

unless u are doing some shady stuff

#

and u wont be able to withdraw

rustic nova
#

Yeah wont matter much then

quartz kindle
#

extending a promise in TS is so damn hard lmao

wheat mesa
#

we have to make UML diagrams for our project in my class... I went a bit overboard, thank god for intellij's diagram generator

lyric mountain
radiant kraken
wheat mesa
#

procedural generation is hard

#

the idea is intuitive but the implementation is confusing

lyric mountain
#

What ur trying to generate?

wheat mesa
#

(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

lyric mountain
#

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

wheat mesa
#

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)

heady garden
#

I finally found it!

spark flint
#

@modern sable

#

in general and general 2 KEKW

#

oh and memes now too

#

this is getting funny

deft wolf
#

25565 is minecraft server port no?

peak drum
#

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

deft wolf
#

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

lyric mountain
#

Any port is minecraft port

rustic nova
#

yus

wheat mesa
neon leaf
wheat mesa
#

Tim has his reasons

#

Never question Tim

quartz kindle
#

lmao

quartz kindle
#

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

wheat mesa
#

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?

rustic nova
#

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

eternal osprey
#

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

solemn latch
#

is that something discord even provides?

rustic nova
#

Fetch audit logs

#

But you're limited to 2 weeks

#

Or logging that yourself

#

there's no direct endpoint on role assigning

eternal osprey
#

ahhh

wheat mesa
#

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

lyric mountain
#

it is an awesome counsilor (is this how u write it?)

#

it helps me learning how to make a game ai

wheat mesa
#

It's awesome to bounce ideas off of, it can point out flaws without bias

lyric mountain
wheat mesa
#

Yeah

lyric mountain
#

ty

wheat mesa
#

I'd maybe prefer something like consultant

lyric mountain
#

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

wheat mesa
#

Yeah, it's nice

#

I'm so used to java 8, having this change is such a massive QOL for me

#

my god

lyric mountain
#

love it too

#

I'm holding my breath for the new switch feature, that'll include this for cases

wheat mesa
#

idk why this hasn't been a thing for like 5 years

lyric mountain
#

I mean, we're also the only ones to have such features freerealestate

#

some jeps are also speculating about adding string interpolation

#

and ofc, some are also discussing about removing the need for enclosing classes

solemn latch
wooden ocean
#

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)
quartz kindle
#

actually, response.body itself is undefined

wooden ocean
#

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] });
     })
   }
 };
wheat mesa
#

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

wooden ocean
#

interesting

stark abyss
#

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

quartz kindle
#

why would you want that tho?

#

its explicitly a node.js library

#

react runs in the browser

latent ocean
#

Hi !
does anyone know an api to get the lyrics of a music by its name?

sage bobcat
#

One message removed from a suspended account.

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

latent ocean
#

okay thanks you

frosty gale
wheat mesa
#

@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

lyric mountain
#

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?

rustic nova
#

yeah nvm, was about to say I could help, though only worked with chartjs through canvas

lyric mountain
#

Ur not sending the attachment

earnest phoenix
#

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

earnest phoenix
#

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

sage bobcat
#

One message removed from a suspended account.

deft wolf
#

Ah yes, reddit e_cat_blush

lyric mountain
#

issue aint even reddit, a const data = content[0].data.children[0].data would make that much more readable

summer torrent
#

yeah

#
let data = content[0].data.children[0].data
let upvotes = data.ups
fading bane
#

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

delicate zephyr
earnest phoenix
#

Show code

crystal wigeon
#

is there any content creators here?
or blog writers?

spark flint
#

what for

pale vessel
quick abyss
pale vessel
#

the beauty of js

quick abyss
#

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.

quartz kindle
#

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.

lyric mountain
#

honestly, it's not that bad

#

just use tones that'd work both in light and dark themes

peak drum
#

its nice in my nitro theme

lyric mountain
#

remove nitro, problem solved freerealestate

#

oh wait, I read "it's not nice"

peak drum
civic scroll
eternal osprey
#

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??

wheat mesa
#

@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

wheat mesa
#

that's what I've done (if I'm understanding what you're saying correctly)

lyric mountain
#

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

wheat mesa
#

Got it working!

quaint rampart
#

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?

civic scroll
#

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

lyric mountain
#

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

surreal sage
#

๐Ÿ˜ƒ

jaunty basalt
#

Can anyone tell me how to this and 19 more thingy for </role info:0> command?
(discord.js)

rustic nova
#
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

lyric mountain
#

it annoys me that the roles list in that image is inverted

rustic nova
#

suffer

lyric mountain
#

๐Ÿ˜”

#

inb4 they try to copypaste your answer but find out it's in python

rustic nova
#

not even proper python either KEKW

#

just a mockup

#

but I'll die inside if they do

#

please consider this just a theoretical example and not just copy paste kthx

wheat mesa
#

I asked ChatGPT to write some basic pseudocode for an algorithm and it wrote python lol

radiant kraken
#

python is literally pseudocode

rustic nova
#

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

pale vessel
#

scrape some site

#

that's always an option

rustic nova
#

seeing how most sites are either shit to scrape or dont provide every item,

quick abyss
#

build your buttons first, then do addComponents().

wheat mesa
#

Just array.push(item)

quick abyss
#

^ - and then pass the array to addComponents

wheat mesa
#

Yes

quick abyss
#

I think I usually just use camelCase names. tbh idk

surreal sage
#

i dont think this is supposed to fix my issue

#

but sure

lyric mountain
#

not only is it not supposed to, but if it does then you have huge issues in your code

quick abyss
#

JSeption

#

or maybe it would be JSONtion

quartz kindle
boreal iron
#

You gonna access the components

surreal sage
#

It was a ```text
{"k":"v"}

#

JSON.parse that

boreal iron
#

It should be your action row (array) including your button

surreal sage
#
{"k":"v"}```
#

JSON parse that

#
{"k": "v"}```
#

๐ŸŽ‰

quartz kindle
surreal sage
#

"well it works for me"

#

๐Ÿ˜ƒ

quartz kindle
#

thats not a valid json response

surreal sage
#

"Shrug"

#

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 cool_

#

this server is so gon crash some day

lyric mountain
# surreal sage it works

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)

wooden ocean
#
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
low abyss
#

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

lyric mountain
#

scripts can do very harmful things if you really want to, so they chose not to allow it

lyric mountain
#

also you can cut down the size of that file by like 80% if you extract the common parts of that if-else chain

quick abyss
#

It's always nice to break out big stuff into utility functions.

#

especially if theres a chance of reusability

lyric mountain
#

use find instead

lyric mountain
#

as a replacement of .filter?

deft wolf
#
Use the fetchReply option to get the bot's reply message.
craggy pine
#

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)
       }
   })
deft wolf
#

Just in case

junior fjord
#

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

deft wolf
#

Oh now

#

Self promotion is probably not very welcome here

earnest phoenix
#

@ivory siren

ivory siren
#

No ads please

#

Still an ad

junior fjord
#

Ok ok ok

ivory siren
#

So nono please donโ€™t

#

Ye thanks

junior fjord
#

Ok

#

But anyone still open to help with that code?

deft wolf
#

If you just paste it here, someone will surely help

junior fjord
#

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

earnest phoenix
#

we cant without the error or the code

rustic nova
#

witch

junior fjord
earnest phoenix
#

we need the code

junior fjord
slender wagon
#

what's the actual point of docker?

#

nvm i asked chatgpt to explain

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

slender wagon
#

so basically a system inside a system

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

slender wagon
#

mhm sounds great

#

gotta start playing with it

sage bobcat
#

One message removed from a suspended account.

slender wagon
#

i had to use it today

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

slender wagon
#

postgres >

slender wagon
sage bobcat
#

One message removed from a suspended account.

slender wagon
#

understandable

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

slender wagon
#

lol

#

cool stuff

#

i wouldn't want to be competing with you yet

#

I'll tell you when ๐Ÿฅถ

spark flint
#

js killing me

#

\n is not ,

#

ok nvm fixed

pale vessel
#

either your code isn't saving or there is literally one element inside the array with that value

spark flint
#

i forgot the ... KEKW

sage bobcat
warm surge
random snow
#

nice font color choice ๐Ÿ‘

rustic nova
#

safari moment

boreal iron
#

Ya... blame safari instead of the developers crafting the crap website poggythumbsup

boreal iron
random snow
boreal iron
#

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)

shrewd kestrel
#

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

boreal iron
#

Well.. you're wrong here

quartz kindle
#

well.. you're right here

boreal iron
#

Quiet grandpa mmLol

quartz kindle
#

silence grandson

boreal iron
quartz kindle
#

:^)

boreal iron
#

What u doin here at this time, Tim?

#

Ain't there anything that needs to get benchmarked? topggDoge

quartz kindle
#

i just woke up

#

fist thing i do when i wake up is check discord

#

for opportunities to troll

#

:^)

boreal iron
#

Aye I see

quartz kindle
#

its 7am, g2g shit and then work on my construction thing

boreal iron
#

Construction thing?

quartz kindle
#

my house

boreal iron
#

Ah

#

Watch out to not get your hand blown up (again)

#

:)

quartz kindle
#

:^)

#

my fingers still hurt from that clock explosion

boreal iron
#

lol

quartz kindle
#

got a nice scar on my middle finger

boreal iron
#

Sadly you didn't record it

quartz kindle
#

thank god i didnt, it was dumb af

#

lmao

boreal iron
#

Accidents of others are quite fun to watch

quartz kindle
#

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

boreal iron
#

Ow... well I don't like that sort of stuff
Reminds me of many house fires I saw and heard because of burning batteries

quartz kindle
#

welp

boreal iron
#

Dont u have constant electricity?

quartz kindle
#

most of the time

#

but this is brazil, infrastrucutre is crap

boreal iron
#

Well to be fair, you moved over there

quartz kindle
#

:^)

boreal iron
#

U had the chance to live in my (warm) heating room

quartz kindle
#

too expensive

boreal iron
#

lmao

#

How about solar?

quartz kindle
#

too expensive and its shit

#

here at least

#

also it rains a lot

boreal iron
#

Hmm, guess stealing some electricity and keeping it buckets is ur only option then topggDoge

quartz kindle
#

also we should probs get off #Dev lol

boreal iron
#

well house development is still development, isn't it?

quartz kindle
#

:^)

quartz kindle
boreal iron
#

Aye you're not allowed to leave the channel anyways

deft wolf
#

They won't check your bot now. You didn't even resubmit it

boreal iron
#

The purpose of the bot is to stay online and reachable

deft wolf
#

Your bot was rejected 2 days ago. You need to resubmit it for review and wait about 2 weeks

boreal iron
#

If it has specific online times then add them in the reviewer notes

deft wolf
boreal iron
#

Can't be something serious then

deft wolf
#

At first I thought he was having trouble finding hosting for his bot, that's why I sent him here

vale ore
#

@

glacial orbit
#

How can I get my bot approved because every one of my bots got declined

deft wolf
#
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

solemn latch
#

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.

glacial orbit
#

Ok

static sky
#

Hey mates, I submitted this simple price bot. Now I come and check but cannot see if it's rejected or not.

deft wolf
static sky
#

Thank you

#

Could you show me the docs for help command

solemn latch
#

the docs?

static sky
#

Yeah, the bot got rejected by this

deft wolf
#

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

static sky
#

okay, lemme check. Thank you guys

junior fjord
#

@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

lyric mountain
junior fjord
#

The command dosnt work the bot sends no response

lyric mountain
#

did you try debugging it?

junior fjord
#

No errors

lyric mountain
#

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?

surreal sage
#

๐Ÿ˜ƒ

#

nrly development related

#

software related Shrug

grim aspen
rustic nova
#

mfw development isnt software

#

a

surreal sage
#

m3u8 to mp4

#

wait

#

no

#

subtitles

#

mp4 + srt

grim aspen
#

so basically conversion software?

surreal sage
#

u dont know ffmpeg?

grim aspen
#

no i do know what it is despite me not using it

surreal sage
#

it's the media tool

#

yay finished

#

2 hours of video

grim aspen
#

i'm done with this channel

lyric mountain
lyric mountain
surreal sage
#

๐Ÿ‘๏ธ

#

think I'm good

#

"we'll see"

lyric mountain
#

not exactly what I mean, but ok

surreal sage
#

ok

rigid maple
#

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

quick abyss
#

anyone know how to keep an interaction open after editReply()?

#

to allow for further editReply()'s

split jay
peak drum
#

Do let msg = await interaction.reply()

After that use msg.edit()

lyric mountain
#

at least from the clarity POV

lyric mountain
#

additional operations must be followup edits

rigid maple
rigid maple
#

i'm actually cropping from a big picture

lyric mountain
#

the image is fixed in the page or it's a screenshot generated by your client?

rigid maple
#

fixed

lyric mountain
#

hm, does tesseract allow supplying your own dataset of samples?

#

or installing custom fonts per se

rigid maple
#

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.

lyric mountain
#

that's pretty simple to do

rigid maple
#

If I can find the font, I can run it in a much healthier way, but I can't find the font either.

quick abyss
peak drum
#

Yes but could use my example ^^