#development

1 messages Ā· Page 1992 of 1

royal herald
#

like this

#

yeah

civic scroll
#

the way me pull this is use xml request, then fetch and create the blob in server on the fly, then send the result data url via sendFile

#

fetch the video via xml then use a <video>

royal herald
#

can u send an example?

spark flint
#

get as buffer maybe

#

send rather

#

just tested, that should work

civic scroll
#
const xml = new XMLHttpRequest();
xml.mimeType = 'buffer' // blob

xml.onload = (data => {
    // do when data fully loaded
    const urlres = URL.createResourceURL(data)
    send(urlres)
})
xml.onprogress = (evt => {
    // or streaming
})
xml.open(url)
#

didn't touch much on this part

#

you can use a promise to make it look cleaner

#

me dumb

royal herald
#

lmao

civic scroll
#

after creating resource url, point the video src to it

#

and technically it's on your server now

royal portal
#

how would i make express accept headers?!?!1

split hazel
#

you don't make express accept the headers

#

express makes you accept the headers

royal portal
#

it doesnt cryangeryBOYE

#

i tried setting headers on my api but it didnt set

split hazel
#

oh you're being serious

#

not sure what you mean exactly tho

#

you should be able to set everything fine

royal portal
#

setting headers in the api code works, just not when using axios and stuff

#

could be CORS related?!?!1

earnest phoenix
#

hey, can anyone help me? i want to make my bot leave a server (i have the id) using eval command

lyric mountain
lyric mountain
#

or something like that

#

check dem docs

earnest phoenix
#

lemme see

#

yeah just changed bot to client and its good

#

ty

lyric mountain
#

yw

royal portal
lyric mountain
#

try printing the returned request

#

if it misses a shitton of info it's definitely cors

#

iirc cors only allows HEAD headers

royal portal
#

yeah it is

feral aspen
#

What are the appropriate permissions to check when it comes to a moderator wanting to warn a user and mute a user? Unfortunately, no permissions called warn and mute on Discord. šŸ˜‚

spark flint
#

and to mute, MODERATE_MEMBERS

feral aspen
#

MODERATE_MEMBERS is what feature?

#

.. the timeout?

split hazel
#

I don't think it's related to cors tho

#

that only instructs browsers whether to block requests or not

royal portal
crystal wigeon
#

so uh, im using discord api to create a dm

#

for some reason im getting unknown user

#

const url2 = `https://discord.com/api/v9/users/266457718942990337/channels`; // dm channel with me

#

this is the url im using

lyric mountain
#

why are u using the url directly?

#

are u doing it raw?

crystal wigeon
#

yeah, im jsut sending the body as { content: "" }

#

i have the bot token but i dont wanna use djs to login and send dm

#

i wanna use the api

#

it says i can send dms, but idk why it throws a unknow user error, my account is like literally here

lyric mountain
#

i'm afraid I can't help u with that, your best bet would be tim

lament rock
lament rock
#

stuff like msg.author.send checks if the DM channel exists or not and then creates one if necessary and then sends the message. Try not to request create DM too often

#

use cache

feral aspen
#

Am I doing something wrong?

#

My website works fine online but locally it looks like this?

split hazel
#

your css import paths are probably in the full format

sick agate
#

yes

feral aspen
lament rock
#

Dont use absolute paths for imports

feral aspen
#

I'm new to HTML, I'm afraid I yet don't understand. Do you have a code demonstration?

lament rock
#

do you know what an absolute path is

feral aspen
#

Oh, indeed.

lyric mountain
feral aspen
#

Oh, well I don't.

lyric mountain
#

considering index is inside Projects

lament rock
#

might want to open the network tab and check for errors

lyric mountain
#

console tab*

#

network wont show the errors

feral aspen
#

Is there anything I should consider thinking before I change the nickname of 400 members in a server using a bot?
Is it API abuse or against any sort of rule or something?

wheat mesa
#

If you’re gonna do it, set a delay in between each nickname

lyric mountain
#

put a delay yes

#

like, rename 5, sleep 10, rename 5, sleep 10

#

and so on

wheat mesa
#

^^

#

If you’re getting ratelimited, then it’s too fast

slender thistle
#

Wouldn't like 1-1.5s delay work too

heavy marsh
#

in d.js how to get the playbackDuration
from @voice.js

lyric mountain
slender thistle
#

True

stiff dust
#

Hi anyone use heroku here ? i try to create vote log for my bot using #topgg-api and this is the error when someone vote:

#

js

lyric mountain
#

503, server issue

#

what lib are u using?

stiff dust
#

djs

lyric mountain
#

not discord lib

stiff dust
lyric mountain
#

is the port open?

stiff dust
lyric mountain
#

actually, nvm you can only have 1 port

#

check which one they assigned to you

#

use that one

stiff dust
#

do i need web dyno ?

lyric mountain
#

write exactly as it is there

#

write as it is there

stiff dust
#

well what should i write in my env for PORT ?

lyric mountain
#

just write that

stiff dust
#

ok

lyric mountain
#

heroku is the one who gives u the port from what I understood

sacred aurora
#

And you need to use the web dyno

stiff dust
sacred aurora
#

Although it will be turn off if not used for several hour

sacred aurora
#

Edit the web to node index.js

stiff dust
sacred aurora
#

Or write it on package.json

stiff dust
sacred aurora
#

On the start script

sacred aurora
stiff dust
#

lets try...

whole glen
#

is this how you send two buttons? it's not working await interaction.reply({ embeds: [suggestion] , ephemeral: false , components: [row, rick] });

lyric mountain
stiff dust
whole glen
#

?

sacred aurora
stiff dust
#

in each row you can have 1 menu or 5 buttons and ig you can have 5 row

lyric mountain
#

ye, a 5x5 grid

stiff dust
sacred aurora
woeful pike
#

you can't have 2 dynos running simultaneously 24/7 without paying

#

if you want to host a webserver on your discord bot process you need to turn it into a web dyno

#

but that means your bot will start sleeping

#

web dynos sleep, workers don't

stiff dust
#

so what should i do šŸ™‚

sacred aurora
#

You'll need to ping it on interval to prevent it from sleeping

woeful pike
#

the correct way is of course to have 2 independent dynos but yeah money

whole glen
#

so how would i add a secound one to this? ```
const row = new MessageActionRow()
.addComponents(
new MessageButton()
.setCustomId('primary')
.setLabel('This does nothing ok?')
.setStyle('DANGER')
.setDisabled(true),
);

    await interaction.reply({ embeds: [suggestion] , ephemeral: false , components: [row]});```
stiff dust
#

wait i write web with capital W and now i have 2 web

sacred aurora
#

Even on free tier you get only 500 hour so its not fully a month

stiff dust
lyric mountain
stiff dust
#

i know about that

sacred aurora
#

Except you provide a credit card

stiff dust
#

but are you sure that i cant have 2 dyno in same time ?

#

cause i turn both on and there isnt any problem

sacred aurora
stiff dust
#

šŸ¤”

whole glen
#

so another .addComponents( new MessageButton() .setCustomId('primary') .setLabel('This does nothing ok?') .setStyle('DANGER') .setDisabled(true), );

woeful pike
#

1 dyno runs 24/7 on free tier for the entire month. 2 dynos run 24/7 for half the month

woeful pike
#

it'll work for now but it'll just die halfway through the month

#

which you probably don't want

stiff dust
#

i can create more than 1 heroku acc šŸ‘€

sacred aurora
lyric mountain
#

just use replit to host the api and heroku for the bot

#

or the other way around

stiff dust
sacred aurora
#

or just use railway

#

if its not using big amount of resources then its not a problem to use railway

stiff dust
whole glen
#

so not this ```
const row = new MessageActionRow()
.addComponents(
new MessageButton()
.setCustomId('primary')
.setLabel('This does nothing ok?')
.setStyle('DANGER')
.setDisabled(true),
new MessageButton()
.setCustomId('primary')
.setLabel('This does tho')
.setStyle('DANGER')
)

lyric mountain
#

you do you, just remember you're capped at ~15 days with 2 dynos AND credit card

stiff dust
stiff dust
whole glen
#

nvm

#

the id

#

right

stiff dust
#

you cant have 2 btn with same id

#

yes

#

also this is the better way to define btns out of the row

#
const btn1 = new Discord.MessageButton().setStyle('LINK').setLabel(`btn1`).setURL(`URL`)
const btn2 = new Discord.MessageButton().setStyle('LINK').setLabel('btn2').setURL(`URL`)

const row = new Discord.MessageActionRow().addComponents([btn1, btn2]);
whole glen
#

ok thx

lyric mountain
#

maybe

stiff dust
#

well

#

the bot is online

lyric mountain
#

also remember your bot will be ran twice if u run the same process on both

stiff dust
#

what is that router?

lyric mountain
#

no content

whole glen
#

thank you

lyric mountain
#

2xx means sucess

#

so it worked

stiff dust
#

guess what -.- its run twice...

whole glen
#

yes

lyric mountain
stiff dust
#

i know

#

i saw your message

lyric mountain
#

you need to split the code into api and bot

stiff dust
#

so huffffffff

stiff dust
lyric mountain
#

easiest way would be using cmdline arguments

stiff dust
#

what if i turn worker off ?

lyric mountain
#

then checkin what argument was passed

lyric mountain
#

meaning your bot will die every 10 minutes or so

#

unless pinged constantly

stiff dust
#

oh...

stiff dust
lyric mountain
#

followed by CLI programs

#

but anyway

#

then use if clauses to lock unwanted sections

#

for example, if u pass -api it locks the bot part

#

(that's an example)

#

^-- example --^

stiff dust
#

ok tnx

lyric mountain
#

how do yall even begin a new programming language nowadays?

#

damn I kinda feel old now

stiff dust
lyric mountain
#

we used to always start from the bare basics then going up after learning the previous step

lyric mountain
woeful pike
#

sorry I only know coding

stiff dust
lyric mountain
#

if we consider any script as coding, around 9

#

gmod e2 was my first coding experience

#

if we consider only making actual programs as coding, then 17

#

on university, 2nd semester

wheat mesa
stiff dust
#

cool i start programming like 6 month and my bot is my first project so i need to learn many things šŸ˜…

fiery stream
#

Why are users so inaccurate in my bot

wheat mesa
#

Because you’re probably getting from cache or something

lyric mountain
wheat mesa
#

I agree

lyric mountain
#

calculator, snake, "what is my name"

wheat mesa
lyric mountain
#

and the infamous "hello world"

quartz kindle
#

everything else you have to fetch

#

or wait until activity comes in

wheat mesa
#

I think that console apps are a good way to learn any language

fiery stream
#

guilds=len(ctx.bot.guilds), channels=sum(1 for _ in ctx.bot.get_all_channels()), users=sum(1 for _ in ctx.bot.get_all_members()), this is what im using n its inaccurate

wheat mesa
#

But people starting with nodejs are usually impatient and don’t care about command line stuff

lyric mountain
#

if you jump right to guis you lose so much focus by having to deal with both sides of the coin at the same time

lyric mountain
#

"but that's too simple, I want to make big badass hackerz programs"

boi, shut and make the damn calculator

stiff dust
#

@lyric mountain Btw if i use railway do i need to do commandline again ?

lyric mountain
#

like, what each one is supposed to run

#

this is one of the many ways to deal with that issue

fiery stream
#

Btw whats the average ram usage if the bot is in just 1 guild

lyric mountain
#

depends

fiery stream
#

Is 38mb fair ?

lyric mountain
#

it can go from 1kb to 1gb

#

depends on what ur doing

fiery stream
#

Its pretty basic with few commands

quartz kindle
#

~30mb is pretty much the bare minimum of the average python program

fiery stream
#

Fair enough

fiery stream
quartz kindle
#

for a python program no

#

python is an interpreter, a simple "hello world" program that does nothing but print "hello world" it will already use about 30mb

#

or whatever it needs to load the entire python engine

fiery stream
#

Ahh i see what if you print hello world in go n compile it how much ram that gonna take šŸ¤”?

wheat mesa
#

In what language?

#

It depends on a lot of factors

fiery stream
#

Golang*^^^

quartz kindle
#

it will take whatever the go engine needs to run

#

go also runs on an engine afaik

wheat mesa
#

Oh I didn’t see go

fiery stream
quartz kindle
#

if you compile it in rust/c/c++ for example, it will be compiled to machine code, the executable size and memory usage will be stupid small

wheat mesa
#

Iirc golang compiles to bytecode does it not?

quartz kindle
#

wasnt golang also interpreted?

wheat mesa
#

Idk

#

Lemme look it up

#

It’s compiled

#

Seems like it compiles direct to machine code too

fiery stream
#

Yuh it does

lyric mountain
#

write in assembly and you might be able to stay below 50b

#

or write in shakespeare, who cares about ram anyway

quartz kindle
#

hmm but golang does include a bunch of stuff like memory safety and garbage collection, so the compiled executable has to include those

fiery stream
#

Wait kinda dumb question is assembly above binary or binary above assembly

lyric mountain
#

just "human readable"

wheat mesa
#

Assembly is pretty much direct hardware instructions

fiery stream
#

So assembly is binary but readable…

wheat mesa
#

You can’t really code in binary

lyric mountain
#

nono, machine code

wheat mesa
#

Binary is the fundamental building blocks of bytes, but bytes are the smallest addressable form of memory in a computer

#

That’s why booleans take up a full byte and not just one bit

lyric mountain
#

actually, shouldn't booleans be represented by a single bit?

#

they are always 1 or 0

wheat mesa
#

They should be but they can’t

#

Since each memory address is at least full byte

stiff dust
#

@lyric mountain better idea i just can create something as topgg.js and then require it in my index.js and then use it for my web dyno so node topgg.js for web and node index.js for my worker so i dont need cmd line any more ig

lyric mountain
#

so you're like stuck with 0000 0000 and 0000 0001?

wheat mesa
#

Yeah

#

A byte is the smallest form of memory you can do things with

lyric mountain
#

so one could say bitflags are more efficient than booleans?

quartz kindle
#

thats why they exist

wheat mesa
#

^

lyric mountain
#

interesting

wheat mesa
#

Otherwise you would be wasting memory technically

quartz kindle
#

in js a boolean takes at least 8 bytes lol

lyric mountain
wheat mesa
#

It’s not a huge deal on a small scale but I’m sure there’s settings where it destroys memory usage

lyric mountain
#

what they do with all the other bytes?

#

it's like a bigbool

quartz kindle
#

v8 object specs

fiery stream
#

Wait yo i got another question

stiff dust
lyric mountain
#

gotta make a new node lib that introduces bool_32 and bool_64 now

wheat mesa
#

Lol

lyric mountain
#

64 bytes for a boolean

#

ftw

fiery stream
#

What if an app doesnt use network and the disk space gonna be more than the ram usage ?

wheat mesa
#

You’d probably have to modify the js standard itself

lyric mountain
#

it's like, 2 words

#

an array

#

process.argv[0] is first arg

fiery stream
# wheat mesa ...?

So like if a code is like 50mb n doesnt get no data from internet you think it might use ram more than 50 mb

lyric mountain
#

process.argv[1] is second arg

stiff dust
quartz kindle
#

actually

lyric mountain
wheat mesa
quartz kindle
#

js doesnt use 8 bytes for booleans

#

it uses a special map of booleans

#

called an "oddball"

stiff dust
quartz kindle
lyric mountain
wheat mesa
#

I can make a 100 byte size program that uses terabytes of ram, it all depends on what the program is actually doing

fiery stream
wheat mesa
#

No

#

Not at all

lyric mountain
lyric mountain
fiery stream
wheat mesa
#

RAM is memory allocated for the storage of data in a program. For example, a number in js uses 8 bytes of memory, and therefore 8 bytes of ram (in theory), but a program like let data = 5; uses more than 8 bytes of disk storage

fiery stream
lyric mountain
wheat mesa
#

While in theory the program itself only has 8 bytes of memory usage (not counting internals)

wheat mesa
lyric mountain
wheat mesa
#

it has to allocate memory for the storage of that data about guilds

#

More guilds = more allocation

quartz kindle
#

a program can easily create and destroy data, so its not really possible to correlate memory usage and code size

lyric mountain
#

and more guilds = relatively more events = relatively more threads/async handlers

fiery stream
#

Hmm cool i see

#

I lost 100 bucks today maybe 200 šŸ™‚

#

Shorting hood didnt go as plan

quartz kindle
#

did you invest in sberbank?

#

lmao

fiery stream
#

Whats sberbank

wheat mesa
#

I made like 70-80 bucks today on amd and nvidia lmao

quartz kindle
#

russian bank that dropped 95% in value the past few days

#

shares went from 15 bucks to 2 cents

fiery stream
#

I woke up late n didnt get to trade the early market hype n got stuck in a bad trade

wheat mesa
#

It’s not a good time to be invested in Russian companies haha

lyric mountain
#

gotta invest in russian coin, then withdraw once putin finishes fckin everything (and someone replaces him)

#

prices are going to the ground

fiery stream
#

?

wheat mesa
#

Economic panic will likely hit Russia when the banks open back up

#

And no, I just own some shares of stuff

fiery stream
#

Oof i day trade take risks everyday lol

quartz kindle
#

trade crypto

fiery stream
#

Nah theres no options in crypto

wheat mesa
#

I don’t have enough money to day trade and I’m not willing to risk it over some small chance of making 20 bucks a day

fiery stream
#

No options no fun

quartz kindle
#

idk what options are

#

xd

fiery stream
#

Options are like betting this stock will hit a certain price in a week n if it does you earn money

quartz kindle
#

ah

#

pretty sure binance has that

fiery stream
#

Like you dont have to wait till end of week tho n even if the stock makes small moves you still earn alot

wheat mesa
#

Stocks are too risky for me, I just put some money into a couple stocks that I know will continue to go up over a while

fiery stream
#

Like you invest 200 dollars you can make 20-30 dollars for 5m of trade

stiff dust
#

@lyric mountain tnx alot i fix it <3

lyric mountain
#

šŸ‘

wheat mesa
#

Bought a decent amount of AMD back when it was 27 bucks per share

#

Made a 300-400% return on that so far

fiery stream
#

You been holding 1 share for that long time period?

stiff dust
wheat mesa
#

I’ve been holding on to like 10 shares of amd for a while

#

It’s not much but hey free money

fiery stream
#

Does amd offer dividends ?

lyric mountain
wheat mesa
#

Don’t think so

lyric mountain
#

like socket or http

#

or database

fiery stream
#

Should go for a dividend stock apple offers em n Pepsi n so on

quartz kindle
wheat mesa
#

I don’t really want to invest in stocks like that for dividends

#

I don’t have enough to invest to make any sort of money with that

fiery stream
quartz kindle
#

for example ```js
// file where client exists
const server = require("./server.js");
server.start(client);

// server.js
function start(client) {
express, webhook, etc
use client here
}
module.exports = { start }

lyric mountain
#

he's running 2 dynos

#

one for api and one for bot

stiff dust
#

so this should works ?

quartz kindle
#

you're using 2 dynos in heroku?

#

you dont need to use 2, just use one web dyno and have your bot in it

stiff dust
quartz kindle
#

otherwise you'll need to do what kuuhaku said, some way of communicating between processes

stiff dust
quartz kindle
#

well that will happen regardless

#

heroku is shit

stiff dust
#

so ig i need to go to railway rn

wooden ember
#

is there a way to increase the timeout limit on file uploads?

#

cuz my internet is bad and files take so long to upload that it just aborts the request

wooden ember
#

yee

solemn latch
#

I dont think so

wooden ember
#

bruh

solemn latch
#

I imagine thats configured site wide

wooden ember
#

but it says user aborted request doesnt that mean it was aborted at my end?

#

i seem to remember there is a timout paramiter in the client object but idk if thats for somthing like this or somthing else

#

bruh i keep forgetting my E's in something

stiff dust
#

@lyric mountain i think i understand that what should i to with command line

stiff dust
# lyric mountain like, what each one is supposed to run

well what should i do with that? i read the stack over flow and process.argv[1] will return /app/index.js so what should i do with that ?

if i do something like the image well again it run twice cause web and worker both has same file name

lyric mountain
#

0 and 1 are node and the file respectively

heavy marsh
stiff dust
stiff dust
lyric mountain
#

did you pass an argument at all?

stiff dust
#

i just console.log the process.argv

lyric mountain
#

do you know what a command line argument is?

stiff dust
#

no i just read the stack overflow link that you gave me

neat ingot
#

that feels like hax.. but it works like a charm šŸ˜‚

lyric mountain
#

what is an arg there?

neat ingot
#

oh i know i know... pick me šŸ˜„

stiff dust
neat ingot
stiff dust
#

why ?

#

arg[2] is abc

neat ingot
#

everything after 'node' is an argument

stiff dust
stiff dust
stiff dust
lyric mountain
#

it's the arg in index 0

earnest phoenix
#

anything inputed into the console is technically an argument

#

right?

lyric mountain
#

I guess so

neat ingot
#

yea i guess thats a fair point šŸ˜„

austere surge
#

im learning a lot by watching this channel

neat ingot
#

im sure there is also a difference between umm, idk how to explain..
like, the position of the arguments?

node -nodearg index.js -filearg```
earnest phoenix
#

Welcome to coding for dummies, where you will learn that a debugger is useless and console logging is perfect

earnest phoenix
austere surge
#

debuggering is weird

wheat mesa
#

I have no homework the jokes on you

#

No it’s not

earnest phoenix
#

Then why are you asking me to wait 1h to vc

#

weirdo

wheat mesa
#

Because I’m not home yet weirdo

earnest phoenix
#

sounds like a personal problem

wooden ember
#

i love the way that some one tryes to help and then they just get treated like shit

boreal iron
#

That’s why we all here tbh

neat ingot
#

wait till someone asks a question šŸ˜„

earnest phoenix
#

Welcome to the world of programming

#

where if you are dumb you will be told so

earnest phoenix
#

smelly

wheat mesa
#

Not usually right off the bat though, there’s a grace period between being called dumb and being helped

neat ingot
#

php is kinda trash tho fr fr

earnest phoenix
#

php has its uses

earnest phoenix
#

but no one goes out of their way to use it

wooden ember
earnest phoenix
#

I mean thats life sometimes

#

dont get butthurt

wooden ember
#

thats the point but eh

wheat mesa
#

Misty says whilst being butthurt about me making a compiler instead of a discord bot :troll:

earnest phoenix
#

troll Well well well, what do we have here

earnest phoenix
#

Also it was cause you weren't helping me with the backend not a discord bot

wheat mesa
#

Pay me money and I’ll compile some bitches for you

earnest phoenix
#

stupid smelly

#

Just cause you need to pay them hospital bills doesn't mean I have money foru

#

I am broke as well mf

#

Why you think I am trying to sharpen my skills in the first place, you think im doing it for fun?

wooden ember
wheat mesa
#

Yes that’s why I do it

earnest phoenix
#

I mean

#

I do it for fun i agree

#

but sometimes I dont have fun

#

and then I get annoyed

wheat mesa
#

Money is the benefit of being good at something and putting time and effort into it

earnest phoenix
#

Indeed

#

They be trying to compile bitches for others when they can't for themselves

wheat mesa
#

šŸ˜”

earnest phoenix
#

So if you want money to pay them hospital bills help me

#

šŸ˜”

earnest phoenix
#

but I think its fake

wheat mesa
#

Definitely fake yup

earnest phoenix
#

the way he talks to me there is no way

#

it's FakE?!

wheat mesa
#

^^^

wooden ember
#

oh my

wheat mesa
#

@boreal iron can you confirm

earnest phoenix
#

@boreal iron u dating waffle?

wooden ember
#

send pics or it didnt happen

neat ingot
#

šŸæ

wheat mesa
#

He’s probably driving

earnest phoenix
#

if he responds it means texting while driving

#

time to report to the 911

wooden ember
#

vroom vroom

boreal iron
#

Huh what? Don’t know the context?!

wooden ember
#

boom

boreal iron
#

Yes no maybe

earnest phoenix
#

So it is confirmed

boreal iron
#

Maybe not

earnest phoenix
#

ur dating wafle

boreal iron
#

Idk

wheat mesa
#

Fake dating a Java user confirmed

earnest phoenix
#

fake loves java

neat ingot
#

yall are syntax racists!

boreal iron
#

W H A T is going on you crazy bitches?!

earnest phoenix
#

Im not crazy your crazy

boreal iron
#

Me loving Java wtf

earnest phoenix
#

smh

boreal iron
#

Ok I’m calling my friend Putin now

earnest phoenix
#

too soon

boreal iron
#

Gotta need to free another countrY

earnest phoenix
#

Way too soon

wooden ember
#

ohnohesgonnasendanotherstalledconvoy

#

ahfuck

#

myspacebar

#

help

earnest phoenix
#

This channel became #real-life-character-development fr fr ong no-cap

wooden ember
#

lol

boreal iron
earnest phoenix
#

voltrex go back to working on the v8

earnest phoenix
#

banned from this channel

wooden ember
#

v9when

earnest phoenix
#

v9?

#

the fuck is v9

wooden ember
#

v10?

earnest phoenix
#

everyone skips 9 and goes straight for 10

wheat mesa
#

The unspoken rule

earnest phoenix
#

Cause 7 8 9

#

;)

wooden ember
#

mmmm

wheat mesa
#

Shut up

earnest phoenix
#

Or what

#

The V8 engine is a representation of the real life V8 engine, a V9 engine AKA 9 cylinder engine can't exist (doesn't make sense to exist)

#

go back to not being home and expecting me to vc with you in an hour

earnest phoenix
#

You just gotta try hard enough

#

Anything is possible

#

it just a matter of if you are smart enough to accomplish it

#

I'll turn you into the V18 engine

#

I dare you

#

I will come to your house and eat all ur noodles

earnest phoenix
#

WHAT

#

makes sense

#

I wonder how heavy that is

boreal iron
#

Very heave as those are airplane engines

earnest phoenix
#

I see

#

So not something I can pick up

#

šŸ˜”

wooden ember
#

not as cool as the deltic

earnest phoenix
#

This channel should be renamed fro mdevelopment to general-3

#

@earnest phoenix Did you know when you touch something you aren't actually touching it

wooden ember
#

mind = blown

earnest phoenix
#

The reason you feel as if you are touching it is cause of the pressure from the atoms repelling themselves (iirc)

wheat mesa
#

Average dev when asked about the last time they went outside

earnest phoenix
#

Now that I have stated my fun fact

#

time to go lay down and ignore waffle

#

ā˜ ļø

boreal iron
#

Did you actually see the funny Ford meme?

fiery stream
boreal iron
#

Of course it is oldEyes

fiery stream
#

Like used in a production car?

boreal iron
#

šŸ¤¦ā€ā™‚ļø

ionic schooner
#

Not in cars

earnest phoenix
#

That's an airplane turbine engine

ionic schooner
#

Planes n stuff

fiery stream
#

Ohh lol i didnt read the thing msg i just looked at it n there was this picture of Pistons n thought it’s a car engine

boreal iron
#

Yes being used in Ferraris only freerealestate

earnest phoenix
#

Only found in FakE's 24/7 running car

boreal iron
fiery stream
#

This channel turned from bot development to engine development thats sum real innovation going on here

boreal iron
#

This channel isn’t about bot development at all

fiery stream
#

Mostly i seen ppl here post question related to code

#

Including myself

earnest phoenix
#

It's for development, but not limited to Discord bots

boreal iron
#

and unnecessary shit

fiery stream
#

True but majority i would say is bot related

#

Voltrex what lib did you make?

earnest phoenix
#

That "Library Developer" role is only for Top.gg SDKs

fiery stream
#

Is it possible to host a discord bot on roblox studio šŸ˜

#

I noticed it allows to make http requests on it

earnest phoenix
#

I'm pretty sure it is

boreal iron
fiery stream
#

Nah i use replit

#

But a wise man should cut costs on stupid things to make the business running

#

Plus roblox studio comes with free database

boreal iron
#

Wise people host their shit themselves and don’t rely on free services

#

Also the wise man has enough cash to pay his shit

dry imp
#

wise people dont host

fiery stream
boreal iron
earnest phoenix
#

Can't wait for Charlie on YouTube to talk about Jass being sued for millions of dollars by Roblox for hosting a Discord bot in Roblox Studio

fiery stream
#

Roblox kills servers with no players in it so imma need a uptime bot like thing that stays in a server

sudden geyser
#

is this a science experiment

fiery stream
boreal iron
#

To repeat my self once again, just never turn your PC off then.

#

Perfect bot

fiery stream
#

Wait can you mine crypto on roblox studio

earnest phoenix
fiery stream
#

You use something thats free out there

boreal iron
sudden geyser
boreal iron
fiery stream
#

Isn’t mit a license

sudden geyser
#

and a university

fiery stream
#

Oh yuh it was in spider man no way home

sudden geyser
#

I remember hearing about some experiment where they'd gather a group of people who claimed to be aliens and test that hypothesis

wooden ember
earnest phoenix
#

Didn't the MIT members make some kind of quantum programming language?

sudden geyser
#

yes

fiery stream
#

Qiskit

#

Isn’t it

sudden geyser
#

no, that was ibm

earnest phoenix
fiery stream
#

Idk shii about quantum computing but i heard if you were to brute force someone with quantum computer it wouldn’t take you too long to get into someone’s account

wooden ember
#

basically

fiery stream
#

It’s infinite money glitch if you were to start brute forcing crypto wallets

#

You just need a multi million dollar computer

sudden geyser
#

Just wait until innovation hits

#

You'll have a quantum computer in your pocket

fiery stream
#

About in like 2050

#

N by then they gonna have quantum level encryption

boreal iron
sudden geyser
#

We just need some information-theoretic secure systems

earnest phoenix
#

Oh god no wtf, MDN is leaning towards NFTs, end of the world is near

sudden geyser
#

No they're not

#

They tried

#

and got murdered

fiery stream
#

What’s MDN now

earnest phoenix
#

Oh thank god

sudden geyser
#

mozilla developer network

fiery stream
#

Ion mind nfts as long as its not stupid jpeg pictures n something useful

earnest phoenix
#

God damn, the founder coming in with a super strong hit

fiery stream
#

Can your discord bot hve animated pictures ?

austere surge
#

?

spark flint
#

no

fiery stream
#

Yk

austere surge
#

oh

#

pfp

#

no

fiery stream
#

Oh yuh sorry for not wording it right

stiff dust
fiery stream
#

Ayy how you do that

#

Thats lowkey dope

hidden gorge
#

AND MY FUCKING BOT GOT HACKDC

#

HACKED*

austere surge
#

damn

fiery stream
#

You’ll be fine

hidden gorge
#

it won’t let me

austere surge
#

;-;

fiery stream
#

Wym

earnest phoenix
#

Gotta love how most of the cryptobros know literally nothing about the crypto technology whatsoever yet they try to defend it and call the founder of Mozilla dumb for calling crypto dumb and the cryptobros as planet-incinerating Ponzi grifters

neat ingot
sudden geyser
#

Yeah they're all dumb

#

Lots of people try shrugging it off too since they think they'll get rich but it's just due to the fear of people missing out, so people will invest in dumb projects like baby musk and get rug pulled.

#

And even for what the founder is talking about, he's still right since basically every big crypto uses that proof of work system

earnest phoenix
#

Yeah

fiery stream
#

I mean its worth it if you join the hype early easy free money lul

sudden geyser
#

trust me it's not

wheat mesa
#

it makes the very lucky few rich

sudden geyser
#

that's how every person in the web3 community gets fucked

fiery stream
#

I joined doge hype early and made 2k

wheat mesa
#

at the expense of everyone else

boreal iron
sudden geyser
#

crypto is purely speculative, so there are a lot of people who want to buy it

#

but use it? fuck no

wheat mesa
#

quick question relating to an api request, what does this mean? ```
< Cache-Control: public, max-age=5
< Expires: Thu, 03 Mar 2022 00:12:41 GMT

#

(These are headers btw)

sudden geyser
#

yeah

wheat mesa
#

Alright

boreal iron
fiery stream
boreal iron
#

Try to sell for example some bitcoins when they are on their highest peak

fiery stream
#

Ik what your talking about thats how stocks work too

boreal iron
#

It has become too speculative nowadays

fiery stream
#

Nobody buys stocks on all time highs i mean they do but its a risky move

boreal iron
#

Unfortunately Klay is right on that

austere surge
#

||adding highest before peak doesnt really make a difference||

austere surge
#

not really

fiery stream
#

Arent smaller peaks also peaks

delicate zephyr
#

it literally does

fiery stream
#

Yuh it does

boreal iron
#

Lower peaks don’t exist for him?!

delicate zephyr
wheat mesa
#

If I have stuff like this: ts const res = await Axios.get<ResponseTypes.ChessPlayerTournaments>( Endpoints.PlayerEndpoints.PLAYER_TOURNAMENTS(playerName), ).catch(err => { if (err.response.data) { throw new ChessRestError(`Code: ${err.response.data.code}\nMessage: ${err.response.data.message}`); } throw new ChessRestError(`Something went terribly wrong: ${err}`); }); would it be a bad idea do just make a function like this to handle the promise rejections? ```ts
async function handleError(err: any) {
if(err.response) {
switch(err.response.status) {
case 404: {
// do stuff
break;
}
// ...
}
}
}

boreal iron
bright hornet
#

how can i make it as false?

wheat mesa
#

permissions takes an object most likely

fiery stream
bright hornet
fiery stream
#

Btw does replit not support jinja highlighting im having a issue with it

spark flint
wheat mesa
#

nevermind, djs handles permissions weird

fiery stream
#

The high lighting looks similar

bright hornet
fiery stream
#

Ofcs

sharp saddle
#

@shell torrent i got Invalid bitfield flag or number: 37080641. error

bright hornet
#

I need the permissions false ;=;

shell torrent
#

just require permissions

sharp saddle
#

a

#

but i put this

if(!permissions.has("MANAGE_GUILD")) return;```@shell torrent
earnest phoenix
# bright hornet how can i make it as `false`?

You can't set those permissions to be denied when creating the role, no permissions are given to the role when creating it by default, if you want to set it to be denied, you must create a permission overwrite in the channels you want it to be denied the said permissions

shell torrent
sharp saddle
#

no

sharp saddle
#

'-'

sharp saddle
shell torrent
#

ok

boreal iron
earnest phoenix
#

After 6 years

boreal iron
#

Even if it requires to work with timestamps which means calculating which is math… errr even more disgusting

sudden geyser
#

yeah now how about they let us users set specific durations

#

don't want to have to pull in a bot to mute someone for 2 days

boreal iron
#

You can’t use that feature in the client?

sudden geyser
boreal iron
#

Oh never seen that before

#

lmao

#

Lol a tab menu

#

Now after they introduced select menus

#

smh

#

Let’s hope we will get a date picker in the future also for interactions of course

#

Spitting out a UTC timestamp

#

Fucking random disconnects anywhere

earnest phoenix
wheat mesa
#

Does anyone know a good way to handle response codes from fetching from an api from axios? Would it be a bad idea to just do something like ```ts
const res = await Axios.get<ResponseTypes.ChessPlayerTournaments>(
Endpoints.PlayerEndpoints.PLAYER_TOURNAMENTS(playerName),
)

// Throws if status code indicates error
handleStatusCode(res.status);

return res.data;

boreal iron
#

After 6 years

wheat mesa
earnest phoenix
#

mmLol That's what we call Discordā„¢ļø

boreal iron
earnest phoenix
boreal iron
wheat mesa
#

it's fetching from an api

boreal iron
#

Ah nvm then

wheat mesa
#

Should I just let axios throw the errors or should I be throwing my own errors with useful information (Like the response that the website sends back with their description of the error)

earnest phoenix
#

If Axios' errors are not packed with useful information much, go ahead

boreal iron
#

I mean my bot is requesting my API too
If something goes wrong I will at least tell the client something has gone wrong

#

Which is then considered to be an internal server error

wheat mesa
#

Something like this then ```ts
throw new ChessRestError(
Code: ${err.response.status} | ${err.response.statusText}\nMessage: ${err.response.data.message},
);

earnest phoenix
#

Sure, pretty simplistic and nice

wheat mesa
#

easy enough

#

I'll just use this api for something myself and that'll help me work out the bugs and such

sudden geyser
wheat mesa
#

I mean, the errors the website returns are pretty simple. It's just a code (which is meaningless compared to the status code that axios gets from the http res) and a message

#

I'd say it's good enough

#

I'll use it a lot pretty soon though before I release it as an npm package (if I ever even decide to) so hopefully I'll figure out what's useful to people and what's not

lucid prawn
#

        let user = messageCreate.mentions.members.first() || messageCreate.guild.members.cache.get(args[0]) || messageCreate.guild.members.cache.find(r => r.user.username.toLowerCase() === args.join(' ').toLocaleLowerCase()) || messageCreate.guild.members.cache.find(ro => ro.displayName.toLowerCase() === args.join(' ').toLocaleLowerCase()) || messageCreate.member;

        if (!user.presence.activities.length) {

TypeError: Cannot read properties of null (reading 'activities')
    at Object.run (/home/runner/mika/commands/Fun/stutus.js:11:28)
    at module.exports (/home/runner/mika/events/message.js:41:9)
sudden geyser
#

oh my

#

user.presence is nullable, so you may want to check if it exists beforehand.

#

i.e. user.presence?.activities?.length

lucid prawn
#

ok

bright hornet
#
let role = message.guild.roles.cache.find(role => role.name == "Muted")
      if(!role) message.guild.roles.create({
        name: "Muted",
        color: "Black",
      })

      try {
        message.guild.channels.cache.forEach(async(role) => {
          role.permissionOverwrites.set([
          {
            id: targetMember.id,
            deny: [Permissions.FLAGS.SEND_MESSAGES, Permissions.FLAGS.ATTACH_FILES],
          }
          ]);
        })
      } catch (err) {
        message.reply(err)
      }

      targetMember.roles.add(role)``` how can i do that if i use the temp mute, the hidden channels remain the same? because when i use the command, all hidden channels will show up
solemn latch
#

šŸ¤” select menu's can be used with webhooks, how does that work?
can you actually have an interaction from a webhook?

#

op, I see it requires an application owned webhook.

#

šŸ‘€ which raises another question, how does that work

cobalt junco
wheat mesa
#

Okay so I might've just invented the dumbest thing known to man... Just couldn't figure out a better way to do it: ```ts
async getPlayerData(playerName: string): Promise<ResponseTypes.ChessPlayer> {
const res = await Axios.get<ResponseTypes.ChessPlayer>(PlayerEndpoints.PLAYER_PROFILE(playerName)).catch(
err => {
throw this.handleError(err);
},
);

    return res.data;
}

private handleError(err: Error | AxiosError) {
    if (Axios.isAxiosError(err)) {
        return new ChessRestError(
            `Code: ${err.response?.status} | ${err.response?.statusText} | ${err.response?.data.message}`,
        );
    } else {
        return err;
    }
}
solemn latch
#

that's so convenient.

#

Ah I remember tim talking about how much of a pain this is

cobalt junco
solemn latch
cobalt junco
solemn latch
cobalt junco
neat ingot
#

That does indeed seem like a pretty neat project

#

i think what i like most is that it only uses native node modules šŸ˜‚

solemn latch
#

its a really neat project that tim has been working on for awhile.

neat ingot
#

I'm totally gonna need to rewrite my whole shit again 😢

wheat mesa
#

holy shit the chess.com api is even worse than I thought

#

thanks for sending me a 1.6 million character long json file for one month worth of data for one player

solemn latch
#

šŸ‘€

wheat mesa
#

this is a really scuffed api

#

one of their most important endpoints isn't even documented at all. I had to find it in someone else's repo

neat ingot
#

why are you using a chess api?

wheat mesa
#

I'm making a discord bot/api wrapper for chess.com's api

#

which is proving to be a terrible decision

#

should've done lichess

#

their api is absolutely beautiful from what I saw

#

actually fuck this I'm swapping to lichess

#

chess.com is way too much work for too little functionality

bright hornet
#

I have an level system, the prob is when someone have their role connected to the level system, when they leave and join again, the roles dont auto back, how do I do that? is there any docs?

neat ingot
#

you would need to listen to the guildMemberAdd event, and then check if that person exists in your database, and then add the roles that their level allows

#

but if someone leaves a guild, should they really get to keep their level? šŸ‘€

bright hornet
#

they keeping the levels

#

there's no such thing as role.addBack right?

neat ingot
#

what do you plan on 'adding back'? if you know the roles that they had before leaving, just add them. but no, i dont think there is a way to view/auto add the roles a person used to have when they were in a guild and then left and rejoined.

neat ingot
#

but in your level system, they should still be the same level

bright hornet
#

ill just experiment the code xd

neat ingot
#

so just check that, then see what roles the server gives for that level

#

and then add those roles

bright hornet
#

ok ok

pale vessel
#

C

stiff oak
#

XD

earnest phoenix
woeful pike
bright hornet
#

I make a temp mute but its going to crap after the bot restart
how can I restore the remaining time of the temp mute?

earnest phoenix
#

You can store the mutes in a database and reload them with the remaining time

lament rock
#

alternatively, use Discord's timeout feature

#

using roles as means of muting someone is esoteric because of how permissions work. It doesn't solve every edge case either even if configured permissions are theoretically perfect

coral sigil
pale vessel
#

why

#

tweetnacl for verifying when you could just use the built in crypto module

#

use tiny-discord if you don't want to deal with the http/crypto part

#

it even has a good rest manager

#

and course it doesn't require any dependency Pog

earnest phoenix
sharp saddle
#

"No such file or directory"

#

this file doesn't exists

#

probably

#

@earnest phoenix

#

try npm rebuild

#

if don't work

#

eeeh...

lyric mountain
#

canvas is known to have issues with replit

eternal osprey
#

hey how would i create a json file if there is none existant?

lyric mountain
#

doesn't work NOW does it?

eternal osprey
#
let json = JSON.parse(fs.readFileSync(`./${message.guild.id}.json`, "utf8"));
  if(!json){
    fs.writeFile(`./${message.guild.id}.json`, `{}`, (err) => {
      if (err) console.log(err)
    });
  }```
lyric mountain
#

then I keep my statement

eternal osprey
#

createFile is a thing? Never knew that lmao

lyric mountain
#

you'll need to wait for tim, he's the one who solved it the last time

sharp saddle
lyric mountain
sharp saddle
#

by the way, why are you using v12?

atomic kindle
#

Delete package lock and reinstall.

sharp saddle
#

but it has node v16

eternal osprey
lyric mountain
#

just make an sql file

atomic kindle
#

That version of canvas was built for Windows and Replit uses linux, that's what's causing the issue.

lyric mountain
#

it's like, at most 3 or 4 lines with sqlite lib

sharp saddle
eternal osprey
sharp saddle
lyric mountain
#

not really, plus you don't get the nasty issue of concurrent edit of json file

sharp saddle
#

but why use discord.js v12?

blazing storm
#

hi

lyric mountain
atomic kindle
#

Not the version, it's the build that's messed up.

lyric mountain
#

if 2 people use a command almost at the same time you'll get a corrupted file unless you make a dedicate writer

sharp saddle
atomic kindle
#

And the only fix I know of involves package lock being messed up.

sharp saddle
#

a

#

ok

lyric mountain
#

but yes, sqlite would be the correct choice

#

small, barely any setup

sharp saddle
#

why not try to change?

#

v12 has already been deprecated

#

ig

#

canvas

#

wut

atomic kindle
#

Is the repl environment set to Node? @earnest phoenix

earnest phoenix
#

what issue are y'all having
does it concern skill?

sharp saddle
#

show your package.json

#

with screenshot psl

#

pls,z

#

WHAT

#

use npm install

#

wtf man

#

you deleted package.json

#

was to delete package-lock.json

#

imagine if it wasn't Replit

atomic kindle
#

This has nothing to do with Node.JS. It's a Replit issue and the fix is using Nix.

sharp saddle
#

aa

atomic kindle
#

Learn?

sharp saddle
#

just learn

earnest phoenix
#

They're known for fucking up packages for no reason

#

replit.nix is the file that has nix configuration

sharp saddle
#

@earnest phoenix

atomic kindle
earnest phoenix
#

well then put language=nodejs in .replit

atomic kindle
#

This'll help you, @earnest phoenix.

#

Mhm. Good luck.

#

Incorrect command?

#

didn't even copy-pasta correctly

civic scroll
#

@woeful pike i did btw

#

didn't work

sharp saddle
#

rel

#

rel = relative

woeful pike
#

wdym

#

you mean a popup positioned under a text but over other content no?

civic scroll
#

the problem is

#

it overflew the parent container

#

and since parent got overflow: hidden

#

that got cut off

#

lemme try using the service

earnest phoenix
#

i told ya to use popperjs

wheat mesa
#

Is there a standard way to construct rest requests? Should I make a static builder method or something so I don’t have to always pass my token through the headers manually?

woeful pike
#

new Request()

#

you don't even need to pick it apart to send the request, just pass it along to fetch and it does its thing

quartz kindle
#

there are no standards, do whatever the fk you want

#

and do it gloriously

woeful pike
#

damn

wheat mesa
#

Alright I’ll make a builder probably

spark flint
#

is it possible to set an iframe's text colour

sudden geyser
#

You guys should check out React's issue page

spark flint
atomic kindle
#
for (const whois of domainData.whois) {
                    let textValue = document.createTextNode(whois.id);
                    let anchor = document.createElement('a');
                    anchor.setAttribute('href', '/whois.html?id=' + whois.id);
                    anchor.classList.add('text-blue-400');
                    anchor.classList.add('hover:text-blue-500');
                    anchor.appendChild(textValue);
                    document.getElementById('whois-reports').appendChild(document.createElement('li').appendChild(anchor));
                }```This doesn't add the LI tag...
#

Just appends the anchor.

#

What am I doing wrong?

spark flint
#

And write what html you want to enter

atomic kindle
#

But that's not very pog @spark flint

spark flint
#

document.getElementById(ā€œid nameā€).innerHTML = ā€œpro htmlā€

atomic kindle
#

not pog

#

Fixed it. Seems like js doesn't like inline

hidden mauve
#

uh huh

spark flint
#

Lol

civic scroll
#

man

#

i can't attach event listeners

earnest phoenix
civic scroll
#

even the element has pointer-events: all in it

earnest phoenix
#

wdym

earnest phoenix
civic scroll
#

they did hit

#

but not react

neat ingot
#

Ey yo @quartz kindle, sorry for the ping, but I got a few questions on your tiny-discord lib if you got a minute to spare šŸ™‚

quartz kindle
#

sure

neat ingot
#

yay thankies ā¤ļø

#

whats its limitations?

#

like, what situation would you recommend someone stick with discord.js, for example

wheat mesa
#

no situation :troll:

quartz kindle
#

lmao

neat ingot
#

i mean... babysitters can be pretty hot...

#

šŸ˜‚

quartz kindle
#

xD

#

i dont know how hot djs is tho

#

depends on your tastes

neat ingot
#

well, ok, ill give you that one šŸ˜„

quartz kindle
#

:^)