#development

1 messages · Page 272 of 1

crystal wigeon
#

does this work for oyu? i copied everything from here and it still wont work wtf

wheat mesa
#

I mean it may or may not work. I did a lot of troubleshooting and I can't remember if this config was problematic or not

#

But I'm pretty sure it's at least 90% of the way there

delicate zephyr
#

whichever you developed it on tbf

#

the version doesnt really matter unless you require specific features from said version

#

plus the security patches etc

slender wagon
#

which one do i go for boys?

neon leaf
#

the right

#

left one wont be in stock for a while

slender wagon
#

oh

#

didnt even see the button

#

lmfao

delicate zephyr
delicate zephyr
slender wagon
#

im now purchasing it

delicate zephyr
slender wagon
delicate zephyr
#

ah nice

crystal wigeon
pine willow
#

Hetzner has nothing to do with datalix

delicate zephyr
#

Ah cool

pine willow
#

Both are from Germany

#

But they are not related

delicate zephyr
#

Yea I realised that alter I said it

#

Since hetzner is in Falkenstein & Helsinki iirc (and Nuremberg)

unreal wadi
#

do anyone know how to regester commands in bot profile ?

pearl trail
#

i wonder why datalix can be that cheap

sharp geyser
#

All EU brands are fairly cheap ngl

delicate zephyr
#

there's a few other reasons they can be

#

like owning their hardware etc

#

it's not hard if you split up a dedi properly

#

or you're contabo and overprovision by like 300%

pearl trail
#

oh wow

#

i see, that's interesting

uncut briar
earnest phoenix
#

It takes the time discord needs to get enough data, there's no timeframe

#

It can be in 12 hours just like it can be in 4 days

#

If your bot is used by 3 people it will take longer than if it's used by 300 people

crystal wigeon
#

This shit making me lose my mind wtf

deft wolf
#

No

radiant kraken
#

no

neon leaf
#

No

rugged dawn
#

@earnest phoenix don't advertise your bot here or anywhere else in this server

earnest phoenix
#

ok

unreal wadi
delicate zephyr
#

and how many guilds use it etc

unreal wadi
#

167k user

#

400 dayily vote

delicate zephyr
#

hmmm idk then

#

probably worth emailing discord and asking then

unreal wadi
#

hmm

digital swan
#

mine doesn't have them either with around 600 daily users

#

i think there must be a minimum amount of slash commands used

#

my users mostly use prefix commands

deft wolf
#

Yes, you need to use slash commands so that Discord has enough data to determine which ones are "popular"

ashen obsidian
#

Hey, i have a Problem with discord.js my code is on the version 13 and now i must upgrade it too version 14. Can anyone Help me with that, because the videos don t help me with my problem.
Maybe I should mention that I'm new to coding Discord bots.

This is my code, thanks for everyone who will help me.

const { SlashCommandBuilder, EmbedBuilder } = require("@discordjs/builders")

module.exports = {
data: new SlashCommandBuilder()
.setName("info")
.setDescription("Zeige Informationen über den Server oder einen Benutzer an!"),
.addSubCommand(subCommand=> subCommand.setName("server").setDescription("Zeige Informationen über den Server an"))
.addSubCommand(subCommand=> subCommand.setName("meber").setDescription("Zeige Informationen über einen Member an")
.addUserOption(option=> option.setName("meber").setDescription("Der Member").setRequired(True))),
async execute(interaction) {
switch(interaction.options.getSubcomman()) {
case "server": {
interaction.reply({embeds: [
new EmbedBuilder()
.setTitle(Informationen für die Guild ${interaction.guild.name})
.addFiles([
{
name: "Channels"
value: ${interaction.guild.channels.cache.size} Channels
},
{
name: "Erstellt"
value: ${Math.round(interaction.guild.createdTimestamp/1000)}>,
inline: true
}
])
]})
break
}

    case "member": {
        const meber = interaction,options.getMember("member")
    interaction.reply({embeds: [
        new EmbedBuilder()
        .setTitle(`Informationen für die Guild ${meber.user.tag()}`)
        .setThumbnail(meber.user.avatarURL({dynamic: true}))
        .addFiles([
            {
                name: "Account erstellt"
                value: `${matchMedia.round(meber.user.createdTimestamp/1000)} >`,
            },
            {
                name: "Member beigetreten"
                value: `${Math.round(member.joinedTimestamp/1000)}>`,
                inline: true
               }
             ])
        ]})
            break
        }
    }
}

}

pale iron
#

This looks like a job for...||chat-gpt||

deft wolf
#

Not really

prime cliff
#

Why are you using switch statements for just 1 condition wtf

ashen obsidian
#

i don t know i just following a YT video 😅

prime cliff
#

Format your code using

ashen obsidian
#
const { SlashCommandBuilder, EmbedBuilder } = require("@discordjs/builders")

module.exports = {
    data: new SlashCommandBuilder()
    .setName("info")
    .setDescription("Zeige Informationen über den Server oder einen Benutzer an!"),
    .addSubCommand(subCommand=> subCommand.setName("server").setDescription("Zeige Informationen über den Server an"))
    .addSubCommand(subCommand=> subCommand.setName("meber").setDescription("Zeige Informationen über einen Member an")
    .addUserOption(option=> option.setName("meber").setDescription("Der Member").setRequired(True))),
    async execute(interaction) {
        switch(interaction.options.getSubcomman()) {
            case "server": {
                interaction.reply({embeds: [
                    new EmbedBuilder()
                    .setTitle(`Informationen für die Guild ${interaction.guild.name}`)
                    .addFiles([
                        {
                            name: "Channels"
                            value: `${interaction.guild.channels.cache.size} Channels`
                        },
                        {
                            name: "Erstellt"
                            value: `${Math.round(interaction.guild.createdTimestamp/1000)}>,`
                            inline: true
                           }
                ])
            ]})
            break
        }

        case "member": {
            const meber = interaction,options.getMember("member")
        interaction.reply({embeds: [
            new EmbedBuilder()
            .setTitle(`Informationen für die Guild ${meber.user.tag()}`)
            .setThumbnail(meber.user.avatarURL({dynamic: true}))
            .addFiles([
                {
                    name: "Account erstellt"
                    value: `${matchMedia.round(meber.user.createdTimestamp/1000)} >`,
                },
                {
                    name: "Member beigetreten"
                    value: `${Math.round(member.joinedTimestamp/1000)}>`,
                    inline: true
                   }
                 ])
            ]})
                break
            }
        }
    }
}
craggy pine
#
interaction,options.getMember("member")

I immediately see this which is using a comma and not a period.

ashen obsidian
#

ok and how to "install" it in my code😅

ashen obsidian
#

Sry that i am so Dump in this topic

pale iron
ashen obsidian
#

yes

pale iron
#

No worries everyone has been there

#

Why do I think you're developing a bot just for the dev badge?

steel scaffold
#

@pale iron Could u pls stop sending GIFs during assistance discussions?

pale iron
#

Maybe

craggy pine
ashen obsidian
#

I want to program a bot for our server, not for the badge. The problem is, I've tried to teach myself how to do it easily using YouTube videos. But I can't find the errors. I can already program myself, but I'm unfamiliar with Discord.js.

craggy pine
#

Thing is, no offense but if you do know how to program, you'd be able to follow the errors it would provide you. As I said, I can't exactly point where / why it's failing for you besides the , I see.

prime cliff
#

Are you you using visual studio code usually that would tell you common errors if you have the js pack stuff installed

craggy pine
#

☝️

ashen obsidian
#

Yes i using visual studio code.

steel scaffold
craggy pine
#

Ah that's something I did not notice.

trim tartan
#

i need dev man anyonce nac

#

dev to make with me good ai bot

prime cliff
#

lol

craggy pine
prime cliff
#

Just use one already made

deft wolf
#

Top Job Board KEKW

lyric mountain
#

you'll either become dependant on them or learn outdated stuff

ashen obsidian
#

Yes, that's true. I've also taught myself other languages ​​on YouTube, which worked well. Unfortunately, it didn't help me as much with Discord.

deft wolf
#

I mean, discord.js likes to change the way it works often

lyric mountain
#

my advice would be to attempt simpler projects before dealing with discord to get used to the language itself

#

d.js is rather overcomplicated in some aspects for unknown reasons

ashen obsidian
#

The problem I have is that I can code Java, but it doesn't work on Discord

lyric mountain
#

java as in java?

#

or javascript?

#

cuz they're 2 diff langs

deft wolf
#

You can make bots in java

lyric mountain
#

and both can be used for bots

ashen obsidian
#

with Javascript

bitter sand
#

Hello

lyric mountain
#

what part of d.js are you struggling with?

ashen obsidian
#

the part of upgrade my code in the newest version

solemn latch
#

What was your old version?

ashen obsidian
#

version 13

solemn latch
#

Discordjs has a guide for you

lyric mountain
#

happy bday woo

solemn latch
#

tyty

deft wolf
#

Happy birthday

ashen obsidian
#

thanks

vocal knot
#

Happy borthday Woo

wheat mesa
#

happy bday

quartz kindle
solemn latch
#

ty ^-^

vocal knot
#

@ashen obsidian also google often is of better help than youtube if you know how to properly use it, including ", site: and more (google dorks)

solemn latch
#

I wish - worked on google still

ashen obsidian
#

ok thanks to all that helpt me

solemn latch
#

👀 this is so cool.

prime cliff
#

Heck yea vibecat got docker stack creation automated

small tangle
#

So Docker Stack is Docker Compose?

prime cliff
#

Yes essentially

#

I'm creating an alternative to Portainer

small tangle
#

So Docker Stack is your naming? pikathink

prime cliff
#

That's how portainer and other services name it yea

delicate zephyr
prime cliff
#

That's for docker swarm mode though so official but not really related the compose

#

Ok time to get this working properly with a build status and stack info vibecat

median moat
#

hello people, i wanna ask a question.

Ive made a bot that one of its functions is to copy an entire category here in discord along with its text, voice, forum channels and set their permissions to be the same as well.

Unfortunately it seems that by what i coded (setting the permissions AFTER the category and channel creation) now, it demands the Administrator privillege or else even with ALL of the privilleges it will hang and give me:

"discord.errors.Forbidden: 403 Forbidden (error code: 50001): Missing Access"

what can i do to make it NOT want the Administrator privillege so i can share it here?

quartz kindle
median moat
#

Tried it, it gave me the error i showed there, and hanged right after the first channel under the category was created

quartz kindle
#

also, you can directly create a channel with the permissions already set, no need to set them after creation

quartz kindle
median moat
#

Yeah 😂😂 i mean i hope so, i can dm you the code if u want. About the create a channel eith permissions directly, i guess i dont know how, cause i tried and this is the only sollution that worked for me

prime cliff
#

Are you copying the entire overwrite perms too or doing something weird?

#

Forbidden access sounds like you have higher roles or restricted perms that your bot can't set

median moat
#

Im creating a copy of a specified category and its channels and then copying the permissions as they are in the original category and channels. Nothing weird

quartz kindle
prime cliff
#

Ah you're copying the entire perms that's your issue then

#

Your bot needs to check if those role permission overrides are below the bots current top role

quartz kindle
#

if you are duplicating an existing channel instead of restoring from a backup

prime cliff
#

Like if a channel has role permissions
Admin
Mod
User

Then your bot would only be able to set user and mod it also checks denied manage channel/view perms for the everyone role and those roles because you'd lock yourself out (and also denied perms)

median moat
#

Yeah i havent included such a check.. maybe thats the issue.

Should i post my code here to see what ive done?

prime cliff
#

Also your bot can only copy permissions that it currently has so if a role perms overwrite has manage messages denied/allowed but your bot dosen't globally in the server have manage messages that would fail too

#

Administrator would bypass all permission checks but would still have to follow the role positions to your current bots top role

median moat
#

Yeah, it will, thats why i started it as admin, but saw that i cant use that, so now im lookin for workarounds, to eliminate the admin privilege.

To be honest i created that bot because i make discord server, and i saw on reddit several people lookin for something like this, so i didnt think ahead (like sharing it)

prime cliff
#

Honestly there isn't really much you can do with copying channels as bots due to how permissions work and you can't grant administrator per-channel which imo would be a really nice feature

median moat
#

You can fake it kinda, but it requires a lot of manual work.

Like you set a specific role that has ALL privilleges except admin,

Add it on all of ur channels and make it X to even see channels, but tick it to have everything to the specific channel u want it as admin.

Too much work tho

prime cliff
#

Yup

median moat
# prime cliff Yup

Thats why my bot can clone roles as well with all of their permissions! 😂😂😂😂

prime cliff
median moat
#

thank you both @prime cliff and @quartz kindle . With your inputs i managed to make it work w/o the Administrator permissions.

Now it will clone the category and ignore any permissions that its missing access to, and if anyone wants he can set it himself as the highest role and then it will work with all the permissions!

Thanks a lot!

#

Without and with admin role :P, again ty vm

uncut briar
#

would be better to not ping the everyone role

#

or any roles in particular

median moat
#

yes i agree, it does pin the everyone role cause its set like this inside the channel permissions, but myself im planning to use it in invisible channel, although ill try to make it as not to ping

uncut briar
#

most libs has allowed mentions setting that you can use, so it wont ping the role but still can mention it.

median moat
#

thnx, ill try it

bitter granite
median moat
bitter granite
median moat
#

yeah ill try fighting the bot for it now xD

bitter granite
#

Ok i hate discord formatting somethimes

median moat
#

i made a change, lets see if it works 🤞

surreal sage
#

{ parse: [] } should disallow all mentions

median moat
#

i have to be honest here, chat gpt helped me with this one, but seems to be working better now

elfin helm
lyric mountain
#

did that already, people abused

#

it's best to simply disable everyone/here pings on the bot itself

median moat
earnest phoenix
#

is my data struct good

median moat
neon leaf
earnest phoenix
#

up = userphone

#

a lot of these are of type jsonb cause i cant figure out the arrays

neon leaf
#

Postgres?

earnest phoenix
#

yea

#

its pgadmin

neon leaf
#

TEXT[] would be a string array

earnest phoenix
#

if u have an ui its kinda good

earnest phoenix
#

i try to default to [] but it syntax errors

neon leaf
#

To set an array it's {}

earnest phoenix
#

i fr need new peripherials

#

my mouse randomly scrolls

#

and my keyboard doubles b and g

neon leaf
#

Fixed itself after some time

earnest phoenix
#

i heard its linear switch problem

earnest phoenix
#

im used to it

#

i just backspace doubles

#

but its so slow

#

and annoying

#

also idk why my bot got approved with the moderation tag

#

it only has !report as a moderation feature

bitter granite
earnest phoenix
#

which lets users report others and it sends message in a channel

#

can yall suggest a better table structure pls

#

wait

#

i think imma plan first

#

like what commands imma add

#

i mean for now json is good

#

just 4 servers using it wont harm the storage

#

they should improve d.js docs fr

solemn latch
#

whats wrong with it?

neon leaf
#

im not sure how I want to handle docker image building for my new rust api tbh

#

im thinking build the app using a seperate step so I can cache depends properly

earnest phoenix
solemn latch
#

Why do you need examples? they describe the input and output of every method

solemn latch
earnest phoenix
#

thats client options

solemn latch
#

Intents are a client option

deft wolf
#

There are probably not examples for everything, but you should be able to find some for the most popular ones

neon leaf
#

chunky boi

   Compiling api v3.0.0 (/root/projects/mcjars/api)
    Finished `release` profile [optimized] target(s) in 11.75s
root@remotedev:~/projects/mcjars/api# ls -lh target/release/api
-rwxr-xr-x 2 root root 19M Mar 20 15:02 target/release/api```
lyric mountain
#

go either camel, pascal or snake, but dont mix them

neon leaf
lyric mountain
#

but well, your structure seems good enough, my only nitpicks would be the naming itself and the table containing (I suppose) collections

#

commandSettings, roleSettings, rank_blacklist and rank_users in the case

knotty night
#

@solemn latch

neon leaf
#

@lyric mountain are you down to help with a query?

lyric mountain
#

Sure, but in about 40 mins

#

Not at pc atm

neon leaf
#

ah, ill wait then

this is the query, currently build_count only counts builds with type = sb and version/project version = sb, I need it to count the builds for all types, however still version/project version of sb

                WITH spec_build AS (
                    SELECT builds.build_number as build_number, builds.changes as changes, builds.created as created, builds.experimental as experimental, builds.id as id, builds.installation as installation, builds.jar_size as jar_size, builds.jar_url as jar_url, builds.project_version_id as project_version_id, builds.type::text as type, builds.version_id as version_id, builds.zip_size as zip_size, builds.zip_url as zip_url
                    FROM builds
                    WHERE builds.type = 'FABRIC' AND builds.version_id = '1.21.1'
                    LIMIT 1
                )
    
                , filtered_builds AS (
                    SELECT b.build_number as build_number, b.changes as changes, b.created as created, b.experimental as experimental, b.id as id, b.installation as installation, b.jar_size as jar_size, b.jar_url as jar_url, b.project_version_id as project_version_id, b.type::text as type, b.version_id as version_id, b.zip_size as zip_size, b.zip_url as zip_url
                    FROM builds b
                    INNER JOIN spec_build sb
                        ON sb.id = b.id 
                        OR (COALESCE(sb.version_id, sb.project_version_id) = COALESCE(b.version_id, b.project_version_id) AND sb.type = b.type::text)
                    WHERE b.type != 'ARCLIGHT' OR (
                        (sb.project_version_id LIKE '%-fabric' AND b.project_version_id LIKE '%-fabric')
                        OR (sb.project_version_id LIKE '%-forge' AND b.project_version_id LIKE '%-forge')
                        OR (sb.project_version_id LIKE '%-neoforge' AND b.project_version_id LIKE '%-neoforge')
                        OR (sb.project_version_id NOT LIKE '%-fabric' AND sb.project_version_id NOT LIKE '%-forge' AND sb.project_version_id NOT LIKE '%-neoforge')
                    )
                )
    
                SELECT *, 0 AS build_count, now()::timestamp as version2_created, 'RELEASE' AS version_type, false AS version_supported, 0 AS version_java, now()::TIMESTAMP AS version_created
                FROM spec_build
    
                UNION ALL
    
                SELECT x.*, mv.type::text AS version_type, mv.supported AS version_supported, mv.java AS version_java, mv.created AS version_created
                FROM (
                    SELECT *
                    FROM (
                        SELECT b.build_number as build_number, b.changes as changes, b.created as created, b.experimental as experimental, b.id as id, b.installation as installation, b.jar_size as jar_size, b.jar_url as jar_url, b.project_version_id as project_version_id, b.type::text as type, b.version_id as version_id, b.zip_size as zip_size, b.zip_url as zip_url, count(1) OVER () AS build_count, min(b.created) OVER () AS version2_created
                        FROM filtered_builds b
                        ORDER BY b.id DESC
                    ) LIMIT 1
                ) x
                LEFT JOIN minecraft_versions mv ON mv.id = x.version_id;```
small tangle
#

what in the name of science

pearl trail
neon leaf
#

that looks worse grin

pearl trail
lyric mountain
#

also u dont need to put an alias on fields that already have the same name

#

what are u attempting to do?

neon leaf
#

wouldnt be against it

#

but no clue how

lyric mountain
#

CREATE VIEW the_name AS the_sql

#

after that u just refer to it as you'd with tables

neon leaf
lyric mountain
#

just remember that views are merely aliases to larger sql blocks (like WITH), they dont store resultsets

neon leaf
#

what about a materialized view

lyric mountain
#

sqlite doesnt have mat view

neon leaf
#

im using pg now

lyric mountain
#

every time I guess the db it's the other lmao

neon leaf
#

this is how a result should look

[
  {
    "build_number": 1,
    "changes": "[]",
    "created": null,
    "experimental": false,
    "id": 208070,
    "installation": "[[{\"url\": \"https://versions.mcjars.app/download/fabric/1.21.1/0.16.10/1.0.1.jar\", \"file\": \"server.jar\", \"size\": 168438, \"type\": \"download\"}]]",
    "jar_size": 168438,
    "jar_url": "https://versions.mcjars.app/download/fabric/1.21.1/0.16.10/1.0.1.jar",
    "project_version_id": "0.16.10",
    "type": "FABRIC",
    "version_id": "1.21.1",
    "zip_size": null,
    "zip_url": null,
    "build_count": 0,
    "version2_created": "2025-03-20 15:16:42.047502",
    "version_type": "RELEASE",
    "version_supported": false,
    "version_java": 0,
    "version_created": "2025-03-20 15:16:42.047502"
  },
  {
    "build_number": 1,
    "changes": "[]",
    "created": null,
    "experimental": false,
    "id": 208070,
    "installation": "[[{\"url\": \"https://versions.mcjars.app/download/fabric/1.21.1/0.16.10/1.0.1.jar\", \"file\": \"server.jar\", \"size\": 168438, \"type\": \"download\"}]]",
    "jar_size": 168438,
    "jar_url": "https://versions.mcjars.app/download/fabric/1.21.1/0.16.10/1.0.1.jar",
    "project_version_id": "0.16.10",
    "type": "FABRIC",
    "version_id": "1.21.1",
    "zip_size": null,
    "zip_url": null,
    "build_count": 66,
    "version2_created": null,
    "version_type": "RELEASE",
    "version_supported": true,
    "version_java": 21,
    "version_created": "2024-08-08 12:24:45"
  }
]```
#

first row being the actual matched build, second the latest (highest id) for type + version identifier

#

and second also including version info

lyric mountain
#

I'm still analyzing the sql u sent earlier

#

it outputs the desired result right?

neon leaf
#

almost

#

build_count should be how much the version has in total, not just for the type

#

66 = all builds with type = FABRIC and version_id = 1.21.1

#

real number is 1298

#

for version_id = 1.21.1

lyric mountain
#

you dont happen to have a DML of your structure do you?

#

as in, the tables that are to be used

lyric mountain
#

the whole "same version id" comparison can be reduced to ```sql
WHERE b.type <> 'ARCLIGHT'
OR split_part(sb.project_version_id, '-', -1) = split_part(b.project_version_id, '-', -1)
OR split_part(sb.project_version_id, '-', -1) NOT IN ('forge', 'neoforge', 'fabric')

#

even better if you make those split_part as select fields instead of repeating

neon leaf
#

thats fancy

lyric mountain
#
SELECT b.*
     , last_value(b.version_id) OVER (PARTITION BY b.type, b.version_id, b.project_version_id ORDER BY b.id) AS latest_build
FROM builds b
INNER JOIN minecraft_versions mv ON mv.id = b.version_id
INNER JOIN project_versions pv ON pv.id = b.project_version_id
``` something like this?
#

it'll get the latest build separated by type, version and project_version

neon leaf
#

project_versions table doesnt have any useful information, thats why the query has stuff like version2 created which uses the min(created) of all builds for type + projectver

#

very cursed db schema

#

out of curiosity though, what does the partition by do

lyric mountain
#
SELECT b.id
     , b.build_number
     , b.changes
     , b.created
     , b.experimental
     , b.installation
     , b.jar_size
     , b.jar_url
     , b.project_version_id
     , b.type
     , b.version_id
     , b.zip_size
     , b.zip_url
     , count(1) OVER w AS build_count
     , min(b.created) OVER w AS version2_created
     , mv.type AS version_type
     , mv.supported AS version_supported
     , mv.java AS version_java
     , mv.created AS version_created
     , last_value(b.version_id) OVER w AS latest_build
FROM builds b
INNER JOIN minecraft_versions mv ON mv.id = b.version_id
WINDOW w AS (PARTITION BY b.type, b.version_id, b.project_version_id ORDER BY b.id)
#

should output everything in the json u sent, separated by type, version_id and project_version_id

neon leaf
#

that as the entire query?

lyric mountain
#

yes

lyric mountain
neon leaf
lyric mountain
#

imagine you have 5 cars:

  • Model A, blue
  • Model A, red
  • Model A, blue
  • Model B, blue
  • Model C, white
#

if you want to count how many cars you have separated by model, you cant just do count(1) cuz it'd be 5 (total of results)

#

so u do count(1) OVER (PARTITION BY model)

#

which would have a separate counter for every model

neon leaf
#

ahh

lyric mountain
#

so it'd output

  • 3
  • 3
  • 3
  • 1
  • 1
neon leaf
#

whats the difference to distinct then

lyric mountain
#

distinct excludes identical results, partition "segregates" them

neon leaf
#

ahhhh

lyric mountain
#

basically the former pretends they dont exist, the latter acknowledge they're of a different group

#

equivalent to GROUP BY but on a window

lyric mountain
neon leaf
#

the query return 121 rows

lyric mountain
#

how many are expected?

neon leaf
#

well what exactly does the query do now

earnest phoenix
#

help bruh

#
getServerData: async function(id) {
            if (!db) x.database.prepare();
            try {
                id = String(id).trim(); // Ensure consistent formatting
        
                console.log("Searching for server_id:", id);
                const res = await db.query("SELECT * FROM servertable WHERE server_id = $1", [id]);
                console.log("Query result:", res.rows);
        
                if (res.rows.length > 0) return res.rows[0]; // Found existing server
        
                console.log("No existing server found. Creating new one...");
                const createRes = await db.query("INSERT INTO servertable (server_id) VALUES ($1) RETURNING *", [id]);
                return createRes.rows[0];
            } catch (err) {
                console.error("Error in getServerData:", err.message);
                return null;
            }
        },
lyric mountain
#

it returns all builds, with info about how many builds, latest date and latest version for that group

earnest phoenix
#

i asked chatgpt dont ask console.logs

#

i asked it cause it didnt work before

lyric mountain
#

I probably understood wrong

earnest phoenix
#

it just added logs

lyric mountain
#

what's the issue?

earnest phoenix
#

if i request server data it wont find it so it will create data for it

#

but it exists and it still creates another entry

lyric mountain
#

you're using postgres right?

earnest phoenix
#

yes

lyric mountain
#

dont use TEXT unless strictly necessary

earnest phoenix
#

why

#

is it buggy?

lyric mountain
#

text is a special type of string that's stored off the table

#

it's not buggy, but it's one of the slowest types of string

#

you're only supposed to use it when text length is unknown and expected to be big

#

discord ids are of a known length and short

earnest phoenix
#

soo

#
ALTER TABLE IF EXISTS public.servertable
    ADD COLUMN server_id bigint;

?

lyric mountain
#

can be yeah, since it's guaranteed to be within bigint range

#

tho u still need to get rid of the old column

earnest phoenix
#

i did

lyric mountain
#

what does console.log("Query result:", res.rows); show in the console?

earnest phoenix
#

it does not log

lyric mountain
#

nothing?

#

did you save your file?

earnest phoenix
#

doesnt log

neon leaf
# lyric mountain it returns all builds, with info about how many builds, latest date and latest v...

need a query that returns 2 rows, 1 for the current build and 1 for latest, "latest" is a build with the highest id for a query of b.type = current.type and coal(b.version_id, b.project_version_id) = coal(current.version_id, current.project_version_id)

then I also need version info using version_id if not null (type, supported, java, created) and finally build count (b.type = current.type and coal(b.version_id, b.project_version_id) = coal(current.version_id, current.project_version_id)) and created2 for min(created) on builds (b.type = current.type and coal(b.version_id, b.project_version_id) = coal(current.version_id, current.project_version_id))

earnest phoenix
#

wait im an idiot

#

i used createServerData instead

#
Searching for server_id: 1350552474271875300
Query result: [ { id: '11', server_id: '1350552474271875300', prefix: '!' } ]
lyric mountain
# neon leaf need a query that returns 2 rows, 1 for the current build and 1 for latest, "lat...
CREATE OR REPLACE VIEW build_data AS
  SELECT b.id
       , b.build_number
       , b.changes
       , b.created
       , b.experimental
       , b.installation
       , b.jar_size
       , b.jar_url
       , b.project_version_id
       , b.type
       , b.version_id
       , b.zip_size
       , b.zip_url
       , count(1) OVER w AS build_count
       , min(b.created) OVER w AS version2_created
       , mv.type AS version_type
       , mv.supported AS version_supported
       , mv.java AS version_java
       , mv.created AS version_created
       , last_value(b.version_id) OVER w AS latest_build
       , coalesce(version_id, project_version_id) AS query_id
  FROM builds b
  LEFT JOIN minecraft_versions mv ON mv.id = b.version_id
  WINDOW w AS (PARTITION BY coalesce(version_id, project_version_id) ORDER BY b.id);

SELECT * FROM (
  SELECT * 
  FROM build_data 
  WHERE type = :TYPE
    AND query_id = :VERSION
  ORDER BY id
  LIMIT 1
)

UNION ALL

SELECT * FROM (
  SELECT * 
  FROM build_data 
  WHERE type = :TYPE
    AND query_id = :VERSION
  ORDER BY id DESC 
  LIMIT 1
)
``` would this work?
earnest phoenix
#

the backend works

lyric mountain
#

gotta confess, it's kinda hard without the data at hand to see the outputs

lyric mountain
earnest phoenix
lyric mountain
#

I forgot whether limit affects windows

lyric mountain
#

is build_count supposed to consider only versions of the same type and project_id?

neon leaf
#

type + coal(b.version_id, b.project_version_id)

lyric mountain
#

well, how many builds are there for that combo?

neon leaf
#

1298

lyric mountain
#

oh wait, remove PARTITION BY b.type, b.version_id, b.project_version_id

#

since it's already being filtered anyway

neon leaf
#

now all rows have a different amount, the last one has 66

neon leaf
#

I meant only coal(b.version_id, b.project_version_id)

#

type ignored for build count

lyric mountain
#

see now, updated the message

neon leaf
#

Query 1: ERROR: missing FROM-clause entry for table "b"
LINE 31: SELECT * FROM build_data WHERE b.type = 'FABRIC' LIMIT 1

#

build_count is 2 now

lyric mountain
#

worth trying with a subselect

#

see now

neon leaf
#

1298

lyric mountain
#

is the rest correct?

neon leaf
#

well

#

Query 1: ERROR: syntax error at or near "UNION"
LINE 33: UNION ALL
^

#

is what happens when I add the union part

lyric mountain
#

I suppose it's due to the limit

#

put it in a subquery

#

SELECT * FROM (SELECT * FROM build_data LIMIT 1)

neon leaf
#

now I get returned one row

#

ok wrapped both

#

let me see

#

data seems correct

#

now whats needed is the arclight stuff for latest build (so suffix matches) and version data for null version_id

#

also what ive noticed is that this query is a lot slower than the original

#

(this one takes 3s)

#

(old one 20ms)

lyric mountain
#

yeah, it requires some optimization

#

use EXPLAIN before the query to see what's taking too long

neon leaf
#
  CTE build_data
    ->  WindowAgg  (cost=15277.87..2168709.78 rows=134 width=677)
          ->  Sort  (cost=15277.85..15278.19 rows=134 width=629)
                Sort Key: b.id
                ->  Nested Loop Left Join  (cost=297.37..15273.12 rows=134 width=629)
                      ->  Bitmap Heap Scan on builds b  (cost=297.08..15199.97 rows=134 width=614)
"                            Recheck Cond: (type = 'FABRIC'::server_type)"
"                            Filter: ((COALESCE(version_id, project_version_id))::text = '1.21.1'::text)"
                            ->  Bitmap Index Scan on builds_type_idx  (cost=0.00..297.05 rows=26767 width=0)
"                                  Index Cond: (type = 'FABRIC'::server_type)"
                      ->  Memoize  (cost=0.29..0.60 rows=1 width=23)
                            Cache Key: b.version_id
                            Cache Mode: logical
                            ->  Index Scan using minecraft_versions_pkey on minecraft_versions mv  (cost=0.28..0.59 rows=1 width=23)
                                  Index Cond: ((id)::text = (b.version_id)::text)
          SubPlan 1
            ->  Aggregate  (cost=16070.36..16070.37 rows=1 width=8)
                  ->  Seq Scan on builds bi  (cost=0.00..16068.58 rows=713 width=0)
"                        Filter: ((COALESCE(version_id, project_version_id))::text = (COALESCE(b.version_id, b.project_version_id))::text)"
  ->  Limit  (cost=0.00..0.02 rows=1 width=1476)
        ->  CTE Scan on build_data  (cost=0.00..2.68 rows=134 width=1476)
  ->  Limit  (cost=3.35..3.35 rows=1 width=1476)
        ->  Sort  (cost=3.35..3.69 rows=134 width=1476)
              Sort Key: build_data_1.id DESC
              ->  CTE Scan on build_data build_data_1  (cost=0.00..2.68 rows=134 width=1476)
JIT:
  Functions: 31
"  Options: Inlining true, Optimization true, Expressions true, Deforming true"```
lyric mountain
#

ugh, are you using intellij?

neon leaf
#

nope

lyric mountain
#

meh, else could've used the built in tool to beautify it

#

but well, lets see

#

first offender is the count on builds, so lets work on it

#

try that

#

do note it's now 2 queries

#

the with became a view

neon leaf
#

build count 830

lyric mountain
#

see now

neon leaf
#

830

lyric mountain
#

do a SELECT * FROM build_data WHERE query_id = :VERSION, see how many rows are returned

neon leaf
#

66

lyric mountain
#

without type

neon leaf
#

1298

lyric mountain
#

any variation in the build_count?

neon leaf
lyric mountain
#

take a look at version_id and project_version_id

#

do they vary?

neon leaf
#

project_version_id yes if no type

#

if type then yes too (goes oldesdt to newest ver)

lyric mountain
#

and version_id?

neon leaf
#

nope, that stays

lyric mountain
#

stays at what?

#

null or a value?

neon leaf
#

a value

#

same value

#

as query_id

lyric mountain
#

it doesnt make sense then for count not to be retrieving the total

#

sorry, this one is making my head smoke

neon leaf
#

same

#

im probably gonna work off of the original query

lyric mountain
#

aight, sorry for not solving this one

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

help

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

it just sends Channel 2 -> Channel 2 instead

sage bobcat
earnest phoenix
#

I have user phone.js

#

I want it so

#

Channel 1 -> Channel 2 and vice versa

#

But instead it does Channel 1 -> Null and Channel 2 -> Channel 2

#

Null being nothing it just does nothing if u send to channel 1

#

I asked gpt to slightly comment and log a lot for easier debug

#

The weird thing is it does debug correct things

#

But does nothing

neon leaf
#

@lyric mountain im not proud, but it works

            let query = sqlx::query(&format!(
                r#"
                WITH spec_build AS (
                    SELECT {}
                    FROM {}
                    WHERE {}
                    ORDER BY builds.id DESC
                    LIMIT 1
                ),
    
                filtered_builds AS (
                    SELECT {}
                    FROM builds b
                    INNER JOIN spec_build sb ON
                        sb.id = b.id
                        OR (COALESCE(sb.version_id, sb.project_version_id) = COALESCE(b.version_id, b.project_version_id) AND sb.type = b.type::text)
                    WHERE b.type <> 'ARCLIGHT'
                        OR split_part(sb.project_version_id, '-', -1) = split_part(b.project_version_id, '-', -1)
                        OR split_part(sb.project_version_id, '-', -1) NOT IN ('forge', 'neoforge', 'fabric')
                ),

                build_count AS (
                    SELECT count(*) AS count
                    FROM builds
                    WHERE COALESCE(version_id, project_version_id) = COALESCE((SELECT version_id FROM spec_build), (SELECT project_version_id FROM spec_build))
                )
    
                SELECT
                    *,
                    0 AS build_count,
                    now()::timestamp as version2_created,
                    'RELEASE' AS version_type,
                    false AS version_supported,
                    0 AS version_java,
                    now()::timestamp AS version_created
                FROM spec_build
    
                UNION ALL
    
                SELECT
                    x.*,
                    mv.type::text AS version_type,
                    mv.supported AS version_supported,
                    mv.java AS version_java,
                    mv.created AS version_created
                FROM (
                    SELECT *
                    FROM (
                        SELECT
                            {},
                            (SELECT count FROM build_count) AS build_count,
                            min(b.created) OVER () AS version2_created
                        FROM filtered_builds b
                        ORDER BY b.id DESC
                    ) LIMIT 1
                ) x
                LEFT JOIN minecraft_versions mv ON mv.id = x.version_id
                "#,
                Build::columns_sql(None, None),
                if search.hash.as_ref().map(|h| h.any()).unwrap_or(false) {
                    "build_hashes INNER JOIN builds ON builds.id = build_hashes.build_id"
                } else {
                    "builds"
                },
                where_clause.join(" AND "),
                Build::columns_sql(None, Some("b")),
                Build::columns_sql(None, Some("b"))
            ))
            .bind(identifier)
            .fetch_all(database.read())
            .await
            .unwrap();```
lyric mountain
#

nice

earnest phoenix
#

god sql is fast

#

its 10x faster than reading json

solemn latch
#

500x safer too

neon leaf
#

alr my ci finally built

#

time to deploy

#

and pray

earnest phoenix
neon leaf
# neon leaf and pray

mcjars-api_web exited with code 101
mcjars-api_web exited with code 101
mcjars-api_web exited with code 101
mcjars-api_web exited with code 101
mcjars-api_web exited with code 101

quartz kindle
earnest phoenix
#

i used guildMessageCreate instead of messageCreate

neon leaf
#

isnt actions for public repos supposed to be free 🤔

pearl trail
#

i don't think so, it still have the limit/month

#

macos takes 4 minutes quota in 1 minute iirc

neon leaf
#

ah

pearl trail
#

ah macos takes 10, sataniaMuahaha

#

but if im not mistaken, you can use your computers (and also mac) as runner right? and basically run it free

neon leaf
#

ye

#

ill do that once I get fiber

neon leaf
#
    io#println("CALLED!")

    fn say(self, text) {
        io#println(text)
    }
}

let instance = new A

instance.say("hello sir")
instance.say("get out")```

```root@remotedev:~/projects/0x7d8/bad-lang-2# cargo run -r testing/class2.bl2 
    Finished `release` profile [optimized] target(s) in 0.00s
warning: the following packages contain code that will be rejected by a future version of Rust: nom v1.2.4
note: to see what the problems were, use the option `--future-incompat-report`, or run `cargo report future-incompatibilities --id 2`
     Running `target/release/bad-lang-2 testing/class2.bl2`
CALLED!
hello sir
CALLED!
get out
root@remotedev:~/projects/0x7d8/bad-lang-2# ```

may be a good idea to redo how this works..
small tangle
#

so top level statements inside a class gets called everytime you access a class instance?

neon leaf
#

yes

#

i made it use a scope for instances now

#

so the code is only ran on construction and static calls

small tangle
#

interesting

neon leaf
#

very cursed

neon leaf
#
class A {
    io#println("CALLED!")

    let default = "no text buddy"

    fn say(self, text) {
        if not (text) {
            text = default
        }

        io#println(text)
    }

    fn set_default(self, text) {
        default = text
    }
}

let instance = new A
let instance2 = new A

instance.say("hello sir")
instance.say("get out")
instance.say()

instance.set_default("sus")
instance.say()

instance2.say()
root@remotedev:~/projects/0x7d8/bad-lang-2# cargo run -r testing/class2.bl2
    Finished `release` profile [optimized] target(s) in 0.00s
warning: the following packages contain code that will be rejected by a future version of Rust: nom v1.2.4
note: to see what the problems were, use the option `--future-incompat-report`, or run `cargo report future-incompatibilities --id 2`
     Running `target/release/bad-lang-2 testing/class2.bl2`
CALLED!
CALLED!
hello sir
get out
no text buddy
sus
no text buddy
root@remotedev:~/projects/0x7d8/bad-lang-2#
deft wolf
#

@solemn latch

#

marco was faster 😔

solemn latch
#

speedy marco

small tangle
#

called rennmaus for a reason Clueless

neon leaf
#
    io#println("CALLED!")

    if not (default) {
        default = "no text buddy"
    }

    fn say(self, text) {
        if not (text) {
            text = default
        }

        io#println(text)
    }

    fn set_default(self, text) {
        default = text
    }
}

let instance = new A("ye")
let instance2 = new A()

instance.say("hello sir")
instance.say("get out")
instance.say()

instance.set_default("sus")
instance.say()

instance2.say()```
looks cursed but I dont hate it
small tangle
prime cliff
#

Hey don't collapse that sidebar there's an ad!

lyric mountain
neon leaf
sharp geyser
#

it looks like rust

#

but not rust

#

Oh wait

#

this is js

#

or is it idfk anymore

neon leaf
#

its bad-lang-2

#

need to redo more class parsing

#

so that method calls work on unknown values

#

like ```
fn do_stuff(instance) {
instance.hi() // <-- error, "unknown expression" due to instance being null at parse-time
}

let ins = new ...()
do_stuff(ins)

delicate zephyr
#

so

#

8 to be exact

#

because otherwise jobs have to wait in line lol

pearl trail
delicate zephyr
#

yup

pearl trail
#

holy moly

thorny wadi
#

can i ask how long it takes to get to approve my discord bot i submited?

gilded plankBOT
#

@thorny wadi

topgg When will my bot be reviewed?

Our current average review time is 1–2 weeks.

Some bots may take longer to review than others depending on their features. Because of this, we can't guarantee your bot will be reviewed as quickly as someone else's, and there's no exact timeframe for approval. There's also no way to check your position in the queue — but remember, you're not first or last!

You're free to edit your bot's page anytime, both before and after review. This won't affect your place in the queue.

You can read more about our review process here: How the Reviewing Process Works.

topgg_ico_bulb In the meantime, please make sure your bot follows all of our Bot Guidelines for a quick and smooth approval!

thorny wadi
#

thx

neon leaf
#

7h to get classes working properly

#

and its not even that slow

prime cliff
#

WOOOO it fully works aside from the nav menu avatar is bugged
An alternative to Portainer with a bunch more developer tools being added.

prime cliff
#

Barely tested for mobile :p been trying to fix annoying small issues and docker setup xD

#

Lol how did they bypass invite detection

#

@solemn latch

solemn latch
#

Someone's script went a little off the rails

solemn latch
wheat mesa
prime cliff
#

Yea i'm insane xD i have a bunch of neat things to add

#

Kubernets support, Azure container support, Short links with customization, Website management, Project management, Pastebin with client side encryption, Status/Uptime monitoring with Discord notification, Image editing/generation, custom dashboards, code editor/formatter and Sentry alternative error logging.

frosty gale
#

just locked myself out of my server completely because i forgot messing with sudo file permission unsets its root bit, oops

:~$ sudo su
sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set
:~$ su
-bash: /usr/bin/su: Permission denied
:~$
#

doesnt help that i restricted su to root only as well

#

hopefully rescue mode will save me

crystal wigeon
#

has anyone used nestjs?

#

im writing a route to download .zip file from github im able to get the stream from github but the nestjs route fails and it crashes the app

neon leaf
#

finally got real expressions working

let a = 10

io#inspect(bool)

if (a >= 10) {
    io#println("hi")
}```
#

now I need to get stuff like &&, || working

pearl trail
#

you make your own language?

neon leaf
#

yes

#

interpreted

pearl trail
#

wow, so cool 👏

prime crescent
solemn latch
#

👀 that had to take so long to make

#

I need to get these skills, really cool

#

Idk if you want to share. But are the embeds just screenshots of discord? 👀

prime crescent
solemn latch
#

The layering is fantastic

#

This makes me want to make something like this, for fun

prime crescent
#

I can give u her @ if u want : P

prime crescent
solemn latch
#

My only real concern is width, I think you might want some custom css

prime crescent
#

im not very good with it xd

solemn latch
#

ignore the weird colors

#

my screenshot tool doesnt support hdr

prime crescent
#

Haha its fine

prime crescent
solemn latch
#

If I had more time I'd help with css, but today is a busy day 😦

prime crescent
#

Xd np, maybe a different day. Ill see if i can fix it myself.

#

Also do you know how long it will take for a bots name to change? I got it updated through support but doesnt look like its refreshed yet on the site.

solemn latch
#

refresh data should be pretty much instant

#

check it again ;p

#

thanks veld for fixing that ❤️

#

If you put the image in an image tag
<img href="https://i.imgur.com/PWs8NjZ.png" id="custom-banner" /> you can just use css directly on the banner.

<style>
#custom-banner {
   set sizing stuff
}
</style>
#

Thats all I can help with today though 😦

prime crescent
prime crescent
solemn latch
#

👀 its src not href, thats my fault

#

<img src="https://i.imgur.com/PWs8NjZ.png" id="custom-banner">

prime crescent
#

ah tyvm

#

got it fixed

#

!

#

ty

#

ill have to see about that momo though she looks a bit blurry

digital swan
#

yeah looks like you might need a higher resolution picture for it

#

looks blurry at that size

prime crescent
solemn latch
#

looks great 😄

prime crescent
# solemn latch looks great 😄

i agree, thanks for the help! updated the description to use html and look nicer as well.

think im finally ready to try my hand at some ads now.

neon flicker
#

Is there a decent guide for me to use while learning React.js? I'm trying to develop a bot with dashboard support after a few months and I already know JS, HTML & CSS

#

And I'm curious about something, is development on Discord pretty much "dead" nowadays?

solemn latch
#

discord updates stuff for bots all the time

#

so bot devs are always working on new things

neon flicker
#

Oh I mean, there are barely any new developers and the bot lists are pretty much also inactvie (Top.gg surely isn't as it is the biggest bot list on Discord)

#

Or it might be only Turkey which I'm a citizen of, but it used to be like a lot more active here

solemn latch
#

👀 we're not inactive

neon flicker
#

"Top.gg surely isn't as it is the biggest bot list on Discord" 🙏

solemn latch
#

I know nothing about other lists tbh, but we've not really seen a decline in activity. If anything we have more activity.

#

We just had to hire more bot reviewers

#

Pretty much doubled in size volunteer wise

#

So idk about discord as a whole, but we're growing.

prime cliff
neon flicker
#

Yes, but it has still been in the same way ever since the ban wasn't a thing

prime cliff
#

Well no wonder why you feel it's inactive if your fellow people cant access Discord xD

neon flicker
#

I've always felt in the same way for like a year or so, when Discord was not banned

#

Yet I still think it's mostly valid for Turkey as people used to look for templates to learn how to code and develop, however I can't see any servers dedicated on this anymore (either anyone looking for them)

#

But the issue is that I also can't see anybody trying to develop their own projects without using any templates

#

Other bot lists are also more inactive overall

prime cliff
#

Bot lists and general users don't really like templated bots either fyi

prime cliff
#

You need to make something good and unique to get better at development

neon flicker
#

Or something that is actually useful

#

An addition, it isn't really possible to be unique in 2025 as there are thousands of bots that are dedicated on different fields

prime crescent
# neon flicker Oh I mean, there are barely any new developers and the bot lists are pretty much...

Im a fresh dev! : P And from what i gather the space is pretty healthy i cant lie, lots of users looking for bots but also good room for new and innovative bots. I think its probably the same as any tech space, where at the start you could get very big simply just building a bot. But now if you wanna get big you will need to make a quality product.

And development on discord isnt dead at all, lots of profit in it if thats what youre worried about. Just gotta find your niche.

prime crescent
prime crescent
bitter sand
#

Hello

vital mirage
#

Dont you just love it when you let a project sit for a month and come back and all of the sudden it throws 20 different errors when it worked the last time you touched it

sharp geyser
#

or perhaps the reason you left it for a month is because of those 20 errors that you didnt feel like fixing

#

It seldom just breaks unless you've updated packages

pearl trail
sharp geyser
#

I'm sure i've asked this before. Though ima ask again cause I cant find my question or any answers to it.

How do you web devs usually make scrollable content?

#

Is it just a bunch of divs with 100vh added to it

humble gyro
#

what isnt a bunch of divs

sharp geyser
#

YOU KNOW WHAT I MEAN

prime cliff
queen needle
#

😧

humble gyro
#

wooooooooooooo

prime cliff
earnest phoenix
#

guys what is a shard

crude vale
earnest phoenix
#

oh

#

i have 4 servers 😭

crude vale
#

Yeah, no need to implement it

solemn latch
sharp geyser
#

Nah

solemn latch
#

Your content should define how tall the page is

quartz kindle
sharp geyser
#

Trying to round a rectangular image and this shit just aint working

#

These are the css properties im applying

#

I assume its a height diff and the fact im hiding overflow

#

I fixed it

lyric mountain
#

Can't u just use border radius?

sharp geyser
#

Not really

#

because its not square it can't be formed into a "perfect" circle

#

It will turn into a pill shape

#
<div className={"w-[256px] h-[256px] relative overflow-hidden rounded-full"}>
  <img src="/assets/introduction-picture.jpg" alt="Picture of me" className={"h-full w-full object-cover"}/>
</div>
#

This is what I ended up doing

lyric mountain
#

Hm, u can put it as a background image of a div, center and use border radius

sharp geyser
#

I still needed to make use of overflow and object-cover

sharp geyser
#

Would not not just result in the same pill shape

lyric mountain
#

Nope, u set the shape with div size

sharp geyser
lyric mountain
#

Can use aspect ratio to guarantee a square too

sharp geyser
#

Can you show me an example?

#

I've not seen this before

#

Still new to web dev and anything css related

#

aha

lyric mountain
#

At mobile atm

sharp geyser
#

Ah damn

#

Okay

#

Well what im doing right now seems to work, but when you are free can you send an example of what you meant?

lyric mountain
#

But basically u set background-image: url(theimage)

sharp geyser
#

I'd like to learn a new way

lyric mountain
#

Then aspect-ratio: 1 on the div

#

Border-radius: 100%

sharp geyser
#

Interesting

#

let me try

lyric mountain
#

Background-size: cover

#

Then you need to set either height or width of the div

#

Else it'll have no size

#

Oh and background-position: center

sharp geyser
sharp geyser
#

Yes that makes it look so much better

#

😭

#

Honestly better than what I had previously

#

Top is your method, bottom is mine.

lyric mountain
#

Css is funny to work with

sharp geyser
#

Looks about the same now that I am clearly looking at it

#

but yours is cleaner

sharp geyser
sharp geyser
#

Right i'm not feeling the scheme anymore

#

I think its too prominently purple

#

I dont know what to make the background

#

Color theory isnt my strong suite

#

Does this look much better guys?

#

Not so "dominant" and more muted

#

and the red is a nicer contrast to the lighter purple

#

@solemn latch you've used shadcn right?

#

How is the button styled do you know?

#

I cant find the correct class to change

#

if need be I will just apply a bg myself but I'd like to change the color of all buttons I end up using

#

Ah its the bg-primary class

#

sorry for ping

solemn latch
#

you're fine 😄

sharp geyser
#

God

#

color design

#

I hate it

humble gyro
#

if you're gonna use a picture make sure to get a good shot, otherwise it doesn't pay off

prime cliff
#

Nah i think his image is fine it dosen't scream desperation

delicate zephyr
humble gyro
#

Your portfolio is like a business card imo

#

bike adds some flair to it since it gives you some personality :)

delicate zephyr
#

No like, I have rarely any with my face in LuL

prime cliff
#

My "portfolio" (main website) has a jankier hairline than me and that's impressive

humble gyro
#

😂

pearl trail
delicate zephyr
#

it shouldnt lmao

#

or what do you mean

pearl trail
delicate zephyr
#

I know why it happens

#

They’re folllowing the links to preload pages

prime cliff
#

Why are you preloading your cv 001_NK_XD

pearl trail
#

it's not really a big deal but yeah

delicate zephyr
#

it's a static file

#

its because I made it a link

prime cliff
#

You mean in the hader or? links by default are not preloaded

delicate zephyr
#

I know it's an anchor in browser

#

thats the first time ive ever seen that happen tho

prime cliff
#

It's not happening on firefox or chrome so ThinkEgg

pearl trail
#

only for idm users with idm extension

delicate zephyr
#

Oh

#

internet download manager

prime cliff
#

Why are you using an extension to download files...

#

What even...

#

Also it says IDM has an auto download feature

clear kite
neon leaf
pearl trail
prime cliff
#

God nextjs is so annoying

#

Annoying as fk embeded script spam

#

And random events on elements that dont do anything

digital swan
#

sveltekit 😋

prime cliff
#

??? why is a mouse enter event on the main root html opening a context menu, especially when there is none to begin with

humble gyro
#

yo, does anyone know the validation/structure around discord invites?

sharp geyser
#

As in what?

pearl trail
crystal wigeon
#

Do bots read your ip?? Is it possible to ip ban someone? Isn’t reading ip against discord tos

acoustic bough
#

bots do not have access to user IPs

sharp geyser
#

Uhm, bots cannot see your IP no

acoustic bough
#

(outside of websites)

crystal wigeon
#

Then how can someone be ip banned from a bot

sharp geyser
#

bans are issued based off IP though

crystal wigeon
#

Like on discord

sharp geyser
#

but only discord has access to this information

crystal wigeon
#

It’s a discord bot not discord itself

#

yeah

sharp geyser
#

It depends

#

Did you visit their site and link ur discord?

crystal wigeon
#

on?

#

Nop

#

They got no website

sharp geyser
#

Then they didn't IP ban you

#

Unless you visited something external that they control

#

discord doesn't give that information out

crystal wigeon
#

Ig not me btw some dude was saying he got ip banned from a bot so was wondering how that’s possible

#

Even if he ip banned on website if he uses discord to access the bot they won’t be able to detect it’s him no?

#

so didn’t make sense to me

sharp geyser
#

Again, its not possible unless they visited something external and logged in with discord

#

then they'd be able to "ip" ban them, but all it is just keeping track of their discord

crystal wigeon
#

Gotcha, thanks

sharp geyser
#

IP doesnt really have anything to do with it here

amber rose
#

Add a thumbs up reaction if you use CommonJS

white gyro
#

discord doesn't give out that information but if they have a website dashboard they could get your ip. It's probably against discord tos if they don't mention it in their privacy policy. But banning your account (with your user id) is easy to do and likely what happened.

acoustic bough
sharp geyser
#

You can store IPs up to a certain period of time afaik

frosty gale
#

ipv4 ips are almost becoming meaningless nowadays since we've ran out of them

#

most residential connections share ips which rotate regularly

solemn latch
#

Ipv6 really needs to be more popular. Soon™ I hope

sharp geyser
#

Its gaining traction

#

It has no other choice

prime cliff
#

vibecat hell yea remote docker container info and start/stop

prisma nebula
#

hey

#

anybody can help me make my cmd user installable

#

still havent understood the system

solemn latch
#

Its a setting on the discord developer dashboard

prisma nebula
#

i have to add a code or smtng

#

as i have read

knotty night
gilded mulch
#

Anyone help to get rid of it

knotty night
neon leaf
#

added importing 🔥


let _ = new Webserver()```

definitely not cursed that it turns any imported code into a class because classes can contain anything so no runtime changes needed
in this case, `new Webserver()` just executes all code inside samples/webserver.bl, because code in the root of a class is ran on construction
sharp geyser
lyric mountain
#

well, better than executing everyting inside on import

neon leaf
#

well this lang doesnt support dynamic imports (yet)

#

all imports are handled by the parser currently

#

which just launches another parser for that file

#
if segment.starts_with("import") {
            let parts: Vec<&str> = segment.splitn(4, " ").collect();
            if parts.len() != 4 || parts[2] != "as" {
                panic!("invalid import in {}", self.location);
            }

            let name = parts[3];
            let file = self.parse_expression(parts[1]);
            if let Some(file) = file {
                if let ExpressionToken::Value(ValueToken::String(string_token)) = file {
                    let class = ClassToken {
                        name: name.to_string(),
                        args: Vec::new(),
                        body: Arc::new(RwLock::new(Vec::new())),

                        location: self.location(),
                    };

                    let file = std::fs::read_to_string(&string_token.value);
                    if let Ok(file) = file {
                        let mut tokenizer = Tokenizer::new(&file, &string_token.value);
                        tokenizer.parse();

                        for token in tokenizer.tokens {
                            class.body.write().unwrap().push(token);
                        }
                    } else {
                        panic!("unable to read file \"{}\" in {}", string_token.value, self.location);
                    }

                    let token = Token::Let(LetToken {
                        name: name.to_string(),
                        is_const: true,
                        is_function: false,
                        is_class: true,
                        value: Arc::new(RwLock::new(ExpressionToken::Value(ValueToken::Class(
                            class,
                        )))),
                    });

                    return Some(token);
                } else {
                    panic!("unexpected value in {} (did you typo?)", self.location);
                }
            } else {
                panic!("unexpected file in {} (did you typo?)", self.location);
            }
        }```
lyric mountain
#

it's best not to have imports executing code imo

#

one because it allows cyclical imports, two because it avoids import attacks

neon leaf
#

yea

wheat mesa
#

(I know you’re doing this for learning purposes but it might be worth looking into later)

neon leaf
#

yeah, I think an ast would help with stuff like chained calling <instance>.method().property or whatever

#

I dont really know how to start though

wheat mesa
#

Read a book called “crafting interpreters”

#

It’s free online and it’s an insanely good intro to compilers

#

Very easy to follow even with no experience, I was able to do it in high school when I knew pretty much nothing

neon leaf
#

alr ill take a look

#

thanks

wheat mesa
#

There is also the gold standard that has been used in CS for a looooong time called the “dragon book”, but it’s much more notationally complex and more difficult to follow, but if you want to go highly into depth it might be worth checking out

#

I haven’t personally read it but I know it’s one of the most famous compiler books ever written, only glanced through it

eternal osprey
#

Hey is it possible for a discord bot to strram video

#

Stream

knotty night
#

Hello! Good question, I don't think it is. But let me look into this for you.

#

Afer checking, it appaears it is not only audio.

deft wolf
#

Bots can't, selfbots can

delicate zephyr
#

thats fucking sick dude

#

keep up the good work

eternal osprey
#

I thought discord didnt support it

deft wolf
#

They are against ToS

eternal osprey
#

😕

lament rock
#

Self bots are against the ToS, but that doesn't stop people from using them especially with client brandings meant for bots so they know the moment you attempt to make a request/connect. Though I will only say from personal experience and not to encourage self botting, but I generally haven't seen them take action against people I know who did do it unless they were being a nuisance with it.

Though for your case, the whole video streaming API is totally undocumented and to replicate the client's behaviour, you'd have to inspect packets

vivid fulcrum
#

^ not worth the hassle

prime cliff
#

Yea video streaming for bots is not supported at all but i do know some mad lad actually managed to do that before Discord patched it xD

delicate zephyr
#

could also just use actvities now tbh

wheat mesa
#

Undocumented APIs are also subject to change at any given time. It is very difficult to maintain

prime cliff
#

LUL found it

solemn latch
#

Fun

lament rock
#

insane

#

I know someone who found out how to refresh cdn files with a bot. The token doesn't need to have a presence in the channel the file is in and you don't need the link params for expiration and all that iirc

digital swan
#

yeah a while ago i found a website that did it for you for free

#

but i've lost it

lament rock
#

❤️‍🔥

deft wolf
#

I have a page like that myself

#

There is a github repo about this

digital swan
#

this?

deft wolf
#

It's probably working the same way but I found different one

solemn latch
#

I love how people found work arounds but I don't understand why bother.

#

Just host the files you need ^-^

deft wolf
#

Honestly? Out of curiosity and sometimes it's useful when I find an old link on a forum or something and I want to see what's behind it

#

I even have some false memory that this endpoint was in the Discord API documentation at some point

lyric mountain
#

I really hate this new policy, my users tend to use discord images' url for their profiles but they always expire after a day or so

neon leaf
#

why not store them yourself

lyric mountain
#

advised them to use external image hosts, but alas they cant bother

lyric mountain
elfin helm
#

do testers usually leave reviews?

delicate zephyr
#

but as I needed assistance from the team testing it a few of us jumped in and had a blast playing so me and fellin found it fitting to drop a review

eternal osprey
#

hey i am using typescript but don't want to continously compile it with tsc ..... each time i update the files.

#

Is there like any watcher or automatic compiler?

delicate zephyr
#

Uhhh

#

I use npx tsx <path to entry file>

uncut briar
#

tsc has a watch param afaik

eternal osprey
#

i see, so npx is the watcher?

#

thank you!

eternal osprey
delicate zephyr
#

like ts-node

#

npx is just npm but executes the cli package

#

tsx allows you to run the typescript without having to compile it every time

#

cause it compiles on runtime

lyric mountain
#

x stands for execute usually

ivory cloak
#

guys why discord bot aint adding to my server?

lyric mountain
#

either you dont have moderator role, the bot reached server cap or they purposely made the bot leave servers on join

frosty gale
#

discord bot did not consent

eternal osprey
#

i would need that tsx

#

cuz i am sick and tired of re-running tsc each time lmao

delicate zephyr
#

yea thats fair

eternal osprey
#

what the fuck happened with the discord ui

#

its all ugly now

#

tf

quartz kindle
#

welcome to 2025

proven lantern
#

they didnt change anything

quartz kindle
sharp geyser
#

I mean it was ugly at first

#

but its already grown on me

#

at the end of the day im here to talk to people

#

so long as I can still communicate idc

proven lantern
#

looks fancy

#

i sold my first discord consumable yesterday

#

much success

quartz kindle
sharp geyser
#

rip

quartz kindle
#

imagine they removed text chat altogether

#

and make it voice only

sharp geyser
#

I'd be okay with that

#

Forces people to actually talk

#

💀

quartz kindle
#

also

#

they make it autoconnect

#

as soon as you open the server

#

and remove the mute function

real rose
#

teamspeak direction

sharp geyser
#

pov new nitro plan that costs 12.99 and the only new thing it has is a text chat feature

prime cliff
solemn latch
#

teamspeak is on version 5 going into 6

#

wtf

#

you need an account for beta 😦

#

teamspeak is weird now

acoustic bough
neon leaf
acoustic bough
solemn latch
#

Best version

hollow briar
deft wolf
#

Sounds like something illegal

hollow briar
#

and that's the funniest part

#

Anyway I don't think we should be talking about that here

deft wolf
#

Ah, you still have those old prices

#

Yea, then it's fine

#

I thought you bought it from some shady store or something like that where they are usually stolen

#

Also it's 20pln, not 10

#

So you are paying 2.6x2

hollow briar
#

Basically half the price

earnest phoenix
#

time for vencord plugins devs to make a og discord ui plugin

acoustic bough
#

for now you can just toggle the experiment

#

until it gets removed

surreal sage
#

uhhh

#

ran pnpm i twice after each other, no changes in between

pearl trail
#

what are you trying to do

frosty gale
#

i wouldnt want 5 new libraries installed after running a second npm i 5 seconds apart

surreal sage
#

nono like

#

it says it added the same packages

#

every time

#

it normally would just say lock file is up to date and that's all

frosty gale
#

maybe they just made it so it prints all packages now

sharp geyser
#

Current progress. Fully responsive

#

Spent a good hour making everything responsive

#

I really do not like frontend work val_Sadge

prime cliff
#

Woooo lets go basic documentation with features and install vibecat https://docs.fluxpoint.dev/devspace

The all-in-one developer dashboard with features for server management using docker, account management with 2FA app/passkeys and future tools for websites/projects/logging/status and image gen.

sharp geyser
#

Good job mate

frosty gale
#

once you get into the habit of letting the browser choose the best width/height responsiveness wont be all that much of a hassle (minus stuff like optimizing sidebars for mobile)

quartz kindle
acoustic bough
#

one is prob supposed to be JavaScript

sharp geyser
#

Not even sure myself

#

That was really late

charred nest
#

ur just that extra proficient in java

wheat mesa
#

Web dev is the bane of my existence despite doing it every day

prime cliff
#

Css will haunt you in your dreams ooga booga

wheat mesa
#

Thank god I don’t do much CSS

vivid fulcrum
#

but the progress bars for skills are pointless

#

it has no meaning, better to just list technologies you're proficient at

#

don't overdo it though, that was a mistake I did on my previous CVs

hollow briar
#

It's called desktop refresh I believe. Set it to not eligible

#

And you're good

jolly vapor
#

i have a question my bot has a command that create a new category and new channel for users but without admin perm the command not working
so
creating category in discord need admin perm??

deft wolf
#

Not really

#

Admin just gives you all permissions and ignores any channel permission overrides

jolly vapor
#

no even if i gave it all permission except admin perm its telling missing access

prime cliff
#

Creating category needs manage channel perms also you can't be doing it right if it's saying missing access unless you're doing something weird with roles that are above your bots current top role

frank thicket
crystal wigeon
#

hey, has anyone used nextjs app router with cloudflare pages? Im using export const runtime = "edge"; like it says in the docs but the page fails with internal server error for some reason. Im using server action to make api calls but it works on static page but not in a dynamic page like /blog/[slug] any idea how to debug or fix this?

prime cliff
#

If it's an internal error then usually you would check some kind of logs that shows the error or something on cloudflare?

crystal wigeon
#

its in the browser

prime cliff
#

Open up browser console see the errors and network requests that fail

crystal wigeon
#

I navigate to a page and this is what it shows

#

nothing else. there nothing in network tab

#

the cloudflare page wont build if i remove edge runtime, but when i add it back this happens

#

maybe it has something to do with fetch? but the docs say fetch is supported

prime cliff
#

Whatever you're doing in the oauth or api is causing the error

crystal wigeon
#

i tried add edge runtime to a page that works. and that page broke after adding it

crystal wigeon
#

thats open to public

#

both test and oauth

prime cliff
#

What is oauth-microservice then?

crystal wigeon
#

these are blog pages

#

its a blog page

#

its a page like /blog/[slug]

#

so the home page works and when i added edge runtime and it broke with same error message

prime cliff
#

Is your page format broken or something that's causing the page to break i think you're missing something here if only specific pages are breaking

crystal wigeon
#

its all the dynamic pages that have export const runtime = "edge"; that are breaking

#

i added export const runtime = "edge"; to a static page and it broke but if i remove the static page works

frank thicket
#

It's an issue with the runtime being "edge", which is specifying the EDGE browser.

crystal wigeon
#

so idk whats going on here

#

??

#

its edge runtime not edge browser.

frank thicket
#

let me try something

prime cliff
#

Is there no build issues, logs at all for this or cloudflare pages?
Seems a bit silly that you're using something that can just randomly break and throw generic "Internal error" without any way to fix it xD

crystal wigeon
#

yeah there sadly no logs. im checkout CF console for logs now.

#

its basically breaking if i use edge runtime

frank thicket
#

Um, Cloudflare.. Are y-.. Are you feelin' alright..?

stark nymph
#

Are we able to test the API with a bot that's in verification?

knotty night
#

You are not.

stark nymph
#

damnn ok thx

#

I guess I'll just code it blindly, how do we tell whether a user voted today or not? Do we just have to check "every day"?

#

And if the number increases, then that's a vote for the day

knotty night
#

A vote sends a post request to a webhook.

stark nymph
#

ah nvm guess i just dont have that yet