#development

1 messages · Page 205 of 1

eternal osprey
#

i got the mobile view working

#

just the desktop is still only showing half

sharp geyser
#

How do you render this

real rose
#

cus its just using up all the space it needs

eternal osprey
#

the html is restricted as it seems

real rose
#

eh

#

Add the CSS Viewer chrome extension, much nicer than devtools imo KEKW

sharp geyser
#

you aren't placing this div inside another div are you?

#

Im thinking its a parent element restricting it to a certain size

eternal osprey
#

no this is genuinely all my code

#

apart from the js, imports and stuff

sharp geyser
#

🤔

#

Is this purely html, css and js

#

or is it react?

eternal osprey
#

yes

#

only using bootstrap to help with css

#

vanilla js and html

#

that explains a lot i think

#

the col-md-6 limits it

sharp geyser
#

I mean that might be the issue

eternal osprey
#

no it ain't

#

wtff

sharp geyser
#

But it doesnt make sense it would be

#

Are you setting the height and width anywhere else in any css

#

like global css?

#

like maybe a * {} or a body {}

eternal osprey
#

i got it working...

#

it was a div in a div.

#

you were right.

sharp geyser
#

lmao

eternal osprey
#

does anyone know how i can test my api on my site?

currently getting:

Fetch API cannot load http://127.0.0.1:3000/login due to access control checks.```
sharp geyser
#

postman

eternal osprey
#

i swear i used to test my api and it worked great, but today it just decided to give me this error.

sharp geyser
#

they have a vscode extension too so you dont need to install anything

sharp geyser
eternal osprey
#

yeah

#

localhost works

#

but 127.0.0.1 is a no go

#

strangeee

sharp geyser
#

well from what I read online

#

it seems to be due to not having a trailing slash

#

💀

eternal osprey
#

crazyy

sharp geyser
#

Is it cheaper running an ai model locally than to use one through a service?

#

I am in need of a speech to text ai that will make it easy transcribing audio files

#

Google cloud offers this, but in the long run idk if it'd be cheaper to use it, or host one myself

eternal osprey
sharp geyser
#

😔

#

Idk how to do any of that

eternal osprey
#

You can try to train it on your own pc but it will cost you a lot of time and resources

sharp geyser
#

my laptop would explode

eternal osprey
#

Yeah don’t do that then

sharp geyser
#

😔

#

Its so expensive to use already made models tho

eternal osprey
#

Actually I think you need 2 ais to accomplish this

sharp geyser
#

What for

eternal osprey
#

One to generate the actual text and one to adverse against, that will actually correct the first AI

sharp geyser
#

😭

eternal osprey
#

It’s used a lot of create realistic image generators

#

Simply cooked.

sharp geyser
#

Well

#

Guess ima have to suck it up

#

and just use google cloud

#

Ion got the time nor money to do it myself

#

11.52$ per 8h audio file.

#

I might have to lower the max

#

That's simply too expensive

#

I am fucking cooked.

tulip plume
#

pretty sure the best alternative

sharp geyser
#

problem with that is I need one that can transcribe in multiple langauges

#

so google cloud's chirp ai model is the best thing for me

#

Its just pricey asf when you get into an increased amount of minutes

sharp geyser
#

I just saw that

#

And whisper is cheaper as well

tulip plume
#

or look into reverse openai api first PEPU
Good for testing

sharp geyser
tulip plume
tulip plume
sharp geyser
#

Actually neither offer a speech to text model

tulip plume
#

there is also zukijourney, which 100% offers audio

gg/zukijourney

sharp geyser
#

I looked at the wrong one then

tulip plume
#

i used both

#

for other stuff

#

the nice thing is, you can just use the openai lib and change base url

sharp geyser
#

What exactly does it mean 3 per minute?

tulip plume
#

its 3req per min

sharp geyser
#

Ah

#

Okay

#

So 3 req a minute, and 200 reqs a day

#

That's not bad tbh

tulip plume
#

pretty sure zuki has better limits as free user

#

let me see

#

naga was pretty awesome but now its too big

sharp geyser
#

Also, naga has paid credits, whats the point of those

#

💀

tulip plume
#

so they addeda lot of limits

#

you get like 5 credits for free every month

#

before it was purely req limit based

sharp geyser
#

What are the credits used for?

tulip plume
#

to make calls to their endpoints

sharp geyser
tulip plume
#

Its like every ai website

sharp geyser
#

They don't specify how much it costs tho for each call

tulip plume
#

1 Minute: 0.0015

sharp geyser
#

Unless it means it costs 0.0015 credits per minute

tulip plume
#

pretty sure it means for 1min audio, it takes 0.0015 credits

sharp geyser
#

yea no

#

thats per minute

#

If you send longer audio it will use that rate for every minute

#

and likely rounds up tbh

#

Still its cheaper than going through conventional means ig

tulip plume
#

for all other stuff its per call, so pretty sure, this is the same lol

#

i just checked zuki and she has no limits as far as i can tell

sharp geyser
#

12,000 minutes of audio costs 18 credits, 1$ per credit is 18$

tulip plume
#

because much smaller

tulip plume
dusky idol
#

How do people usually host their bot on more than one server?
I heard that for a large scale project, you need more than a single hosting?
So how is it exactly split? Is it shard based or something

sharp geyser
#

kubernetes

#

Services like OVH has kubernetes built in, allowing it to spawn servers as it needs.

#

You wont likely need kubernetes for a discord bot though, not any time soon.

#

You'd need to have a massive amount of servers to warrant the need for it.

sharp geyser
# dusky idol How do people usually host their bot on more than one server? I heard that for a...

Learn the basics of Kubernetes and how it's used to scale containers to massive workloads in the in cloud, in 100 seconds. https://fireship.io/tags/docker/

Docker in 100 Seconds https://youtu.be/Gjnup-PuquQ
Full docker Tutorial https://youtu.be/gAkwW2tuIqE

Official Kube docs https://kubernetes.io/

#docker #100SecondsOfCode

Install the quiz a...

▶ Play video
dusky idol
sharp geyser
#

Uh, no

#

Cause its quite literally an acheivment (meaning you'd likely never reach the need to start scaling horizontally) you likely would never reach. Unless your bot is in discord.js then maybe.

#

Depending on the language it also has its drawbacks, every language has its own ways of handling memory. The point of kubernetes is to scale your application horizontally, which is adding more servers onto your stack and spreading the workload. Vertical scaling on the other hand is increasing the spec of the hardware like the ram and cpu cores.

For a discord bot, you'd probably need to start scaling either way once you reach servers in the millions (depending on the language you are using and what your bot does)

#

Its hard to say when you should start scaling though, as me saying in the millions is just an estimate. Some languages are better at handling memory and have a lower footprint.

#

I am also very likely over exaggerating, but you'd still need a substantial amount of servers to warrant any sort of horizontal scaling, typically just upgrading your current vps is fine enough

sharp geyser
lament rock
#

Eventually you will hit a CPU bottleneck just by processing network packets

#

So that's always fun

sharp geyser
#

yea but horizontally scaling is usually not something you'd want to do in this case.

#

Vertically scaling typically is more than sufficiant

#

Unless you hit a limit there as well

#

horizonal scaling can also be rather expensive as well

sharp geyser
lament rock
#

I was having issues with gateway events at around 7000 servers processing messages but this was with the ws package. Tim's ws gave a huge performance uplift

dusky idol
sharp geyser
#

js

#

Any time you see someone say "I used tim's x" its always js

dusky idol
#

I hit 7000 yesterday, doubt how I'm gonna fix the issues I'm currently facing muidead

sharp geyser
#

What's the issue?

dusky idol
sharp geyser
#

Ah right.

#

Still having problems?

lament rock
#

Use cloudstorm and snowtransfer

sharp geyser
#

they use python

#

honestly zeksy, that lib you use for mongodb is so unheard of no one i've asked knows it.

dusky idol
#

Oh yes another issue, the ram keeps stacking up on the hosting
When I run the server the bot consumes like ~1gb ram. Overtime it keeps increasing tho
After 12 hours of bot being online, it hits like 4gb ram and everything becomes a little slower. I usually reload the server once every 12 hours to fix this issue. Still concerning

dusky idol
sharp geyser
#

pymongo

#

motor is listed on the official docs, but i've never seen people actually use it

#

pymongo was the one most people went for

dusky idol
sharp geyser
#

I've no idea on that. Nor am I suggesting you switch

#

If motor is listed on the docs of mongo then its supported by the community.

#

I also don't think what you are facing is necessarily a db issue, it just doesn't make sense

#

Databases are meant to be able to handle large amounts of requests

dusky idol
sharp geyser
#

maybe @lament rock is able to help more

sharp geyser
#

they are smarter than me

dusky idol
#

I could possibly use print statements to check where the command takes a stop

sharp geyser
#

Also 4gb of ram for only 7000 servers

#

thats abnormally high

dusky idol
#

yes i could tell

sharp geyser
#

Are you sharding? You kind of have to be casue discord forces you to at 2500

sharp geyser
#

ic

#

I mean, python has always been a slower language mmLol

#

4gb of ram tho just seems too high to be normal for python

dusky idol
#

it could be catch

#

because like something stacks up over time

#

the ram is at 1gb and then it slowly scales up

lament rock
#

If py allows dumping the memory for analysis, do that

#

Sounds like a leak

sharp geyser
#

yea

#

Also, could be the problems to your database queries taking longer than usual

dusky idol
dusky idol
#

true

sharp geyser
#

:p

dusky idol
#

well it takes from storage space, not ram tho. But could this possibly be the problem muidead

#

okay i doubt it's the problem, did some research and its just old code

sharp geyser
#

.git is a folder generated when you use the git cli tool so you can push your changes to GitHub

#

It’s for version control

dusky idol
# sharp geyser Have you did a memory dump?

Not yet, but I talked to the hosting support team
They told me while or for loops might be causing the load on the machine and it instantly ringed a bell.

So there's a jjk fight command which sends an image, and then dynamically updates it every 3 seconds.
Basically your character A attacks the Char B and does damage etc till one is dead.
This fight command takes around 3-5mins on an average and i believe it might be storing the images in ram.

That might be cause of the issue

#

Let me show you how I save the images usually

                arr = io.BytesIO()
                await background.save(arr, format='PNG')
                arr.seek(0)
                file = disnake.File(arr, filename='filename.png')
#

usually it's something like that ^

#

i doubt id need to re work this command or find a fix for it lmao

sharp geyser
#

Either way that’s still too much ram to be used

dusky idol
sharp geyser
#

Either way it also doesn’t hurt to do a memory dump anyway

#

Just to make sure

dusky idol
sharp geyser
#

While loops can cause a performance hit, I doubt it’d be that significant unless you’re seriously doing something wrong

sharp geyser
dusky idol
dusky idol
#

Another test I'm probably going to execute is disabling the fight command for ~6 hours and see how much difference it makes on the performance

#

if the difference is drastic then I might have to just fix this one command

sharp geyser
#

This is why if I make a bot with a lot of commands I group em into modules, that way I can disable either the entire module or a specific command :p

pearl trail
#

anyone know a way how to listen discord raw event from discord.net ?

wheat mesa
pale vessel
#

it doesn't save it to disk, wdym

#

it's using bytesio

wheat mesa
#

If you want to send an image, you’re going to have to save it in RAM at some point in the process. If you don’t want to, you can use a CDN or something of that sort

#

That looks like it’s saving it, is it not?

#

I don’t know what BytesIO is, that just looks like it’s going on the disk

pale vessel
#

bytesio is used to manipulate data in memory

wheat mesa
#

I see

#

Python once again making sure to overcomplicate functions that should be standard

#

Nice

frosty gale
#

you must be doing something wrong

#

probably even on the worst host

slender wagon
#

psql -U fivem -d fivem
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: Peer authentication failed for user "fivem"

do you guys have any idea why it uses peer auth instead of requiring the password?

dusky idol
# frosty gale it still shouldnt be this slow

No I believe that was probably the issue only
I disabled the fight command, now the ram only scales upto 800mbs-1.2GB unlike before.

                arr = io.BytesIO()
                await background.save(arr, format='PNG')
                arr.seek(0)
                file = disnake.File(arr, filename='filename.png')```

I believe this little shit just stores the image in memory and it's probably isn't deleted at all, as people run the command over and over the memory fills up and bot gets slower. That's an assumption
All I can say fs is that as soon as this command got disabled, the performance increased by 5times ![muidead](https://cdn.discordapp.com/emojis/1218213861388320808.webp?size=128 "muidead")
#

I'd want the command back however. The fight command is important
it's either that I get rid of images or find a better way to deal with it

#

I doubt it even deletes the image after the command has finished, it's more likely that it just keeps the image stores in the memory.
That's the only valid explanation I can think of considering that the memory isn't scaling up with having this command off

eternal osprey
#

hey guys i had learned java a pretty long time ago, i forgot a lot of it tho. Any good docs i can refer to, to refresh that bish

dusky idol
#

I'm still doing my research on how to resolve the problem xD. Pretty glad that I figured out what even is causing the problem muidead

dusky idol
pale vessel
#

sorry, but i'm not proficient with python. best to ask other users here

dusky idol
#

ah alright

rugged delta
#

SOMEONE PLS COME AND HELP ME

#

I need help

#

ASAFP

#

Liek in DMs pls.......

#

This is me rn^^

#

.^(

deft wolf
#

What

rugged delta
#

in Dms??pls/

deft wolf
#

If you want to ask a question, please ask it here. Personally, I don't text random people in DM's

frosty gale
#

no one will give you personal support for free unless you wanna pay for it

#

but it would be just as good asking for help here

shell tundra
#

ok guys

#

its happening

#

the code isnt coding

#

so im following the djs guide on making a bot

sharp geyser
#

I am here to help sunglas jk I got stuck on it too

shell tundra
#

and something went wrong bc commands weren't being deployed globally

#

and then misty is trying to help but he doesnt know either 😭

#

what part of the code should i show bc im clueless at this (first time)

#

wait let me just

#

everything on there

#
  • a deploy-commands file
sharp geyser
#

I hate the djs guide with a passion

#

🔥

#

its her first time man

real rose
sharp geyser
#

calm down

real rose
#

fr

sharp geyser
#

don't need a typescript library 😭

shell tundra
sharp geyser
#

its advised to do so

shell tundra
#

bro i dont even know typecript lets slo down

sharp geyser
#

detritus without ts is like shooting yourself in the foot

shell tundra
#

i think(?) thats what i had till misty edited stuff

sharp geyser
#

Im writing a class based framework for zobs rn

#

Well global commands can take up to 1h to show

#

guild commands which she is trying to post rn aren't showing

shell tundra
#

im p sure its been an hour since we started trying

sharp geyser
#

maybe

shell tundra
#

i've the bot in 2 servers

#

its showing it on 1, not the other

#

wait

#

do i need to edit the guild id

#

in config file

#

cuz its set to the other srver

#

ok

#

nvm its been on the guild im tryna make it work on 😭

sharp geyser
#

before you were doing it to the other

shell tundra
#

oh

#

anyways it has been fixed sunglas

sharp geyser
shell tundra
#

my eyes are in pain

shell tundra
#

I'm very happy with the coding progress

#

Very little but it's something

radiant kraken
#

I am also helping aaron on his discord.js framework

shell tundra
#

I've heard

#

Ur both poggers

sharp geyser
#

We will make it the best one you could possibly use

radiant kraken
ionic schooner
sharp geyser
#

we are doing this for zobs

#

dont be mean

ionic schooner
#

oh

#

understandable

sharp geyser
#

yea

ionic schooner
#

zobs for president

radiant kraken
sharp geyser
#

ong

radiant kraken
sharp geyser
#

Zobs for Vice CEO

radiant kraken
#

me for CEO

ionic schooner
#

whenever I do any other languages I think "man I could do this so much faster in rust"

sharp geyser
#

I was originally writing the framework in js

#

and then was like fuck this I need a type system

#

so I am using ts now

ionic schooner
#

ts is bae

sharp geyser
#

I forgot you can make js packages in ts

ionic schooner
#

Yeah honestly the best way to do it

radiant kraken
#

best of all worlds

sharp geyser
#

I honestly want to learn C at some point

#

but not this year

#

@radiant kraken since you are a C god

#

what is C written in

#

like

#

the compiler anyway

radiant kraken
#

i'm flattered

sharp geyser
#

you know more about it than me

#

so

#

yes

#

:D

radiant kraken
sharp geyser
#

So what is the C compiler written in

#

asm?

radiant kraken
#

The C compiler is written in either C/C++ or asm

#

It can be any compiled language really

sharp geyser
#

yea

#

but C is the birth of all modern languages (for the most part)

radiant kraken
#

Hahahaha yeah!

#

C is over 51 years old

sharp geyser
#

So how could its compiler be written in itself

#

Ion understand

#

How can the C compiler

#

be written in C

radiant kraken
#

With another compiler compiled by another compiler... and so on

#

Until a compiler written in machine code

sharp geyser
#

so

#

my hopes of writing a true programming language

#

not built on another

#

is but a dream

radiant kraken
#

Like Rust for example, the Rust compiler is written... in Rust

lament rock
#

but thats a pre compiled binary

sharp geyser
#

I want to make a programming language on par with C /j

#

itd be cool to make a language that doesn't rely on another like C or C++

radiant kraken
sharp geyser
radiant kraken
#

it would also teach you C/C++ too! :)

lament rock
#

asm is… Fun

#

I know how to write some forms of asm

#

Do I recommend it? Not really.

sharp geyser
#

fuck it

#

the only thing it does is let you view top.gg

lament rock
#

just strip chrome os

sharp geyser
#

even if I do that it'd still use up 40gb of ram

lament rock
#

You paid for the system. You will use all of the system

sharp geyser
#

lol

radiant kraken
lament rock
#

cc?

#

carbon copy?

sharp geyser
#

its our company project

lament rock
#

What about bcc?

#

Oh lol

sharp geyser
#

it'd be cool to make an OS

#

or even a programming langauge

#

Lets turn rust OOP

sharp geyser
#

🪆

radiant kraken
#

Rust++

sharp geyser
#

BET

#

we will rewrite cc in it

#

😏

sharp geyser
ionic schooner
#

Just rewrote everything in rust

radiant kraken
#

mhm

sharp geyser
#

Me and null are hiring rust devs for 0$ an hour

#

:)

radiant kraken
#

ahahahaha we don't need to, because we already are!

sharp geyser
#

nah we r++ devs

lyric mountain
#

Rawr devs

sharp geyser
#

ok im never posting that cursed shit again

lyric mountain
#

I saw it lmao

sharp geyser
#

and it will stay that way

radiant kraken
sharp geyser
#

nothing

radiant kraken
#

I must KNOW

sharp geyser
#

Nothing shall be known

#

My curse is I come up with new shit to do every day

#

forgetting I already have priorities

radiant kraken
#

We all went there

sharp geyser
#

yet I always get distracted

radiant kraken
sharp geyser
lament rock
#

@ mods leak deleted message!!

covert roost
#

question. is it possible for a bot to get banned for what it says with the say command?

lament rock
#

Yeah

#

It's your job to sanitize

pale vessel
pearl trail
covert roost
sharp geyser
#

yea you can

covert roost
#

how

sharp geyser
#

sanitize the input

covert roost
#

as if i knew how to do that perfectly

pearl trail
#

get 1 trillion list of curse words, filter the word with that

pale vessel
#

if bots like carlbot doesn't filter it, then you're probably fine

civic scroll
#

better yet, use machine learning

proud tartan
pale vessel
#

do you have your bot link?

proud tartan
dusky idol
#

Had to ask get some confirmation, pretty basic

@commands.command()
async def test(self, ctx):
   a = "anything"
   for i in range(1, 5): print(a)

This a as well as the loop is instantly dropped once the command is finished right muidead

sharp geyser
#

yea

gusty linden
#

hi

frosty gale
#

oh i think typescript supports them

#

thats awesome

green kestrel
past field
#

hello world

ionic schooner
tribal crow
#

Is this channel limited to bot development?

pale vessel
#

nope

tribal crow
#

Great

sharp geyser
#

hey gamers

#

I got a js/ts question ik can you believe it after swapping to rust I looked back!

#

I am making a framework for discord.js, and decided to bring some rust ideologies to it. Since I can't do feature flags, I kind of have to make multiple packages and just have them act as "feature" flags. My only worry is, if each package requires the same dependency, will it bloat the node_modules by reinstalling that dep

#

or does it just install it once, and have every package use it that requires it

#

Or does this vary depending on package manager?

harsh nova
sharp geyser
frosty gale
#

i hope so anyway

harsh nova
#

Also, making a framework for a framework???

sharp geyser
#

djs is a library

#

🤓

harsh nova
#

🤓

#

ATE

sharp geyser
#

beat you to it

#

L bozo

harsh nova
#

Not on my screen

sharp geyser
#

im on pc

#

so my opinion is more valid

#

L bozo

harsh nova
#

Yeah I reloaded and it changed :(

sharp geyser
frosty gale
#

mostly because its hard to keep track of this stuff to reuse a shared package and because its very likely 2 packages will end up having 2 different versions of the same thing

sharp geyser
frosty gale
#

i know a package manager like pnpm actually attempts to reuse packages with dependencies instead of each dependency having its own node_modules

sharp geyser
#

What about with pnpm

frosty gale
#

but i wouldnt worry about it too much

sharp geyser
#

Well

#

I don't want their node_modules to be bloated with the same package.

#

The entire framework runs based off a plugin system. You can make your own plugins as well by installing the core package which handles loading plugins and giving you the plugin class.

#

Very likely you will be needing the core package yourself, and then other plugins also make use of the core package

#

Would this also not likely cause version conflicts or whatever?

frosty gale
#

not even a bad project

sharp geyser
frosty gale
#

write an os that sets up everything required to run a reduced version of javascript

sharp geyser
#

bun as in the js runtime?

frosty gale
#

theres tons of js engines designed to run in embedded environments

#

then you can expose APIs in that js engine to basically make an os in js

sharp geyser
#

why not write an OS in zig

frosty gale
sharp geyser
#

Chloe x Tim

frosty gale
#

you can handle the js and engine side i can handle the os side

sharp geyser
#

a force to be reckoned

#

Also, how the hell should I handle loading plugins thonk

#

Should I just scan any directories that has classes with an instance of Plugin

frosty gale
#

this would be the most ridiculous project to ever exist

#

imagine writing system drivers in js

sharp geyser
#

💀

#

Sounds like it would be fun

quartz kindle
#

sounds like a nightmare

sharp geyser
#

oh hello tim

#

just the person I am looking for

#

please guide me in the way of js/ts

#

I haven't touched this language in 3 years

#

😭

quartz kindle
#

wut

mental glen
#

is it possible to fetch how many votes my bot has so i can put it in my botinfo command?

robust yacht
#

@shell tundra the bot has a help command its @pulse help

#

its in the status and works fine

shell tundra
#

you put $ as the prefix so that's what was tried

robust yacht
sharp geyser
#

you gotta resubmit

robust yacht
#

but with a ping

robust yacht
sharp geyser
#

👍

frosty gale
#

@shell tundra can i make a bot that can only be reviewed by a specific reviewer

sharp geyser
#

I mean, just make the reviewer zobs

#

and you will 100% get approved

#

Your chances of not getting zobs as your reviewer is higher than getting struck by lightning

frosty gale
#

i will pick the worst one so that my public eval command can be approved

#

admin permissions as well

sharp geyser
#

bot require admin perms to send messages

robust yacht
shell tundra
#

you will pick worst what

robust yacht
#

anyone can grab ur token through that

sharp geyser
#

aka u /j

shell tundra
frosty gale
shell tundra
#

after yesterdays events yes i am the worst 💀

robust yacht
#

ok ill resubmit

sharp geyser
#

bro idek the rules of that event and I can already tell I dont want to fucking do it

shell tundra
#

give me the damn repo
"r u on drugs"

#

oh i was talking about my little mistake

sharp geyser
#

Oh

#

LOl

shell tundra
#

💀

robust yacht
#

@shell tundra btw the crypto cmds only work within a svr i beeh lasy asf for once i resubmit so yk its working just im lazy to make function in dms

shell tundra
#

if there's no commands what am i meant to test?

#

ok that was funny why'd you delete it

sharp geyser
#

the commands that are available zobs

shell tundra
#

i have done the laughing

sharp geyser
#

delete your messages I can put it back

robust yacht
#

lol

shell tundra
#

ok

robust yacht
#

kk

#

ill resub

shell tundra
#

submit fast i need to review 2 bots in 15m to get even number reviews

sharp geyser
#

well if she cant test the commands

#

what is there to test

shell tundra
#

their mom

sharp geyser
#

HAHAHAHAHHAHAHAHAHA

shell tundra
#

thasnk im so funny omg

frosty gale
#

yk i think its time to finally make a discord bot

#

and submit it to topgg

#

not for anything serious but for the sake of it

shell tundra
#

i am indeed making one

frosty gale
#

ill make one that lets you spawn a temporary linux vm and do anything on it

sharp geyser
shell tundra
#

best cmd ever

sharp geyser
robust yacht
#

@shell tundra done

shell tundra
#

u think i can review in 8 mins?!?! jk yes i cna

robust yacht
#

LMAO ty

#

ill create a /help ans $help cmd later tdy as well for now its just @pulse help

#

thanks

shell tundra
real rose
#

bro

sharp geyser
real rose
sharp geyser
#

what you think of my framework code ray

#

😏

real rose
#

i dont see any fw code

real rose
#

i see that

#

mmm

sharp geyser
#

But you can vaugely see the idea im going for

proven lantern
#

is the Manage Messages permission ever needed for a bot to edit/delete it's own messages?

lament rock
#

No, never

#

the permissions for a bot to edit its own messages is view channel and read message history

proven lantern
#

gotcha so one way i could get an error trying to edit a message is if i dont have read message permission in the channel the message was written to

lament rock
#

read message history but yes

#

Use interactions if you absolutely must edit the messages and not after 15min

#

interactions largely ignore permissions

proven lantern
lament rock
#

Ah

proven lantern
#

right now my bot asks for manage messages permissions and doesn't need them, pretty sus

#

so i just need history?

lament rock
#

View channels is read messages

#

read message history and view channels

#

err maybe it might work without read message history. view channel is a must tho

#

Reactions require read message history so I assumed the same would apply for editing messages even self

#

manage messages is only required when editing someone else's messages for setting flags

#

Try it and see tbh

dusky idol
#

Either way so here's the update, I got suggested by my host provider to not use Atlas or buy a dedicated Atlas server instead I can host my MongoDB database on the hosting itself.
According to him if bot and database are getting hosted on the same server then there will be 0 latency/network issues as bot dont gotta build a connection bla bla

Yap wall aside now is the question, what region do I get my discord bot's server for? Which one will give best performance possible with discord's API? I'm assuimg the closer the host is to discord's hq the faster it would work muidead
Just tell me what is the most ideal geographical region to host a discord bot on

sharp geyser
#

Hey Ophidian

#

I have a question for you

#

Have you ever made a npm package in ts and it was useable to people who used js?

dusky idol
lament rock
sharp geyser
#

Right right

#

My problem is

dusky idol
#

ohh

sharp geyser
#
  1. We can't use js files, because the compiled js code has import/export
  2. We can't use mjs files, because the compiled files are not mjs, so we can't do import {Something} from 'package'
#

We are running into errors left and right

dusky idol
#

let me just drop the options hol up

dusky idol
lament rock
#

utah is us west-central

#

miami might be best

dusky idol
#

Ohio database, couldn't ask for anything more

lament rock
#

ohio is us east perfection

dusky idol
lament rock
#

no lol

dusky idol
#

bruh

lament rock
#

texas is us west

dusky idol
#

oh

#

buffalo ny?

lament rock
#

ny is north east. Ohio is middle of eeast

#

its perfect

dusky idol
lament rock
#

no

#

middle of us east is

dusky idol
#

what muidead

lament rock
#

ohio

dusky idol
#

Ohio is perfect for discord bot?

#

I can already see memes coming in

lament rock
#

ok and?

sharp geyser
#

ReferenceError: __exportStar is not defined what kind of bullshit

lament rock
#

export * isnt supported in cjs

civic scroll
sharp geyser
#

BRUH

civic scroll
sharp geyser
#

What am I supposed to do this, this bs

#

Wanna know what I quit

#

ts wasn't meant for me

civic scroll
#

or change tsconfig

#

by default its output is like ES3

#

or ES5 i don't rember

#

module stuffs are from ES6 onward

sharp geyser
#
{
  "compilerOptions": {
    "module": "CommonJS",
    "target": "ESNext"
  }
}
lament rock
#

This is what happens when the js ecosystem is fragmented

sharp geyser
#

I guess I don't do ESNext for my target

#

💀

lament rock
#

esm sucks imo

sharp geyser
#

Well I don't want to force people to use mjs

#

but not ot mention, the transpiler doesn't output mjs files

#

so people can do things like import {} from ''

#

so

lament rock
#

if its esm its mjs

#

same thing

#

mjs is just a file extension

#

cjs is for common js

sharp geyser
#

We were getting errors like this

SyntaxError: Named export 'ShensuoClient' not found. The requested module '@shensuo/core' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from '@shensuo/core';
const { ShensuoClient } = pkg;
lament rock
sharp geyser
#

Thing is idk what its talking about

lament rock
#

or export { value }

sharp geyser
#

Yea but I don't get it

#

Dk what its talking about module.exports

dusky idol
# lament rock ok and?

also could you quickly tell whys us-east more api friendly? I earlier thought west might be it conisdering discord hq is at san frencisco

sharp geyser
#

I use barrel files and export class

lament rock
#

the dif js flavor have dif module import and export syntax. module and exports is a cjs term

lament rock
dusky idol
civic scroll
#

remember, it's your application that reads / writes to the database, not discord api

dusky idol
civic scroll
dusky idol
civic scroll
#

but like i said, pick a location that is physically closest to discord api servers

civic scroll
#

which is not on pterodactyl

dusky idol
civic scroll
#

ah, understandable

civic scroll
#

yeah

dusky idol
civic scroll
#

hit up discord cto

dusky idol
# civic scroll yeah

Migrating from atlas to petro shouldn't be that hard or lets hope its not lmao

civic scroll
#

tried to compile mongodb once

#

was a nightmare

dusky idol
civic scroll
#

you can have petro join mongodb's cluster then copy data from there

sharp geyser
#

I blacked out and wrote this

earnest phoenix
#

Hi, I need help with my bot. Idk why it's still offline. I have already verified few days ago

earnest phoenix
sharp geyser
#

what are you using

earnest phoenix
#

I used Python and it's made years ago until recently I found out someone messed with mine so I made a complaint through Discord support. They took out my restriction and asked me to reverify and i did

sharp geyser
#

ok

#

are you sure you started the bot

earnest phoenix
sharp geyser
#

Are you double sure? No errors in the console?

#

Did you reset your token at any point or was it reset

earnest phoenix
#

Yeah because it worked before as well

sharp geyser
#

Check your console for errors

earnest phoenix
#

Because it's created years ago with my friend and i might have forgotton how to do it

sharp geyser
#

Okay, check your console for errors

earnest phoenix
sharp geyser
#

I guess?

earnest phoenix
#

ok

#

also how do i change the image here?

sharp geyser
earnest phoenix
#

I did

sharp geyser
#

you have to click refresh data, click edit, change something like adding a dot to your description and click save

earnest phoenix
sharp geyser
#

I am going crazy sayu

civic scroll
#

i know

sharp geyser
#

Like

#

all the code I just wrote

#

usless

#

the design is flawed

#

😭

green kestrel
#

hey

sharp geyser
#

hello

green kestrel
#

hows stuff?

sharp geyser
#

I am going absolutely bonkers

#

you?

civic scroll
#

hi brain

green kestrel
#

lol how come

sharp geyser
#

sayu, you use ts extensively right?

civic scroll
green kestrel
#

ahahaha

civic scroll
green kestrel
#

you didnt need that ram

civic scroll
sharp geyser
#

I need someone to help me come up with a better design for my project cause the way it is rn, plugins are fucking useless

#

😭

#

I implemented the plugin system so poorly, its not even useable

#

It does what it is written to do, but it doesn't mesh well with anything

green kestrel
#

at least its not a minecraft server

#

check the swap usage lol

sharp geyser
#

300 threads go brrr

green kestrel
#

lol ikr

sharp geyser
#

8gb/8gb

#

nice

civic scroll
sharp geyser
#

Not necessarily

#

its a design problem.

#

I implemented it in a bad way

civic scroll
#

oh

sharp geyser
#

That now its better off not using it

civic scroll
#

brb

sharp geyser
civic scroll
#

watching goblin drawing tutorial

sharp geyser
#

lol

#

gl

sharp geyser
#

but your input might be helpful

green kestrel
#

i have swap because i have to, or linux shits the bed

green kestrel
sharp geyser
#

Its more of a design flaw than actual ts I think

civic scroll
#

@sharp geyser also plugin wise you will need to
register the plugin at runtime
let the plugin be known to the type system (possible through namespace patching)

green kestrel
#

given up on C++ now? lol

sharp geyser
#

well

https://github.com/collegecrafts/shensuo-core & https://github.com/collegecrafts/shensuo-commandhandler are where the code is at.

Core has the plugin class, then the client class which handles loading the plugins. This is all fine and dandy but the issue arises when I am loading the plugin.

CommandHandler has ofc the CommandHandler class which extends Plugin from the Core package. Issue is, anything attached to CommandHandler class is basically useless because it only recognizes properties attached to the master class, in this case Plugin. Not to mention, when getting a plugin like the CommandHandler, you have to do `client.plugins.get('commandhandler') (assuming you put the name of the plugin as commandhandler as people can make their own plugins). Which I think is kinda meh, I feel like plugins should be attached to the client class but idk what you think

sharp geyser
#

I am kinda taking inspiration from rust's cargo package manager with its feature flags, and making the framework work based off a plugin system so you can simply install what you want to use and disregard the rest.

#

Instead of what other frameworks do and add bloat onto an already bloaty package, and you likely will never use everything that framework has to offer

green kestrel
#

so like npm just not crap

sharp geyser
#

Well it still uses npm ofc

#

but I split the modules of the framework into different packages

#

So you only install the packages you need

#

core package only has the client and plugin loader and its also the package all plugins need

#

then you can install plugins like the commandhandler which relies on the core package to create the plugin :p

#

Its like a plug n play type thing

sharp geyser
#

💀

#

if node had a cargo like package manager it'd be leagues better already

radiant kraken
#

i'm planning on making ports for two major C++ discord libraries, D++ and DiscordCoreAPI

eternal osprey
#

can i be held liable if i creatyed a site and some payment went wrong, without being the site owner myself?

#

For example the user paid but my endpoint suddenly went offline for some reason

sharp geyser
#

Whatever service you are using should have record of that payment.

#

Have them reach out to you if the payment went through on the processors end but not yours.

#

This isn't legal advice

#

but its due diligence

radiant kraken
#

but you are the Top.gg Lawyer™️

sharp geyser
pine willow
sharp geyser
#

Honestly, i'd put payment processing into its own microservice though or smth.

#

Not attached to the main instance

#

Less risk of it going down when your api does. Unless its just a server issue

eternal osprey
#

i might do a full on review

#

once the site is up

#

i will test it for days and days to make sure it doesn't happen

#

but, in any sense can i be sued over a failed transaction

#

but that's actually really start

lyric mountain
#

monetary transactions are usually atomic

eternal osprey
#

smart, before payment i will send like a mock transaction to see if endpoint works. If not, i will simply return an error and block incoming requests.

lyric mountain
#

basically they either happen or they dont, no in-between

#

so u can just query the service once in a while to sync transactions

#

if it goes offline just tell the user to wait

eternal osprey
#

i use stripe to do so

eternal osprey
#

so that my site does not recognize it

sharp geyser
#

Request Timed Out 😏

lyric mountain
#

like, manually request the list, instead of being passive

#

you can use both

#

just like you do with topgg votes

eternal osprey
#

but to be fair, i don't think anything goes wrong because as soon as i use the webhook, i can simply update the user already which has a small chance of erroring

#

but in any case, can i be held liable?

#

What if i have that i as a developer cannot be held liable in my terms of service, privacy policy etc?

lyric mountain
#

privacy police has nothing to do with this

#

you could be held liable if the money was taken but you did nothing to attempt to fix the situation

#

so as I said, query the api once in a while to check if you lost any trans

eternal osprey
#

What i want to implement is before we start the transaction, create a stateful entry of the user.

#

If completed, set to complete, if not but paid, we can actually query all those users and perform the action anyways. Maybe once each day?

green kestrel
#

what sort of cpu(s) is that?

#

or it is a heavily virtualised solution?

green kestrel
#

its only when you are taking payments, not delivering the service and offering no way to communicate to get help, activate the service or seek refund that it becomes a problem

#

in the case the webhook didnt deliver payment state to your servers, you can check on the gateway for the transaction, and once verified you can retrigger it or make it right yourself

#

thats what i'd do

#

if the concern is real that the service may be down, and unable to receive a webhook, you need to rethink your service availability, make it more robust. perhaps add redundancy

#

in the real world for most people (unless you host on your wifi, in your bedroom at your parents house) its a non-issue

#

also most financial systems retry webhooks, with a backoff, so eventually you'd receive the webhook anyway

unreal umbra
#

Do you offer Bot developers community

lyric mountain
#

uh...what?

eternal osprey
#

definitely made me less anxious

#

let me translate this for you guys:
"Hey i don't know how to code, but i want to make money by coding. I will search clients and you will do all the hard fucking work that will make you bald before you reached 30 years old (you'll probably die as a virgin as well). It's 50/50 btw."

unreal umbra
#

I am looking at making Privacy Policy and terms and condistions and wnated to know the best way to make them

eternal osprey
#

termly e.g. has a good one

lyric mountain
#

dont use one for PP

#

you need to state what info you use and how you use

#

NO

#

go somewhere else, nobody is going to work for free here

unreal umbra
lyric mountain
#

it doesn't need to be an essay, just be clear on how you use users' data and how they can ask for deletion

unreal umbra
#

does YouTube channel url come under Personal Information Collected Automatically (Derivative Data)

lyric mountain
#

uh, probably

#

you dont need to be too formal on the PP, just state what you store and why you need it

green kestrel
#

youre supposed to pay for them

lyric mountain
#

that's a guide, not a generator

#

it explains what you should include in it

green kestrel
#

true, mainly talking about their generator

unreal umbra
green kestrel
#

probably not

#

its a legal document

#

if you do, first time its tried legally a lawyer would poke holes through it like wet toilet paper

green kestrel
lyric mountain
#

that's more regarding ToS, not PP

#

PP is less strict than ToS

green kestrel
#

the whole hipster "dont be formal" thing is bs, if you look at all the informal PP's they have a formal part underneath and the informal bit is a summary

#

the wording is very important

#

especially when it comes to things like GDPR

#

PP protects end user, TOS protects YOU

#

rules laid out in the TOS give you a concrete reason to ban people who abuse your service, with no legal comeback on their part

#

rules laid out in privacy policy give the user concrete terms on how you store and use their data

#

i mean what if you just go "we dont give your data to third parties" <- exactly this, in your PP

#

you are breaking it the minute you connect to discord or any API

#

you know what you meant to say, but a lawyer would have an absolute field day with you

eternal osprey
#

though it's limited to 1/pp

green kestrel
#

and 10,000 page views per month

#

any popular bot is way above that

eternal osprey
#

owh damn dind't now

eternal osprey
#

anyone know how i can fix this...

#

my image appears to be too small for my content

#

so the background repeat shows this ugly repeat from the top like:
top
bottom
top
bottom.

#

How can invert the background repeat?
like
top
bottom
bottom
top?

lament rock
#

You'll need two image divs where one is normal and the other is flipped upside down

#

If Im understanding properly

mental glen
#

this look good?

#

what else should i do?

#

that blob thing kinda looks weird imo. idk lol
(yes i got the button idea from dank memer aPES2_Hehe )

lament rock
#

too much empty space

#

Very bland design. Modern design is very boring when you're trying to convey fun. Look up fun design elements for websites

sharp geyser
lament rock
#

ctor functions are fun

#

the js parser is very loose and its cursed

sharp geyser
#

its dumb you can just chain new

#

💀

solemn latch
#

you just want the newest you can get

#

I get it

quartz kindle
#

its not the only thing you can chain :^)

sharp geyser
#

ong

#

there's a lot I can chain tim

#

like ur mom

solemn latch
sharp geyser
#

ok bye

quartz kindle
#

you cant chain my mom, shes unchainable

sharp geyser
#

😏

#

Ask @shell tundra that

shell tundra
#

sorry tim's mom is in my basement

lament rock
#

chained

quartz kindle
#

funny, she just told me she locked someone in her basement

sharp geyser
#

oh snap

#

zobs got gotted

sharp geyser
#

😏

#

Honestly tim should setup a code review site

#

make bank

lament rock
#

Just have ChatGPT do it

sharp geyser
#

lol

#

You had an error, heres some code from a github issue of the guy facing the same error!

quartz kindle
sharp geyser
#

matter of fact

#

let me look at twitch again

quartz kindle
#

i thought about doing that tbh, stream code reviews... and shitting on bad code

#

xD

sharp geyser
#

its my new framework

quartz kindle
#

no :^)

sharp geyser
#

First time using typescript in 3 years

quartz kindle
#

i just watched an interesting video about a job interview at microsoft from 1994

#

the interviewer asked the interviewee to implement a strcpy function in C

#

the interviewee made something like for(i = 0; (*output[i] = *input[i]); i++)

sharp geyser
#

hey man, the twitch Software and Game Development tab is popping off

quartz kindle
#

and the interviewer wasnt satisfied, they wanted something even more compact

sharp geyser
#

Nope, I accidentally paused on a twitch streamer and got hit with ads AGAIN

#

twitch really hungry asf

quartz kindle
#

lmao

sharp geyser
#

how do you get more compact than that

quartz kindle
#

while(*output++ = *input++) {}

#

lmao

#

C shenanigans

sharp geyser
#

isnt that...an inf loop?

quartz kindle
#

no because C strings are null terminated, so at some point it will reach a null character, which will resolve to false

sharp geyser
#

or would it go on until it reaches the end of a string

#

since C doesn't have strings

#

they have char * right?

quartz kindle
#

ye

sharp geyser
#

makes sense

quartz kindle
#

but the actual interesting part is

sharp geyser
#

damn I actually know something thats correct for once

quartz kindle
#

30 years later, the guy who was the interviewee at the time revisited it, and actually checked the compiler output

#

and it turns out the for version is faster

#

huehuehueheu

sharp geyser
#

lmao

#

honestly I wanted to learn C

#

but like

#

I know no one who knows C

#

so I can't fact check myself

#

😭

quartz kindle
#

ask brain

sharp geyser
#

Does brain know C?

#

I mean ig c++ is an abstraction of C

#

but