#development

1 messages · Page 253 of 1

void storm
#

Which one should i use?

#

Couldn't get the whole thing.

#

There were a lot more of them.

quartz kindle
void storm
#

Thx.

past field
#

how’s emoji bingo looking?

void storm
#

Ok so i have another question.

#

Is it normal for 4 BOTS to be in the same channel and not all of them chat in one go?

#

Bc some do chat and some don't at other times.

#

Bc IDK if that's normal or not.

#

Hello?

#

Is anyone there?

#

.....

#

Hello?

past field
# void storm Hello?

someone will answer, i don’t have enough knowledge of what you’re doing to have any input sorry

void storm
#

I'll just be here.

#

Waiting.

#

I wonder when someone is going to be here. 🤔

#

Oh hey your here.

quartz kindle
quartz kindle
void storm
#

Well ig i'll be going then.

past field
#

have a good one

#

so anyways @quartz kindle you saw the emoji bingo!? cool right?

quartz kindle
#

i still think there are too many layers on them lel

#

i would fix the vertial centering and remove the white layer on the emojis

jovial palm
#

Hi, look like it dont send anything to the log did i do anything wrong about it?

const axios = require('axios');

const channelID = '1280677846372716674'; // Channel ID for join events

module.exports = (client) => {
  client.on("guildMemberAdd", async (member) => {
    const guildName = 'Bazaar'; // Hardcoded guild name

    try {
      // Fetch guild data from Hypixel API
      const response = await axios.get('https://api.hypixel.net/guild', {
        params: {
          key: process.env.HYPIXEL_API_KEY,
          name: guildName,
        },
      });

      const guildData = response.data;

      if (!guildData.success || !guildData.guild) {
        console.error('❌ Guild "Bazaar" not found or an error occurred. Please check the guild name.');
        return;
      }

      const onlineMembers = guildData.guild.members.filter(member => member.online).length;

      // Construct message content
      const content = `🟢 **${member.user.tag}** has joined the server! \nCurrently, there are ${onlineMembers} members online in the "Bazaar" guild on Hypixel.`;

      // Send message to the channel
      const channel = client.channels.cache.get(channelID);
      if (channel) {
        channel.send({
          content: content,
          username: 'Guild Bot',
          avatarURL: 'https://pbs.twimg.com/profile_images/1346968969849171970/DdNypQdN_400x400.png', // Hypixel logo for the avatar
        });
        console.log(`Member joined: ${member.user.tag}. Message sent to channel ${channelID}.`);
      } else {
        console.error(`❌ Channel with ID ${channelID} not found.`);
      }
    } catch (error) {
      console.error('Error fetching guild data or sending message:', error);
    }
  });
};
jovial palm
#

i try rejoin it myself it dont send anything

solemn latch
#

What is the api fetch even doing? 👀

#

Also, do you have the intent enabled?

jovial palm
solemn latch
#

I think that's a privileged intent, so you need to add it in the discord dashboard

jovial palm
#

for hypixel

solemn latch
#

I don't see it being used anywhere in your code

jovial palm
#

um

quartz kindle
jovial palm
#

is there a way to bypass the key throttle

quartz kindle
#

unless you have multiple keys and you swap between them, but that is likely against their tos and can get you ip banned

jovial palm
#

usally the 429 it last for how long?

quartz kindle
#

you need to use caching for data that is unlikely to change

quartz kindle
#

or check response headers

jovial palm
#

'retry-after': '35',

quartz kindle
#

to see if its seconds, or minutes

jovial palm
#

ok

quartz kindle
#

why are you fetching always the same guild tho?

jovial palm
#

i want it show my guild

quartz kindle
#

but is the data going to change?

#

because if its always the same data, just fetch once and store in a variable

jovial palm
quartz kindle
jovial palm
#

i set the interval make it find every 5 min

#
 Expires: 9/5/2024, 7:50:43 AM```
quartz kindle
#

better make it a regular interval

jovial palm
#

ok

jovial palm
quartz kindle
#

for example, on member join, check last time it was fetched, if over X time ago, fetch again, if not, get the previously fetched data

jovial palm
#

ok

surreal sage
#

can i rename the localhost hostname

#

like make it "lolcathost" or something silly

swift barn
surreal sage
#

nvm :3 hosts file drivers/etc hehe

timber hatch
#

are there any freelance nextjs pentesters in here? my web app is due to launch in a few weeks but want to ensure there are no vulnerabilities prior to launch (and fiverr has dreadful results)

pallid zinc
#

Im trying to setup a monorepo with turborepo it contains 2 apps one discord bot and another one is a express server and im using mongodb

I wanted to share the mongo schemas in my whole project hence i tried adding aliases with tsconfig with path and it wont work. There is no inline error shown on vscode but when i run it it says @model/user not found @model/* is in my tsconfig and it is referencing to the correct path too

Lemme know what im doing wrong and if i can do something better

Thank you in advance ☺️

lament rock
#

Not use mongo

surreal sage
#

tailwind mfs when they get this unreadable code

quartz kindle
#

you can add lolcathost 127.0.0.1 in your hosts file

#

oh nvm, you already answered it

#

:^)

surreal sage
#

hehehsgh

lyric mountain
pallid zinc
#

Avoid naming things

surreal sage
#

sx prop is just so convenient imo

quartz kindle
civic scroll
#

pensive

lyric mountain
#

I dont dislike it either

pearl trail
frosty gale
#

web devs realising they might as well have wrote the css themselves after adding 20 tailwind/bootstrap classes to one element to do something

eternal osprey
#

i added so many boostrap shit and then realized i had to manually write and override the bootstrap classes i was using for a large part

bronze shale
proven lantern
#

tailwind is better than using css

pearl trail
prime cliff
#

Looks inside tailwind
Css
wires

slender wagon
#

Is this bad or very bad

neon leaf
#

very bad

slender wagon
neon leaf
#

which location?

slender wagon
#

US but could also be EU

neon leaf
#

for us i dont really know anyone thats cheap except contabo

slender wagon
#

Thanks

#

What’s the best to show graphs on discord

#

Would it be canva

#

Or is there any lib

#

Its gonna be usage graphs with numbers daily

neon leaf
#

contabo usa was pretty okay for me

#

3 months no downtime

prime cliff
#

Contabos network is very poor performance for latency sensitive apps though like Discord bots

warm surge
#

novonode

neon leaf
#

datalix is half the price for 5950x

surreal sage
#

can we kill the people who decided to put fn left of control on thinkpads

lament rock
#

buy your own orange pi for $100 USD 8 core arm chip and 16GB of ram

#

Wont be breaking any cpu benchmark world records, but your applications shouldn't be CPU intensive anyways

proud plover
#

how to add this checkmark thing?

deft wolf
#

It's css

proud plover
#

:o I see

#

any docs for it or anything?

#

cuz I will have to learn css then ._.

deft wolf
#

You can just copy their css from the page or make your own

proud plover
#

:o oki ty

pearl trail
deft wolf
proud plover
deft wolf
#

You can use any html tag in the description (including the <style> tag but except <script> iirc)

proud plover
#

:o ty

lyric mountain
#

those will make topgg ignore whatever is inside

proud plover
#

:o oki ty

pearl trail
#

man dvw and dvh is 🔥 🔥 🔥

#

very useful for responsive site

lyric mountain
#

vw/vh is safer

pearl trail
#

that's for the backup yeah

lyric mountain
#

no, I mean, "d" units dont respect the actual window size

#

so you lose resposiveness if u dont use full screen browser

pearl trail
vivid fulcrum
#

does anyone have suggestions for tunneling services? I'm looking for something long lived. I want to tunnel my rpi which hosts a web UI for IoT. is cloud flare viable for something like this?

neon leaf
#

yeah you can use cloudflare tunnels for this

vivid fulcrum
#

great, thanks

past field
neon flicker
#

Whenever people submit a modal, the client event sometimes gets fired more than once for the same interaction, is it a problem regarding Discord API?

past field
radiant kraken
radiant kraken
pearl trail
radiant kraken
#

hm whats the difference

#

i only know px 😭

pearl trail
#

it's most used for mobile

#

vh is 100vh but address bar included. thus overflow-y is shown

#

idk the wording but that image should explain 💀

radiant kraken
#

huh

pearl trail
#

see the chat input

radiant kraken
#

yea

#

so when should we use lvh or svh lmao

thorn torrent
# pearl trail

Thank you for the clarification Now I will create a website 🥲✨

pearl trail
radiant kraken
#

you can just use dvh for that, no?

#

or even just 100%

pearl trail
#

i use dvh

pearl trail
radiant kraken
#

huh really?

pearl trail
#

yes

radiant kraken
#

i've been using 100%

#

😭

#

howw

neon leaf
#

100% is just 100% of the parent

#

100vh is 100% of the screen

pearl trail
radiant kraken
#

oooo icic

#

interesting

thorn torrent
quartz kindle
# pearl trail

in most cases svh is better, because dvh causes the screen to jank when you scroll on mobile

#

when the address bar is shown/hidden, the screen height is recalculated and the screen can shift in a janky way

pearl trail
#

oh

#

havent tried that

quartz kindle
# pearl trail havent tried that

check out this part of the video: https://youtu.be/veEqYQlfNx8?feature=shared&t=235

Conquering Responsive Layouts (free course): https://courses.kevinpowell.co/conquering-responsive-layouts

Join the Discord: https://kevinpowell.co/discord

Viewport units often feel like this cheat code that makes things so much easier when you first discover them, but they actually are problematic for a number of reasons, from creating horizon...

▶ Play video
quartz kindle
#

it has some cool stuff in there

pearl trail
#

i know him from web dev simplified (afaik) but never watched him

#

🔥

quartz kindle
#

nice

thorn torrent
#

@quartz kindle

#

How did you get the second signal?

quartz kindle
thorn torrent
quartz kindle
#

what is that?

thorn torrent
spark flint
#

...second signal?

#

those are badges

deft wolf
#

Badge

quartz kindle
#

ah the badge lol

quartz kindle
# thorn torrent 😐

discord gave those to the people who had verified bots in the first 6 months or so, when verification was released

#

they dont give those out anymore

thorn torrent
deft wolf
#

Yeeeeeees

thorn torrent
neon leaf
#

gotta love it when a free api is more profitable than a paid one

quartz kindle
#

after discord stopped giving them, people started buying and selling accounts that had it lmao

#

i've been offered like 1k+ usd in bitcoin, although it most likely was a scam

neon leaf
#

github ratelimited

quartz kindle
#

lmao

quartz kindle
neon leaf
#

github is trying to pull a docker image

quartz kindle
neon leaf
#

yeah it wants me to login with the main docker repo site

#

maybe nodejs has a mirror on ghcr

pearl trail
#

self host gitlab Troll

neon leaf
#

i have gitlab selfhosted

#

this project is half open source though so its on github

pearl trail
#

damn rate limited when pulling node

neon leaf
#

rip nodejs has no ghcr mirror for docker

#

gotta wait a bit then

quartz kindle
#

or... login at docker?

#

with a free account?

#

:^)

neon leaf
#

nah

#

dont want to make an account

quartz kindle
#

then wait 6 hours

#

huehuehue

neon leaf
#

( I reran it rn and it worked fine )

quartz kindle
#

damn, those 6 hours went by so fast

#

time is flying

neon leaf
#

true

quartz kindle
#

:^)

neon leaf
#

smh only 1 week of logs root@HDE-02:/srv/containers/mcjars-backend# du -sh logs 66M logs

neon flicker
neon flicker
#

This is the code, however I don't have the logs of the error

if(interaction.customId == "botmodal") {
  const botId = interaction.fields.getTextInputValue('botid')
  const prefix = interaction.fields.getTextInputValue('botprefix')
  const inviteLink = interaction.fields.getTextInputValue('botinvitation')
  const botLogChannel = client.channels.cache.find(channel => channel.id == BOT_LOG_CHANNEL)

  if(!botLogChannel) return interaction.reply({ content:"I couldn't find the bot log channel, please valid until this issue is fixed.", ephemeral:true })

  const currentBots = await botsTable.get("bots") || []
      const pendingBots = await pendingBotsTable.get("bots") || []
      const blacklist = await blacklistTable.get("blacklist") || []
      
      const botIsAlreadyIn = interaction.guild.members.cache.find(member => member.user.id == botId)
      const hasBot = currentBots.find(data => data.ownerId == interaction.user.id)
      const hasPendingBot = pendingBots.find(data => data.ownerId == interaction.user.id)
      const isBlacklisted = blacklist.find(data => data == interaction.user.id)

      if(botIsAlreadyIn) return interaction.reply({ content:"This bot is already apart of our server.", ephemeral:true })
      if(hasBot) return interaction.reply({ content:"You already have a bot in the bot list.", ephemeral:true })
      if(hasPendingBot) return interaction.reply({ content:"You already have a bot pending.", ephemeral:true })
      if(isBlacklisted) return interaction.reply({ content:"You're blacklisted from this server.", ephemeral:true})

  let response
  try {
    response = await axios.get(`https://discord.com/api/v10/users/${botId}`, {
      headers: {
          Authorization: `Bot ${TOKEN}`
      }
  });
  } catch(e) {
    console.log(e)
    return interaction.reply({ content:"Please enter a valid bot ID.", ephemeral:true })
  }

  const botData = response.data
  console.log(botData)
  if(!botData.bot) return interaction.reply({ content: "This ID does not belong to a bot.", ephemeral:true })

    const embed = new EmbedBuilder()
    .setTitle("Bot Submission")
    .setDescription(`<@${interaction.user.id}> submitted the bot ${botData.username}#${botData.discriminator}.`)
    .addFields(
      {name:"User", value: `${botData.username}#${botData.discriminator}`, inline:true},
      {name:"Prefix", value: `${prefix}`, inline:true},
      {name:"Invite Link", value: `${inviteLink}`, inline:true},
    )
    .setFooter({ text: client.user.username, iconURL: client.user.displayAvatarURL({ dynamic:true, size:1024 })})
    .setColor("#ffffff")
    .setTimestamp()
    .setThumbnail(interaction.user.displayAvatarURL({ dynamic:true, size:1024 }))

    /*
     pendingData {
     ownerId: userId,
     messageId: messageId,
     botId: botId,
     } 
     */

    const message = await botLogChannel.send({ embeds:[embed], components:[botLogRow] })

    const pendingData = {
      ownerId: interaction.user.id,
      messageId: message.id,
      botId: botId,
    }

    await pendingBotsTable.push("bots",pendingData)
    
    await interaction.reply({ content:"You've successfuly submitted your bot.", ephemeral:true })
}
}
#
await interaction.reply({ content:"You've successfuly submitted your bot.", ephemeral:true })

This is the line that throws the error

#

Okay, I just found that a BaseInteraction has the property method isRepliable(), which I can use to detect if the modal interaction was handled already

pearl trail
#

that only happen when building docker image wth

pearl trail
#

ok nvm

#

but does anyone know what this --provenance false do on docker build?

surreal sage
#

the fuck is this quality

neon leaf
#

lol

lament rock
#

The source quality can be anything

surreal sage
#

why is

#

wikipedia begging for donations

#

but when you look at their financials 2022-2023

#

they are

#

quite

#

okay

#

living

#

15 million in assets

#

2023

frosty gale
#

either side can scam each other

frosty gale
#

they apparently do it to make sure they have enough money for the future

surreal sage
quartz kindle
#

i've donated to wikipedia like twice i think

neon leaf
#

i've donated to tim iike twice i think

quartz kindle
#

<3

#

im playing around with the idea of setting up some sort of open source trickle down

sage bobcat
#

One message removed from a suspended account.

quartz kindle
#

like donations i get for XYZ open source project would have a part of it go to the maintainers of its dependencies, if any

neon leaf
#

I think that would turn into way too little at the end

quartz kindle
#

yeah, its a complicated thing

frosty gale
neon leaf
#

imagine a project with 800 dependencies + subdeps

#

and someone donates 1$

quartz kindle
#

:^)

quartz kindle
#

assuming 5%

sage bobcat
neon leaf
#

ye

#

too lazy to do it sometimes

frosty gale
#

they call it 5 dollars then they proceed to write it down as $5

#

dollar 5

#

... that includes me

quartz kindle
#

so each of the 800 dependencies gets 0.0000625, and then 5% of that, 0.000003125, goes to all of their subdependencies

#

:^)

sage bobcat
quartz kindle
#

i think commercial companies should to that tho

#

reserve a percentage of their profit to distribute among any open source libs they use

neon leaf
#

(that will never happen)

quartz kindle
#

unfortunately

frosty gale
#

difficult thing is open source was quite literally intended to allow for profit organisations to use the software for free

#

its not truly open source or free if you make exceptions

quartz kindle
#

yeah it wouldnt be by force

#

but it would be cool of they do it out of their own will

#

i will do it myself if my shit ever works out

#

at least to key stuff i use like better-sqlite3 and sqlite itself

sage bobcat
#

One message removed from a suspended account.

quartz kindle
#

makes his own sqlite to reduce dependencies and increase profit margins

frosty gale
#

they all use lib-sqlite or whatever its called

#

guess rust developers arent brave enough to make their own db from scratch

#

thats basically what recreating sqlite3 is

quartz kindle
#

lets recreate sqlite in pure js

#

:^)

earnest phoenix
#

lets recreate a js engine in pure js

lament rock
#

Me and a few dev friends once planned on writing a bot language with js as a backend which does a lot for you backed by low level api libs and also baked in hot reloading of files :)

neon leaf
#

(discord bot maker)

frosty gale
#

js sucks with handling raw binary which just happens to be a lot of the work databases do

#

your beautiful columns and rows get converted to disgusting looking binary all squeezed together in one file

quartz kindle
#

i mean, of course not as performant as c/c++/rust

#

but i dont think it would be orders of magnitude slower

frosty gale
#

no structs is the biggest issue, compilers optimize structs into offsets from a memory location

neon leaf
#

correct, it would be orders of universes slower (jk)

frosty gale
#

in js you cant do that

#

but i would be interested in seeing how it would perform

quartz kindle
#

you can store persistent arraybuffers of various sizes and read/write to them

wheat mesa
#

I’d imagine you’d have the same level of difficulty as building it in a lower level systems lang. it’s the theory behind making databases efficient that’s hard, not the language you use

frosty gale
#

i mentioned its easier since you dont have to worry as much when it comes to writing the query interpreter and network stuff

#

in js that would be a whole lot easier

wheat mesa
#

How?

frosty gale
#

dynamic data structures mainly

wheat mesa
#

Js doesn’t magically understand SQL by itself :p

#

Personally I’d say that nothing about it would be easier

frosty gale
#

ive wrote both versions so i have first hand experience, but sure

quartz kindle
#

you dont need to rely on dynamic data structures, you can make things faster with fixed structures like arrays and arraybuffers that never change sizes

frosty gale
#

not sql specifically but a query language nevertheless

wheat mesa
#

I’d imagine it would be harder because of no compile time type safety

frosty gale
#

thats one of it yeah

#

its difficult to convey into a sentence but its mostly the fact you can be a lot more careless and abstract in something like js

#

but when it comes to the actual db driver some principles remain the same like the need for structures to remain consistent in files

#

js cant really help out here

quartz kindle
#

creating new arrays, new objects, and especially new buffers/arraybuffers

#

js is often regarded as a slow language because people use it the same way they would do it in a different language

#

like how in C you define structs and then create instances of them when you need them, if you do that in js its gonna be terribly slow

#

js works much better then you move data without creating new structues

#

especially when working with buffers

lament rock
#

if only js had in/out params for functions

#

I hate creating objects for multiple values I want out

quartz kindle
#

well it does if you wrap them in objects

lament rock
#

Exactly what I do crycry

#

js' reference management is so close to perfect

quartz kindle
#

for small objects its not a big deal, js quickly optimizes stuff like return {a,b,c}

#

but stuff like buffers and uint8arrays are slow to create

neon leaf
#

thats why you reuse the same 1gb buffer everywhere 🔥🔥

quartz kindle
#

:^)

#

DataView for example is stupid slow to instantiate

#

i even asked voltrex about it and he didnt know how to answer lol

#

its literally faster to copy 10kb from one buffer to another, than create a new DataView on said buffer

#

i actually did this optimization in my etf lib lmao

lament rock
#

Pretty sure cloudstorm's flavor of etf still uses a DataView

#

time to switch to wetf

quartz kindle
lament rock
#

oh lawd

quartz kindle
#

if data is smaller than 12kb, copy it to the existing 12kb buffer that already has a DataView attached

#

lmao

lament rock
#

Why 12KB?

quartz kindle
#

i tested it, thats was more or less the breakpoint where the copy is still faster

#

at 13k+ copy starts getting slower than creating a new DataView

#

but this can change between engine versions and environment

#

i tested on both node and chrome/brave

lament rock
#

I mean, node is all I care about

proven lantern
#

aws is so tricky sometimes

#

4.2 gb. it stores every diff so you can revert back or something

frosty gale
#

get to work on it

past field
#

hey tim! check me out

#

my new red light green light game

quartz kindle
#

seems like a lag fest tho, especially for people with bad net/phone

quartz kindle
#

its a cool idea tho

past field
quartz kindle
#

hmm, why do you delete the game from the games map when the lobby closes?

lament rock
#

judging silently

past field
past field
red wadi
#

how do i force a light theme or just change the font to black ?

hasty falcon
#

DiscordAPIError[20012]: You are not authorized to perform this action on this application
what is the problem? i try at my vscode with beta bot account and its working.

#

same code

pearl trail
#

give more context

warm canopy
# proven lantern

Heh yeah it tiers your storage based on how frequently you access it and how quickly you need to retrieve that data. We have clients who use S3 and even they don't truly understand the voodoo of it all!

frosty gale
warm canopy
#

Sadly true - I work for one of those companies!

junior cargo
#

@inner tusk

radiant kraken
#

huge enuf

#

thats what she said

pearl trail
#

😔

quartz kindle
proven lantern
# warm canopy Heh yeah it tiers your storage based on how frequently you access it and how qui...

i use CloudFormation and every time i deploy a change it packages all my lambdas and saves them in S3. Even if there is no change to the lambda it still makes a new copy.

https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-package.html

radiant kraken
quartz kindle
#

1e+300 ** 1e+300

radiant kraken
#

i don't think C has that operator

#

it has a pow() function in math.h tho

quartz kindle
#

ye

quartz kindle
radiant kraken
#

💀

#

anyone with a naïve mind would just go with the loop lmao

#

can't imagine how they implemented the sin, cos, and tan functions

frosty gale
#

theres a formula that lets you do it efficiently

frosty gale
#

so cpu manufacturers have these operations built into the FPU that does it for you and is much more precise + hardware accelerated

#

C might fall back to approximation algorithms if that fails?

analog narwhal
#

if you dont mind me asking what major do y'all have? I was reviewing some chats earlier and i seen a bug debate on java in a way i did not expect lmfao

#

💀

#

any recommendations on books?

wheat mesa
#

What major? Wdym?

#

Like, college major?

quartz kindle
analog narwhal
#

🤣

quartz kindle
analog narwhal
#

YOU NEVER

#

LIAR

#

ong

#

😭😭😭

#

Yeah I was talking about you bro wtf kind of books are u reading

quartz kindle
#

i read manga

analog narwhal
#

💀

#

Damn

quartz kindle
#

lmao (its true tho)

neon flicker
#

Is it possible to add choice questions to modals yet?

#

Or does it only support text inputs yet?

acoustic fern
#

Only text inputs for discord modals

neon flicker
#

Thanks

hasty falcon
# pearl trail give more context

i wanted to update my bot version (like add new commands or something) and i tried it in my beta bot, after that i already coded the new version, i uploaded the file to my public bot for updates. but when I want to start there is an error message
DiscordAPIError[20012]: You are not authorized to perform this action on this application

#

idk why, I tried it on my beta bot and it worked

wheat mesa
#

Just pick a language and start learning it by making things with it

#

Usually trying to convert java to rust is hard bc Java is very OOP and OOP burns in flames with rust

wheat mesa
#

Minecraft is heavily based on inheritance and OOP concepts

#

You’re not going to have much luck trying to 1:1 convert it

quartz kindle
# wheat mesa Just pick a language and start learning it by making things with it

indeed, there is something very cool i learned at some point, you gotta aim past your actual goal, make your goal just a stepping stone onto something else
some martial arts like karate implement this principle as well, for example you dont punch someone, you punch whatever is behind someone, and that someone will be hit way harder because hes in the way

#

so you dont aim to learn programming, you aim to build something cool, and the learning is just the obstacle in the middle that will be hit harder because its in the way of the actual target

#

cc@analog narwhal because #relevant

analog narwhal
#

😆

#

Will do Tim thank you

radiant kraken
radiant kraken
#

and maybe call some method or impl Deref to retrieve it

pearl trail
#

anyone here know how to open exported azure disk?

#

i tried using qemu-nbd and doesnt work

radiant kraken
pearl trail
#

🤫

radiant kraken
#

tell

#

smh

pearl trail
#

opening linux vhd yes

radiant kraken
#

whats a vhd

pearl trail
#

virtual hard drive

radiant kraken
#

damn pro stuff

pearl trail
#

nah

autumn knot
#

I haven't done that in ages.

#

What response were you getting from qemu?

pearl trail
#

there is no error when doing qemu-nbd, but when i try to mount, there's error smth like 'invalid fs type .... i saw there are nbd0-nbd21 via lsblk . nbd0 has 30gb size (my vhd size) and others are just 0

#

right now im trying to re-download the vhd, maybe it's corrupted before? i'll see

autumn knot
#

Could be, but unlikely. Could be qemu acting up too though. I know the last time I did anything in this area, I actually used the guestmount route for simplicity.

#

As far as nbd0, I believe that's the default nbd device available.

hasty falcon
frosty gale
pearl trail
#

ill debug it

#

ok i got it working. using guestfish

autumn knot
#

Oh nice. Sorry, I went to bed haha

pearl trail
#

it's okay :D

dim lake
#

Hey 🌹

#

@vapid rune

deft wolf
eternal osprey
#

hey guys, next to properly aligning the text, any other advice on how to design it better

#

idk something seems off..

#

it seems boring or sum

quartz kindle
#

the outer box already has drop shadow, so inside the box there shouldnt be any similar drop shadows

#

also the orange box is too strong

#

doesnt match well with neither black nor white inner text colors

#

the basic/premium/standard titles could be a simple header instead of a button/box, the same style as Onze prijzen

#

the bottom black button could be a background covering the entire width of the box instead of being a button on top the box

#

the orange box could be darker for white text, or lighter for black text

eternal osprey
#

I got this so far

#

way ebtter than the original

eternal osprey
#

i like it

eternal osprey
#

maynn why is bootstrap teasing me

#

i am using the grid system and if all breakpoints add up to 12 it cramps everything together

harsh aspen
#

just use tailwind

#

||I HATE CSSSSSS||

quartz kindle
#

the borders can still be orange, as well as the title and/or prices and/or button

#

xD

frosty gale
surreal sage
#

i will forever hate win+ctrl+t

#

SO annoying

scenic kelp
#

why?

#

that's a power toys thing you can just turn it off

surreal sage
#

i love you

#

i didnt know

#

thank u

quartz kindle
#

ok so

#

who was the engineer who thought this was a good idea

wheat mesa
#

Someone probably worked hard on that too

#

💀

quartz kindle
#

im sure that took 2 weeks and 20 meetings to make

wheat mesa
#

This is government work, it took 16 Jira tickets and 7 hours of code review for that

quartz kindle
#

:^)

#

now lets see if i can use this crap to generate ephemerides that are decent enough

neon flicker
#

LOL

frosty gale
#

a friend i knew shes going on to become a project manager so im not sure if i can be friends with her anymore

#

y'all stay safe out there

quartz kindle
pearl trail
#

is there something im missing

#

it's an old project, trying to resurrect, idk something might change

earnest phoenix
#

@tough beacon

deft wolf
#

🤨

autumn knot
# pearl trail is there something im missing

Order of the get? Pretty far outside my typical scope, but I usually dump wildcard routes at the end. That usually keeps it as a reliable fallback. Beyond that, nothing else really stands out.

pearl trail
#

i'm not expecting this to work but still wondering why

proven lantern
autumn knot
#

Agreed, the order looks a bit off.

lament rock
#

Shouldn't the route be /*?

pearl trail
#

hmm still didn't work

#

anyways thank you guys for helping me. i don't want to make it run correctly either

frosty gale
sharp geyser
#

I setup a foreign key reference from one table to another, and on the table its references if I update the value at that key is there anyway I can make it reflect on all the referencees ?

eternal osprey
#

hey guys i am writing a bash that should basically write 99 characters excluding a newline, for exactly 500 lines. However the file in bash tends to always add another line that is empty.

#

so instead of 500 lines it ends up being 501

#

reason as to why i have not copied the code is because it is on my vm and mac does not have bidirectional pasting

wheat mesa
#

Yeah

#

Didn’t see ben’s thing

lyric mountain
#

oh wait, nvm, you caught that already

#

well, still, if an empty line is being added it's 99% due to trailing \n

proven lantern
#

Mainly the $'\n' part

sharp geyser
#
-- Your SQL goes here
CREATE OR REPLACE FUNCTION update_server_messages()
    RETURNS TRIGGER
    LANGUAGE PLPGSQL
AS
$$
BEGIN
    UPDATE servers SET messages_sent = messages_sent + 1;
end;
$$;

CREATE OR REPLACE FUNCTION update_player_messages()
    RETURNS TRIGGER
AS
$$
BEGIN
    UPDATE players SET messages_sent = messages_sent + 1;
end;
$$ LANGUAGE PLPGSQL;

CREATE TRIGGER player_messages
    AFTER INSERT
    ON players
    FOR EACH STATEMENT
EXECUTE FUNCTION update_player_messages();
CREATE TRIGGER server_messages
    AFTER INSERT
    ON servers
    FOR EACH STATEMENT
EXECUTE FUNCTION update_server_messages();

Does this look correct? I swear I am doing something wrong cause it wont execute

sharp geyser
#

I fixed it, but the update stuff isn't working too well. I am trying to have it so it updates those fields on those tables, but its doing it for ALL entries in that table

#

I then tried WHERE player_id = new.player_id and WHERE ip = new.server_ip respectively, but that doesn't seem to work

sharp geyser
#

Fixed

#
create function update_server_messages() returns trigger
    language plpgsql
as
$$
BEGIN
    UPDATE servers SET messages_sent = messages_sent + 1 WHERE ip IN (SELECT DISTINCT server_ip FROM messages_sent);
    RETURN NULL;
end;
$$;

alter function update_server_messages() owner to chimeralabs;

create function update_player_messages() returns trigger
    language plpgsql
as
$$
BEGIN
    UPDATE players SET messages_sent = messages_sent + 1 WHERE players.player_id IN (SELECT DISTINCT messages_sent.player_id FROM messages_sent);
    RETURN NULL;
end;
$$;

alter function update_player_messages() owner to chimeralabs;

#

Had to use WHERE x IN

crystal wigeon
#

hey has anyone used the new eslint config with typescript?

#

and svelte?

lyric mountain
#

this way you allow using index

#

also u cant return null unless it's an AFTER DELETE trigger (and even then)

#

RETURN NEW instead

sharp geyser
#

works perfectly

#

thanks

#

First time using triggers

lyric mountain
#

postgres triggers are very very powerful

#

given you can use programming langs like java or js in them, you could even have it send http requests

quartz kindle
crystal wigeon
#

Yo where the discord leaks at

warm surge
crystal wigeon
#

I thought all the discord chats got leaked KEKW

#

I got fake info

warm surge
#

yea it fake information

#

discord isn’t that dumb

sharp geyser
#

Love getting an err_conn_reset on localhost

#

how tf does that make sense

lyric mountain
#

well, localhost still uses a network adapter to find yourself

sharp geyser
#

yea

#

but I can't tell why its happening

#

Maybe its because im on a mesh wifi system

sage bobcat
warm surge
frosty gale
#

@quartz kindle Just argued with rossmann in the yt comments lmao

sharp geyser
#

@lyric mountain seems like my triggers aren't working anymore

#
create function update_server_messages() returns trigger
    language plpgsql
as
$$
BEGIN
    UPDATE servers SET message_count = message_count + 1 WHERE exists(SELECT 1 FROM messages WHERE server_ip = ip);
    RETURN NEW;
end;
$$;

alter function update_server_messages() owner to chimeralabs;
#

Its not updating the message_count row

earnest phoenix
#

@timid raft

lyric mountain
#

Actually, nvm, brb

lyric mountain
#

tho that trigger should be on messages, not on servers since you'll be inserting there

half hatch
#

@lyric mountain top.gg is not working

pearl trail
#

meow

lyric mountain
#

also this

half hatch
#

I have question how to remove this

#

Or verify that

lyric mountain
#

hm, what browser are you using?

half hatch
lyric mountain
#

weird, but well it's best if you ask in #support so some moderator can help you better

#

site's working fine, it's probably some problem on your side

pearl trail
#

outdated browser?

quartz kindle
#

outdated topgg

half hatch
pearl trail
#

nono i mean, is your google chrome up to date?

half hatch
#

Yes's I share you ss

#

I just unstall and install now it's working

#

I don't know how

crystal wigeon
#

Are there any game devs here

#

Like people who use godot or unreal

solemn latch
#

I goofed around on godot for a bit, its too hard ^-^

proven lantern
wheat mesa
proven lantern
#

this is what i get for my user

{
  id: '92436985859293184',
  username: 'ben2317',
  avatar: '2e9616d43db1545d83214e7e8f4e4476',
  discriminator: '0',
  public_flags: 0,
  flags: 0,
  banner: null,
  accent_color: null,
  global_name: 'Ben',
  avatar_decoration_data: null,
  banner_color: null,
  clan: null
}```
wheat mesa
#

I know a little bit about gamedev

wheat mesa
proven lantern
#

i tried making an api call

#
    const response = await fetch(`${URLS.api}/users/${user_id}`, {
        headers: {
            Authorization: `Bot ${config.discord_bot_token}`,
        }
    });```
wheat mesa
#

I’d assume that if the field is not present then the value is by default false. Odd way of doing things on discord’s end though

proven lantern
#

but my email is verified

wheat mesa
#

Oh

#

That’s odd

proven lantern
#

maybe the bot needs permissions

#

Required OAuth2 Scope
email

#

it needs email access

wheat mesa
#

Yeah that was gonna be my other question

proven lantern
#

and it's oauth only, not in the bot

#

dang

crystal wigeon
sharp geyser
#

I had ip = NEW.ip before

maiden vault
#

Yo this my new bot I make it I add some slash commands: mute, kick ,ban ,deafen ,report , warn I'll make more commands and more updates🌹

sharp geyser
#

but you said it wasn't good doing that way since its not using indexing or whatever

lyric mountain
sharp geyser
#

👍

lyric mountain
sharp geyser
#

oh I did

#

💀

lyric mountain
#

in this case it doesnt use index cuz it's doing a full scan

sharp geyser
#

I guess the one i showed you I did that

lyric mountain
#

btw

#

u can make it even better, no need for update

#

just NEW.message_count = NEW.message_count + 1

#

u can modify NEW entry as you wish

surreal sage
#

google gemini web devs cant even align buttons on their sidebar

neon leaf
#

site was made using gemini 🔥

surreal sage
#

🫶

floral iron
sharp geyser
#

I cant do that

#

Because New is the messages table, and that doesn't have messages_count

#

That only exists on the players & servers table

lyric mountain
sharp geyser
#

I attached them on the messages table

sharp geyser
#

It was a way for me to track the total number of messages sent on a server & by a player, without doing another query in code

lyric mountain
#

AFTER INSERT ON players

sharp geyser
#

yes I know what that says

#

I have since changed it though

#

because it makes no sense to put it there

#

I attached those triggers to the messages table now

sharp geyser
#

I want the message_count fields on the player & servers table to update when a message is inserted

#

So I had to attach it to the messages table for that trigger to work

lyric mountain
#

ah

surreal sage
#

helppp

#

typescript hellppp

#

im in a browser enviroment

#

a global object is being created

#

i want to create types for it

#

i made an environment.d.ts and added it to my tsconfig.include but it no no worky

#

nvm got it!!!

prime cliff
#

Peak UI design, Facebook has a toggle just to enable the search bar

surreal sage
#

can someone explain to me

#

why the hell

#

margin and padding

#

have

#

e.g.

#

margin: 0px 0px

#

as y then x

#

instead of x then y

#

so dumb

sharp geyser
#

💀

#

its top & bottom then left and right

#

Not that hard to understand

pearl trail
#

bro is doing margin-x and margin-y

quartz kindle
#

its because its the short form of the 4-params rule

#

4 params = top right bottom left

#

so the short 2 params form becomes top(bottom) right(left)

#

and the even shorter 1 param for all of them

lyric mountain
#

starting from top is a crime, LTRB ftw

timber hatch
#

does anyone know where to find legal counsel that specialise in UGC web apps? I'm building one and want to make sure i'm compliant. I have SOME knowledge of what's required but would rather be safe than sorry.

i know there's obviously places like fiverr and upwork but often they either don't specialise within the actual niche, aren't actually qualified, or just provide low quality services

lyric mountain
#

well, you can hire a lawier even if just as a consultant

hidden gorge
#

is this a good way to do if statements?

 if (Settings.ChatBot && Settings.ChatBot.Enabled) {
                    if (message.channel.id === Settings.ChatBot.Channel) {
                        if (client.bannedWords.includes(message.content)) {
                            console.log('IsChatBotChannel true')
                            console.log('IsMessageBlocked true')

                            return;
                        } else {
                            console.log('IsChatBotChannel true')
                            console.log('IsMessageBlocked false')
                        }
                    } else {
                        return;
                    }
                }
#

discord screwed my indenting

wheat mesa
#

Can you put it on a pastebin I’m on mobile

hidden gorge
lyric mountain
#

when you have a branch where the only statement is return, it's better if you simply use a guard clause instead

hidden gorge
hidden gorge
lyric mountain
#
if (Settings.ChatBot && Settings.ChatBot.Enabled) {
    if (message.channel.id !== Settings.ChatBot.Channel) return;

    if (client.bannedWords.includes(message.content)) {
        console.log('IsChatBotChannel true')
        console.log('IsMessageBlocked true')
        return;
    } else {
        console.log('IsChatBotChannel true')
        console.log('IsMessageBlocked false')
    }
}
#

if the code you'll put in that first return is short enough, u can still use it like that

urban delta
#

how do i make a site for my bot? This time i need one for interactions with my bot

#

similar to Mee6

#

i'm planning to allow it to make custom templates for characters and characters with custom sheet

neon flicker
#
await interaction.deferReply({ ephemeral:true })

How does this line throw the error Unknown interaction? 🙏

#

Okay, I tried out something stupid in order to fix the issue, however it worked

lyric mountain
#

like next.js, react, flutter, angular, vue, etc

#

or just rawdog html + js + css

#

try making a simple site, one that works

#

after that you'll need to learn how to make an api, similar to making a bot but not exactly

neon flicker
#

Oh LOL, so my project had already been running on pm2, however I used node before stopping pm2 so it was kind of replying to the same interaction twice

lyric mountain
#

then at last you make the site send requests to the api

#

voila, you have a dashboard

neon flicker
#

God I will

frosty gale
neon flicker
#

What is the ComponentType for modals?

deft wolf
#

Isn't a modal an interaction response?

neon flicker
deft wolf
#

Because I guess that counts as an interaction

proven lantern
#

submitting a model is an interation. displaying a model is different

quartz kindle
#

displaying is replying to an interaction right?

inland rune
#

How can I immediately get when a user has voted on top.gg?

I see on some bots, when I vote for it on top gg, it almost immediately sends the message to confirm I voted. I see that there is an API endpoint to get user vote counts, but I dont understand how the immediate feedback is done

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

inland rune
sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

I'm using authjs (next-auth v5 beta) and the Discord provider. If someone attempts to login but they click "cancel" how can I redirect them to a 401 page? In extension, using next.js v14 app router, how can I handle error codes such as 500, 403 etc? I tried using an error.tsx and global-error.tsx but these are not getting rendered when I do this in a client component:

setTimeout(() => throw new Error('test'), 5000)```
quartz kindle
#

you need to promisify the timeout and throw the error as a promise rejection

wheat mesa
#

Do you need to make an API request for every single call to your API, or can you store that data on your end via a database?

#

If you can store the data in your db after, you probably don’t even need a cache unless you’re going overkill or it’s a high hit endpoint

vapid berry
#

is there a way to see when a user voted for my bot? Like a timestamp of when the user voted. I have a vote system that tracks when a user votes in my database, but im unable to ensure that the user has voted exactly when they voted on topgg

lyric mountain
#

you need to store that yourself

#

topgg doesnt supply timestamps

vapid berry
#

Ah okay, i am doing that already but i was hoping that topgg could give that so its more precise

quartz kindle
vapid berry
#

When a user uses a voter only command, the system checks the database for an existing vote entry. If no entry is found, it checks the api to see if the user has voted. If the user has voted, it updates the database with the current timestamp. If the user hasn't voted, it raises an exception.

ive had issues with using the lib for the api so i just do aiohttp requests. i can give you my checks if you wanna see how it works

lyric mountain
#

it shouldn't raise an exception, just return false

#

simply check the database whether the user has voted, if the timestamp is absent or older than 12h then send a request to topgg to check

#

if voted return true, else false regardless of why

quartz kindle
#

if so, then webhooks would give you what you want

vapid berry
vapid berry
vapid berry
naive pulsar
#

here i'm useing router.push("url") to change lang but its re loading everything fetched from api this vid will show you what happend to me and what i want to happen

vapid berry
#

the automod doesnt have topgg links whitelisted?

#

kek

vapid berry
naive pulsar
solemn latch
#

any is blocked

vapid berry
#

ah

#

could still whitelist topgg links though

#

makes sense to

quartz kindle
#

xd

vapid berry
#

probably works off a regex

quartz kindle
#

doesnt work wiuthout http://-

vapid berry
warm surge
vapid berry
#

thanks captain obvious

solemn latch
#

darn

#

sftp isnt a hyperlink?!?! wild ;p

quartz kindle
#

report

frozen isle
#

How to add stars like the trust pliot widget but for top.gg

#

like this

lament rock
#

Can just add an image and then mask it with css

ivory nebula
#

I want my bot to give coins to users who vote for it, but my code doesn't seem to work. What should I do?

const express = require('express');
const app = express();
app.use(express.json());

const WEBHOOK_SECRET = 'WEBHOOK :O';
const webhookChannelID = '798993508404953098'; 

app.post('/topgg', async (req, res) => {
    console.log('Webhook received: ', req.body);
    const auth = req.headers.authorization;
    if (auth !== WEBHOOK_SECRET) {
        return res.status(403).send('Unauthorized');
    }

    const { user } = req.body;
    if (!user) return res.status(400).send('Bad Request: Missing user information');

    const hahacoinAmount = (Math.random() * 1000).toFixed(3);
    await db.add(`coin_${user}`, hahacoinAmount);

    const channel = await client.channels.fetch(webhookChannelID);
    if (channel) {
        channel.send(`**${user}** adlı kullanıcı bota oy verdi ve **${hahacoinAmount}** coin ödülü kazandı!`);
    }

    res.status(200).send('Success');
});
pearl trail
#

you set the coin value instead of adding it?

ivory nebula
earnest phoenix
#

Are you even receiving the request

ivory nebula
surreal sage
#

hi chat

#

what react library for animating elements being added to the dom

#

i see framer but animatepresence is only for removal?

ivory nebula
# surreal sage i see framer but animatepresence is only for removal?

in Framer Motion, AnimatePresence is not just for removing elements; it can also be used to animate elements being added to the DOM. AnimatePresence allows you to apply animations when elements are both added to and removed from the DOM, so it can handle both entrance and exit animations.

surreal sage
#

nvm i've got it

eternal osprey
#

what yall think of my code to reverse a queue using a queue?

Array.prototype.enqueue = function(elem) {
  return this.push(elem);
};

Array.prototype.dequeue = function() {
  return this.shift();
};

function reverseQueue(Q1, Q2) {
     while(!Q2.length == 0){
  for (let i = 0; i < Q2.length - 1; i++){
  Q2.enqueue(Q2.dequeue());
  }
  Q1.enqueue(Q2.dequeue());
  }
 
  return Q1;
}

let queue1 = [];
let queue2 = [1, 2, 3, 4, 6, 7, 8, 9, 10];
console.log(reverseQueue(queue1, queue2));  

i mean the queue is represented as an array, but just like a normal queue it pops from the start and adds at the end

neon leaf
real rose
past field
#

Making a Friday the 13th themed game

#

called Camp Blood

#

and I can't seem to figure out why the rounds won't progress correctly.

past field
#

maybe it's just time i learn how to use listeners for button interactions instead of collectors..

earnest phoenix
ivory nebula
ivory nebula
warm surge
#
const Topgg = require("@top-gg/sdk");

const app = express(); // Your express app

const webhook = new Topgg.Webhook("topggauth123"); // add your Top.gg webhook authorization (not bot token)

app.post(
  "/dblwebhook",
  webhook.listener((vote) => {
    // vote is your vote object
    console.log(vote.user); // 221221226561929217
  })
); // attach the middleware

app.listen(3000);```
#

and add coins part idfk

ivory nebula
warm surge
deft wolf
#

You can send test vote

ivory nebula
warm surge
ivory nebula
#

const express = require("express");
const Topgg = require("@top-gg/sdk");

const app = express(); // Your express app

const webhook = new Topgg.Webhook("SSSSSS");

app.post(
  "/dblwebhook",
  webhook.listener((vote) => {

    console.log(vote.user); // 
    const webhookChannelID = '798993508404953098'; 
      const hahacoinAmount = (Math.random() * 1000).toFixed(3);
       db.add(`hahacoin_${vote.user}`, hahacoinAmount);
    if (channel) {
        channel.send(`**${vote.user}** adlı kullanıcı bota oy verdi ve **${hahacoinAmount}** Hahacoin ödülü kazandı!`);
    }
  })
); 

app.listen(3000);
ivory nebula
earnest phoenix
warm surge
ivory nebula
#

Isn't that it?

warm surge
ivory nebula
#

which one

warm surge
#

thats it

ivory nebula
#

what should i do?

warm surge
ivory nebula
#

its just has only id

warm surge
#

hm

#

I could let you use my bot but same time thats called self proming

ivory nebula
#

ahahah yes

#

What can we do about this?

warm surge
warm surge
sage bobcat
#

One message removed from a suspended account.

quartz kindle
# ivory nebula its just has only id

your vds should have a network point of entry, for example if you want to host a website, what do you use? there shoild be something like an ip address or dns address

neon leaf
#

sir tim

ivory nebula
quartz kindle
#

what company is your vds from?

ivory nebula
quartz kindle
#

for example, when you have a vps/vds/dedi, you are usually given an ip address, and when you want to host a website, you run a webserver like nginx or xampp and then set a domain name with a DNS record with your vps/vds ip address

ivory nebula
#

yeah i got it. ill try it later

#

thank u for ur helping

quartz kindle
#

if you have an ip address then you can use your ip address to receive topgg webhooks

#

you dont need a full xampp system

#

if you use python or node, you create a webserver using a library like express or flask, and run the server on a port

#

and then your topgg webhook url is your vds ip address and the server port

ivory nebula
#

im using node

#

okay man thank you

#

ill try it

quartz kindle
#

good luck!

thorn torrent
#

@quartz kindle @quartz kindle

#

I have a question

#

What is the benefit of Patreon?

lyric mountain
#

it's a form of donation like kofi and chargebee

thorn torrent
lyric mountain
#

well, if you want to receive donations...yes

#

just be aware that patreon has an awful api

#

also iirc patreon cut is fairly high

#

compared to the others I mentioned

quartz kindle
#

its just that patreon is the most popular platform and most people are familiar with it

#

but yeah, its not really the best

thorn torrent
#

what is the solution to create a future plan

quartz kindle
thorn torrent
quartz kindle
#

but you can have external alternatives like paypal, patreon, kofi and others

#

or you can do for something more professional like paypal, stripe or chargebee

lyric mountain
#

only catch is that ur also forced to use the same price on discord (u cant factor in their absurd cut)

quartz kindle
#

yeah, if you sell premium for $5 on discord you cannot sell it for less outside of discord

#

even though discord takes more %

thorn torrent
#

This is a bigger problem

lyric mountain
#

what

thorn torrent
#

I mean umm

deft wolf
#

🤨

thorn torrent
quartz kindle
#

apparently not

thorn torrent
earnest phoenix
thorn torrent
earnest phoenix
#

ONLY U.S

thorn torrent
earnest phoenix
#

lol

thorn torrent
earnest phoenix
thorn torrent
#

I didn t understand

quartz kindle
earnest phoenix
quartz kindle
#

international business is not easy, countries have different tax laws, different bank systems, different payment methods

thorn torrent
earnest phoenix
#

world wide shopping really hard

thorn torrent
earnest phoenix
#

everythings hard nuh

thorn torrent
quartz kindle
thorn torrent
#

Ok?

thorn torrent
quartz kindle
#

oh i thought you are from turkey

#

i confused you with the other guy i helped today who is from turkey lol

thorn torrent
quartz kindle
#

what is your country?

#

you can dm it if you dont want to say in public

thorn torrent
quartz kindle
#

everyone knows iraq lol

#

very famous country xd

thorn torrent
quartz kindle
#

apparently this works in iraq

thorn torrent
#

That s right it works

#

but the site is strange and I don't feel it will work

#

In my field

past field
#

i need some advice 👀

earnest phoenix
quartz kindle
quartz kindle
past field
#

I have this game CAMP BLOOD that i'm working on. It's basically like a Friday the 13th themed version of my click war game, but it's a little different. Jason is hunting you and what you choose to do determines your outcome. You have 3 medkits, last man standing wins. But I want to add a few embeds to display the results between each round.

#

but everytime i do, it sends round 1 to the channel a million times

earnest phoenix
past field
#

this is what i was trying to add

quartz kindle
#

for example:

const result = await new Promise((resolve, reject) => {
  setTimeout(() => {
    reject(new Error("timeout"))
  }, 2500);
  someOtherAsyncFunction().then(result => {
    resolve(result);
  })
})
quartz kindle
#

what are you waitign for that can take more than 2500?

past field
earnest phoenix
#

but im trying to handle uncaught errors using next.js error.tsx and/or global-error.tsx

#

which once an uncaught error occurs, the error page will be rendered

#

someone also said this:

The error boundary catches only the exceptions thrown by function components, therefore this exception will escape it since it happens in a separate function that is pushed to the call stack after the timeout is expired.

The same happens if you throw an error in an event handler, it will not get handled.

The React error boundary is a safe net only for errors that can break rendering.

thorn torrent
quartz kindle
#

but what errors are you expecting to catch?

#

because there is no such thing as a truly global error handler

#

there are many different types of errors, and the code needs to be handled corrctly for each type of possible error

earnest phoenix
quartz kindle
#

client side?

#

if you want to catch client side errors, then you do that inside client side js

#

not on the rendering/routing

earnest phoenix
quartz kindle
quartz kindle
earnest phoenix
quartz kindle
#

why not? typescript doesnt let you?

earnest phoenix
#

my fault, it logged an error but continued to compile, i thought it cancelled

#

yeah the page does render now

quartz kindle
#

so the error page renders right?

earnest phoenix
#

i tried it page.tsx (server component) which works but i havent yet tried a client component

earnest phoenix
quartz kindle
#

alright then it looks good

earnest phoenix
quartz kindle
earnest phoenix
#

so if i just have an error.tsx file in the root layout which renders a 500 page then global-error is practically useless?

quartz kindle
#

it says in the docs that error handles below root layout, and global-error handles root layout

thorn torrent
earnest phoenix
quartz kindle
thorn torrent
quartz kindle
quartz kindle
#

but i dont think they support Iraq

thorn torrent