#development

1 messages · Page 65 of 1

serene thistle
#

Adding

#

Server

surreal sage
#
let array = []
let object = {"array": []}

How would I push the items in object.array to array? (without .forEach if possible)

#

array.push(...object.array)?

#

yup thats it

lyric mountain
earnest phoenix
#

anyone know how to make a specific message send with option choices? discord.js v14

lyric mountain
#

technical debt is a thing u dont want to have

surreal sage
boreal iron
lyric mountain
boreal iron
lyric mountain
#

not so much micro, spread is a hella slower

surreal sage
lyric mountain
#

and what error happened?

surreal sage
#

None

earnest phoenix
boreal iron
#

Huh what

#

Your question was how to send a message with option choices

earnest phoenix
#

yeah

#

this is what i did for the option thing

const playerRC = interaction.options.getString('player-rc')
#

is that right?

boreal iron
#

channel.send({ content: "Java sucks", components: […] });

#

… is your array of components

#

In your case your select menu

lyric mountain
#

so you'd have to assign the returned array to the property

#

arr = arr.concat(object.array)

boreal iron
#

That has actually nothing to do with your question

#

Just explain once more what u wanna do, please @earnest phoenix

surreal sage
spark flint
#

Is it possible to clear a select menu's selection after it is used?

lyric mountain
#

just edit the components

neon leaf
#

and yes, the one from chakra works when I dont edit it

neon leaf
#

fixed it, had to add this to the formik block
initialValues={{ }}

outer crater
#
@client.event
async def on_message(message):
    if message.content.startswith('.rules'):
        embedVar = discord.Embed(title="Title",
        description="Desc", color=0x00ff00)
        embedVar.add_field(name="Field1", value="hi", inline=False)
        embedVar.add_field(name="Field2", value="hi2", inline=False)
        await message.channel.send(embed=embedVar)

ERROR: Bot not responding

rustic nova
#

full stacktrace thanks

earnest phoenix
outer crater
#

It responding to other cmds

rustic nova
#

you're not catching if the user is the bot itself

#

also, still provide a stacktrace, that error is not descriptive at all

rustic nova
#

because that would explain why your bot got ratelimited, if it has been

#

and would explain it not responding

outer crater
#

RIP, everything was fine by my internet was so slow that it didn't save anything

outer crater
#

can I use message.content.startswith as a variable and use it?

**```
trigger = message.content.startswith

@client.event
async def on_message(message):
if message.author == client.user:
return

    if trigger('.hi'):
          await message.channel.send('hello')
lament rock
#

not like that as message would be undefined

lyric mountain
#

why is your font funny

lament rock
#

you'd have to define it in the event

slender wagon
#

so is there a way i could put a rule in db to not accept users with the same ID

lyric mountain
#

there's not only a way, but a rule for structuring data on sql databases

rustic nova
#

me when primary key

lyric mountain
#

all tables should have 1 or more primary keys, which is, by definition, an unique identifier for each row

rustic nova
#

and that left thing is not a primary key

#

fyi

lyric mountain
#

optionally you can use AUTO INCREMENT to make it increment automatically

rustic nova
#

atgrainger

lyric mountain
#

I'd even go a little further and make a constraint where username + discriminator must be a unique combo

#

since discord doesn't allow duplicate name + discrim too

compact pier
#

I'm trying to write cookies on my client with react-cookie and cookie but it somehow doesn't work.

const [accessToken, setAccessToken] = useCookies(["accessToken"]);
....
setAccessToken("accessToken", data.token.accessToken, {
  secure: true,
  maxAge: 900,
  httpOnly: true,
});
#

btw Next.js

slender wagon
#

and just using the convos

lyric mountain
#

nono, you will still need ids

#

ids are used for indexing the data, it drastically increases query performance

lyric mountain
#

1, 2, 3, 4, ...

#

you don't need to supply an id when inserting data

#

unless u want a specific id

slender wagon
#
pg.query("INSERT INTO premium(id, username, discriminator) VALUES(1, 'random', '4232')", (err, res) => {
console.log(err, res);
});

what i am doing here is very basic

lyric mountain
#

your issue is in the structure itself

lyric mountain
#

show me ur table ddl

slender wagon
#

what's a ddl

lyric mountain
#

data definition language

#

the script u used to create the table

#

or did u create with the gui?

slender wagon
#

ik it's cringe

#

i created it with gui

lyric mountain
#

not cringe at all, go to "alter table" or smth and show me how it's structured

slender wagon
lyric mountain
#

that's the id column

#

but well, go to general

slender wagon
#

nothing much here

rustic nova
#

create table data (id primary key autoincrement, username text, discrim integer)

lyric mountain
#

hmm, weird gui

rustic nova
#

but yeah that gui weird

lyric mountain
#

but yes, drop the whole table and execute what una said

rustic nova
#

una

#

kekw

lyric mountain
#

but use username varchar(32)

#

inb4: maximum allowed username length

rustic nova
#

what's more beneficial? limiting var length on sql or checking the var length on the code?

lyric mountain
#

code, but also limit on database

slender wagon
#

oh okay

slender wagon
lyric mountain
#

reason is trying to input data bigger than the column size will raise an exception

#

and exceptions are quite costly

lyric mountain
slender wagon
#

i am a bit confused with this one

#

id primary key autoincrement

lyric mountain
#

ok, i'll break it up:

#
id INT PRIMARY KEY AUTOINCREMENT
├┘ ├─┘ ├─────┘ ├─┘ ├───────────┘
│  │   │       │   └ will receive an `N + 1` number as default value, with `N` being the current value
│  │   │       └ it's a key
│  │   └ primary constraint (non-repeating and not nullable)
│  └ will hold integer values
└ name of the column
#

una forgot the type of the column

lament rock
#

CREATE TABLE users (id TEXT, username VARCHAR(32), discriminator VARCHAR(4)) PRIMARY KEY (id);

#

just store the actual IDs bruh

lyric mountain
#

U almost nailed it, if not for TEXT

#

And discrim can be a smallint

#

Id can be limited to 32 chars

boreal iron
#

Text as primary key… smh

#

What prevents you from just using an INT AUTOINCREMENT primary as ID?

#

Full text searching on columns other than the primary one is still faster in the indexed table than text as primary column

#

Would even make more sense to use the user tag as primary key (or unique) as VARCHAR instead of text

#

32 chars max + hashtag + 4 digits as discriminator

earnest phoenix
# boreal iron Just explain once more what u wanna do, please <@456226577798135808>

i have a command with option choices:

        .addStringOption(option =>
            option
                .setName("apply-for")
                .setDescription("What are you looking to apply for?")
                .setRequired(true)
                .addChoices(
                    { name: 'Player RC', value: 'player-rc' },
                    { name: 'Creative RC', value: 'CREATIVE RC' },
                    { name: 'Creator RC', value: 'CREATOR RC' },
                )
        ),

And when a user picks a option i want a specific embed to send so Idk if this works but i put down this:

        const playerRC = interaction.options.getString('player-rc')

and when i do playerRC.reply({}) i get a error. So idk if im doing it right

lyric mountain
#

it's usually much better if u need to fetch a certain user by id

boreal iron
#

Ah thought he just wants an unique id

#

But a bigint primary id which represents the discord user id still make more sense than text

boreal iron
#

player-rc is just the value u get once the user selected it

earnest phoenix
#

so how do i make a specific message send when a user selects the option

quartz kindle
#

something like this i guess ```js
const choice = interaction.options.getString('apply-for');
if(choice === "player-rc") {
// do something
} else if(choice === "CREATIVE RC") {
// do something else
} else if(choice ==== "CREATOR RC") {
// etc
}

earnest phoenix
#

ahhh okok tyty

tight scaffold
#

hey hey guys, im trying to get my site to embed in discord but for some reason im only getting the image to pop up by itself. can you tell me what im doing wrong?

<meta property="og:image" content="https://mewdeko.tech/assets/img/monogatari-series-background-hd-1600x900-108924-1.jpg">
    <meta property="og:type" content="website">
    <meta property="og:description" content="Invite Mewdeko! The only completely free bot that's both open source and completely customizable.">
    <meta property="og:url" content="https://mewdeko.tech"/>
    <meta property="og:site_name" content="Mewdeko" />
    <meta name="twitter:card" content="summary_large_image">
solemn latch
lyric mountain
#

Also u forgot to close last tag

tight scaffold
lyric mountain
#

Doesn't matter

tight scaffold
#

since it thinks its a "new" site

lyric mountain
#

U can't bypass discord cache, I tried it

#

As long as it's the same endpoint, it'll still cache regardless of params

solemn latch
#

🤔

lyric mountain
#

Except if ur sending an image url

solemn latch
#

you need a query param

tight scaffold
#

i just did it

tight scaffold
#

.... why is discord so stupid

#

and why did it send as a separate message

lyric mountain
#

Well, it's still the same message

#

Now remove the #

tight scaffold
#

yeah that ik, will have to wait ages

lyric mountain
#

Like, the cache probably cycled while u were trying

tight scaffold
#

nah

lyric mountain
#

When I was testing my og tags I made multiple endpoints to test it

tight scaffold
solemn latch
#

I think query params work 🤷

tight scaffold
#

ye

#

query params work for some odd reason

solemn latch
#

its probably using the cloudflare setting kek

tight scaffold
#

prolly

earnest phoenix
#

are you able to mention a role in dms?

lyric mountain
#

kinda

#

but the other side will see deleted-role if they dont share the same server

earnest phoenix
#

i was just testing with myself and it came up as deleted-role

#

is there a way to fix that?

lyric mountain
#

nope

#

there's nothing to fix, it's the client that transforms text mentions into interactive mentions

earnest phoenix
#

ahh okok

distant spruce
#

mother fucker dude

#

my ass just got whooped by this mexican

wheat mesa
lament rock
#

might be something to test

boreal iron
#

Nope, tested that already

#

For testing of tags you simply add some random GET parameter

#

To bypass the cache and play around with it

shut socket
#

How do you think to make music for my bot? If so, which networks should be included in the supported ones? I will definitely turn off YouTube, but what else do I need to turn off?

earnest phoenix
#

@solemn latch can u recheck my application

earnest phoenix
#

If you mean that we check them when we need new staff members.

#

If you mean your bot's approval we check your bot once its your bot's turn in the queue. It can take up to 2 weeks

#

Now please stop mentioning or DMing random staff member or you may get muted, thanks kryptonWriting

outer crater
#

How to make custom prefix?

earnest phoenix
#

Sorry for Ping

boreal iron
outer crater
#

..

boreal iron
#

Not to say that nowadays it makes much more sense to move to application commands anyways, aka. slash commands

outer crater
#

yhea

earnest phoenix
outer crater
#

.

dry imp
#

just delete it

outer crater
dry imp
#

u mean slash command?

outer crater
#

[No]

dry imp
#

ok

lyric mountain
#

non-slash commands aren't registered at all, just delete the file or the binding whatever

outer crater
#

I want bot to delete command after command is used

lyric mountain
#

delete the message, you mean

#

because "delete command" makes little sense since command means code

outer crater
#

🚶‍♂️

lyric mountain
#

u need to use the proper words when asking questions, else there might be confusion understanding what u want

rose warren
#

Slash commands 67.6% adopted without even incentivising or pushing people to use them 👀

lyric mountain
#

I mean, for the end user slash commands are way more appealing than prefix commands

rose warren
#

Yeah they're much better

lyric mountain
#

for the developer tho... 💀

rose warren
#

The UX is much easier than messages

#

For users

#

And honestly for devs it can be easier too tbh because you have Discord's native input validation

earnest phoenix
#

Well arguably in Python there's no difference for example

lyric mountain
#

it's easier if u use common command-response cmds with little syntax mutability

#

slashes allow little flexiblity when you need to have different syntaxes based on supplied args

rose warren
#

Yeah they can be a pain sometimes

outer crater
#

Finally, did it

rose warren
#

I've only ran into that once though

outer crater
#

Oh, hi mac

lyric mountain
#

I made my handler in a way that I can switch to slashes at any moment by flicking a switch, I'm just waiting for discord to implement conditional syntaxes

outer crater
#

How I can use every msg as a cmd input for an api

rose warren
#

I run slash commands and prefixed commands off the same files but have to do a bunch of input validation and handling at the top of each file which is a pain

outer crater
#

.message.content.startswith()?

lyric mountain
#

that'll only check if the message starts with X

outer crater
#

Okay

#

Then?

lyric mountain
#

...then?

#

I didn't really understand your question

outer crater
#

.message.content.startswith(Every single message)

lyric mountain
#

you're new to programming aren't you?

outer crater
#

💀

#

Yes

lyric mountain
#

well, I'd recommend you to take a few crashcourses before starting a bot, it'll save you a lot of headache later on

outer crater
#

Well I made a bot that detect toxic msgs

#

But in other lang

lyric mountain
#

which lang?

outer crater
#

BDSCRIPT 😂

lyric mountain
#

that's not really a lang, and let's be honest, it did 99.9% of the job for you

outer crater
#

Yes

lyric mountain
#

programming is like...writing a bread recipe

#

you need to tell the runtime EXACTLY what you want to happen

outer crater
lyric mountain
#

sometimes, like in your question, it reads very fluently

#

message.content.startsWith

#

"message content starts with"

outer crater
#

Yhea ik

lyric mountain
#

so, if you were to write in plain english, "message content starts with every message" makes little sense

outer crater
#

I wanna build that same bot

#

So

#

I want every msg to be send to api

rose warren
lyric mountain
#

using raw coding is much more complex than using a bot builder, but also much more powerful

lyric mountain
outer crater
#

Bro u got that badge

lyric mountain
#

oh there we go again

#

I verified right at the start of it, that's why I have the badge

lyric mountain
#

I...cant because it takes a lot of time and dedication

outer crater
#

I got both

lyric mountain
#

I don't

outer crater
#

😭

lyric mountain
#

google has a ton of tutorials on how to program using js

outer crater
#

Are u serious

#

Js?

#

NO

lyric mountain
#

yes, js is what you're using

outer crater
#

No

lyric mountain
#

does your code contain {?

outer crater
#

No

lyric mountain
#

oh it's python then

outer crater
#

Yhea

#

Ik

#

I can read

#

import

#

Things

#

Are in py

lyric mountain
#

I'll be honest, python has a HUGE complexity curve later on

#

it starts easier, but snowballs very quickly

outer crater
#

It looks simple

lyric mountain
#

for now

#

but well, there are a ton of py courses on google too

outer crater
#

I just can't even make ma bot online with js

#

Idk where to use }

#

And wtf is const

lyric mountain
#

a constant

#

aka a value that wont change

outer crater
lyric mountain
#

variables are variables

outer crater
#

Okay

lyric mountain
#

they can change along the way

outer crater
#

Constant in maths

lyric mountain
#

I call python a "newbie trap", because it looks easier at first sight, but when you notice it's already too late

outer crater
#

What you use

lyric mountain
#

java

outer crater
#

Okay

lyric mountain
#

back to the topic, run a few courses on python to learn how things work, the longer you study the more you'll get to know it

lyric mountain
#

like, very "english-y"

radiant kraken
#

because it is

outer crater
#

But at the end it sucks

radiant kraken
#

it's primarily targeted towards beginner programmers

lyric mountain
#

well yes, but things get very messy real quick if your codebase gets big enough

#

they made it as a scripting language, they didn't account for bigger codebases

radiant kraken
#

messy?

lyric mountain
#

yes, very messy

radiant kraken
#

doesn't that apply to every language

lyric mountain
#

kinda, but most non-scripting langs have ways to make understanding the code easier later on

#

like, I love bash but I'd never use it to write full-blown projects because it's fuckin unreadable at bigger sizes

radiant kraken
#

lmao

#

what's the difference between scripting and other types of programming languages

#

interpreted?

lyric mountain
#

scripting languages have a shitton of abstraction and ways to write one-liners for objective tasks

#

with python I can manipulate windows and files like eating a piece of cake

#

no sweat, clear and precise

#

I wouldn't write scripts in c++, java or even js, per se, since they'll drag the code way longer than if I used bash, python or lua

#

using threads is...at best "awful" in py (js suffers the same), since you need to juggle child processes around instead of multithreading directly within a single runtime

dry imp
outer crater
#

I don't wanna say this but that words made you look like avg 10 year old

outer crater
lyric mountain
#

not really "threads", it still spawn child processes

dry imp
lament rock
#

oh wait no

#

SharedArrayBuffer

#

they are actual threads

outer crater
#

Ok

lyric mountain
#

hm, interesting, so node does allow multithreading

earnest phoenix
#

Yeah node have their way with worker threads

#

Pretty nice article

stiff dust
#

guys if do bulk delete more than once is api spam how some bots delete more than 100 messages

earnest phoenix
#

They add a rate limiter in their code that follows the rate limits of Discord

stiff dust
earnest phoenix
#

You code it so that you follow the rate limits, they're written in the documentation

outer crater
#

Delete 100 msgs 2 times

earnest phoenix
#

That's cool but doesn't change anything

#

The same applies in any other library or language

#

Might want to take a look at what rate limits are on the internet, so that you don't delete messages too fast for Discord to not like it

#

Once you know what they are, it should be self explaining how to follow them

outer crater
#

Just send msgs quickly

earnest phoenix
#

You won't get spoon-fed with code here though

outer crater
#

Hey

#

Hoist

#

How to set every messages in channel as a command trigger?

earnest phoenix
#

Listen to message create events?

#

Don't quite understand your question kryptonShrug

lyric mountain
earnest phoenix
#

Never heard of that

#

Some sort of BDFD replicate or what?

outer crater
#

No

earnest phoenix
#

Oh it's the syntax they use

outer crater
#

Like

earnest phoenix
outer crater
#

I send something

#

Like

#

Anything

lyric mountain
earnest phoenix
#

Yeah, then don't expect to have the same freedom as when using a proper library & programming language

#

They probably don't even support raw event listeners

lyric mountain
#

Told them to do a few courses, but apparently they didn't yet

lyric mountain
#

Now they're using dpy

#

But have virtually no knowledge of programming

earnest phoenix
#
@bot.listen()
async def on_message(m):
  print(m)
#

¯_(ツ)_/¯

solemn latch
#

finished bot

earnest phoenix
#

yes

stiff dust
# earnest phoenix That's cool but doesn't change anything

well what should I do? I don't want code but I don't understand well what is the rate limits for bulkDelete ing message for example waiting 10 second between each bulkDelete is enough? so if they bulkDelete 1000 it will delete the messages after 100seconds, I know what is the rate limit but don't know how should I create a rate limiter/rate limit checker

earnest phoenix
#

Discord's API docs will tell you how many messages you can delete, then make the bot rate limit/wait accordingly

lyric mountain
#

also, bulk delete cannot delete very old messages

earnest phoenix
lyric mountain
#

ye

lyric mountain
lament rock
lyric mountain
lament rock
#

in other languages, sure

lyric mountain
#

no, quite the inverse

#

in other langs (those that use multithreading) u cant halt the whole application (save for a few weird langs, like delphi)

#

had a talk with tim not so long ago abt that, how awaiting inside an event caused the application to freeze

lament rock
#

Even ES Modules (await in top level) cannot fully halt the thread as even things like import statements are collected on load regardless of where they appear in the file, so if you want to do an async task before loading a module, you literally can't

lyric mountain
#

not talking abt modules, imports or anything like that

lament rock
#

The import statement is async

#

it is intrinsically awaited

#

but all of the imports are pushed to a Promise.all

#

The thread still is not halted

#

I have had to work around this in a few of my projects that were once cjs

#

Only synchronous methods can halt the thread

lyric mountain
#

I would not compare imports with general awaits

lament rock
#

The stack trace of errors related to imports literally includes Promise.all

lyric mountain
#

still

lament rock
#

If you can produce code that halts the js thread, I'll believe you

#

I have literally never witnessed the thread being halted

lyric mountain
#

cba to make a djs bot for testing purposes

#

if there's anything wrong with that test I'll modify it, the file will stay there while I dont close the ide

#

the promise was supposed to execute infinitely without stopping "The end" from being printed

lament rock
#

This is because the event loop works in ticks and while loops halt the tick execution as the thread waits for each tick to complete
The PromiseConstructor itself is not async, so the callback is executed immediately on the same tick and the while loop halts the tick, thus anything below doesn't happen

lyric mountain
#

hmmm aight, brb

#

but wait, what can I use to test then?

#

if I make another promise await that async loop, it'll still be inside a promise constructor

lament rock
#

You were trying to argue await blocks the thread

lyric mountain
#

yes, gimme something to await

lament rock
#

when something is awaited, it's pushed onto the event loop

#

:)

lyric mountain
#

why would a fetch would hang forever?

lament rock
#

Does it need to hang forever for the effects to be noticeable?

lyric mountain
#

pretty much yeah, or a task that'll take very long to complete

#

else it'll result in unnoticeable difference

#

oh ik one

lament rock
#

Immediate console logs should be noticeable

#

they would be out of order

#

66ms to load a page is not a small amount of time when it comes to nodejs' throughput

lyric mountain
#

indeed it didn't halt, perhaps it only happens inside events then

#

tho I'll not create a bot to test that

lament rock
#

you can construct a new EventEmitter
const { EventEmitter } = require("events")

#

I'm pretty sure the events module is not coupled to the logic of the underlying event loop

lyric mountain
#

ok, ran 2 tests:

  • if the promise is created with setTimeout to resolve it later, it works normally
  • if I make any long-running task inside the promise, simply calling it will prevent the second event from running at all
lament rock
#

Just due to how node waits for each tick to finish

quartz kindle
lament rock
#

idk if worker_threads have their own event loop

quartz kindle
#

yup

lament rock
#

Smart

lyric mountain
#

I cannot think of any long running task other than an infinite loop, js is inlining everything I put

#

but ye, await does basically nothing regarding it, calling the method itself is enough to halt it

lament rock
#

regular expressions funny enough halt the thread with compilation and matching

lyric mountain
#

I wonder what monster of regex manages to take more than 1s to compile

quartz kindle
#

everything in js is sync

#

until the point it isnt

#

even promises, callbacks and events are all sync

#

until one specific point when they exit the current event loop iteration

lament rock
#

At their core, yeah

quartz kindle
#

exiting the current event loop can only be done in a handful of ways

#

thats what actually makes the code "async"

lament rock
# lyric mountain I wonder what monster of regex manages to take more than 1s to compile

Compiles are usually no problem. Cloudflare had an issue when it comes to matching, a regex they deployed backtracked a lot of times causing CPU exhaustion at scale and was just a regular expression denial of service. The part of a larger regex that caused the exhaustion was .*(?:.*=.*)

An example string they provided was
x=xxxxxxxxxxxxxxxxxxxx matched against that regex takes 5,353 steps mainly just backtracking.
https://blog.cloudflare.com/details-of-the-cloudflare-outage-on-july-2-2019/#appendix-about-regular-expression-backtracking

The Cloudflare Blog

Almost nine years ago, Cloudflare was a tiny company and I was a customer not an employee. Cloudflare had launched a month earlier and one day alerting told me that my little site, jgc.org, didn’t seem to have working DNS any more.

lyric mountain
#

lmao

earnest phoenix
#

ReDoS are fun

outer crater
#

What if session id is leaked?

lyric mountain
#

ID usually matters very little if exposed, but the log isn't supposed to be public anyway

#

like, it's probably a hash or smth, it's not like having your token leaked

earnest phoenix
#
  • they most likely reset
lyric mountain
#

very likely

lament rock
# outer crater

main gateway sessions can be exposed just fine since they're under bot tokens. Sessions under the voice are more detrimental to leak

lyric mountain
#

chances are it's just the current timestamp + shard index hashed into md5

lament rock
#

sessions only reset if you do something to invalidate your session like sending a bad packet or something or your bot doesn't reconnect within 2 min

outer crater
# lament rock sessions only reset if you do something to invalidate your session like sending ...

Like 2022-11-08 23:55:12 INFO discord.gateway Shard ID None session has been invalidated. 2022-11-08 23:58:10 ERROR discord.client Attempting a reconnect in 5.41s Traceback (most recent call last): File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/discord/client.py", line 627, in connect await self.ws.poll_event() File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/discord/gateway.py", line 645, in poll_event raise ConnectionClosed(self.socket, shard_id=self.shard_id, code=code) from None discord.errors.ConnectionClosed: Shard ID None WebSocket closed with 1000

lament rock
#

Discord sends you an invalid session whenever you try to resume a session when it's past its expiry time or you did something bad

outer crater
#

Like?

lament rock
#

Sending invalid JSON or sending JSON which doesn't follow the { op: number; d?: any; s: number; t?: string } format

#

or sending an identify packet.d in a presence update op

outer crater
#

Btw

#

It's py

lyric mountain
#

json is json regardless of lang

lament rock
#

every language has a JSON serializer/deserializer

outer crater
#

Ok

lyric mountain
#

dont mind too much about the technical details, focus on learning how to code first

outer crater
#

Ok

lyric mountain
#

the lib abstracts all those stuff for you, you'll very rarely, if ever, need to tackle into the internals

outer crater
#

It is not giving error now

#

This is my code

#

I learned sending embed msgs till now

earnest phoenix
#

nano

lyric mountain
#

aside from using nano for coding, you really shouldn't hardcode the token

outer crater
#

...

#

Okay

boreal iron
#

_probably doesn’t matter at this point anymore _ smirk

outer crater
#

I like ur pfp FakE

lament rock
#

nano > all other editors

#

who needs intellisense

#

your editor suggesting to you how you should code? Blasphemy

boreal iron
#

cough notepad++ cough

lyric mountain
#

well, better to happen during verification than after it goes public

#

that said, test your features properly, don't simply give admin and call it a day

rustic nova
#

gotta love when you dont unittest your bots :3

#

if it works locally and on my server with admin, so will it on the moon

lyric mountain
#

gotta love when

boreal iron
#

tf... why do you need to test ur bot?

#

don't u trust ur own coding skills?

rustic nova
#

ofc I do lol

boreal iron
#

nubs exposed

rustic nova
#

I'd control a car with my spaghetti code

#

it might not drive stable

#

but it drives

boreal iron
#

lol

#

who needs stability if you can have fun instead

rustic nova
#

Just have the car randomly stop Troll_Smile

#

I mean I am doing a esp32-based selfcontrolled car in vocational school rn

#

should just make a 5% chance of it just stopping lol

#

also a toy car, not an actual one

boreal iron
#

add another 5% chance after stopping to go reverse full speed

rustic nova
#

yess lmao

#

0.05% of just falling apart bigbrain

boreal iron
lyric mountain
#

when u declare steering wheel angle as an integer instead of double

#

angle-snapping wheel

rustic nova
#

buffer overflow wheel

#

run doom on car when

lyric mountain
#

tho rip if it uses rad instead of deg

boreal iron
#

entering one 0 too much... wooshh cut off your legs

wheat mesa
#

Lmao

lyric mountain
# rustic nova run doom on car when

This video tutorial will explain how to mod your Porsche 911 or other car to run Doom in just three easy steps. No engineering experience is required, it only takes a couple minutes, and this works for many different cars built in the last couple years.

Demoed with Doom and Doom 2 with a 2017 Porsche 911 Carrera S Cabriolet.

NOTE: This mod was...

▶ Play video
rustic nova
#

say fucking less

lyric mountain
#

KEKW I think at this point everything that has a screen had someone attempting to run doom in it

rustic nova
#

aaaand

#

bad apple

lyric mountain
#

idk why bad apple is so popular, or where did it come from, I just know it's everywhere

rustic nova
#

funny weeaboo dance in black and white omg

lyric mountain
#

there's an anime btw, but it barely covers the lore

radiant kraken
lyric mountain
#

but why bad apple specifically

radiant kraken
#

because it's just a black and white video

#

which makes it really easy to put on everywhere

#

though ngl bad apple is a banger

lyric mountain
#

it is, it's just odd that a random video from some nobody got to doom level

radiant kraken
#

though it's not just some random video, the music video exploded in popularity when it first came out

surreal sage
#
// asynchrous thread
for () {
    return new Promise((resolve) => {
        resolve()
    })
}
wheat mesa
#

`for () {

surreal sage
#

there

#

This would technically work right?

wheat mesa
#

I mean yeah, but there's no point in the loop

surreal sage
#

I know

#

Just an example

wheat mesa
#

since the function will return after the first iteration

surreal sage
#

Didn't bother to fill in any arguments

#

But it would go to the next iteration once resolve is fired correct?

wheat mesa
#

No

#

You're returning from the function

#

return transfers control back to the calling function

surreal sage
#

Remove return and it'd work?

wheat mesa
#

It would do nothing at that point

#

What's your goal?

#

this is an x y problem

surreal sage
#

The next iteration would start once the current iteration would "idle" or finish right?

wheat mesa
#

That's what await is for

#

If you want to wait for the result of a promise, await is the way to go

#

You can use .then callbacks as well but they're messier in the long run

#

I think what you're looking for is an anonymous self executing async function maybe?

#
(async () => {
  // Async stuff
})();
surreal sage
#
for (let iteration = 0; iteration < 2; iteration++) {
    promise().then(() => {
        console.log("Yippie!", iteration)
        //"I have finished"
    })
}
#

I'm just going back to the basics

#

Reminding myself yk

#

The for loop would go to the next iteration once "Yippie" is logged right? (Since it's the last line)

wheat mesa
#

What you put there is correct, but you can simplify it to something like ```js
for (let i = 0; i < 2; i++) {
await promise();
console.log("Yippie!", i);
}

#

async/await is a lot cleaner

surreal sage
#

Would I have to put the for loop in an asynchronous thread?

#

Or am I just asking stupid questions at this point where the question I'm asking is a yes already.

earnest phoenix
#

is it possible if a user only has access to buttons if they used the command and no one else can use them?

quartz kindle
#

you cannot disable or hide the buttons from other users, but you can ignore the button press so that nothing happens except if the user is correct

#

or you can put the buttons in an ephemeral message, only the user can see the message if its ephemeral

earnest phoenix
quartz kindle
surreal sage
#

await promise() correct?

quartz kindle
#

if you dont use the await keyword, you will only be initializing the promise, without any guarantees of fullfilment

#

yes correct

surreal sage
#

And no differences if it's in a try block?

quartz kindle
#

the same thing applies to a try block, it will only catch the error if the await keyword is used

surreal sage
#

sum like this?

quartz kindle
#

yes

surreal sage
#

Thanks for the time.

quartz kindle
#

np!

surreal sage
#

Should I move the continue statement into the finally statement (or whatever I should call it)?

quartz kindle
wheat mesa
surreal sage
quartz kindle
wheat mesa
#

It's less ambiguous

surreal sage
quartz kindle
#

unless you want it to skip the current iteration prematurely

wheat mesa
#

The compiler is guessing where you MEANT to put them, but that may not always be where you intended them to be

surreal sage
#

🦆

wheat mesa
#

It's usually not a huge issue, but it improves readability and reduces the chance for bugs

#

You can get a linter or something like prettier to do it for you even

surreal sage
wheat mesa
#

And you can set it to format on save

wheat mesa
earnest phoenix
surreal sage
#

found it

#

I gotta get used to this now

#

shut up you twat NERD

lament rock
#

shut yo bitch ass

radiant kraken
wooden warren
#

does discordgo have a way to await for a user message?

radiant kraken
#

it's not as ambiguous, unless you do things like

if (a.isTrue())
  something()
  other()

or

const a = () =>
  69
  + 420
wheat mesa
#

I think it looks ugly and can cause bugs

earnest phoenix
#
class MyClient(commands.AutoShardedBot):
    def __init__(self, *, intents: discord.Intents):
        super().__init__(intents=intents, command_prefix=check_prefix)
    async def setup_hook(self):
        for filename in os.listdir('./cogs'):
            if filename.endswith('.py'):
                await self.load_extension(f'cogs.{filename[:-3]}')
        await self.load_extension('jishaku')
        dbl_token = "e"  # set this to your bot's Top.gg token
        client.topggpy = topgg.DBLClient(client, dbl_token)

@client.event
async def on_autopost_success():
    print(
        f"Posted server count ({client.topggpy.guild_count}), shard count ({client.shard_count})"
    )
#

is this correct?

earnest phoenix
#

Try it and see. Then report back the errors, if any, here

old cliff
#

what was the built in node alternative of using oneline for multi line strings which don't break indentation?

fringe marten
#

Any help?

earnest phoenix
#

How about waiting some time for stackoverflowers to reply?

#

Waiting and being patient is part of being a developer :)

#

If you ask in tons of places and get a response at one place you most likely won't reply to the others that took the time to reply somewhere else; so ask at one place and wait BunNod

earnest phoenix
outer crater
#

Okay

outer crater
#

command

#

Error:

Traceback (most recent call last):
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/discord/ext/commands/core.py", line 190, in wrapped
    ret = await coro(*args, **kwargs)
  File "/data/data/com.termux/files/home/discord/bot.py", line 36, in unban       banned_users = await ctx.guild.bans()
TypeError: object async_generator can't be used in 'await' expression         
The above exception was the direct cause of the following exception:
                                                                              Traceback (most recent call last):
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 1347, in invoke
    await ctx.command.invoke(ctx)
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/discord/ext/commands/core.py", line 986, in invoke
    await injected(*ctx.args, **ctx.kwargs)  # type: ignore
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/discord/ext/commands/core.py", line 199, in wrapped
    raise CommandInvokeError(exc) from exc                                    discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: object async_generator can't be used in 'await' expression
earnest phoenix
#

Blindly copying code from old tutorials won't help you learn, especially from such a bad tutorial serie on YouTube

lyric mountain
earnest phoenix
#

correct

#

can also tell you it's the part 6 of the series they're following

lyric mountain
#

tf

#

is that part of brev training?

earnest phoenix
#

Nope

#

Been helping in the python server for like 2 years for discord bots

#

Enough to be able to recognize tutorials just by seeing snippets

#

Here ya go

outer crater
#

Yes

lyric mountain
#

lmao

earnest phoenix
#

Lucas is also popular for that horrible tutorial series

outer crater
#

Why horrible?

earnest phoenix
#

Not sure if that's a good thing to be popular for that but yeah KEKW

outer crater
lyric mountain
earnest phoenix
#

word i was searching for

outer crater
#

At least better than my physics teacher

earnest phoenix
#

cc @lyric mountain@outer crater

lyric mountain
#

credit card? /s

boreal iron
earnest phoenix
#

¯_(ツ)_/¯

outer crater
#

Google cloud is better than local host?

earnest phoenix
#

It doesn't serve the same purpose

outer crater
#

But they got better internet connection than me

earnest phoenix
#

You definitely don't want to host your bot at home

outer crater
#

I'm doing rn

earnest phoenix
#

GCP is one out of many other providers, you probably don't want to go for GCP or AWS due to their pricing

outer crater
#

Yhea

#

Something free

earnest phoenix
#

Nothing then

wheat mesa
#

Oracle has a free VPS

outer crater
wheat mesa
#

Dear god no

#

Replit is ass

#

Don’t use replit

outer crater
#

Rate limit?

#

Oaky

wheat mesa
#

Oracle is perfectly fine for a free VPS for hosting a small bot

#

You will eventually need to upgrade, but that goes for any service. Oracle at least provides a proper VPS for free

outer crater
earnest phoenix
#

There is definitely no server limit because Oracle doesn't create their VPS specifically for Discord bots

#

You most likely have a specific amount of hours per month/year your VPS is running for free, after that you'd need to pay

solemn latch
#

I really reccomend reading and understanding their free service tier before using it in a production environment.

earnest phoenix
#

Why is DPI so complicated NotLikeThis Should've never started that

lyric mountain
#

they cancel your account out of the blue without any justification

#

I used to think tim was joking, until it happened to me not so long ago

lyric mountain
#

u use it for whatever u want, as long it's legal

outer crater
outer crater
earnest phoenix
#

And that is why free VPS are not good

rustic nova
#

and that is why free things in general are not goid

#

good

#

what a surprise

#

quality comes with a price, if you can't provide that price, you won't be able to have that quality

lyric mountain
#

free = not good
good = not free
free + good = you're the payment

rustic nova
#

free + good + unlimited = they're selling your data

#

also, + heroku: omg free token may I use uwu

earnest phoenix
#

heroku is paid either way

#

so doesn't fit with the free part

rustic nova
#

whatever host has some sort of tier that allows you to private your stuff lol

sick agate
#

imo

#

heroku should have sticked to free plan with ads

earnest phoenix
#

With ads?

#

Absolutely useless

#

You get once a week/month or something on the panel, if you have automatic deployments you never even go there

sharp briar
#

I have had 3 free oracle machines running for about a year now with no issues

lyric mountain
#

well, you run the risk of having them terminated without previous warning

sharp briar
#

I'm not too worried about it because it's just personal programs being run. And even moreso now that I have a home server

#

Just no point in migrating them to my home server if they're doing their own thing there without issues

outer crater
#

Ppl running home server

boreal iron
#

You should be well aware about the runtime costs and hardware prices

quartz kindle
#

how many FakEs does it take to run a bot

neon leaf
#

How can I limit the body size in a node:http server?

lyric mountain
#

you simply reject the request if it exceeds a certain size

neon leaf
#

how do I get the size? Just check if the body has like more than 1 mil chars or something?

lyric mountain
#

yes

neon leaf
#

would that prevent massive post bodies lagging a server?

lyric mountain
#

do note, it wont work if u intend to use it to limit upload size

lyric mountain
#

and it doesnt matter if it's get, post, put, delete, whatever

#

the server will receive it regardless, receiving is what can crash a server

#

if u want to prevent that, use a middleman

#

like nginx

neon leaf
#

does expresses body-parser have the same problem?

lyric mountain
#

idk what that is, but if the request reaches your server, it's already too late

quartz kindle
#

you can check the content-size header

#

before you start actually downloading the data

#

or rather, content-length

#

not content-size

solemn latch
#

That's what I thought.

#

I wasnt sure if I was remembering correctly though

quartz kindle
#

express and body-parser have a size limit option you can configure

solemn latch
#

That doesn't really prevent long uploads though.

ie, if I upload 1 million characters and send 50k a second, that still will cause issues right? 🤔

#

no wait, we've talked about this before. thats non blocking?

quartz kindle
#

the server wont process any data until you tell it to

#

for example in node:http you need to explicitly add a "data" event listener to start receiving the data

#

until you do that, the stream is paused

#

the uploader's side is also paused

#

the uploader will only start uploading when the server starts downloading

#

so you can check headers and reject the request before the upload starts

neon leaf
#

will the header always be available when a body exists or can malicious people somehow remove it?

quartz kindle
#

content-length is mandatory except when you use chunked transfer encoding

#

afaik

#

chunked transfer encoding is used when the total size is not known, for example for audio/video/dynamic file streams

#

in that case each chunk will have its own content-length

neon leaf
#

is content length the amount of characters or size in bytes?

quartz kindle
#

another thing you can do is start reading the data, but only read X amount, and if still not finished after reading that amount, cancel the reading and reject

quartz kindle
#

node has methods to manually read streams

#

instead of using the data event

lyric mountain
#

Can't content length be faked tho?

solemn latch
#

I would imagine express stops downloading as soon as content-length is reached.

lyric mountain
#

No express

#

They're using raw node http

buoyant estuary
#

Any idea If this code will work

module.exports = {

prefix: 'shutdown',
description: 'help_shutdown',
action: async function (msg, data, safeDS, command_message, message, app_permissions) {

    // Check Global Permission
    if (safeDS.config.allowShutdown) {

        // Shutdown
        if (app_permissions.superAdmin) {

            await safeDS.console.file.sendDSUserLog(msg, 'mod', 'info', 'log', `${safeDS.lang.get('cm_shutdown_result', data.lang)}`, null, true);

            // Emit Event
            await safeDS.events.emit('command_shutdown', {
                bot: data.index
            }, msg);

            safeDS.close_app(`${safeDS.lang.get('cm_shutdown_alert', data.lang)}`.replace('{user}', msg.author.tag).replace('{id}', msg.author.id));

        }

        // Nope
        else {

            // Emit Event
            await safeDS.events.emit('triedSuperForbiddenCommand', {
                bot: data.index,
                command: 'shutdown'
            }, msg);

            // Send Message
            await safeDS.console.file.sendDSUserLog(msg, 'mod', 'error', 'error', `${safeDS.lang.get('cm_shutdown_not_allowed', data.lang)}`, null, true);

        }

    }

    // Nope
    else {
        msg.channel.send(safeDS.console.discord.error(`${safeDS.lang.get('cm_shutdown_not_allowed', data.lang)}`));
    }

    // Complete
    return;

}

};

wooden warren
#

been tryna make this for a while

#

does anyone know how I can do it with markdown?

buoyant estuary
#

Cant rn

quartz kindle
buoyant estuary
#

My host is messed up rn

quartz kindle
#

for example:

- 1. something
- 2. something else
wooden warren
earnest phoenix
#

.

quartz kindle
#

use number and dot directly then

#

without the -

#
1. something
2. something else
buoyant estuary
#

I get notifications when my bot joins servers

wooden warren
#

it looks like this

earnest phoenix
#

That most likely uses HTML with custom styling

earnest phoenix
#
  File "main.py", line 5, in <module>
    client = commands.Bot(command_prefix = "!")
TypeError: __init__() missing 1 required keyword-only argument: 'intents'
 
#

i have this error

#
import os
from discord.ext import commands

client = commands.Bot(command_prefix = "!")
async def hello(ctx):
    await ctx.send("zsx is a W")

    token = os.environ['TOKEN']
client.run(TOKEN)``` My code, Its a project im creating but i wanna see what im doing wrong
spark flint
#

you're not passing intents over

wooden warren
#

how do I fix this huge spacing though? xD

earnest phoenix
# spark flint you're not passing intents over

import discord
import os
from discord.ext import commands

intents = discord.Intents.default()
client = commands.Bot(command_prefix='!', intents=intents)
async def hello(ctx):
await ctx.send("zsx is a W")

token = os.environ['TOKEN']

client.run(token)

#

?

lyric mountain
#

your token is inside hello command

buoyant estuary
#

Yeah you need it hidden lol

sudden geyser
#

Is there a way to get a user from the API without authorizing (i.e. to hit /users/...)? I'm working on my personal site and don't want to hard-code my Discord tag.

dry imp
#

use lanyard api?

lament rock
#

could save your info in a db

sudden geyser
#

I ended up just using laryard (ty daff), though am considering a more permanent solution

earnest phoenix
#

Then you'll need to have a backend that gets that information using Discord's API

sudden geyser
#

yes but how would I do that?

#

(presumably not using a bot application)

earnest phoenix
#

You have no option but to use authorization using for example a bot application's token, since you're working on your personal website you can just put that in there and fetch the user information

sudden geyser
#

So Discord still requires a bot application even if the bot won't actually interact with anyone?

rustic nova
#

if making changes to options such as roles etc, yes

earnest phoenix
#

The bot doesn't have to be connected to the gateway or anything like that in anyway, the main reason the user endpoint requires authorization is to ratelimit you if you exceed the limit

sudden geyser
#

oo now I see

#

ty

earnest phoenix
#

Find yourself

crystal wigeon
#

Hey how do i get my bot on app directory?

#

on the developer portal page it says my bot meets all requirements

#

but its not appearing on the app directory

#

am i doing something wrong??

earnest phoenix
crystal wigeon
#

yes

crystal wigeon
earnest phoenix
#

damn that's whys it wont show for me 😢

crystal wigeon
#

what? lol

earnest phoenix
earnest phoenix
crystal wigeon
#

kekcry can i get some real help pls

#

ig your bot isnt verified haha

earnest phoenix
crystal wigeon
#

good luck with it

earnest phoenix
#

ty :)

crystal wigeon
crystal wigeon
outer crater
#

Where I can host my website for free? I got my html file....any suggestions?

crystal wigeon
#

pls help

outer crater
#

Woh you got your Bot verified

rustic nova
#

but lol enjoy that 000webhostapp domain

outer crater
crystal wigeon
#

how do i get my bot on app directory

earnest phoenix
#
  1. Have your bot verified
#
  1. Fill all the requirements which are
crystal wigeon
#

but the "Enable discovery" is disabled for me

crystal wigeon
earnest phoenix
gilded plankBOT
outer crater
#

Okay,,lemme check

lyric mountain
#

there's also replit

outer crater
outer crater
lyric mountain
solemn latch
#

Keep in mind domains cost money.

outer crater
#

Yhea ik

#

But

#

There is one option

lyric mountain
#

tk is...something else

outer crater
#

With replit

lyric mountain
#

you never really get to "own" any of freenom domains

#

you just borrow them, and your site gets iframed inside a proxy site

#

this causes many services to simply reject talking to your site at all (since freenom tlds have a looooooong history of scams)

solemn latch
#

Iirc tk domains can be taken from you at any point.
If it grows too much they will take the domain back and ask you to pay a lot of money

lyric mountain
#

that too

solemn latch
#

Which you'll at that point have to pay, because all your users only know that domain.

lyric mountain
#

they also include a few trackers in that proxy site, so there's the privacy concern

radiant kraken
#

time to ddos every website using the .tk domain

solemn latch
#

Tk domains are amazing for fun projects that you only intend to use for a short period of time.

radiant kraken
#

.repl.co tho

outer crater
#

It's saying not found

lyric mountain
#

repl co is the suffix for replit

outer crater
#

Why

#

It's not showing full link?

#

@lyric mountain can i use javascript and collect ip of visitors? Is it legal?⚖

lyric mountain
#

well...it's a gray zone

outer crater
#

Umm?

lyric mountain
#

it aint illegal, but u need to state you'll be collecting it

#

and gathering ip is usually frowned by people

#

the question is, why do you need it?

#

ip is considered sensitive data, so it falls under GDPR (whatever it's called in your country)

wheat mesa
#

Hint: just don’t steal user data

#

IPs are mostly used for validation purposes. If you have no legitimate reason to collect them, then don’t

#

Simple as that

lyric mountain
#

and if you do, remember sensitive data must have a TTL and be available for deletion at any time

outer crater
#

OK

rustic nova
#

but.. but.. I wanna see the funny numbers

outer crater
#

...

outer crater
#

220.189.254.114

rustic nova
#

fe80::1

lyric mountain
#

best number is 0xDEADBEEF

#

it's even used globally as a debug status code

rustic nova
#

beadbeef

#

dead

#

fuck

lyric mountain
#

converted to ip it'd be 222.173.190.239

outer crater
#

How to send a entered txt to other txt file

#

Use 127.0.0.1 for any experiment

lyric mountain
outer crater
#

...

lyric mountain
#

u added an extra zero there

outer crater
#

To .txt file

#

With

#

Html

fringe marten
#

Is there a way to like get options if you've selected an option
for example im creating a slash command, and if someone creates the option "enable" they get a list of other options like "channel", "role" etc but if they select disable then none of the options are there. djs v14 any way of doing that?

rustic nova
#

nope

fringe marten
#

aww

#

guess i have to create 2 different commands

lyric mountain
#

u need to use js

outer crater
#

Yhea

#

I'm using

lyric mountain
#

the lack of mutable syntaxes is awful

lyric mountain
outer crater
#

Idk

#

Like

lyric mountain
#

open file, write text, close file

outer crater
#

Its

lyric mountain
#

search google

outer crater
#

Null

#

$("/text.txt").html(data.ip);

#

But it will be like I have to use paragraph id

lyric mountain
#

buddy ur ip logging

outer crater
#

Yhea

#

From

lyric mountain
#

*sigh*

outer crater
#

website

#

Like greek

#

For

#

Something

lyric mountain
#

what part of "You shouldn't grab IPs unless you really need them" did you miss?

#

and in plain text, to put a cherry on top

#

you're asking to get sued for GDPR breach

outer crater
#

It's for EU

hidden gorge
lyric mountain
#

it's a pretty much standard law, with very little variation between them

outer crater
#

I'm doing at ma localhost

#

It's not a big deal

#

Hosting with python

lyric mountain
outer crater
#

How

lyric mountain
#

why tf are u making a site if you'll only use it locally?

outer crater
#

I don't have money

lyric mountain
#

we gave u a lot of free options

outer crater
#

Yhea

#

I use replit for ma bot

#

As I said

lyric mountain
#

"#1 ranked" KEKW ok

outer crater
#

6k users boi!!!!

lyric mountain
#

u meant servers right?

outer crater
outer crater
#

You know which is best platform to host imgs and videos for Website with HD quality

#

@lyric mountain you were typing something

hidden gorge
lyric mountain
lyric mountain
lyric mountain
#

and "with hd quality" depends on what u send

outer crater
#

Rip me, I use Discord

lyric mountain
#

Why "no"?

outer crater
neon leaf
#

just use your replit instance for images / videos

#

I do too for small projects

lyric mountain
#

No, no no no

lyric mountain
#

Your repl bandwidth will suffer if u do that

#

Just use YouTube like a normal person

#

Youtube is a video host primarily, with added social network features

outer crater
neon leaf
lyric mountain
outer crater
#

My bot is on bdfd

lyric mountain
#

Or site, whatever

outer crater
#

Idc

neon leaf
#

If you dont care then do it

outer crater
lyric mountain
#

Well, soon you'll learn those hosts have a maximum upload rate

outer crater
lyric mountain
#

The more u clutter the bandwidth, the slower things load

neon leaf
outer crater
#

I use for embed image and one icon

lyric mountain
#

Also if I'm not mistaken, replit has a maximum project size

neon leaf
#

ye, 1gb

lyric mountain
#

There's really, REALLY no reason not to use dedicate hosts, unless it's for something like 0x uses for, icons and stuff

neon leaf
#

yup, on some hosts you can get whole vpsses for 1$ a month

lament rock
#

one off workers responding to master commands

#

I want to somehow load balance my slash commands

lyric mountain
lament rock
#

but as my bot is a music bot, there is the assumption that the gateway exists for commands

lyric mountain
#

Not for bots

neon leaf
#

I mean you can just setup nginx and host images there aswell

lyric mountain
#

Not worth it still

#

Unless ur vps is on expensive tier

#

Youtube is there and more than happy to host your videos

#

Same for imgur

lament rock
#

idk about more than happy

lyric mountain
#

They are, cuz it means revenue for them

lament rock
#

4k causes them to loose revenue

#

bandwidth and storage costs

lyric mountain
#

Not really, ads pay for it

#

You underestimate how huge yt datacenters are

lament rock
#

You misconstrue how much ads actually pay off