#development

1 messages · Page 1962 of 1

round cove
#
console.log(`${someVariable}`);```
craggy pine
#

this is just copy pasta code I had going from v12 -> v13 so Ik for a fact it worked b4

#

so it's something with v13 and fields

round cove
#

big version change

#

This why people need to use TS

boreal iron
#

Oh the options of your send() method are fine

craggy pine
#

mhm

boreal iron
#

But I don’t know about the helper methods like addField etc

craggy pine
#

I may understand why thinking about it

#
  try {
    if(args.length === 0) {
      let errorReply = await message.reply("You need to specify an anime!")
      setTimeout(() => errorReply.delete(), 10000)
    } else {
      let loadingMessage = await message.reply("Loading...")
      let animeSearch = args.join(" ")
      await mal.search('anime', animeSearch)
      .then(info => anime.animeResult = info.results)
      .catch(err => console.log(err));
      loadingMessage.delete()
    }
boreal iron
#

Why do you even use them?

craggy pine
#

I do this b4 the embed right

boreal iron
#

You’re close to creating the embed object yourself anyways?

craggy pine
#

But the embed is after the else{} so I think it tries to create it before the api can fully do the push to my array

boreal iron
#

embed.fields =
[
{ name: …, value: …. },

]

#

Is your field structure already

#

It’s just an array storing the field objects in it

craggy pine
boreal iron
#

Not necessarily, just to say

craggy pine
#

I could do it your not wrong. Main focus is just some of my main stuff working for now from the transition

boreal iron
#

Yeah unfortunately can’t figure that huge chunk of code out on mobile

craggy pine
#

haha no worries

#

Ya litterally doing String() made it work.

round cove
#

I mean the error did say non string

#

Xd

craggy pine
#

But why

#

They are strings KEKW

round cove
#

technically it's a number, boolean is a bool

#

etc etc

craggy pine
#

well I suppose

round cove
#

JSON is very picky.

craggy pine
#

Still lame but it worked regardless.

#

Kinda dumb that Title, Description, and image works no issues without String()

earnest phoenix
round cove
#

This floor

boreal iron
#

I remember… oldEyes

#

v13 does enforce that

round cove
#

good

boreal iron
#

As it doesn’t convert your value anymore to something it should be

round cove
#

implicit conversion can be bad at times.

#

Especially for those who don't understand it or when it happens.

boreal iron
#

Yeah all the work for the lib dev to cover each type an user can pass if you don’t enforce a strict type

#

I mean a key lock which is supposed to be opened by a key also doesn’t expect to be opened by a candle

#

fuck that quote is awesome, gonna write that down somewhere

onyx socket
#

What is the performance impact of using custom prefixes where prefix data is stored on a mongodb database.

boreal iron
#

Well it literally has no no effect as you need to get your prefixes from the database and cache them when initiating your client.

One database request each time somebody executes a command to check if that prefix actually exists would be nonsense and quickly result in total chaos.

#

You gotta create a map/object with your guild IDs and their prefixes which you check if a command is executed or simply attach the prefix to the already cached guild object

#

But before thinking about custom prefix, think about to switch to slash commands (interactions).

#

Without mentioning the bot you won’t have access to the message content anymore, soon

#

(if you don’t have the privileged intent)

feral aspen
#

What would happen to my bot if I didn't apply for the message content privilege intent but I switched everything to slash commands?

boreal iron
#

Nothing?
Why would you still need the message content anymore after switching to interactions?

#

If you don’t switch and get the intent your common commands will not work anymore

#

As the message content received in event will always be null

#

Except somebody is mentioning your bot

feral aspen
#

What are some good example uses of message content?

#

My m8 used the stupidest reason and got accepted, so..

#

What are some good uses to it, I know anti-link system is good (something I'm developing)

boreal iron
#

That depends on what your bot does

#

Discord isn’t dump, they know anything about what your bot sends to the API

#

Getting the message content by lying will most likely end up in a report and you or your app being banned from the dev portal

#

So… if you don’t need it because the transition to slash commands is possible, then move to slash commands

#

or use your bots mention as prefix

#

(actually it doesn’t matter when you mention it in the content, could also be at the end)

feral aspen
#

I think it's too early, right now. I have 2 more months to develop the commands I need.

boreal iron
#

As well as attachments, reactions and whatever it was

#

You can still listen to the message_create event but the content, attachments, reactions etc. will be null without the intent or somebody mentioning your bot in the message

onyx socket
#

Ok, so i am new to all this, but i just wanna know how my bot will be effected.. Currently my bot is based on commands and there is only one feature that actually requires to read the content from message object. So what will not work, if i choose to not apply for message intents, the later feature or what exactly?

feral aspen
boreal iron
#

I mean just read what I wrote above.
That fits for you, too.

boreal iron
feral aspen
boreal iron
#

That’s up to you

#

I heard people being denied will not get another chance if discord thinks your reason isn’t valid

feral aspen
#

When does the message content apply, exactly.

boreal iron
#

April 30th I think

feral aspen
#

Broo.. I have a lot of time. 😂

boreal iron
#

Discord isn’t really fast when it comes to checking for privileged intents

#

Anyways it’s up to…

#

If you really need the message content, then apply for it if not, you will see what Discord will respond

eternal cobalt
#

hm

flint phoenix
#

Is there any was to make a bot slash commands not work in certain channels ?

boreal iron
#

Yes for example by configuring the channel permissions to remove the users ability to execute application commands.

#

Or by handling this inside your slash command handler, sending an user an ephemeral message for example, telling him he can’t use that command in that channel.

cinder patio
#

Just React + Chakra.UI give me a 300kb bundle size 😭

modest maple
#

One of mine is 158.37 kB in totalmmLul

#

bulk moment

frosty valve
#

What’s a good image generation tool for node.js? So I can like change text and stuff like that depending on data

lyric mountain
#

canvas?

winter pasture
frosty valve
lyric mountain
#

as a note, replit has some issues with it

winter pasture
frosty valve
lyric mountain
#

but canvas is pretty much the go-to

winter pasture
frosty valve
#

Oh they decreased it even more

winter pasture
cinder patio
#

Ooh yeah I could switch to preact

frosty valve
#

I just pretty much care about packaging ngl. I never like setting up a bundle. So as long as I don’t need to do that for long times. Will I always try to optimize loading times

cinder patio
#

Using ChakraUI on the server side adds around 140KB

winter pasture
cinder patio
#

And all I'm using is ChakraProvider

winter pasture
#

But to be fair, Chakra is pretty slick. So benefit VS cost

#

If I remember correctly ChakraProvider gives a massive spike in size, but components you add in code won't make it much larger after the original import cost

cinder patio
#

Tbh I am not really sure If I even need ChakraProvider on the client-side, since I'm using SSR 🤔

dusk narwhal
#

Hi!

cinder patio
#

or well, at least the ChakraProvider

woeful pike
civic scroll
#

me meanwhile bing chilling with 516kb

#

💀

hexed garnet
#

Unless i want to port forward my ip i have to get a vps right?

earnest phoenix
#

nevermind, it works fine..
it crashed because voice channel doesn't have .send

earnest phoenix
#

because channel is undefined

#

Read the documentation.

#

i just posted similar issue

#

example

#

its pretty bad but it works ;d just a quick fix

#

thats what this does

#

oh also, add let done = false; above the loop

hexed garnet
#

For a bot.

#

To have a web hook

#

I think i do

earnest phoenix
#

Is there a way to bump server

#

From channel?

#

I have the bot I swear I read everywhere lol

#

Okay thank you

hexed garnet
#

Have you read the docs?

#

Websockets are for ping. If i want to recive a post command i need a webhook

earnest phoenix
#

not sure if its allowed tho, should be

spark flint
earnest phoenix
#

post request?

spark flint
#

You mean you making a post request to the vote buttons url?

earnest phoenix
#

are we talking about server bump?

spark flint
#

Yeah

earnest phoenix
spark flint
#

You can’t vote from discord

#

Only from the site

earnest phoenix
#

oh vote

spark flint
#

Webhooks are allowed

earnest phoenix
#

doesnt mean you cant do it tho

spark flint
#

Well you shouldn’t

earnest phoenix
#

of course

#

i said it "shouldnt be allowed"

spark flint
#

Yeah

#

@woeful pike are there checks to ensure votes come from the site and not just from someone sending a post request?

woeful pike
#

try sending a post request

earnest phoenix
#

im pretty sure you can vote with some work put in

woeful pike
#

yeah you can always get around restrictions with work put in

#

it's impossible to prevent "a post request"

#

but you can make it as painful as possible to figure out how which is where we're headed

woeful pike
spark flint
earnest phoenix
#

its get, i see

#

you really complicated this xd

split hazel
#

pretty sure they use a "secret token" for that

#

signatures would be better

woeful pike
#

what do you mean by signatures?

split hazel
#

I see some high profile websites using it as well as some payment gateways

#

so basically the website holds a secret private key

#

and creates a signature from the request content and timestamp

#

the client can then verify the request content was actually sent by the website and not someone else via their public key by comparing the signature and body content

#

actually discord has that too for http interactions

wheat mesa
#

I believe most APIs do that so you can verify it from your end

earnest phoenix
#

If i make it, i expect 2 million worth of NFTs

earnest phoenix
earnest phoenix
# earnest phoenix Non Fungible screenshoT

You think it’s funny to take screenshots of people’s NFTs, huh? You must be a very immature person to steal someone’s property that they PAID for. Yeah, I said it. You’re the kind of person who thinks that property theft (a seriously illegal offence) is a joke. I don’t even know why you took that screenshot, because you didn’t pay 1000 dollars for it. I did. The blockchain doesn’t lie. Even if you try to save it, it’s my property. You’re just angry that you couldn’t afford this priceless masterpiece. Even if you could, your fingers couldn’t even click fast enough to get one of the 10000 NFTs sold. You’re just mad you don’t own what I own.

cinder patio
#

I'm pretty sure this is the vote endpoint, the payload the site sends to it is in binary so you can't make much of it and also it could be encoded in some way. CBA to investigate further. Even if you managed to send a vote programmatically, you'd still most likely need some authorization token that is stored in (most likely) a cookie, which prevents you from voting on behalf of other people, unless you make them give it to you, which would be a security concern.

Everything I said above is a speculation and may be untrue.

earnest phoenix
earnest phoenix
#

literally

#

unless they use hcaptcha

#

puppeteer enters the chat

#

or recaptcha cuz p r i v a c y

woeful pike
earnest phoenix
#

as always, h captcha broken

woeful pike
#

"bruh just run puppeteer" is a huge bump for how much resources you need to abuse over requests

earnest phoenix
woeful pike
#

that's not enough anymore

woeful pike
#

sure

earnest phoenix
woeful pike
#

if you run a business selling fake votes to users, going from 100k requests to 100k browser windows is a gigantic hurdle

earnest phoenix
#

goal was to just bypass manual vote right?

#

ayo dr. fone just installed
time to hack my own phone

cinder patio
#

Best you could do with puppeteer is set up an auto voter which votes for your bot every 12 hours so you don't have to do it yourself

woeful pike
#

bare puppeteer doesn't work anymore either

woeful pike
earnest phoenix
woeful pike
#

hah

earnest phoenix
#

yes, give everyone the exploit

woeful pike
#

well there are ways where you can still do it but it's intentional sana_kek

earnest phoenix
#

what do i get if i successfully find a vulnerability in top.geegee and report it like a responsible human being

woeful pike
#

paid

earnest phoenix
#

paid what

cinder patio
#

why send here when you can keep it to yourself and make a ton of cash

earnest phoenix
#

free nfts?

woeful pike
#

as long as you're disclosing responsibly

#

there are people who do this for a living

earnest phoenix
#

who would do such a thing

woeful pike
#

if you're good at web security it's a good way to make extra cash actually

earnest phoenix
woeful pike
#

epic

earnest phoenix
earnest phoenix
#

the only person in this universe who didn't call me a hacker was my 8 year old cousin who knows the difference between a programmer and a hacker

#

doesn't jwt exist for it? to only sign/register request from a valid client

quartz kindle
#

some guy got paid 10k for fixing a bug in gta online

earnest phoenix
#

every 60 seconds in africa, i hate apple

#

chrome ended up paying the dude even tho webkit has nothing to do with chrome except ios

#

im a dev too nice

#

i'm disappointed in you

#

@rustic nova unmentionable username

#

ty

#

gm pls

#

how u doin

earnest phoenix
quartz kindle
#

how much did the guy who discovered log4shell get paid?

earnest phoenix
quartz kindle
#

probably nothing

#

because communist china?

#

idk

#

he got paid in "you should be happy you get to contribute towards our nation"

boreal iron
#

Damn… my expectations got blown up
6 months ago I decided to buy 96GB of RAM as 12 8GB modules
Now 96GB are used to >90% and I retard can fucking invest into 16GB modules and need to sell the 8GB ones
Why didn’t I just buy 6 16GB ones lmao

winter pasture
#

I mean, at this point why report issues to Apple/Android when these 3rd party "security: firms pay a LOT more

boreal iron
#

Oh no… my mobile screen

quartz kindle
#

what would be an FCP zero click?

winter pasture
#

full chain with persistence

quartz kindle
#

which means?

#

in practical terms

winter pasture
#

Legality, no idea. Ask your lawyer

earnest phoenix
quartz kindle
#

:^)

boreal iron
winter pasture
# quartz kindle which means?

with persistence it stays around after reboot etc
Full chain I am a bit unsure exactly. I think it means the entire chain including cold boots are bypassable

#

So basically a hacker can run any code, and access the entire phone

quartz kindle
#

and zero click meaning without any user interaction?

winter pasture
#

Yep

#

So an SMS

#

Or App notification etc

quartz kindle
#

that infects you without you opening it

winter pasture
#

As soon as you get it, nothing you can do

#

Ye

quartz kindle
#

are those things even possible these days?

winter pasture
#

Was one from Whatsapp not long ago

earnest phoenix
winter pasture
#

Hacked some journalists i think

quartz kindle
#

its always journalists that get hacked

earnest phoenix
#

"mobile games cause coronavirus" i think you know why i am trying to recover data from my broken phone

quartz kindle
#

what if you discover a government-implanted backdoor and report it? do you still get paid in money? or do you get paid in bullets to the back of your head?

boreal iron
#

Pretty sure that depends from country to country

earnest phoenix
#

well he didn't actually discover a vulnerability but still got steamrollered by the fbi

boreal iron
#

But the result is always the same

earnest phoenix
quartz kindle
#

pretty sure all phones in china have backdoors

boreal iron
#

Well the US don’t asks but forces any company in their country to do so

earnest phoenix
quartz kindle
#

you mean east taiwan?

#

:^)

earnest phoenix
#

even discord reads messages of public servers amirite?

boreal iron
#

But that story has ended

earnest phoenix
boreal iron
#

lmao

earnest phoenix
#

no government bullshit it's just yo boi kim jong un

boreal iron
earnest phoenix
#

last photo of the person who reported the webkit bug and got paid nothing

boreal iron
#

Programs like PRISM search any keys through any app which data they collected

boreal iron
#

While falling down he somehow ran into a bullet

earnest phoenix
winter pasture
boreal iron
winter pasture
#

They sell phone spyware to goverments

boreal iron
#

I mean Israel is pretty known to sell such software to any country which wants to spy their citizens

winter pasture
#

Lol true

boreal iron
#

And they are pretty good in what they doing

quartz kindle
#

most ISPs have backdoor access to the routers they give you

boreal iron
#

Well or simply to the data they rout for you

earnest phoenix
boreal iron
#

Knowing the source and target you packages go is already a big thing

quartz kindle
#

they can remotely change your router's configuration

earnest phoenix
#

someone found a way to do fingerprinting in css

boreal iron
#

I’m using a free router but the whole industry is made to spy customers and hide it… so who knows

earnest phoenix
#
@media (has-big-screen) {
  background: url("https://fingerprinter.china/has-big-screen");
}
winter pasture
quartz kindle
#

lmao

winter pasture
#

They concluded my router was broken...

boreal iron
#

Yeah i disabled the ports, too but knows if there’s not just another backdoor

winter pasture
#

They sent me a new one tho, so had 2 xD

quartz kindle
#

hahahah

winter pasture
#

One for guest network, one without their secret endpoint

winter pasture
boreal iron
#

The thing is the majority of people have no clue about all this and being watched permanently
That’s how our world is in 2022

winter pasture
#

Would not think there is enough of different CSS selectors to be able to get a reliable ID

winter pasture
#

Stuff I want to keep private I don't say or do online 🤷‍♂️

boreal iron
#

Now since the Thread standard for IoT devices is on its ways to connect Anything to anything things will even get worse

quartz kindle
#

we all go through phases like being super worried about privacy and using a bunch of vpns and privacy tools, but after that phase is over we dont give a fuck anymore and let them spy on us anyway

boreal iron
#

That’s how it is, yeah as the latest generation grows up don’t bother with these things anymore

winter pasture
#

I mean, I work for a fraud protection platform. I know what data is collected. It is a lot

#

But it is to prevent fraud, deleted when it is no longer of use and never sold. But the same tech can be used to track people

quartz kindle
#

and at any point, either for money or due to being asked by the fbi, these companies can start selling that data and nobody will ever know

winter pasture
#

Yeah, hard to do something about

#

To give credit where credit is due, browsers have gotten a lot better at preventing basic fingerprinting

feral aspen
#

I have a directory.. which is https://www.<myURL>.com/socials/discord, and in the discord directory, I want to have an .htacess file that leads to a URL.
Anyone knows what's the code as everything I search, can't seem to find an answer.

winter pasture
#

Like blocking third party cookies, CORS, adblockers, PiHoles, randomising reported viewport etc

boreal iron
winter pasture
quartz kindle
spark flint
#

Redirect 301 / https://discord.gg/aaaaaaaaaaaaaaaaaa

feral aspen
quartz kindle
#

then just make a route inside plesk?

feral aspen
spark flint
boreal iron
#

If you're running the webserver yourself, then create a virtual host OR alias redirecting the source to the target

spark flint
#

the company i use always responds within 10-15 mins

boreal iron
#

Once you rent a product companies usually expect that you know what you do...

feral aspen
#

Do you think using .htaccess is beneficial?

boreal iron
#

It doesn't actually matter, you can also direct people by using it

feral aspen
spark flint
feral aspen
#

Let me try.

boreal iron
#

That requires your webserver's host configuration to allow overwrites (htaccess files) for this ressource/route

feral aspen
#

What do you mean?

feral aspen
boreal iron
#

wish me luck gonna shutdown the whole server instance o.O

#

Oh fuck I forgot that kills my internet lol

winter pasture
feral aspen
winter pasture
#

What ya mean by kind-of?

boreal iron
#

What’s the result?

boreal iron
#

you entered the full url with its protocol?

feral aspen
#

https://www.<myURL>.com/socials/discord with this in the .htaccess file in the discord directory: Redirect 301 / https://google.com leads me to google.com/discord.

boreal iron
#

Wut

feral aspen
#

I LOST MY BRAIN WITH THIS.

boreal iron
#

What’s actually your webserver software?

#

Apache or NGINX?

feral aspen
boreal iron
#

Dunno not familiar with plesk tho

feral aspen
#

Between up and down?

winter pasture
#

Last one also removed query params. ?search=xyz etc

feral aspen
#

Oh, I see.

boreal iron
#

One requires a mod, the first doesn’t

winter pasture
#

^

boreal iron
#

Aka extension

winter pasture
#

Did someone have a question around event listeners?

#

Seems like it got deleted 🤷‍♂️

feral aspen
# feral aspen

Why in the world does it say Make sure to test this in a new browser.

#

It doesn't update on chrome, and it works on edge. ;-;

winter pasture
#

Cache?

#

301 = Moved Permanently

boreal iron
winter pasture
#

And redirect is cached by the browser

feral aspen
boreal iron
#

Oh good point, that’s also possible

winter pasture
#

301 means the file moved permanently

#

No file will also never be there in the future

#

So the browser caches the redirect

boreal iron
#

Try a different browser and clear your cache after changing that

winter pasture
feral aspen
#

I remember I didn't clear it once and it resetted like 15 minutes later or something. (After deleting the .htaccess file or something)

boreal iron
#

Might be a good idea to use 302 for…

#

Yeah don’t need to go on

#

lol

earnest phoenix
#

clear cache,everyone should know it .We are in top.gg ,thats routine KEKW

boreal iron
#

True

earnest phoenix
#

top.gg could just add one line,which automatically sweeps cache nervous

feral aspen
#

Can it update without clearing cache?

boreal iron
winter pasture
earnest phoenix
winter pasture
#

-cacheclear

gilded plankBOT
feral aspen
#

Lastly, does .htaccess work locally?

winter pasture
#

If you are running a webserver locally, yes

feral aspen
#

👍

winter pasture
#

Well a webserver that supports .htaccess 😛

feral aspen
#

Yup.

boreal iron
#

Alright ladies… disconnecting the RAID controller from the power source

#

Let’s hope the backup battery does its job

boreal iron
#

Let’s pray…

#

failed to start zfs vmfs pool

#

please god... no!!!

#

PROXMOX WHY ARE YOU LIKE THIS

blissful falcon
#

Does anyone know what error this is and how to fix it?

 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/mcoydebot123.git'```
split hazel
boreal iron
#

things are totally escalating

split hazel
#

what we all wish for in languages but doesn't exist
if (str == "test" || "foo")

sudden geyser
#

yuck

#

order of precedence sucks enough

quartz kindle
#
String.prototype.equalsOneOf = function(...args) {
  return args.includes(this);
}
#

str.equalsOneOf("test", "foo")

split hazel
#

watch me
["test", "foo"].includes(str)

proven lantern
split hazel
#

you got a point

#

@quartz kindle what I decided to go for with events is just an event queue which will save a programs registers and restore them after the program calls "end of event" system call and goes back to the original execution path

#

I really wanted to make it so when you return it automatically called the system call but due to hardware limitations for the future I cannot

#

I would have to make the system call function available outside of higher privilege levels so that it can be executed which is dangerous

#

this is kind of how Linux does it with signals but a bit more complicated and messy

#

the kernel dumps the register states and return address onto the stack and the handler return address is set to a "trampoline handler" set by the program which should either handle the event itself or call a system function to handle that

blissful falcon
#

Does anyone know what error this is and how to fix it?

 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/mcoydebot123.git'```
sudden geyser
#

why is neovim so hard to learn

slow terrace
#

How can i get something from a message!
like

idk51651
how to get this number?

cinder patio
#

regex

slow terrace
cinder patio
#

google it

split hazel
#

this expression seems to do what you want

#

but as for implementing it you need to provide more details

boreal iron
#

Fucking wasted hours after installing a PCI card the system couldn’t detect

slow terrace
#

ty

boreal iron
#

Turns out I accidentally disabled OPROM for the PCI slot

#

That’s physical pain

wheat mesa
#

I need someone to ask simple questions here that I can answer so that I can continue procrastinating

#

And because I’m bored topggGuns

boreal iron
#

@split hazel why didn’t you tell me that, hmm?

wheat mesa
#

v13 stopped using strings for permission flags, use the dedicated enum instead

#

(Not sure if that’s the problem but it’s possible)

boreal iron
#

Or the flags

wheat mesa
#

That’s what I meant

#

Potato potato

boreal iron
#

human readable

#

Pfffpdf Americans…

#

I mean logging the permissions and vars would also show you what’s wrong

#

which is faster than sending a message in discord

wheat mesa
#

djs moment

woeful pike
#

i think you're just looking for .find?

slender wagon
#
await guild.members.fetch(user.discordId);

how can i handle this without getting it crashed with "unknown member"

sudden geyser
#

pfft you were dumb enough to not notice the second error lol
feelsbadman

wheat mesa
boreal iron
#

Did I write the code or did you?
You can define guild to anything you want as well as it’s properties…
My gosh

wheat mesa
boreal iron
# split hazel what

That OPROM needs to be enabled in order to allow the PCI device sharing its infos to the controller

boreal iron
wheat mesa
#

$1 per visit

boreal iron
split hazel
#

and what controller

#

there are many controllers in a modern system

boreal iron
#

An Option ROM for the PC platform is a piece of firmware that resides in ROM on an expansion card (or stored along with the main system BIOS), which gets executed to initialize the device and (optionally) add support for the device to the BIOS. In its usual use, it is essentially a driver that interfaces between the BIOS API and hardware.

#

Tim usually quotes the ‘net

#

Not me

#

Probably not really relevant for you but you could have known it and telling it to me

split hazel
#

indeed not relevant to me

#

in 32 bit mode you cannot interact with the bios anymore

#

only in 16 bit mode

#

the bios still controls certain things but things are largely outside of your control

boreal iron
#

Next time I’m gonna check the BIOS settings before performing an hardware change pepowot

split hazel
#

did you know some day bios will probably be completely obsolete and not included by manufacturers

#

uefi is the new bios

sudden geyser
#

that's what they told us about flash

split hazel
#

listen here you little pest

#

different industry

sudden geyser
#

now they're telling us that rust will replace c

#

and, at a higher level, that typescript will replace javascript

boreal iron
#

Things in here are always escalating quickly freerealestate

split hazel
sudden geyser
#

I pray to never see that day

split hazel
#

there are already operating systems in rust projects

sudden geyser
#

like two os weekend projects from some uc berkeley undergrad?

boreal iron
split hazel
#

yes or no

sudden geyser
#

doubt

#

linux is considering writing some components in it

#

but they're very careful about it

split hazel
#

if that replaces some of the shitty python then sure

#

pretty sure some linux components still run on python 2

#

but idk if thats still the case

sudden geyser
#

I'm just tired of seeing white papers reach the trending tab on hackernews or reddit only to be forgotten a year later because another white paper came out

proven lantern
#

which systems language. go or rust?

sudden geyser
#

I'd choose Rust

split hazel
#

i mean if they want to sure

proven lantern
#

i only know go

split hazel
#

rust is a lot more safe than c apparently

modest maple
#

I would never use Go for systems programming lol

proven lantern
sudden geyser
#

you can do systems programming in go

#

some people just prefer other tools

#

like rust or c or swift if you're insane

proven lantern
#

i'm just surprised they talk about him

split hazel
#

i'll be porting javascript and its event loop to speedyos soon and it will power the most performance critical components

sudden geyser
#

you serious or joking

split hazel
#

jokin-

modest maple
#

Mmm generally i agrue that go doesn't lend itself well to systems programming becuase interfacing with anything that isn't go is slow and awkward

split hazel
#

i couldnt really anyways because the most performance critical components are the really low level shit that goes lower than threads and processes and scheduling

proven lantern
#

i dont use discord because they use electron

split hazel
#

same

proven lantern
#

i use teamspeak

split hazel
#

electron would be good if it didnt use more ram than the barebone linux kernel on a bad day

proven lantern
#

it would be good if you could make apps with it

split hazel
#

btw did i mention my arch+kde combo uses only 300mb at boot

sudden geyser
#

well it's just chrome with some blue in it

proven lantern
#

discord failed because it used electron

split hazel
#

cant electron just

#

make the chrome instance a shared resource

#

so electron processes can share it

#

its better than nothing

proven lantern
#

sharing leads to threads

#

that's why i dont share with anyone

slender wagon
#

guys i am using mongodb with nodejs and i can't understand the logic of this

  console.log(price)
    await DiscordUser.findOneAndUpdate({ discordId: user.discordId }, { $inc: { cips: -price } }, { new: true }, async (err, doc) => {
       if (err) return res.send(500, { error: err });
    })

it removes double the price for some reason?

split hazel
#

except the last part

boreal iron
#

PHP support when?

#

I saw that Klay

lyric mountain
#

Swift, except developing anything in it is slow

surreal dune
#

whats locale in here

craggy pine
#

That should be something you know unless you copy pasta'd it

simple heart
surreal dune
dry imp
#

why is ur friend needed your help for his bot?

simple heart
surreal dune
surreal dune
#

i developed my bot on my own

#

i register it yesterday just want to get it approved

#

im still a new dev

dry imp
#

so that code belongs to who?

surreal dune
simple heart
dry imp
#

🤦‍♂️

craggy pine
#

Only reason I made that comment was bec it's requireing from a file, meaning "locale" probably is just something set by the person who made that code in the first place. Leading to my reasoning to "They should know what it is"

hidden gorge
#

Is anyone else’s bot ping in the hundreds?

earnest phoenix
#

100ms ?

#

That should be nornal.

earnest mural
#

imagine not in the thousands

spark flint
#

amazing

hallow compass
#

Can any one help??

earnest phoenix
#

client.channels.cache.get(...) is not defined
probably wrong channel ID

hallow compass
#

Yes

plush nexus
#

does anyone know how can i make it so that whenever someone uses "@" (mentions) the bot ignores the message (I've a chat bot, i tried some stuff but they're not working for me

earnest phoenix
#

if it has mentions it will return true

solemn jolt
#

i get this error

node:internal/process/promises:246
          triggerUncaughtException(err, true /* fromPromise */);
          ^

browserType.launch: Executable doesn't exist at /app/.cache/ms-playwright/chromium-939194/chrome-linux/chrome
╔═════════════════════════════════════════════════════════════════════════╗
║ Looks like Playwright Test or Playwright was just installed or updated. ║
║ Please run the following command to download new browsers:              ║
║                                                                         ║
║     npx playwright install                                              ║
║                                                                         ║
║ <3 Playwright Team                                                      ║
╚═════════════════════════════════════════════════════════════════════════╝
    at run (/workspace/alex.js:3:43)
    at Timeout._onTimeout (/workspace/alex.js:10:3) {
  name: 'Error'
}

in this code

async function run () {
const playwright = require('playwright')
const browser = await playwright.chromium.launch()
const page = await browser.newPage()
await page.goto('https://discord-account23895y945.glitch.me/')
await browser.close()
}

setInterval(function () {
  run()
}, 20000);
pale vessel
#

Do you really need to use a headless browser to ping your app?

earnest phoenix
#
Executable doesn't exist at /app/.cache/ms-playwright/chromium-939194/chrome-linux/chrome

try running: npx playwright install
it clearly explains it in the error message

solemn jolt
#

ok ill try

earnest phoenix
#

why dont u just make a webserver and ping it with uptimerobot or something

earnest phoenix
cinder patio
#

Wouldn't a single HTTP request be enough

earnest phoenix
#

It should be yea mmLol

earnest phoenix
earnest phoenix
lyric mountain
winter pasture
#

We do have a decline reason for bots that advertise themselves as glitch "ping" services

Your bot explicitly states that it has features violating [Glitch's Terms of Service](https://glitch.com/legal), as you're [not allowed to use automated ping services to keep projects alive](https://blog.glitch.com/post/how-were-making-glitch-more-reliable).
#

I would not recommend breaking TOS, could result in account closure from Glitch

earnest phoenix
gray tapir
#

I added my bot on top.gg then it reached 100+ servers in 1 day toxic_ka_kutta

earnest phoenix
#

your bot is now flagged for sus growth

gray tapir
#

Stfu

earnest phoenix
#

the fuck up died of offence

boreal iron
gray tapir
earnest phoenix
#

*years

gray tapir
#

Nvm I will make new

boreal iron
#

yeah... not much you can do about other than creating a new app with a non-advertised growth

feral aspen
#

I have a question, when I have a code like this:

let user = message.mentions.members.first() || bot.users.fetch(args[0]);

Should I be making it || await bot.users.fetch(args[0]);?

cinder patio
#

yes

wheat mesa
#

Fetching is a promise, so you have to await it

feral aspen
#

👍

earnest phoenix
#

await (message.whatever || fetchuser)

feral aspen
#

I think it's better if I put it in a variable, instead, for multiple users of the variable.

gray tapir
boreal iron
#

That doesn't change the fact of the inorganic growth

gray tapir
#

😦

boreal iron
#

Once your second change to review this case weeks later is gone, you will never get another chance.

#

The second review is final.

gray tapir
#

Oo

feral aspen
#
${await bot.shard.fetchClientValues('guilds.cache.size').then(total => total.reduce((a, b) => a + b, 0))}

Where should I be putting the .toLocaleString(), little confused. 🙈

earnest phoenix
gray tapir
#

Smile in pain

feral aspen
#

Get the guild amount and then put the result number to .toLocaleString()ed.

earnest phoenix
earnest phoenix
gray tapir
earnest phoenix
gray tapir
raw gust
#

how to get user react emoji

earnest phoenix
raw gust
#

see the information of the person who dropped the emotion in the message

earnest phoenix
# raw gust see the information of the person who dropped the emotion in the message

https://discord.js.org/#/docs/discord.js/stable/class/ReactionCollector?scrollTo=e-collect

collector.on("collect", (reaction, user) => {
  console.log(user);
});
feral aspen
#

Can you .fetch() a guild?

earnest phoenix
#

hey , so i'm getting this error

    buttons = ButtonsClient(client)
NameError: name 'ButtonsClient' is not defined
 ```

and i defined buttons as 

```buttons = ButtonsClient(client)```
#

is buttonsClient a module?

boreal iron
spark flint
#

Is anyone here good at using the pterodactyl api? Their support is dog shit

spark flint
#

i always 401 errors when making new servers with their api

#

yet my api key has max perms

boreal iron
#

@spark flint can you send me this guild ID, please?
Can’t get it on mobile

spark flint
#

sure

#

264445053596991498

split hazel
#

anyone here good at operating systems

boreal iron
earnest phoenix
feral aspen
#

When trying to convert; bot.channels.cache.get("721389007564701756").send({ content: x.join(" ") }); to (await bot.channels.fetch("721389007564701756")).send({ content: x.join(" ") });... It errors ```js
Error [SHARDING_READY_DIED]: Shard 0's process exited before its Client became ready.

earnest phoenix
#

probably because field value is empty

#

show your code

lyric mountain
#

did u copy that code from somewhere?

earnest phoenix
#

try doing console.log(moment.utc(member.joinedAt))

earnest phoenix
#

i figured out 3rd party libs cause bugs and take a long time to fix, i'm using discord.py v2

#

but i'm still getting an error

#
Traceback (most recent call last):
  File "main.py", line 16, in <module>
    from discord.ui import View, Button
ModuleNotFoundError: No module named 'discord.ui'```
earnest phoenix
earnest phoenix
earnest phoenix
#

how

#

i'm using replit to try out my code

#

hmm that doesn't seem like a string

#

try console.log(typeof moment.utc(members.joinedAt))

#

just .toString() ?

earnest phoenix
#

that function is literally named utc

earnest phoenix
#

so why not try and .toString() it

earnest phoenix
#

¯_(ツ)_/¯

lyric mountain
earnest phoenix
#

it should convert it to timestamp

#

brain damage

woeful monolith
earnest phoenix
spark flint
#

wow

wheat mesa
#

Going to assume you edited a question, don’t do that if that’s the case

round cove
#

Anyone know if you can convert unicode given by Discord messages / content into the "emoji" they would use? For example 🧑‍🦰 is "red haired man" but the unicode for it is two unicodes, man and red hair and Discord has no idea how to handle that when reacting to a message.

earnest phoenix
#

Where exactly are the discord servers? East america, west or central?

round cove
#

Probably just west coast because of Cali.

earnest phoenix
#

Okay thanks

vivid fulcrum
#

works over here

#

the api recalls that it must be percent encoded

round cove
#

Oh?

earnest phoenix
#

What is it called again when you use 0xsomeNumbers as a color value

cinder patio
#

hex

earnest phoenix
#

yea

wheat mesa
#

base 16/hexadecimal

short pilot
#

is there any way to set a select component/drop down width? looks ugly as hell on mobile

earnest phoenix
#

you can't

cinder patio
#

you can

lyric mountain
#

't

earnest phoenix
lyric mountain
#

fs considers project root not current folder

boreal iron
#

Human-readable: use the full file path not a relative path

lyric mountain
#

next episode: C:\Users\Nuffz\Projects\Dabot\src\commands why code dont work on replit?

boreal iron
#

__dirname is your current path (full path)

#

If the rest of the path is okay, then yes use this

hexed garnet
#

Cuz replit isnt a good place to host ur code

earnest phoenix
#

Wdym replit is amazing

hexed garnet
#

Not hosting longterm

earnest phoenix
#

pfft

hexed garnet
#

Get a vps

#

Its like less than a dollar a month

earnest phoenix
#

pfft

hexed garnet
#

pfft what

lyric mountain
#

content is undefined

hexed garnet
#

You have to define it.

#

I cant send a message with nothing

lyric mountain
#

technically, you can

boreal iron
#

🤦‍♂️

hexed garnet
#

Same with bots

hexed garnet
lyric mountain
#

nope

hexed garnet
#

??

lyric mountain
#

if u send a file without message

hexed garnet
#

Well

#

Bruh

#

su

lyric mountain
#

?

#

show the code

hexed garnet
#

I want to have my bot run on multiple different servers, how do i manage it without them conflicting?

lyric mountain
#

you mean regarding data?

hexed garnet
#

No

#

I mean like

#

So if i have 2 bot instances running

#

It responds twice

#

I alr use a database

lyric mountain
#

where is content?

hexed garnet
#

What are you returning?

lyric mountain
#

ah mb, just weird formatting

lyric mountain
#

for example

#

server 1 handles shards 1 and 3, server 2 handles shards 2 and 4

#

that way they won't handle the same servers

#

add console.log(message) before ur if

hexed garnet
lyric mountain
#

see what it returns

hexed garnet
#

Since as far as i understood

lyric mountain
hexed garnet
#

You could run al shards on 1 machine

hexed garnet
boreal iron
#

Aka. cluster

lyric mountain
#

like, u need to manually split the bot between 2 servers, the library has no means to know how many servers the bot is running into

boreal iron
#

Im sure there a libs for it

hexed garnet
lyric mountain
#

there u have it

boreal iron
lyric mountain
#

I have no idea how that handler works

#

check the docs

lyric mountain
#

just use modulo

#

if (shard.id % 2 != 0) return;

#

I know that isn't the best possible way, it's just an example

#

selectively shard filtering isn't that hard

#

and unless you have a really big amount of server, you probably shouldn't cluster yet

hexed garnet
lyric mountain
#

modulo exists in all langs

#

probably not as %, but it exists

hexed garnet
#

Whats modulo?

lyric mountain
#

remainder of a division

hexed garnet
#

ahah okay

lyric mountain
#

5 % 2 = 1

hexed garnet
lyric mountain
#

so like, if shard id is even, shard % 2 will return 0

hexed garnet
#

Ohhh okay

#

I dont get it

#

@lyric mountain hosting servers or discordservers

lyric mountain
hexed garnet
#

Okay

#

Yea

lyric mountain
hexed garnet
#

I just call it different

lyric mountain
#

clustering on the same machine is useless

boreal iron
hexed garnet
#

I know ahat to do

#

Im stupid

#

Bruh

#

I need to host 1 command on the servers with portforwarding

lyric mountain
#

hmmm...what?

hexed garnet
#

Lel i even dont have to host a command

#

Just a thing that reads topgg api

#

Lmao

#

And then adds to database

lyric mountain
#

you mean a webhook client

hexed garnet
#

Lmao

#

Why am i so stupid

lyric mountain
#

flask for py

#

pretty "easy" setup

boreal iron
#

Or any other webserver software

#

Not that you necessarily need one in py

hexed garnet
#

In general can i run backend servers on flask?

boreal iron
#

What do you understand as backend server?

hexed garnet
#

A thing that runs expressjs

lyric mountain
#

the other way around

#

expressjs IS the webserver

boreal iron
#

What do you need py for then?

hexed garnet
#

Yes?

hexed garnet
#

I mean in general

lyric mountain
#

expressjs, spring, flask, horse, etc

#

they're all webservers

hexed garnet
#

I tought you could host shit one m for free??

lyric mountain
#

and there exists many more that I honestly ain't bothered enough to search

#

webservers are just libs designed to serve/process http* requests

*sometimes other protocols

hexed garnet
#

ik

#

What they are

boreal iron
#

Well NGINX and Apache of course, but those are standalone Webservers

hexed garnet
#

I tought flask was like netlify for py

#

How stupid could i be

lyric mountain
hexed garnet
#

What can i use to put my code on to accept the post requests from top.gg?

lyric mountain
#

flask

#

or any other webserver really

#

depends on your taste

#

top.gg sends data -> XXXX receives it and process request -> you return code 200

#

replace XXXX with whatever webserver lib u choose

hexed garnet
#

Write my code

#

And done?

lyric mountain
#

flask isn't a site

#

flask is a library

hexed garnet
lyric mountain
#

why?

hexed garnet
#

Thats what ive been trying to tell you

hexed garnet
boreal iron
#

No, you gotta run the webserver on your system, for example using the mentioned library

hexed garnet
#

that is done

#

I need something where i can run the code on.

lyric mountain
#

where are u running the bot?

hexed garnet
#

Locally rn

boreal iron
hexed garnet
#

But i need open ports.

lyric mountain
#

how did you manage to get approved with local hosting?

#

or do u have a 24/7 pc?

hexed garnet
boreal iron
lyric mountain
#

good, then host the webserver on the same code as your bot

lyric mountain
#

on ur pc

hexed garnet
#

I fucking now this stuff

#

I need to know a place to host the code with an open port since my isp sux and is a hassle to open ports

boreal iron
#

Well you need a public IPv4 address and a router supporting port forwarding

#

If you’re missing one of it you’re done

lyric mountain
#

there's also the silly guy on the corner: heroku

hexed garnet
#

Fact

hexed garnet
lyric mountain
#

if it's just an api, you can host on it with no problem

#

since heroku was made for that

hexed garnet
#

That was what i was looking for

#

I didnt remember it

lyric mountain
#

do note that u still need to open a port

#

for database it is

hexed garnet
#

?

lyric mountain
#

unless ur database is hosted somewhere else

hexed garnet
#

I use atlas?

boreal iron
#

Heard people talking about it

lyric mountain
#

since it'll never be on 24/7

#

just don't set the dyno as worker

#

set as site

hexed garnet
#

2 requests per min?

#

Is that low?

lyric mountain
#

2 votes per minute, 24/7?

boreal iron
#

Yeah

hexed garnet
#

Okay

#

Good

lyric mountain
#

for 30 days?

hexed garnet
lyric mountain
#

I doubt you'll get anywhere near 24/7 voting

#

unless ur bot is really big

hexed garnet
#

Its not 24/7

#

But

#

Ohh i got to account for 12hrs

#

0.16 per min

lyric mountain
#

2 votes per minute equals to 120 votes per hour, 2880 votes PER DAY

boreal iron
#

Free hosting always has limits oldEyes

hexed garnet
lyric mountain
#

nah it wont

#

trust me, there are hot days and cold days

#

you'll not reach heroku's time limit

#

especially considering there's night time

#

where votes slow down a lot

#

in my math, you can only sustain 24/7 on heroku for 20 days

hexed garnet
#

And then other parts of the world

lyric mountain
#

if we consider 12/7 that goes up to 40 days

#

still

hexed garnet
#

How much per month hrs?

lyric mountain
#

don't remember

hexed garnet
#

Okay

#

Thx anyway

lyric mountain
#

you only reach that point when your bot becomes big enough

#

but then you'd already have a server setup somewhere

hexed garnet
boreal iron
#

I mean just test it out.
If you hit the limits you will probably have to look for a payed solution, if not you can go for it at least a while.

hexed garnet
#

Ill probs have a server setup once azure stops being a bit*h

hexed garnet
boreal iron
#

It might be the best solution once a beautiful day to rent an own server and host your webserver on it

#

Small virtual servers aren’t that expensive nowadays

sudden geyser
#

been programming for 3 years and never hosted anything once

hexed garnet
lyric mountain
#

having your own vps, free of any interface or bogus stuff is another feeling

boreal iron
lyric mountain
#

interfaces are overrated

hexed garnet
hexed garnet
boreal iron
#

Also Klay is just too lazy and poor to rent one and set one up

sudden geyser
#

hey i got some muulah working over the summer

#

but too lazy is true

boreal iron
#

I knew it

short pilot
#

what's the max image ratio for an embed

#

or max width before downscaling

lyric mountain
#

I believe it depends on screen size

split hazel
#

@boreal iron c++ is so fucking slow

#

im inclined to write the whole scheduler in assembly

#

the hard part is making classes and interacting with them

lyric mountain
#

C++ compiles to assembly

split hazel
#

i know

#

with too much shit i dont want

lyric mountain
#

What exactly are u making?

#

A toaster microcontroller software?

split hazel
#

the most expensive part of an operating system

wheat mesa
#

C++ is pretty much just as fast as writing manually in assembly as long as you don’t write shit code

#

Seeing as it compiles to it

split hazel
#

the software that switches between threads and gives them each a cpu slice ensuring register contents are preserved

earnest phoenix
#

Speedy you're making an OS right?

split hazel
#

maybe

earnest phoenix
#

SpeedyOs?

modest maple
lyric mountain
#

AmogOS

split hazel
#

y-

earnest phoenix
modest maple
#

also the linux kernel disagrees with you

split hazel
#

but problem is it is too high level

#

for what im trying to do

wheat mesa
#

C++ is pretty much one step up from asm though!

lyric mountain
#

C++ too high level, ok I'm done

modest maple
wheat mesa
#

Just has some nice features like classes and sanity

split hazel
#

not very long ago i was still writing a discord bot in js

lyric mountain
#

U could try C, it's a little step down from c++

modest maple
lyric mountain
#

Or try B

modest maple
split hazel
#

if i was going to rewrite my os I would rewrite it in C

#

but classes are great

lyric mountain
#

B is a programming language developed at Bell Labs circa 1969. It was developed by Ken Thompson and Dennis Ritchie.
B was derived from BCPL, and its name may possibly be a contraction of BCPL. Thompson's coworker Dennis Ritchie speculated that the name might be based on Bon, an earlier, but unrelated, programming language that Thompson designe...

#

A step down from C

#

Before B is A, which is Assembly

modest maple
lyric mountain
#

So u can't get lower than that

modest maple
#

Because a) those high level abstractions are there for a reason

split hazel
#

C generally produces more minimalistic code

earnest phoenix
#

anyone here code python if so please DM me

modest maple
#

pithink no...

wheat mesa
split hazel
#

it does

modest maple
#

also what do you mean by minimalistic???

lyric mountain
#

C is "as-is"

split hazel
lyric mountain
#

What u write is what u get

wheat mesa
#

Exactly why you skipped it!

split hazel
wheat mesa
#

“Too high level”

split hazel
#

you could say higher speed code

#

uses less instructions

modest maple
#

lemon_raised_eyebrow .... that is... Just wrong

lyric mountain
#

Tbh, one could say java is as fast as c++