#development

1 messages · Page 294 of 1

quartz kindle
#

i feel like reading code you didnt write yourself is so much easier to miss something

#

so you lose confidence in the program/project/commit

queen needle
#

How's trae goin

quartz kindle
#

not used to this kind of stuff

queen needle
#

ah that's fair

#

I've tried every AI editor except cursor

quartz kindle
#

lots of waiting and lots of wrong stuff, i guess im not good at explaining what i want it to do

#

it often tries to do things i didnt ask

queen needle
#

Yeah..

#

I often have to stop it and just reject it all so it can understand me better

quartz kindle
queen needle
#

Here is what you gotta do, use chatgpt to make the prompt better then give it to trae

queen needle
quartz kindle
#

because AI is not profitable

#

its expensive af, and they all rush in with billions in investment and offer deals to capture interest

queen needle
#

trae is made by bytedance

quartz kindle
#

and then when they face the actual bill, its all comes crashing down

queen needle
#

so they have money

quartz kindle
#

im testing it with deepseek3.1:free from openrouter now lol

#

it keeps generating broken files lol

#

files are either cutoff at the end, or missing huge chunks in the middle for no reason

neon leaf
#

another user stole ur code suggestion !

quartz kindle
#

lol openrouter has a limit for free requests

#

they are "free" but you cant use them

swift barn
#

I mean you didn’t pay 😂

frosty gale
#

still quite buggy and dodgy but better than the others from what ive seen

#

and i get it for free from work

#

getting paid to vibe code is wild

quartz kindle
#

gemini 2.5 flash:
i will now proceed to do X
I apologize for the repeated mistake
i will now do X
i apologize for the issue
i will now proceed with X
I apologize for the oversight
I have successfully reviewed X
I will now proceed to do X
Task Completed
(did not actually do anything)

solemn latch
#

yeah

#

I've been noticing that

#

pro seems to do better ish

vivid fulcrum
#

yeah they often fail at anything that requires expertise in complex technical problems. 🤐 more often than not I'm arguing with LLMs over a system design choice. it's great for writing boilerplate though

neon leaf
#

beautiful

solemn latch
wheat mesa
#

Gemini pro is half decent but their free model with no limits is pretty bad

solemn latch
#

Yeah

#

It did 4110 lines pretty much unsupervised. Works without issue.

It'll have problems with some stuff I'm working on next, so I'll just do it myself but it was really easy.

frosty gale
#

the amount of emojis and ticks it always gives me after it said it did a task when it did not drives me up the wall

quartz kindle
frosty gale
#

think it did something similar to me a few times

#

then it just starts making random changes, it says it fixed it, i say its not, the loop repeats

eternal osprey
#

(base) apple@Mac ~ % ping discord.com
PING discord.com: 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3
Request timeout for icmp_seq 4
Request timeout for icmp_seq 5
Request timeout for icmp_seq 6
Request timeout for icmp_seq 7
Request timeout for icmp_seq 8
Request timeout for icmp_seq 9

boys

#

what the fuck is my mac doing

#

all of my api fetch requests are failing as well in my ts project.

#

ong i am being ddosed

#

okayyy, turns out a fetch was being held alive and blocked my interface.

frosty gale
#

i cant with these robots bro

#

and that answer is also incorrect on top of that also which is why i insisted on evidence

quartz kindle
#

lmao

swift barn
quartz kindle
#

im still within pro trial though

#

i first asked it to identify and fix all the issues the other AIs caused, and it did a good job

frosty gale
#

bad code meaning possibly the worst code youve ever seen in your life that looks like it was written by a beginner js discord bot developer in this channel

queen needle
quartz kindle
#

im using it to create a localization system for a website

#

right now they have dedicated files for each language

#

i need to scan all these files, compile a database of localized strings, and create files that access this localization data

#

this is extremely annoying to do by hand and most AIs i tried end up not correctly detecting the strings and generating completely broken files

neon leaf
#

cant you just write a simple script for that? or am I misunderstanding something

quartz kindle
#

strings are all over the place

#

in html structure, html attributes, php variables, comments, php arrays/objects

crystal wigeon
#

um guys

#

wtf

#

It says customId is empty when sending url buttons

#

but if i add a customId it says customId and url cant be specified

#

wtf? it breaks everything

#

Invalid Form Body\\ncomponents[0].components[0].custom_id: Must be between 1 and 100

#

.components[0].url: A custom id and url cannot both be specified dafuq man?

#

everything was working fine until today

prime cliff
#

You either have CustomId or Url not both set

crystal wigeon
#

but from today morning it looks like you ahve to get rid of the prop

#

yea

junior prairie
#

Hi

topaz grove
#

Im running into a issue and honestly have no idea how to fix it or what to do - essentially when i split my bot up into clusters / shards theres some button functions that dont work, for example replaying a game (a view that edits itself) in my case the button will freeze sometimes but work most of the time

I registered custom ids and have persistent views but im still unsure what this issue is

prime cliff
topaz grove
#

Still trying to figure it out on my end, ive had alot of discord related bugs but im not quite sure if this is one of them or not

lament rock
#

Another thing that can be happening is depending on how your sharding/clustering is happening and how you're handling button callbacks, you may not be in the same memory space where you handle the callback and where you ack the interaction

#

Either route the interactions with the necessary info to where they're supposed to go so the origin can handle it or have the ability for any worker to handle button presses

#

Even if you say you have interactions sent over the ws, DMs are always handled by shard 0. And also don't pipe them over the ws. Discord can kill your connection and ask you to resume and the time it takes to resume is enough for your interactions to expire

quartz kindle
#

you know whats ironic?
the best way handle discord interactions is like this:

  1. receive interaction via webhook
  2. dont respond to it but keep it open
  3. create a new post request to the interaction reply endpoint
  4. send reply
  5. connection received in step 1 will automatically abort
  6. handle response from step 4
  7. ???
  8. profit
errant harness
#

ratmodsSitMadge its not up to my bot to be able to view channels it doesnt have access to right? Viewing my logs, i feel like they kicked bot out because it didnt see channels it wasnt allowed (It technically can view all channels but not access them/see the message history). Idk if its a me thing or not. Like enabling/disabling tracking channels i dont even list the the channel if it doesnt have access.

lament rock
#

If users misconfigure their permissions for bots to be able to see then you are technically not obligated to notify them about potential issues or issues that are "currently" arising. Though if you are, within reason, able to notify them, I think you should. Example being they use an application command which has little to no restrictions involved on the bot end like if you receive an interaction, you are practically guaranteed to be able to respond. That way, you can tell them about doing some other action possibly or is "currently" failing

#

Though would I go out of my way to try to DM them? Not really

pearl trail
#

ah yes can’t click any button xD

quartz kindle
deft wolf
quartz kindle
#

have you guys heard about the everything package?

#

The everything package and its 3,000+ sub-packages have caused a Denial of Service (DOS) for anyone who installs it. We're talking about storage space running out and system resource exhaustion.

stark kestrel
#

wasn't it taken down by npm?

#

because it blocked removal of npm packages as they were dependencies of that everything package

quartz kindle
#

idk its still there

#

unless they did something behind the scenes

pearl trail
stark kestrel
#

or they may have removed that limitation of not being able to delete a package that is dependent on another

#

remember talking with one of the authors about it

frosty gale
#

these npm packages are so stupid lol

#

nodejs developers doing everything they can to keep this meme alive

quartz kindle
#

but that would be so much work its insane

#

you'd need a wikipedia-scale team

#

scan all 3 million npm packages, organize them by categories/jobs/tasks, approve only the best/fastest version, bug their devs to implement anything that other worse versions offer that the main one doesnt

#

thats worse than trying to refactor an entire OS source code

wheat mesa
#

The bloat really is impressive

#

And yet 300k lines of code worth of node modules for a simple web app is still somehow more reliable than dynamically linking one C++ lib

frosty gale
neon leaf
#

90gb for one project

#

and not even a big one

acoustic fern
#
cargo clean
     Removed 3959 files, 1.3GiB total

so true

quartz kindle
#

need to capitalize a string?
32 packages uses str[0].toUpperCase() + str.slice(1)
10 packages use capitalize
83 packages use lodash.capitalize
8 packages use just-capitalize
12 packages use titleize
9 packages use title
2 packages use capitalize-ts
...

#

not to mention different locked versions of the same lib

stark kestrel
#

write your own function

#

just like isTrue(someBool)

wheat mesa
#

return areBooleansNotEqual(someBool, false)

queen needle
#

return !areBooleansNotEqual(someBool, false)

#

both are constants

#

const true = ...

quartz kindle
#

imagine a powerful AI package manager

#

that could scan the entire dependency tree and deduplicate common functionality

#

eliminate redundant dependencies

stark kestrel
queen needle
prime cliff
#

Another reason not to use OVH https://x.com/vxdb/status/1976309952236105767

One of the largest DDoS mitigation providers for Minecraft networks, TCPShield, has had its OVHCloud account terminated.

According to TCPShield, they are now working with a major Canadian law firm to pursue legal action against OVH over the termination.

rustic nova
#

What does TCPShield use OVH for? Mitigation or for what

quartz kindle
#

i mean, shouldnt a ddos mitigation company have their own datacenter so they dont hog other datacenters? lmao

#

or at least some sort of partnership where they have their own reserved hardware and dedicated network stack/bandwidth

prime cliff
#

They would have bought dedicate servers and resources at least

quartz kindle
#

probably some dude at OVH just went:

why is our network usage at 99%?
who are these idiots hogging our network?
"unplugs cable"

unreal mist
#

Banana icons with banana theme KEKW

#

I said I’d do it and finally did weirdsip

swift barn
unreal mist
#

That yellow theme is so pretty tho so it definitely fits 😂

#

One of my classmates said I was crazy for the banana icons tho

deft wolf
unreal mist
#

Hehehehe

#

Yes!

swift barn
unreal mist
frosty gale
#

rust seems to have a very similar rationale to nodejs where you just install a package to do X

#

in c/c++ you dont see this as often because there isnt a clear or popular package manager and most lib devs just prefer to have 0 or near 0 dependencies

#

so ironically rust may be more unsafe because of how many sub dependency libraries may have that have some kind of unsafe vulnerable code

#

language safety is only one half of the battle

#

only time i ever install a dep in c++ is for json parsing/writing and simd hashing, and those also have no sub dependencies

radiant burrow
#

@radiant kraken is *** %n in writable segment detected *** a common/normal error for c? I'm not seeing much online about it. It's coming from a certain test (checking that my alloc function returns a pointer that is a multiple of 8, satisfying alignment requests)

radiant burrow
#

nvm! it was from the asert function used in tests

grizzled sail
#

Hello

hidden gorge
#

Hello again everyone,

In testing this line of code works but once i put the code onto the VPS it just hates it...

#

I'm incredibly confused here

#

This is it running in testing

small tangle
#

Is your nodejs on your vps too old? Are you running node 18 locally?

wheat mesa
#

That’s likely the cause

hidden gorge
neon leaf
#

the newest node ver is 24

hidden gorge
#

baboom

#

there we go

radiant kraken
small mural
#

Looking for client who has project. DM

neon leaf
#

I love it when I make a codebase easy to extend

hollow raft
#
    "type": 1,
    "integration_types": [
      0
    ],
    "contexts": [
      0
    ],
    "description_localizations": {
      "en-GB": "Play / add a new track to the queue.",
      "en-US": "Play / add a new track to the queue.",
      "ru": "Воспроизвести / добавить новый трек в очередь."
    },
    "name": "play",
    "description": "Play / add a new track to the queue.",
    "name_localizations": {
      "en-GB": "play",
      "en-US": "play",
      "ru": "воспроизвести"
    },
    "options": [
      {
        "type": 3,
        "description": "Specify the track name or url.",
        "name": "query",
        "name_localizations": {
          "en-GB": "query",
          "en-US": "query",
          "ru": "запрос"
        },
        "description_localizations": {
          "en-GB": "Specify the track name or url.",
          "en-US": "Specify the track name or url.",
          "ru": "Укажите название трека или url."
        },
        "required": true,
        "autocomplete": true
      },
      {
        "type": 4,
        "description": "Specify the volume at which you want to play the track.",
        "name_localizations": {
          "en-GB": "volume",
          "en-US": "volume",
          "ru": "громкость"
        },
        "description_localizations": {
          "en-GB": "Specify the volume at which you want to play the track.",
          "en-US": "Specify the volume at which you want to play the track.",
          "ru": "Укажите громкость с которой следуют воспроизводить трек."
        },
        "name": "volume",
        "required": false,
        "autocomplete": false
      }
    ]
  }```
why is the slash command not imported?
young prawn
languid dragon
#

is discord.js still the goto for ts devs?

clever tundra
hollow raft
#

I tried to add commands to the website

swift barn
lament rock
# languid dragon is discord.js still the goto for ts devs?

I think it heavily depends on what the project is for. If it's something really simple, then sure why not. But if you're planning on scaling, I still cannot recommend discord.js or any other class based abstraction layers. The most I'd go for is as close to raw API as possible without it being really stupid, so there's a few options.
For rest, either snowtransfer or @discordjs/rest is alright, but I think @discordjs/rest is a bit too close to just making your own http requests for my tastes.
Then for the gateway, I'd likely only recommend cloudstorm and not even @discordjs/ws just because of the fact that @discordjs/ws puts a dependency on the ws package which doesn't scale all that well on high volumes of messages and is quite slower in general

#

Please ignore the fact I maintain the packages I recommend. It's because they're good that I maintain them

languid dragon
#

hmm interesting, i'm planning on building something of a vast scale, but also convenience and cache handling of discord.js is a decent plus
just to clarify, snowtransfer is essentially fancy api client bindings for discord's api and cloudstorm for ws connection to discord?

lament rock
#

snowtransfer is for the http end of things so creating messages, etc.
As for caching, I think it makes more sense to extract just the data you need instead of holding onto full payloads especially for extended periods

languid dragon
#

hmm, i appreciate your insight, is there an example of these 2 libraries being used in a project already?

lament rock
frosty gale
#

@quartz kindle can you tell your homies to stop hacking into my unused microsoft account

#

this is the second time so finally got the motivation to move everything to passkeys and bitwarden instead of bad passwords

topaz grove
earnest phoenix
#

Hey I am currently running my moderation bot of a NAS looking to switch it to online hosting anyone got any recommendations

earnest phoenix
acoustic bough
#

been using it for over three years now

#

it's the cheapest (while also reliable) thing I found over my two years of server jumping

acoustic bough
#

hm?

stark kestrel
#

affiliate links my beloved

oak cliff
#

anyone here possibly know anything about microsoft entra? Eyes

earnest phoenix
#

Thank you I will be switching over

oak cliff
#

for my masters degree im making up a fake company that is migrating from on-prem AD to microsoft entra and didnt know if i might be able to pick someones brain with some questions heh

#

ive been reading their documentation

#

seems kinda huge

stark kestrel
#

yah, we didn't do that - mainly doing hybrid

#

can't help for that 🙏

oak cliff
#

my current company i work for is hybrid

#

but i dont want to bother lol

frosty gale
#

but from i gather with my limited experience of AD at work is that entra is basically a local AD instance hosted by microsoft.. which you probably already know

#

you're welcome 🙏

oak cliff
#

Lol thanks

frosty gale
#

this feels like a topic where you need to be a neck beard IT person with 20 years of experience to answer properly

craggy pine
#

@solemn latch

rotund verge
#

can someone tell me why this is not working if the message is to long zhe bot should cut it and send the message but idk why it ain't working..

if len(ai_message) > 1900:
    ai_message = ai_message[:1900] + "...\n\n*(Message truncated due to length)*" ```
patent bramble
#

My app was verified and showing the tick like a week ago, but it keeps glitching and hiding and I don't know why. Anyone else happen to experience this?

deft wolf
#

Shows fine for me, maybe it's cache issue or something. If it doesn't affect how your app behaves, it might just be a visual bug

patent bramble
#

That's the thing though. It's also happening on different accounts/devices, even with relogging/incognito.

#

Also cache issues after 11 days would be insane. It should only be a few days tops.

wheat mesa
rotund verge
open olive
#

I have a question.
How to use buttons in embed?

clever tundra
#

note the above is in discord.js latest stable version since someone will ask
i was that person, but in another channel

deft wolf
open olive
hushed patrol
#

Anyone know why this happened and how to fix it?

deft wolf
#

You can't, there is a limit of 50 integrations per server

#

Kick non-used bots maybe, idk

swift barn
prime cliff
#

Webhooks don't count for that

#

It just means 50 max apps/bots on your server in general

hushed patrol
#

All fixed, thanks @deft wolf @swift barn @prime cliff

simple cradle
#

ima think what cool stuff you can do with this

supple hound
#

Can I look here for developer to make and manage me a bot?

frosty gale
#

discord adds this limit but people still manage to hit it

simple cradle
hushed patrol
patent bramble
#

I have my bot sending <:emoji:emoji_id> in a message and it just shows :emoji: instead of the actual emoji and I don't know why. It's in the same server so not any sort of "not in server" or "external emoji" restriction. name/ID are correct.

#

So I totally forgot to use <a:emoji:emoji_id> for animated but still doesn't explain the other non-animated ones lol

patent bramble
#

fkng hell. The test failed because my test bot isn't in the same guild as the ones with the emojis, so it couldn't send them. The prod failed because it sent automated emojis without <a: (just <:)

#

Wild double whammy

lyric mountain
#

Uhhhh...I just use emote objects :D

patent bramble
#

Eh I would be interested in using the bot's built in emoji store but it's only for the main server so no real need. Plus that still wouldn't of helped my prod vs dev situation lol

deft wolf
#

Elon Musk scam, no way

neon leaf
#

I hate zstd

frosty gale
#

if i had to write this code to get some compression i would just opt in for no compression at all

neon leaf
#

I mean it technically works without this curse

#

but on max compression level, it oomd my entire machine

crystal wigeon
crystal wigeon
#

What are you looking for?

#

Has anyone used AI apis for anything? Like open router

#

weirdsip how do i give it more context if there’s a lot of content

#

I tried chunking

supple hound
crystal wigeon
#

yo any mods in here

#

@solemn latchgot a minute

lament rock
chrome arrow
#

Hi, @static hornet

frosty gale
surreal sage
#

how does one approach this css bug

unreal mist
#

this was the size of my interactionCreate.js file- how many lines do you reckon it has now 👀

acoustic bough
#

70

unreal mist
#

thats actually pretty close

acoustic bough
#

the open buffer is my interactionCreate

unreal mist
#

this is the events/client folder of the live version, obviously production version only needed the bottom 2 hence they arent there kekw

acoustic bough
#

i'd never put multiple things into a single file

#

I must admit that I have over 250 files but still

unreal mist
#

i had all major events in one, but now its split up into their own files

proven nymph
proven nymph
unreal mist
#

D:

#

i still havent figured a fix to that issue yet though

proven nymph
#

The missions?

fresh flume
#

Could you potentionally award users with money...?

#

for being the top of a leaderboard

proven nymph
#

Or per hour, that much money gets sent, depending on how high you're

fresh flume
#

Top leaderboard of month = you get money

#

as in irl

proven nymph
#

Ah

#

Let me see

fresh flume
#

is there any api which could do that

#

or package

#

would be bitcoin

proven nymph
#

Well, aren't you interesting lol

fresh flume
#

yeah lol

proven nymph
#

Discord TOS: Do not offer real money or any real-world financial equivalent (like gift cards, crypto, or PayPal transfers) for bot leaderboards. Stick to on-platform, virtual-only rewards like roles to stay within Discord's rules.

fresh flume
#

i'm probaly the first

proven nymph
#

I guess their is a way around

frosty gale
#

terms of service always boring

fresh flume
#

fr

fresh flume
frosty gale
#

i was about to make a multi million dollar gambling bot

proven nymph
#

By hosting a giveaway that only depends on the rank in the leaderboard

#

I mean a giveaway is a giveaway

fresh flume
#

oo yh

#

true

proven nymph
#

But be carefull with stuff like this

#

As Discord TOS is really strict

#

But mentioning it in your bot could possibly still break TOS

frosty gale
proven nymph
#

So, like, you need to somehow make it apart, but also not apart, linking to the bot to then be able to host a giveaway

proven nymph
#

So yeah, I don't encourage this, but obviously, just randomly hosting a giveaway set to a rank role in your Discord server is 0 harm, but I personally suggest using a separate bot

unreal mist
proven nymph
#

Oh yeah that part lol

#

Mate at this point just make an app lol

#

I got a client asking me to make an app

unreal mist
#

one day

proven nymph
#

Firebase is easy use tool

#

If you know what that is

#

I use it for Google login, and for attachments when someone posts a picture or anything

#

Anyway i'm logging off lol

unreal mist
#

ive never heard of it before xD

sharp saddle
#

you can link Firebase with it

fresh flume
fresh flume
#

giveawayBot, giveawayBoat and so on....

digital cove
#

Hi

prime cliff
fresh flume
#

I’m just saying how I’ve seen that work around multiple times

prime cliff
#

Invite 4 reward bots too are also just as bad and promotes spam

fresh flume
#

Yeah lol why do they even exist

#

Well anyways I’m proud of myself

#

Actually been 5 years always decline so thank you to the reviewer who accepted me

#

Seems like they been hiring non corrupted reviewers!! Took long enough

deft wolf
#

"Hiring" weirdsip

hollow pollen
deft wolf
#

Thanks for the ping

hollow pollen
#

nice to meet u

fresh flume
#

What’s the max fields in a modal?

#

Gonna make a command which builds a command and modal and forwards those information to myself with their user ID and so on

#

Essentially a bidding system but I wanna make iy more cooler

#

Never mind I’ve solved it

sharp geyser
forest osprey
#

Hi can we talk about coding in this channel or no

swift barn
reef coral
#

Hi

frosty gale
#

: troll:

acoustic bough
#

honest opinion for bot logo, I prob gonna go with "diff shape"

unreal mist
acoustic bough
#

I plan to edit the pride one more and offer it as well as a customizable

#

the contrast just kinda sucks for it rn

unreal mist
#

Fair enough

acoustic bough
unreal mist
#

Looks cool though!

humble gyro
acoustic bough
#

for which

hoary cliff
#

components v2 is so nice to play around with

#

actually happy with how this looks

#

also really fun to play around with separators

unreal mist
#

Separators are great, just don’t over use them 😁

clever tundra
unreal mist
clever tundra
#

I think it needs more

hoary cliff
#

its beautiful

harsh nova
# hoary cliff

Thought that message was very well designed, checked the link in the image, and ofc it was you bigsmile Your skills are insane

hoary cliff
#

trying to get a strong brand identity for a discord bot going because why not

#

still figuring out the right wording for some of these changes but making mockups for them is fun val_steamhappy

stark kestrel
#

Finally someone making an amazing use for components v2

#

Looks amazing

hoary cliff
#

thank you thank you :p

humble gyro
hoary cliff
#

only thing i dislike about forwards is the spam lol oops

unreal mist
unreal mist
slender wagon
#

any idea why requests are like this? nothing changed on my web app it seems somewhere between 10 oct its just been going like this and as u can see the visitors are also stable

#

and no no config has been changed

#

they all seem to come from germany as well?

wheat mesa
slender wagon
#

there is nothing to scrape on my site

wheat mesa
#

Still possible, some scrapers are stupid

#

I have 6k requests to my site in the last 30 days, and I know for a fact that my teammates and myself aren’t using the production site that often yet

#

I get a fair chunk of those requests from Germany, France, the Netherlands, and surprisingly Australia

slender wagon
#

i think it correlates with me enabling a feature on cloudflare

#

im unsure tho

wheat mesa
#

Maybe

slender wagon
#

but 3.4K visitors and 220K requests is absolutely nuts

#

the users only need to be in the site for like 3 seconds max

stark kestrel
#

That's what scrapers do

clever tundra
#

success: bot is finished

rugged dawn
lament rock
#

Im part of the cv2 alpha testing Discord so this was done a while back. Need to work on improving my UIs a bit more

#

Ignore the fact that the leaderboard for the economy is insane

hoary cliff
hoary cliff
#

that alignment could be useful tho, depending on how it renders on mobile

lament rock
#

back? There never was any columns. I made a feature request for built in tablification, but they said they're not considering it

hoary cliff
#

i was talking about inline fields, basically columns

lament rock
#

There was no mention for or against it

#

But I'd imagine not considering they want to control the horizontal real estate and give us control over the vertical

hoary cliff
#

atm logs look very long because stuff cant be side by side

lament rock
#

I just use separators in containers that used to have inline fields as well

#

Or I can tablify text manually using a combo of regular spaces and zero width spaces inside of code blocks so that the text doesn't get trimmed and the code block kinda forces the text to be a consistent size

#

but it doesnt look nearly as nice on mobile

hoary cliff
#

yeahh wish they added that specific functionality since they have it for inline buttons/images

hoary cliff
#

i dislike using modals lol, wish these input fields supported multiline natively so i didnt have to do this goofy workaround

clever tundra
#

Don't they do multiline or am I thinking about smth else

hoary cliff
clever tundra
#

Or the command input boxes

hoary cliff
#

i'm talking about slash command text input fields, since i don't want to use modals

on mobile newlines do work, on desktop they don't

clever tundra
#

Ah

#

Yeah I don't think they do that on desktop, unless you used models or a send a message kinda thing there's no other way I think

hoary cliff
#

discord moment

clever tundra
#

Literally

#

Acrually

hoary cliff
#

but i mean this workaround works pretty well lol so its fine

clever tundra
#

Hold on lemme try smth

#

Nope, didn't work

#

I was thinking of whether this thing worked on desktop

hoary cliff
#

when you select that menu on desktop it just transforms into the usual input field command and spamming shift enter does nothing haha

clever tundra
#

Yeah I tested it

#

Sadge

#

Discord should really do smth like that

#

Yeah the new modal components are nice but they need to work on the other stuff

#

It feels like they're trying to phase them out without phasing them out

#

Prefix commands they're deffo trying to get rid of

hoary cliff
#

yeahhh theres these tiny inconsistencies that you don't really notice but they're a real pain when you happen to need them to work 😭

hoary cliff
clever tundra
#

I really god damn hope they don't reject mine

#

Pretty much the main feature relies on it

hoary cliff
#

i'm planning to apply again cuz it was right around the time the leak thingy happened and they never replied to my follow-up

clever tundra
hoary cliff
hoary cliff
#

that's why i prefer not using them

clever tundra
#

The main thing is a fully configurable listener to check for codes and fetch info on it all, it relies on message content. That and guild members for the dashboard I think, but I can feel that getting rejected

hoary cliff
#

i think if you explain it thoroughly enough you'll be fine

#

they sent me my mail to get intents approved at like 85 servers and approved it way past 100 so it's kinda slow

hushed patrol
#

Anyone knows a good free bot host?

swift barn
hushed patrol
#

Thanks

swift barn
hushed patrol
#

1st can't 2nd won't

hushed patrol
#

Interesting right?

swift barn
swift barn
hushed patrol
#

I don't even have a pc

#

Let alone an old one

swift barn
hushed patrol
swift barn
frosty gale
# swift barn theres always a catch to these "free" services innit

if youre willing to deal with some of the shit oracle throws at you upfront you can get 2x 1gb 1 cpu (slow) virtual servers you can comfortably host a bot on, or you can get their arm ampere virtual servers where you can create multiple (or just one) server totalling 4 cores and 24 gb of ram (its really fast), all completely for free always which is amazing, oracle is very competitive with their always free tier

but, they are very annoying to work with initially, you need a debit card upfront of course and they choose to deny your registration for absolutely no reason sometimes (ive had that happen because they didnt like my network), and after you get an account, you have to upgrade it to pay as you go where you pay a refundable $100 i think (you technically dont have to do this but they are known to terminate and prune accounts on only free tier resources if you dont upgrade, ive had it happen), but after that if youre careful not to go over the paid usage you are basically smooth sailing

#

theres a lot of lore to this but i think its more than worth it in the end if you have at least 100 buckaroos to spend that will get refunded instantly after

swift barn
frosty gale
#

yes but the recommendation is for anyone really

#

basically an always free fast host

clever tundra
#

I used them for a bit. Better than bothosting where you need ads or coins to renew, instead you just press a button

#

Maintenance on their site is annoying since they often screw up and make the servers go offline, but the maintenance is rare

#

Though I always recommend getting smth like a raspberry pi zero 2w and just self hosting

hushed patrol
#

Thx

clever tundra
#

I've been self hosting for a while on a 3b, it works great. I have 3 bots, dashboard, and ngrok all running off it without any issues

#

Specs / Stats ^

clever tundra
#

It's like £30 for the pi

#

I would very much recommend it over any free host online though

swift barn
hushed patrol
hushed patrol
#

It's aint true

swift barn
hushed patrol
#

I'll try again

neon flicker
deft wolf
#

As active as?

clever tundra
#

[d.py] no idea if anyone can help with this, but im using a webhook to send some components v2 and any media which was in a message.
It makes the webhook and does everything ok but when it tries to send it I get the error:
{"message": "Invalid Form Body", "code": 50035, "errors": {"components": {"3": {"items": {"_errors": [{"code": "BASE_TYPE_REQUIRED", "message": "This field is required"}]}}}}}

any help is appreciated
relevant code:

        payload = {
            "components": [
                {"type": 10, "content": f"{ce.flag(detectedlang)} {message.content}"},
                {"type": 14, "divider": True, "spacing": 1},
                {"type": 10, "content": f"{ce.flag('United Kingdom')} {deeplresult.text}"}
            ] + [
                {"type": 12, "media":{"url":media.url},"description":'null',"spoiler":'false'}
                for media in message.attachments
            ],
            "username": webhook.name,
            "avatar_url": webhook.avatar.url if webhook.avatar else None,
            "flags": 32768
        }

        async with aiohttp.ClientSession() as session:
            async with session.post(
                f"https://discord.com/api/v10/webhooks/%7Bwebhook.id%7D/%7Bwebhook.token%7D?with_components=true",
                json=payload
            ) as resp:
                if resp.status != 204:
                    print(await resp.text())
#

ive tried a bunch of stuff but cant figure out what it wants lol

solemn latch
#

is it possible media.url is null sometimes?

clever tundra
#

It was when trying this, but it's got the for media in message.attatchments so I assumed that would handle jt

#

If I try and do SMTh like for media in message.attatchments if message.attatchments else None then that screws it up more

#

Even then, I've tried with attachments and get the same thing

solemn latch
solemn latch
# clever tundra [d.py] no idea if anyone can help with this, but im using a webhook to send some...
{"type": 12, "media":{"url":media.url},"description":'null',"spoiler":'false'}
                for media in message.attachments

Would output something like

[
        {
            "type": 12,
            "media": {
                "url": "https://cdn.example.com/image1.png"
            },
            "description": "null",
            "spoiler": "false"
        },
        {
            "type": 12,
            "media": {
                "url": "https://cdn.example.com/gif2.gif"
            },
            "description": "null",
            "spoiler": "false"
        }
]

Which would be a separate gallery for each image(still improperly formatted)

The docs link above should be helpful

clever tundra
#

hmm interesting

solemn latch
#

Let me know if the docs are not enough.

clever tundra
#

i think i understand it

#

trying smth now

#

before and after (images)
code:

        payload = {
            "components": [
                {"type": 10, "content": f"{ce.flag(detectedlang)} {message.content}"},
                {"type": 14, "divider": True, "spacing": 1},
                {"type": 10, "content": f"{ce.flag('United Kingdom')} {deeplresult.text}"}
            ] + [
                {"type": 12, "items": [{"media": {"url": media.url}, "description": "Message Image"} for media in message.attachments]}
            ],
            "username": webhook.name,
            "avatar_url": webhook.avatar.url if webhook.avatar else None,
            "flags": 32768
        }
#

it worked but image has decided to go kaput

#

i also found that if there is no image i get error
{"message": "Invalid Form Body", "code": 50035, "errors": {"components": {"3": {"items": {"_errors": [{"code": "BASE_TYPE_BAD_LENGTH", "message": "Must be between 1 and 10 in length."}]}}}}}

solemn latch
#

or just if else it

clever tundra
#

that cant work tho

#

or hold on

#

no no i think i realise how to do it now

#

i was thinking of if elsing inside the payload but because thats bound to end badly and take ages to figure out i just did if message.attachments: payload = ...... else payload = ....

#

alright welp everything works

#

i just had a shitty structure

#

thank you for your help :3

#

its not over yet... only for multiple images in a message, on pc they show as just infinitely loading until discord says nuh uh and stops, having the failed to load thing. however, on phone, they load perfectly fine instantly

#

yeah nevermind this is weird asf, its stopped but not stopped but stopped? idfk

loud canopy
#

guys

#

i made a mistake

#

i wanted to do it for VScode but someone else did it before me so i said fuck it and i made it for the whole pc xd

hoary cliff
#

heat

unreal granite
#

One message removed from a suspended account.

swift barn
old tiger
#

Bring ChatGPT back.

prime cliff
#

We'll replace you with chatgpt then

acoustic tangle
old tiger
#

Ok, so show me where the ChatGPT app is?

old tiger
#

Hello?

solemn latch
old tiger
#

Ok?

solemn latch
#

Thats where chatgpt is. I'm not really sure what you're asking for.

sharp saddle
last stratus
#

hey guys. im getting my bot verified and i use python to run it but it uses discord.Intents.all() as the expected intents, the article says it doesnt give admin. should my bot still be functioning or will it error?

deft wolf
#

Intents and permissions are two different and completely unrelated things

last stratus
prime cliff
last stratus
deft wolf
#

Depends what are you logging I guess?

last stratus
lament rock
#

It'd be a good idea to go through the intents list and see which ones are relevant to you. Like you might not need any of the voice related events

#

Just not receiving some of the events is huge at scale

proven nymph
#

@minor oasis Hello, can you send me a DM once your bot is back online?

minor oasis
proven nymph
#

It might be a decline if you got an open owner-only command.

minor oasis
proven nymph
minor oasis
proven nymph
minor oasis
proven nymph
#

But the owner's command is what I'm saying—the moment it's done, for reviewing, it goes back to your owner ID again, correct?

proven nymph
#

Alright then, it's all fine. Just DM or ping me to get your bot reviewed again.

minor oasis
#

ok

deft wolf
#

@solemn latch support scam

proven nymph
#

@shell tundra I need 911 ⏰

shell tundra
#

ty

crystal wigeon
#

is there a way to override the client.users.fetch function?

#
if (Client.prototype.users) {
    Client.prototype.users.fetch = async function (userId: string) {
        const discordUser = await this.fetch(userId);
        console.log({ discordUser });
        discordUser.username = sanitizeUsername(discordUser.username);
        return discordUser;
    };
}```
I tried this at startup but at this point users doesnt exist so this never gets replaced
lament rock
wheat mesa
crystal wigeon
#

my brain is roasted, havent coded in a long time

#

😭

#

i remember class extends something

wheat mesa
#

Something like this work for you?

class CustomUserManager extends UserManager {
async fetch(userId: string, options?: any) {
const discordUser = await super.fetch(userId, options);
discordUser.username = sanitizeUsername(discordUser.username);
console.log({ discordUser });
return discordUser;
}
}

crystal wigeon
#

but does this actually override the func from client.users.fetch?

#

i dont think so right? flork_think cause im using client.users.fetch everywhere so

wheat mesa
crystal wigeon
wheat mesa
#

I almost never modify prototypes, usually means you’re doing something hacky. I’d rather just define my own functionality in a subclass

crystal wigeon
#

Hmm

wheat mesa
#

Much more extensible too, and is easier to debug when something breaks

quartz kindle
#

afaik djs no longer allows class extensions no?

#

or is this another lib?

quartz kindle
#
const ___fetch = Object.getOwnPropertyDescriptor(window, "fetch");
    Object.defineProperty(window, "fetch", {
        value: function() {
            if(arguments[0].includes("HandRaise")) {
                window.postMessage({ source: 'meet-statistics', type: "send", payload: arguments[1].body }, '*');
            }
            // @ts-ignore
            return ___fetch.value.apply(this, arguments);
        }
    });
#

:^)

frosty gale
quartz kindle
neon leaf
#

beauty

frosty gale
# quartz kindle cant even imagin what hacky looks like in rust

since rust has a very annoying ownership and borrowing system (to prevent undefined behaviour), you usually have to choose between accepting an unnecessary copy or write a 200+ line file to work around the problem using some fancy rust compile time shenanigans (ive had this happen to me a few times)

#

or you can hope there is a crate to solve your problem

#

or you can also opt into using unsafe but even then in some cases unsafe cant save you

neon leaf
#

ah yes, that too

#

still not possible to use if let properly for this

frosty gale
neon leaf
#

no

#

you need to if calling the function with incorrect parameters causes ub

frosty gale
#

ive had some situation happen where rust wouldnt let me use some unsafe resource inside a safe function without also declaring it unsafe, it involved global variables though

#

actually i think it was that i needed unsafe to access the global variable

neon leaf
#

you need unsafe to access static muts

#

but you should be able to always use an unsafe block

frosty gale
#

ive ran into a very annoying problem where i had a global variable which had to be initialized at runtime, but i know it will only be initialized once and code accessing it wont access it before that point, so i had to opt into using LazyLock which checks if the value was initialized on every single access

#

i tried to solve it with unsafe but figured it was more trouble than it was worth, but i do want to revisit it some day

#

i also didnt want to make an annoying wrapper function for it just to make it safe for other code but i think i might just have to do that

#

at least i wont incur the cost of checking if it was initialized unnecessarily since the function will be inlined anyawys

neon leaf
#

realistically that check wont matter, the cpu branch predictor will figure it out pretty quickly

#

depends on what the var is for

frosty gale
#

yeah thats true also, its a very trivial and easily predicted branch

neon leaf
#

yes, though I do use these in some places

#[inline(always)]
#[cold]
fn cold_path() {}

#[inline(always)]
pub fn likely(b: bool) -> bool {
    if b {
        true
    } else {
        cold_path();
        false
    }
}

#[inline(always)]
pub fn unlikely(b: bool) -> bool {
    if b {
        cold_path();
        true
    } else {
        false
    }
}
#

famously also used in the hashmap impl for 15% speed improvements or something

frosty gale
#

i see its trying to encourage the compiler to make the likely case the fallthrough path since predictors are more likely to pick it

neon leaf
#

yes

#

and the compiler fully follows this, even in cases where this would be suboptimal

#

not sure about unlikely(true) though

#

i could imagine that being optimized away

near ether
#

how come my users consistently run into this "uh oh" error when visiting my bot's store? it works sometimes and displays the store correctly, but other times it doesnt

deft wolf
#

Sounds like a question for discord support

steel oxide
#

the only solution i found to reliably display products

#

was using the "product" type button components

near ether
#

I used to have direct product type buttons but those disappeared for mobile users so I stuck with links

steel oxide
#

so i try to use my own payment processors as much as i can 🤣

near ether
#

Yup!! I’m seriously considering doing the same😂

cosmic ginkgo
#

000

clever tundra
stark kestrel
#

@solemn latch all channels

solemn latch
#

tyty

eternal osprey
#

hey everyone

#

do hyperlinks work in embeds?

swift barn
proud galleon
frosty gale
# neon leaf i could imagine that being optimized away

its probably because the negative weight of the cold_path method (marked as cold) somehow propagates onto the condition itself, compilers do some weird stuff when inlining methods and eliminating dead code so it probably has some rules for hints like cold to propagate onto the condition

#

although it wont be needed anymore since nightly added in std::intrinsics::likely

#

probably does something similar under the hood but with a guarantee that it will actually always hint instead of potentially breaking in future llvm/rust versions

neon leaf
#

who needs simplicity when you can minimize heap allocations ‼️

radiant kraken
#

am i dumb or what the fuck is going on here

radiant kraken
#

nevermind fixed it (somehow)

neon leaf
#

free actions, github? say no more!

frosty gale
#

ez free action runners

neon leaf
#

well i would if I had proper arm and mac hardware

#

realistically even with my own hw these builds wouldnt get much faster either

#

its rust with all optimizations cranked

#

like literally everything

#

takes 3min with cached deps on 9900x

frosty gale
#

mines only takes around 39 seconds if the deps and cargo install is cached

#

but yeah its incredibly annoying getting rust action runners to be fast

#

i dont have almost as much trouble with c++ and js codebases

neon leaf
#

this is peak slowness

#

but I need the small bin size

#

I cant ship 50mb to prod

#

22mb with this

neon leaf
frosty gale
#

are you building the binary in action runners?

frosty gale
#

i dont even bother caching the npm installs because its so fast anyways

frosty gale
#

though thats for a svelte codebase if it was react id probably be waiting 5 minutes for the npm install to finish

frosty gale
# neon leaf yes

ah do you also have them automatically add a release? then that makes sense instead of just running cargo check

neon leaf
#

yea I release every commit

#

still in development so makes it easier

barren warren
#

Hi

neon leaf
#

thanks rust 1.91.0

woven sigil
#

hey can someone help me set up a vote-tracking system for server? dm me or reply if you can help, thanks

woven sigil
#

Umm anyone?

shell tundra
clever tundra
unreal mist
#

we now have prefilled icons :D

#

and yes its the exact same grid from my dashboard 😂

unreal mist
#

i gave it a task bar icon kekw

unreal mist
#

its slowly coming together, buttons only log to console rn!

unreal mist
errant musk
#

Hell yesss dude 🔥🔥 it’s looking good!!

unreal mist
#

font? yes

unreal mist
unreal mist
#

can also select a theme, but right now that doesnt do anything kekw

errant musk
#

YESSSS 🔥🔥🔥

quartz kindle
#

nice

frosty gale
#

but is it AI Powered™

#

that phrase makes me sick

unreal mist
#

it now generates solveable puzzles

frosty gale
#

i like how the rust people anticipated people accidentally using %s for strings instead of {} so they added a warning

neon leaf
#

they do the same for ternaries

#

literally parse them just to show u an error

unreal mist
#

i still need to add the ability to play it KEWK

clever tundra
#

or smth should be done to em

unreal mist
#

oh yeah definitely

clever tundra
#

like merging the left and right bits

#

dropdowns and stuff

unreal mist
#

im planning to work on buttons and the stats at the bottom once its playable

clever tundra
compact condor
barren warren
#

@steel oxide Hey, have you ever worked with spotify api?

steel oxide
barren warren
#

aw

#

anyone else here?

frosty gale
#

its just an api so should be pretty straight forward

barren warren
# frosty gale what do you need

I'm getting an error every time I use the api, like for instance, I was coding a command to fetch similar artists, but every time I try to run the command, it gives back a 404 error.

frosty gale
barren warren
#
Error in similar-artists command: http status: 404, code: -1 - https://api.spotify.com/v1/artists/711MCceyCBcFnzjGY4Q7Un/related-artists:
 Not Found, reason: None```
#

ping me in your reply (as I'm going offline)

frosty gale
#

they removed related artists api route completely

#

as a sort of workaround you can fetch the artist and get their genres

#

then you can use the search api to search for one (or more) of those genres and thats how you can sort of get similar artists

barren warren
#

Ooohh, thankkk youu soo much @frosty gale

lyric mountain
unreal mist
lyric mountain
#

lul

unreal mist
#

I hand drew them KEKW

prime cliff
#

💀 github just shoved AI on the homepage
Why is there no feature preview to turn this off

compact condor
prime cliff
#

That's the new home exprience you can turn that off in feature previews

compact condor
#

oh didn't know

unreal mist
prime cliff
#

I use floorp (firefox fork) so i don't have to deal with that 🙂

clever tundra
#

i use firefox as my daily driver and i havent had a hint of ai

prime cliff
deft wolf
#

Time to disable it then

unreal mist
clever tundra
#

weird

#

i dont have that at all

unreal mist
#

Luckily it’s not really that annoying since it’s like the smallest popup ever 😂

frosty gale
wooden ember
#

tryed using the vc command on my bot for the first time in a while and it doesn't work now? I have changed nothing at all in a couple years now. This is the error I have:

#

I did install the sodium wrapper as the answer on stack overflow suggested but that has done nothing

wooden ember
#

had to update something and then install soething called dave?

frosty gale
#

did you update discord.js to latest?

wooden ember
#

Yeah i think thats what the DAVE thing was I had to install was. I just updated the voice library cuz I'm guessing if I update the core d.js library i will have to rewrite my code again.

frosty gale
#

rust compiler goes real quiet once i pull out this bad boy

compact condor
#

#[allow(dead_code)] 😭

neon leaf
#

#[allow(clippy::too_many_arguments)] >>>

quartz kindle
#

guys, i need help

#

im working part time for a small company, and their lead developer just quit, and they need me to inherit his source code temporarily while they figure stuff out

#

no idea how to work with it, how to compile it, how to test it or how to upload it to the webhost lmao

wheat mesa
#

Open the solution with visual studio

#

Set the startup project to be whatever project has the Program.cs file in it

quartz kindle
#

visual studio community 2022 right?

wheat mesa
#

Yeah that works

#

There will be a green “play” button at the top where you can launch after setting the startup project. It might say “IIS Express” or “http” or “https”, it really just depends on their setup

quartz kindle
#

do i need any other optional things from the installation details?

wheat mesa
#

Uhhhhh .NET Framework is really old

quartz kindle
#

gonna remove copilot lmao

wheat mesa
#

Is there a .NET Core option?

#

Framework is like mid 2000s to early 2010s

quartz kindle
#

this is all there is

wheat mesa
#

Odd, there wasn’t a setup wizard that had icons or anything like that?

quartz kindle
#

this is the visual studio community 2022 install screen

wheat mesa
#

Ah okay that should be fine, the pack should include .net core

#

You probably already have it installed through some other program, which is fine

#

Just continue with that installation

quartz kindle
#

alright

#

they sent me the source code in a zip file, it contains a .sln and a folder, and in the folder a program.cs

wheat mesa
#

You should be able to open the .sln file with visual studio

quartz kindle
#

then for uploading it to the webhost, do i compile it on my pc, and upload the compiled files to the host?

#

its a plesk panel windows host

wheat mesa
#

Uhhhh it’s going to depend largely on your setup. Personally when I deploy, I use docker containers, but I imagine yours is different

#

I’ll look it up and see if I can get any info for you

quartz kindle
#

the only thing they gave me was access to this webpanel

#

i can use files/ftp/etc

wheat mesa
#

You can compile with like dotnet publish “YourProject.csproj” -c Release -o your/output/dir

#

Which will compile a dll that can be run with dotnet OutputDll.dll

#

Are you familiar with Docker? I’ll send my usual dockerfile setup here so you can take a look at how it builds in release mode.

#

(You don’t have to use docker but you can still see the build process)

#
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app
EXPOSE 8080

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src

COPY ["DisasterAnalysis/DisasterAnalysis.csproj", "DisasterAnalysis/"]
RUN dotnet restore "DisasterAnalysis/DisasterAnalysis.csproj"

COPY . .
WORKDIR "/src/DisasterAnalysis"
RUN dotnet build "DisasterAnalysis.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "DisasterAnalysis.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "DisasterAnalysis.dll"]
#

It might differ a little bit based on your setup. The way .NET projects work is that there is usually a "Solution", which contains many "Projects". This dockerfile setup is just compiling one project, since I only have one project for my actual API for this case, and one project for my tests (which aren't included in this process since I'm not running tests on deployment, that's a job for CI)

quartz kindle
#

its just a windows shared hosting

wheat mesa
#

Yeah I figured

quartz kindle
#

i dont see any settings for starting/stopping the asp.net server, i'll need to test if uploading new files would trigger some kind of auto-restart

wheat mesa
#

If you upload new files, you have to recompile

quartz kindle
#

i have to recompile in my pc, then upload the compiled dlls

wheat mesa
#

Yeah, or you could rebuild on the host if that’s more convenient to use something like a private git repo

quartz kindle
#

this is what i have access to

wheat mesa
#

Oh I’ve never used that before

quartz kindle
#

its a basic shared webhost lol

wheat mesa
#

Google is saying that you can use that dotnet publish command I suggested earlier, zip up the output files, upload it to Plesk, extract it into the “httpdocs” folder (idk what that is), and configure the application settings on Plesk:

Application root: Specify the directory where your application’s files reside
Document Root: Static content (wwwroot for asp.net core)
Application Startup File: YourApp.dll

#

All of that sounds about right

quartz kindle
wheat mesa
#

You’d run it in the terminal on your pc to compile it

#

dotnet publish “YourProject.csproj” -c Release -o /your/output/dir

#

This generates the DLL and any other files you need

#

Then you’d zip that output up, transfer it to Plesk, unzip in the right place (whatever your configuration points to), and voila

quartz kindle
#

alright ill give it a go

#

i was just confused if the server would auto restart on file change, but it seems it does

wheat mesa
quartz kindle
#

more specifically, it seems that modifying web.config will cause an auto-restart

#

AI to the rescue lol

wheat mesa
#

Yeah it’s pretty useful for deployment

#

Especially since a lot of these smaller companies have janky non-standard configurations

prime cliff
wheat mesa
#

Man they change it every 3 years

#

I can’t keep track anymore

quartz kindle
#

lmao

frosty gale
#

it used to be that .net framework was windows only with stuff like windows api and windows forms and core was cross platform but they merged it all into one now

wheat mesa
#

If you’re ever working on a .net framework app then I pity you

#

Been there and done that

quartz kindle
#

alright i opened the project in VS, now i need to figure out how to fix the bug they asked me to

#

xD

prime cliff
wheat mesa
prime cliff
#

There is also the Web Deploy Config?

wheat mesa
#

Honestly I started off my asp.net journey on an MVC app running on .NET 6. Even though the code was garbage, I fell in love with asp.net as a whole. Really awesome framework

prime cliff
#

Yea MVC is still nice and useful but i've switched to fully using blazor

wheat mesa
#

I absolutely despise razor pages, haven’t tried blazor though. Asp is great when you use it with an SPA

quartz kindle
prime cliff
#

Tim you should see a build publish option, create a FTP profile with the settings, then publish using that

quartz kindle
#

ok i fixed the bug and running an IIS test server now

wheat mesa
#

Dang, must’ve been an easy bug lol

quartz kindle
quartz kindle
prime cliff
#

Looks like your configuration has some things in appsettings.json or appsetings.Development.json that is causing that network path

wheat mesa
#

^^

#

Configuration is a dictionary that is typically read from an appsettings.json file or appsettings.[ENVIRONMENT].json file

quartz kindle
#

hmm i think its looking for the mysql database locally

#

not sure if the database runs alongside the project

#

or if i would need to run it separately

wheat mesa
#

Separately usually

#

Do you have a connection string in the appsettings? Also, I think that exception you showed is the result of it not finding an appsettings file, not just a mysql db

quartz kindle
#

yeah there is a connection string in appsettings

#

im gonna copy the string from the production appsettings

wheat mesa
#

Uhh

#

Probably not a good idea

#

I’d imagine that your prod db and development db should be different

quartz kindle
#

probably, but its just for testing

#

or i can just "test in production" :^)

#

i mean, realistically what could happen just from changing a single int and then recompiling?

wheat mesa
#

You might have bootstrapping processes that do something on startup like creating an admin account with a default username and password

quartz kindle
#

hmm

wheat mesa
#

For one of my projects, my prod db is not directly accessible (since it’s running inside a docker container network), so I can’t create an admin account manually. Therefore, I have a section of my appsettings that specifies the admin account info and it’ll create the user if it doesn’t exist on startup

#

Not a super common configuration but it’s def possible

quartz kindle
#

all i was tasked to do was to open the source files, fix the issue with the rounding error and update the website
i already fixed the issue in the source code, now to apply it to the website is where im at, i dont want to accidentally screw something up

wheat mesa
#

I mean it’s possible that they don’t have a dev database. Does the connection string look for something locally running or is it an actual host somewhere?

#

Use your own judgement, I doubt it would be an issue but just warning of the dangers :p

#

I’ve had times at my work where I use the prod db

#

Just depends on your setup

quartz kindle
#

the development connection string looks like this

#

Server=WK-HTS0380;Database=StarSeeds2;Trusted_Connection=True;MultipleActiveResultSets=true;TrustServerCertificate=true

prime cliff
#

Me when i SSH and route my ports from server to local so i can access them 🙂

wheat mesa
#

Yeah I can still access my prod db through that, but it’s just a hassle

quartz kindle
#

ok i generated the publish folder, now im gonna try uploading it to the host

#

gonna made a full backup of the old files first

frosty gale
#

we have to justify that overpriced veeam backup cost somehow

neon leaf
#

hearing veeam gives me ptsd

#

monitoring like 200 windows servers is my current nightmare

quartz kindle
#

jesus

#

how is this project nearly 200mb zipped lol

wheat mesa
#

that's massive

quartz kindle
#

oh this is why

wheat mesa
#

my entire docker image for my backend is 90mb lol

quartz kindle
#

lol

quartz kindle
#

is this why it is generating all those runtimes?

frosty gale
#

ah did you enable the self contained option?

#

that will bundle the runtime in the final build

frosty gale
#

set it to your target (probably windows 64) and disable self contained if its checked

quartz kindle
#

target framework net8.0

wheat mesa
frosty gale
#

that should use your system .net then

neon leaf
#

I try to keep mine under 30mb

wheat mesa
#

Yeah you shouldn't be using self contained since the host already has the runtime installed (I'm assuming)

wheat mesa
neon leaf
#

yea

quartz kindle
neon leaf
#

though I did end up causing this

#

to be fair the bin does include tons of images

wheat mesa
#

Maybe you DO need self contained lol

quartz kindle
frosty gale
#

just keep it on then it just means the builds are fat

quartz kindle
#

idk because on the plan page it says
.Net Core 9.0,8.x, 7.x, 6.x
ASP.NET Frameworks 4.x, 3.x & 2.x

#

so maybe 4.8.0 refers to asp.net and visual studio is refering to net core 8.0?

#

is a webdeploy .publishsettings file something i can add to visual studio to automate uploading the files?

prime cliff
#

4.8.0 is the old .net framework

#

Followed by .NET Core 1 - 3 which then got changed to just .NET 5+

quartz kindle
#

this is what i have in the plesk panel

frosty gale
#

oh right thats asp net

#

thats almost the latest version then

#

asp net is the web framework library sorta like express but on sterioids

quartz kindle
#

so it has nothing to do with net8.0 that is set in visual studio

frosty gale
#

no thats just the library so youre all up to date

quartz kindle
#

im testing different build options in visual studio just to get a feel for it

#

i didnt try uploading the actual files yet

prime cliff
#

Why would it even show that though it's very confusing

quartz kindle
#

is single file executable worth it?

frosty gale
#

it leads to longer builds but its your choice, if its an app youre distributing to people you should probably go for single file, otherwise go for regular where it dumps all dll's in a directory with the exe

quartz kindle
#

what about ready2run?

frosty gale
#

never used it tbh but reading on it it basically precompiles some of your code so the net runtime doesnt have to do it while JIT compiling

#

you can but apparently it will increase your final build size by a lot

#

the JIT will probably do a good enough job anyways caching bytecode so its probably unnecessary here

#

some of it physically cant be precompiled so it most likely wont even precompile the entire program

quartz kindle
#

and trim unused code? the logs show some trim warnings when i enable this

neon leaf
#

peak code

class Request(_data) {
    let _head = string#slice(_data, 0, string#index_of(_data, "\n"))

    let _method = string#slice(_head, 0, string#index_of(_head, " "))
    let _method_len = string#len(_method)
    _method_len++

    let _end_slice = string#len(_head)
    _end_slice -= 10

    let _path = string#slice(_head, _method_len, _end_slice)
    let _path_query = string#index_of(_path, "?")
    _path_query++
    let _query = ""
    if (_path_query <= string#len(_path)) {
        _query = string#slice(_path, _path_query, string#len(_path))
        _path_query--
        _path = string#slice(_path, 0, _path_query)
    }

    let _headers = []
    let lines = string#split(_data, "\n")

    let i = 1
    let header = []
    loop {
        let line = array#get(lines, i)
        if not (string#trim(line)) {
            break
        }

        let key = string#slice(line, 0, string#index_of(line, ":"))
        let key_len = string#len(key)
        key_len += 2
        let value = string#slice(line, key_len, string#len(line))

        let header = array#clone([])
        array#set(header, 0, key)
        array#set(header, 1, value)
        array#push(_headers, header)

        i++
    }

    fn method(self) {
        return _method
    }

    fn headers_get(self, key, default) {
        let result = default
        let i = 0

        loop {
            let header = array#get(_headers, i)
            if not (header) {
                break
            }

            let _key = array#get(header, 0)
            if (_key === key) {
                result = array#get(header, 1)
                break
            }

            i++
        }

        return result
    }

    fn path(self) {
        return _path
    }

    fn query(self) {
        return _query
    }
}
quartz kindle
# frosty gale what warning?

idk im building without it rn. it was something like "trim() generated warnings, check <something> for more info"

stark kestrel
neon leaf
#

the name explains itself

#

its beautiful

stark kestrel
quartz kindle
#
string#slice(_data, 0, "\n");
``` why dont other languages support this
neon leaf
#

i mean it kills readability doesnt it

#

(in general, not here for um obvious reasons)

#

also u can do this peak

frosty gale
neon leaf
frosty gale
#

but not in a bad way so i think that bodes well for you

neon leaf
#

good

frosty gale
#

my first impression was a mix of js and rust

#

if they had a baby

quartz kindle
neon leaf
#

that is what it was meant to be inspired from

#

it wasnt a good birth

lyric mountain
#

spaces in method names became a taboo after the nasa catastrophe, back in fortran days

neon leaf
#

this too

quartz kindle
#

welp

lyric mountain
quartz kindle
lyric mountain
#

for the catastrophe thing

quartz kindle
#

ah, apparently this was turned on lol

quartz kindle
#

anyway trim unused only shows up if i set it to self-contained, im gonna try framework-dependent and see if it works

frosty gale
#

you can prob disable it if youre unsure

#

ive never ran into these before so im not sure what crack your jobs codebase is on

quartz kindle
#

neither do i

#

setting it to frame-work dependent make it 80mb instead of 120mb+

#

lets see if this works

#

this plesk file manager is abysmally slow though

#

it takes like 2min to delete files and replace them with the new ones

#

apparently its working fine for now

#

reduced project size from 200mb to 80mb lol

quartz kindle
#

and its not even transferring anything

#

i upload the zip, i unzip the zip