#development

1 messages · Page 1948 of 1

boreal iron
#

Wut

earnest phoenix
#

?

solemn latch
#

VPN != VPS

boreal iron
#

Vpn!=vps

solemn latch
#

LOL

boreal iron
#

lol

lyric mountain
#

man it'll be a giant mogus face if u really bought a vpn

earnest phoenix
#

oh

boreal iron
#

Woo makes FakE nervous

earnest phoenix
#

vps???

lyric mountain
#

vps = virtual private server

#

as in, a remote pc that stays on 24/7

#

vpn = virtual private network

#

as in, "hide dem porns"

solemn latch
earnest phoenix
#

VPN MegaThonk

#

ok

boreal iron
#

Oh no not this dude again

solemn latch
#

you need to wait in queue like everyone else

reef stump
earnest phoenix
#

wooo review verify my bot pls

spark flint
#

makes no sense

reef stump
spark flint
#

wha

earnest phoenix
#

Even if the bot isn't in a server with it?

reef stump
#

@spark flint hey can remove my nickname 🙂

spark flint
#

i'm not a mod

#

and you have a hoisting username

earnest phoenix
#

Yeah^

spark flint
#

even if i could i wouldn't

reef stump
spark flint
#

symbols at start of the name

earnest phoenix
#

Creating a name to be displayed at the top of the list.

#

or that^

#

Either one.

spark flint
#

like that

#
  • makes them appear higher
reef stump
#

Thx Dud

earnest phoenix
#

dud

quartz kindle
earnest phoenix
#

How would I do that?

#

client.users.cache.get('ID')?

#

but that would get a user who is in a server with it right?^

#

.fetch

compact pier
wheat mesa
#

await client.users.fetch('id') iirc

lyric mountain
#

perfect wiki/docs site name

wheat mesa
quartz kindle
#

Lol

#

someones gonna buy that and make a website that posts random quotes from top.gg

wheat mesa
#

“Tim said:

someones gonna buy that and make a website that posts random quotes from top.gg

sudden geyser
#

hmm which one should I get

spark flint
eternal osprey
eternal osprey
#

Anyways; what should I change on the design of my bots frontpage? Any tips on designs, maybe any commands to add? I am running out of ideas sadly

shrewd orbit
#

How many times i can edit the message? (bot message) like 4-6 times in one min?

sudden geyser
#

There's no concrete limit as Discord dynamically defines it.

#

Today it may be 5 per 5 seconds, tomorrow it may be 5 per 5 years.

#

You should pick a reasonable limit.

#

I'd suggest once every 2-3 seconds.

#

If you're only editing it a few times

#

else raising it.

earnest phoenix
small tangle
#

or buttons as arrows for paginating

shrewd orbit
sudden geyser
#

You should ask why you need to edit the same message 12 times in 60 seconds.

#

Of course, that means 1 edit per 5 seconds.

#

Which won't hit today's rate limit, but is still spammy to some.

#

Try to be reasonable with the limit you pick.

shrewd orbit
#

in js i can't do more than 9 sec (sleep)

earnest phoenix
wheat mesa
split hazel
#

pov you tell someone they spelled awesome wrong in their company name

spark flint
#

lol

eternal osprey
eternal osprey
#

Meaning that I probably was high.

#

It looks dumb tho but I couldn’t find a better name lmao

harsh nova
#

https://discord.js.org/#/docs/main/stable/class/GuildMember?scrollTo=ban you should be able to pass a object with days being the period of time to remove messages within

boreal iron
#

0-7 days

earnest phoenix
#

await client.users.fetch(message.content)?

boreal iron
#

Timeout is a new feature

#

Disabling the member to interact with channels and the guild for the selected time

#

Without actually banning him

#

That’s basically what a mute and you can’t join channels role does

#

No

#

Read the description

#

One takes a timestamp UNTIL a timeout is valid, timeout just takes milliseconds

#

No they don’t

wheat mesa
#

If fetching returns undefined then you know it’s not a user

wheat mesa
#

Yes

earnest phoenix
#

What's that?

wheat mesa
#

IDs in discord are called snowflakes

#

They follow a pattern

earnest phoenix
#

._.

wheat mesa
#

This is generally what I do to check if it’s a snowflake ```ts

export function isSnowflake(value: string): boolean {
if (16 <= value.length && value.length <= 21) {
return !!parseInt(value);
}
return false;
}

#

(This is typescript btw, just take the types out if you’re using js)

earnest phoenix
#

o-o I am using js

#

I am so confused on that o-o

boreal iron
#

Like I said today there’s a helper function checking if snowflake is valid

wheat mesa
earnest phoenix
wheat mesa
#

Yup

wheat mesa
#

But yeah if there’s a built in helper function use that

#

Or regex if you care enough

boreal iron
#

Yee I already saw it but can’t fucking remember it

earnest phoenix
wheat mesa
#

...anything that would error in js

#

Aka (value: string) would turn into (value)

earnest phoenix
#

wow

wheat mesa
#

But if there’s a djs helper function for checking snowflakes then use that instead

#

No reason to write your own method if djs provides one for you

earnest phoenix
#

lmao

earnest phoenix
wheat mesa
#

Wdym

earnest phoenix
#
 function isSnowflake(value) {
  if (16 <= value.length && value.length <= 21) {
    return !!parseInt(value);
  }
  return false;
}```
#

Was it supposed to do something?

wheat mesa
#

Are you calling the function? You have to call the function

earnest phoenix
#

Whaaat how

wheat mesa
#

Wdym how

earnest phoenix
#

How do you call a fucntion o-o

wheat mesa
#

isSnowflake(input)

#

That’s basic js

#

The function doesn’t magically do something without being called lol

earnest phoenix
#

Where do I put that? o-o

slender thistle
#

I'm very confused on what's going on here

earnest phoenix
#

This is a whole another language.

slender thistle
#

Are you new to programming/JS in general?

wheat mesa
#

Calling functions is a core fundamental concept to working with any js program, especially the discord api

earnest phoenix
#

That's confusing, its doing something outside of the function

wheat mesa
#
#

Wrong link

earnest phoenix
#

I have that tho

#

return console.log(value)

wheat mesa
#

What

earnest phoenix
#
  return p1 * p2;   // The function returns the product of p1 and p2
#

I replaced that with

#

return console.log

earnest phoenix
boreal iron
#

I think deconstructing an invalid snowflake may return trash

wheat mesa
#

^^

boreal iron
#

Using that method

#

But can’t test atm

earnest phoenix
#

o-o

wheat mesa
#

I was looking at that class and was going to recommend it but it seems like you need to learn some of the concepts of js first :p

#

Understanding how to make and use functions is essential to creating a working and organized program

#

I recommend you check out some stuff on functions online if you don’t understand them but you can continue without them

#

It’ll just help you a lot to understand them imo

boreal iron
#

Not really what I expected tbh

quartz kindle
#

lmao

#

thats really strange actually

#

the first line in the deconstruct method is BigInt(input) which should throw an error on non-numerical inputs

boreal iron
#

Yeah saw the code, too

#

I’m confused

quartz kindle
#

unless you're using an outdated version

#

this was november 19th

boreal iron
#

Is there a property for the client to check the version?

quartz kindle
#

Discord.version

earnest phoenix
#

o-o

pale vessel
#

o-o

boreal iron
#

Could be older than Nov, probably

quartz kindle
#

ye

tribal crow
#

Ayo

#

I only get "Interaction Failed!" when executing slash commands

#

And when starting the bot from VSCode it works fine

#

Does anyone know how to fix that?

#

-.-

boreal iron
#

Indeed a version issue

#

Pings don’t work when sharing images via iOS without being in the app

#

Not really needed tho

tribal crow
#

no other solution?

#

well it works on my other bot

boreal iron
#

You get that error for global commands?

tribal crow
boreal iron
#

That indicates you don’t actually respond correctly if guild commands are affected as well

tribal crow
#

its like that on ALL* of the commands

#

*3

boreal iron
#

Mostly an issue if you register commands over and over again for example on any startup

#

But responding to them is another story

boreal iron
#

Do you deal with them correctly in your interactionCreate wvent listener?

#

Yes there we go

#

Mostly an issue if you register commands over and over again for example on any startup

tribal crow
#

block or srcbin

boreal iron
#

You register commands more than one time which can cause unexpected behavior

#

Which is also not correct

boreal iron
#

Yeah the part with dealing with it, even if it’s very simplified is okay

#

But that’s not the code which registers the commands

tribal crow
#

oh

#

wrong one

boreal iron
#

Yeah a straight copy of the useless guide which registers the commands any time you call that code, assuming on any startup

#

Commands need to be registered once only

tribal crow
boreal iron
#

That code doesn’t register global commands, just guild commands

tribal crow
#

ik, but ive tried global commands as well

boreal iron
#

Then delete all existing commands and register them once again

tribal crow
#

and that is done how?

boreal iron
#

<guild>.commands.set([]);

#

For your guild

#

client.application.commands.set([]);

#

For the global ones

tribal crow
#

in index.js or deploy.js?

boreal iron
#

After receiving the ready event

#

Or inside

tribal crow
#

ait

boreal iron
#

Start with your guild commands before deleting the global ones

#

Make sure to actually use the correct guild object

tribal crow
#

huh?

boreal iron
#

Get your guild from the cache and use its object to delete its commands

tribal crow
#

but its only in one guild

boreal iron
#

Yeah and how do you get guild?

#

By getting it from the cache

tribal crow
#

tru

boreal iron
#

client.guilds.cache.get(…).commands.set([]);

tribal crow
#

like this?

#
guild.commands.set([]);```
boreal iron
#

Sure creating a var does also work

tribal crow
#

Give me an E!

#

Give me an R!

#

Give me an R!

#

Give me an O!

#

Erro!

#

TypeError: Cannot read properties of undefined (reading 'set')

boreal iron
#

Wut

sudden geyser
#

you forgot the r

boreal iron
#

do client.application.commands.set([], guildID);

sudden geyser
#

though are you using discord.js v13

boreal iron
#

Actually good question, Klay

#

The property doesn’t exist in v12

tribal crow
#

TypeError: Cannot read properties of undefined (reading 'commands')

#

w

#

u

#

t

#

?

boreal iron
#

There we go

#

V12

tribal crow
#

its djs v12

#

BUT

sudden geyser
#

no buts

boreal iron
sudden geyser
#

discord.js v13

#

unless you want to use the proxy api

tribal crow
#

i did install it like 2 minutes ago

sudden geyser
#

and that's no fun

boreal iron
#

Alright not much more to say here

#

Doing some work…

tribal crow
#

there we go

raw nest
#

It's not exactly development but I hope I can ask this question tho.
I'm searching for 3 main questions to describe a company. I'm looking for the last one, I've got these yet:

  • Why did I start xy?
  • What are the future plans for xy?
  • ???
tribal crow
#

What is xy?

#

...

raw nest
tribal crow
#

ik that

tribal crow
#

Kind of

sudden geyser
raw nest
sudden geyser
#

Why did I start RandomCorp? 'Cause the others suck at handling notifications.

raw nest
#
  • What is xy?
  • What do we offer?
  • ??
#

That's a bit like What do we offer? Like Klay said "(that our competitors don't)"

raw nest
solemn jolt
#

hello i want a host for glitch

sudden geyser
#

oh no

#

is glitch still deactivating long-running projects even with pingers

raw nest
#

and with uptimerobot you can make an https request every 5min an it keeps running

tribal crow
#

repl.it aint good but it works fine.

#

best free one ig

raw nest
tribal crow
#

yup

solemn jolt
#

i use glitch repl railway render in the same time🥲

raw nest
#

But if you use glitch I guess repl.it would do the job by far xD

solemn jolt
#

and i need a host for glitch if someone have

solemn jolt
tribal crow
#

u dont

#

u can do it for free

raw nest
#

yes, why pay?

solemn jolt
#

but the code well be public

raw nest
#

but tbh if you want to do something professional you should buy something like a VPS or so

tribal crow
#

only if they search up ur username

#

or the name of ur project

raw nest
tribal crow
#

^^

solemn jolt
#

but my project is website

solemn jolt
tribal crow
#

only html, css and js?

#

Or react, express and that stuff

raw nest
#

what about GitHub pages?

solemn jolt
#

js ,css,ejs

raw nest
#

I guess you can make your privat then

tribal crow
#

Express.js or/and react?

spark flint
#

if i could self promo i would

solemn jolt
spark flint
#

@harsh nova do i have permission to tell them about my ||removed so no promo||pain

#

as its relevant to the convo

#

and not just sudden promo in general KEKW

harsh nova
#

I would personally not allow it, sorry

spark flint
#

ah thats fine

#

i'm gonna send a motorbus to nom

harsh nova
#

you can check with another mod though but I'd assume they would say the same thing

harsh nova
solemn jolt
tribal crow
#

Use Vercel

spark flint
#

vercel is nice

tribal crow
solemn jolt
#

vercle have own host free?

spark flint
#

yeah

tribal crow
#

yup

spark flint
#

netlify

#

theyre good too

solemn jolt
raw nest
#

vercel, netlify, heroku, hostinger, repl.it etc. they are all "okay" but not everyone keeps your code private

spark flint
#

yeah

#

not hostinger

raw nest
#

but vercel is very nice tbh

spark flint
#

they suck ass

solemn jolt
#

🥲

spark flint
#

000webhosting is meh

solemn jolt
#

i now

raw nest
#

just buy a raspberry pi 4 xD (they are actually quite good)

solemn jolt
#

how if i create a cloud service for my own bot😂

spark flint
#

are you looking for free

#

or cheap

solemn jolt
#

free

spark flint
#

ah

#

i was gonna suggest a cheap vps

#

like £1.50 a month ($2)

#

you could host bot and site at once

solemn jolt
#

i want it

raw nest
#

I would also suggest that... it's horrible to have like 3 services for all the stuff.

spark flint
#

the company i use

solemn jolt
raw nest
raw nest
#

or don't you use your own hosting?

spark flint
raw nest
#

aight

spark flint
#

bots = advinservers
sites = brixly hosting (NOT MINE)

#

thats the VPS one

#

the only reason i've stuck with brixly for almost a year is because of their amazing support

raw nest
#

I have a VPS at Contabo and the price is actually awesome compared to others... :)

solemn jolt
#

thank you

spark flint
#

i hate contabo

#

its annoying

modest maple
#

Contabo do be chill

#

very nice people

spark flint
#

worlds oldest dashboard and slow support

modest maple
#

slow support?

spark flint
#

yeah

#

a

#

and copy pasted responses

modest maple
#

they've responded to every one of our messages within 30 minutes lol

raw nest
#

the dashboard etc. at contabo isn't great but it's fast and very good price for the performance

spark flint
#

brixly (webhosting) is a bit pricey compared to other companies but you can't really beat 5 minute support times

raw nest
#

how about buying 3 raspberry pi's and building my own cluster to host all my stuff KEKW

spark flint
#

lol

raw nest
#

or arduinos lol

spark flint
#

i was originally gonna buy a server and host it all in my room but never did

modest maple
#

i mean for the price of advin servers I can get:```
1 vCore
2 GB RAM
20 GB SSD (RAID10)
40 TB Traffic
Remote-console etc.

spark flint
#

i prefer a VPS

modest maple
#

for just .50 extra

spark flint
raw nest
modest maple
#

we use a diffrent provider for our streaming nodes because bandwidth requirement is too high

solemn jolt
raw nest
spark flint
#

ah

#

yeah i've used them before

modest maple
#

but contabo give me about a %30 discount to their normal prices on VPS'

#

which is nice

modest maple
#

Used them alot

spark flint
#

oh nice

raw nest
boreal iron
#

Hetzner is also a very reliable option nowadays

raw nest
#

got partner because you bought for 100k or what? xD

solemn jolt
boreal iron
#

With top performance

raw nest
spark flint
#

magic

modest maple
spark flint
raw nest
spark flint
#

i spend like £30 a month on hosting atm

#

its too much

#

gonna scale shit down

boreal iron
#

I’m a customer for more than 10y

#

I can’t complain at all

modest maple
raw nest
#

I pay like 120€ in a year for my VPS and host everything on it. love it

modest maple
#

because big daddy company that powers their network is just insane

#

2.5gbps avg speed

#

thats who i have my personal machine with

#

cuz great specs for price with good network

raw nest
#

👀

solemn jolt
#

one time ill pay 26$ for a vps and i forget the password😂

boreal iron
#

Bullshit

spark flint
raw nest
spark flint
#

then £120 a year in webhosting (personal and project hosting), £96 for extra reseller hosting

modest maple
#

honestly, no as bad as my ultimate derp moment. which was brought a new dedi, set it all up, last thing i did was enable firewall and block all incoming connections

#

without enabling port 22

solemn jolt
#

how

spark flint
modest maple
#

which just meant all the days work of setup just went out the window mmLul

solemn jolt
#

how i can buy it?

modest maple
#

I mean

#

they definitely wouldn't appreaciate it

raw nest
#

xDD

modest maple
#

and you're also probably opening yourself up to a bit of liability

solemn jolt
#

😅

modest maple
boreal iron
#

Order a KVM console for free at Hetzner and fix the issue within minutes

solemn jolt
#

what i need to create a server?

raw nest
#

hardware

boreal iron
#

But don’t worry that shit happened to me too

#

If you rush things that shit can happen

solemn jolt
modest maple
#

and a bit of software ig

raw nest
#

well, hardware, the knowledge, connection, and proper software

boreal iron
#

And a bit of experience

raw nest
#

xDD

solemn jolt
#

xDD

raw nest
#

yes

boreal iron
#

As long as cables don’t stop the airflow which is important in a server, nobody cares about that

#

Hmm I should send you a few picture then

#

To see what happens

quartz kindle
#

revives the dead

boreal iron
#

Don’t forget the cable mods also to make each cable have the same color then oldEyes

quartz kindle
#

nah just give them random colors and make a rainbow

boreal iron
#

IoT Thread mesh is the future

#

A future that nobody needs or wants

#

Just close your eyes freerealestate

proven lantern
#

my bot has permission to delete this channel, but it doesn't have permission to update the permission_overwrites with a patch. is that because one of the permissions it's adding is for the server owner?

pale vessel
#

Yes

coral palm
#

Can anybody help me? How would I make it to whenever the bot fails to kill a message it returns without it crashing?

boreal iron
#

Killing a message? Wut

#

I’m interested

coral palm
#

deleting messages

wheat mesa
#

try...catch

boreal iron
#

Well you have catch your code errors properly

#

In order to prevent node from exiting the process - not crashing

#

So catch your process errors in the first place and additionally catch each promise

simple stump
#

When fetching a member, is it possible to check if the member the bot's fetching exists or not? I have this:

let memberGet = await message.guild.members.fetch(someUserID) .then(async (user) => {
  // do something with user
});

However I get this error:

/home/container/node_modules/discord.js/src/rest/RequestHandler.js:298
      throw new DiscordAPIError(data, res.status, request);
            ^

DiscordAPIError: Unknown Member
    at RequestHandler.execute (/home/container/node_modules/discord.js/src/rest/RequestHandler.js:298:13)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async RequestHandler.push (/home/container/node_modules/discord.js/src/rest/RequestHandler.js:50:14)
    at async GuildMemberManager._fetchSingle (/home/container/node_modules/discord.js/src/managers/GuildMemberManager.js:388:18)
    at async Client.<anonymous> (/home/container/index.js:3498:32) {
  method: 'get',
  path: '/guilds/guildid/members/memberid',
  code: 10007,
  httpStatus: 404,
  requestData: { json: undefined, files: [] }
}

Line 3498 is the let memberGet line.

quartz kindle
#

you need to catch it

#
let member = await ...members.fetch(id).catch(() => null);
if(!member) { /* do something */ }
boreal iron
#

If createdAt actually is a property not a method than yes

#

Not that I know any property or method without checking the docs, too

#

I understand how things work and where to look at
Tim is walking lexicon/documentation knowing anything

#

Yeah createdAt is an user property

#

What does the last one mean?

#

cute?

#

Whatever

pale vessel
boreal iron
#

Yeah I noticed that has gone wrong a lot of times already

#

I better shut my mouth freerealestate

bitter adder
#

hey i have an active mongodb server running, can i add a new data class to it without any issues or do i have to create a new db an migrate the old data?

#

ew js

#

i never really used js, neither did i ever use the new discord features / buttons etc

#

sorry cant help

round cove
#

You haven't given us enough to know how you run your execute function, etc so for all I know with what you've given us is that you're not calling the execute function.

spring arch
#

Is there a way to save cooldown even shut down in discord.py?

sudden geyser
#

As in persist cooldowns after restarts?

#

If so, no. You'll need to persist it yourself (e.g. a database).

pale vessel
#

Try again, that just means that you've just updated the command

ashen walrus
#

.

earnest phoenix
#
const output = mm.array().reverse().map(m => `${new Date(m.createdAt).toLocaleString('en-US')} - ${mm.user.tag}: ${m.attachments.size > 0 ? m.attachments.first().proxyURL : m.content}`).join('\n');```
wheat mesa
#

what's mm

earnest phoenix
#

idek

#

messages

#

the messages sent in the channel

wheat mesa
#

mm.array() doesn't exist

#

that's not a thing

#

if you have an array of messages, just use the array directly

#

but you can't just make up methods and expect it to work lol

earnest phoenix
#

Well yeah

#

How would I get all the messages then?

#

I reverted it back to the normal

            interaction.channel.messages.fetch().then(async (messages) => {
                    const output = messages.array().reverse().map(m => `${new Date(m.createdAt).toLocaleString('en-US')} - ${m.user.tag}: ${m.attachments.size > 0 ? m.attachments.first().proxyURL : m.content}`).join('\n');```
#

messages

#

Still confused on how to get all the messages o-o

wheat mesa
#
channel.messages.fetch({ limit: 10 })
  .then(messages => console.log(`Received ${messages.size} messages`))
  .catch(console.error);
``` something similar to that
earnest phoenix
#
                .then(async (messages) => {
            const output = messages.map(msg => `${msg.author.tag}: ${msg.content}`).join('\n');```
So this get's the plain messages, how can I get it to fetch the content from the embeds?
#

That's what it comes out as, there isn't embed text or anything. o-o

#

I tried something like

            const output = messages.map(msg => `${msg.author.tag} : ${msg.content}`).messages.embeds.forEach((embed) => {embed.embeds[0].description}).join('\n');
``` but it didn't work.
#
TypeError: Cannot read properties of undefined (reading 'embeds')```
wheat mesa
#

you're mapping messages to an array of strings, which doesn't have a property called messages

#

why are you even mapping them?

#

just skip the mapping process unless you actually have a use for it

earnest phoenix
#

me when I actually remember what my code does:

boreal iron
#

message.embeds is an array

#

Containing the raw embed object

#

Looping through it and calling embed.embeds[0] doesn’t exist

#

There’s no array in the array

#

for(const embed of message.embeds) console.log(embed.description);

#

See the magic freerealestate

#

You may wanna check if description isn’t null as well

earnest phoenix
#

Ahh

#

Makes sense

earnest phoenix
boreal iron
#

Well yeah, can’t know that one

earnest phoenix
#

Do you think this package is useless or reliable for npm?
Package:

  • you can create node worker and is event based(for sending data,emitting custom events)
  • heartbeat system for auto respawning dead worker or unresponsive worker
    Usage:
    Parent index.js
const { Manager } = require('./workerjs/index');
const manager = new Manager();
//dynamically add workers
for (let i = 0; i < 2; i++) {
    manager.addWorker(i.toString(), './worker.js');
}
//event from parent to child
setTimeout(() => {
    manager.emitChild('testSpeed', {date: Date.now()});
}, 5000);
//listen to all events from child
manager.events.on('heartBeat', (data,id) => {
    console.log(data,id);
})
manager.events.on('ready',(data,id)=>{
    console.log(data,id);
})

Child(worker) - worker.js

const {Child} = require('./workerjs');
const child = new Child();

//event from parent
//test time took from parent to child
child.on('testSpeed', (data) => {
  console.log(`Took ${Date.now() - data.date} ms`, child.id);
})

//emit when everything on child is ready
child.emitParent('ready', {ready: Date.now()});

//send heartbeat 
setInterval(() => {
  child.emitParent('heartBeat', {beat: Date.now()});
}, 2000);

Out:

{ ready: 1640718191399 } 0
{ ready: 1640718191400 } 1
{ beat: 1640718193400 } 1
{ beat: 1640718195402 } 0
Took 1 ms 0
Took 1 ms 1
earnest phoenix
#

Useless packages get more downloads than useful ones

#

but dblapi.js is deprecated

#

whitenames be like

pearl trail
#

just use node-fetch ASbigBrain

earnest phoenix
#

or use phin

#

lmao they deleted their messages

pearl trail
earnest phoenix
#

why does this person keep deleting his messages

earnest phoenix
eternal osprey
#

i tried to add my bot to a server to check the new channel creation module

#

what is this lmao

#

the bot is verified tho

#

huh wtf do i have to verify it again?

boreal iron
#

Well contact discord then as nobody in here can help you

supple oriole
#
           switch(choice) {
                case "gay" : {
    let avatar = interaction.user.displayAvatarURL({ dynamic: false, format: 'png' });
        // Make the image
        let img = await new DIG.Gay().getImage(avatar)
        // Add the image as an attachement
        let attach = new MessageAttachment(img, "gay.png")
        interaction.followUp({attachment: [attach]}).then(() => {
                            console.log();
                        }).catch((err) => {
                            errorEmbed.setDescription(`An error has occurred\n\`${err}\`\nIf you think that this was a mistake, please join our Support Server!`)
                            return interaction.followUp({embeds: [errorEmbed], ephemeral: false});
                        });
                    }
                    break;
quartz kindle
#

attchments

#

not attachment

supple oriole
#

what

pearl trail
#
- attachment
+ attachments
supple oriole
#

oki.

earnest phoenix
#

Wait, you guys put comments in your code?????

quartz kindle
#

i dont

boreal iron
#

Just makes sense if you work as team on the same code

#

If you don’t know what you code and have to explain it to yourself something might be wrong freerealestate

earnest phoenix
#

or if you are a solo developer who writes docs

supple oriole
boreal iron
#

Stop change your name every fucking day, my gosh

earnest phoenix
boreal iron
#

loading the shotgun

earnest phoenix
#

username: qt

#

true

surreal sage
#

I am using pkg to 'y know, and I'm stringifying fs.readFileSync. on that line where i stringify, the app crashes. Can someone help or do I have to reach out to pkg?

#

I'm seeing -c as command line parameter, would that help?

#

I'll try { the line and log the error

#

Ping me if you replied

quartz kindle
surreal sage
#

A moment

#

Ah I see

#

pkg takes the file I try to read with fs into the exe

earnest phoenix
surreal sage
#

lol

#

yeh my message was broken

#

pkg makes its own container with the files you require() in the javascript file

earnest phoenix
#

completely fucked

surreal sage
#

^

#

So the fix was process.cwd() + targetFileName

small tangle
#

oh no.. my message... its broken

surreal sage
#

oh

earnest phoenix
surreal sage
#

my

#

message

#

its broken

#

BANG BANG

#

no

#

lol

#

It's uhh

#

A roblox group finder flushded

earnest phoenix
surreal sage
acoustic citrus
#

Did anybody know how much time will take to publish our bot in top.gg

acoustic citrus
#

Thanks 🙂

bright dawn
#

hey does anyone know how to install pyaudio

#

i did brew install portaudio

#

and brew link portaudio

#

but i get the same error

#

im on mac btw

#

12.0.1

earnest phoenix
#

Well displaying the error would be more helpful

#

That way people who can help can help better

modest maple
bright dawn
modest maple
#

PyAudio's standard installs are basically permanently broken since it's basically a dead lib

#

errr let me find the link to the wheels

bright dawn
#

ok thx

modest maple
#

select the wheel which matches your python version

#

then install it via pip install ./path/to/wheel

bright dawn
modest maple
#

yes

bright dawn
#

?

modest maple
#

3.x wheels are provided if you look

bright dawn
modest maple
#

you're probably looking at the pyaudio version

#

cp stands for cpython which is the standard python interpreter that basically everyone has

bright dawn
#

ok

bright dawn
modest maple
#

39 is just the major and minor version 39 -> 3.9

bright dawn
#

how do i find the path

modest maple
#

just download the file and drag it into your project is probably the easiest

bright dawn
#

ok

earnest phoenix
#

python moment

bright dawn
#

im a competitor coder

#

but like im completely lost in the world of libraries

earnest phoenix
#

i know!!!

#

books are great

bright dawn
#

well here was the error i had

modest maple
#

PyAudio has always been a bit of a nightmare to install since it's not really maintained anymore

bright dawn
#

so how would i do speech recognition w/o it

#

or can i??

modest maple
#

ya sorta dont lol

#

ultimately people still use it because it's just a lightweight wrapper around a lib that is maintained (c++) so it's just requiring someone to build the wheels

bright dawn
modest maple
#

pip install ./path/to/wheel

bright dawn
#

idk where it is tho

modest maple
#

well, obviously change the path to point to the wheel you just downloaded

#

probably in your downloads file

#

your browser should give you the option to view in folder

bright dawn
#

how would i write that

modest maple
#

litterally easier just to view the downloaded file via the browser

#

then copy paste the wheel into your project

bright dawn
#

i am confuzzled

bright dawn
#

how do i write that

modest maple
#

yes

#

rigfht

#

just drag the file

#

from your downloads

#

to where ever you have your code

#

then in a terminal opened in what ever folder you have your code

#

run the pip instal ./some-wheel.whl

bright dawn
bright dawn
#

?

modest maple
#

are you on windows 32 bit or 64 bit

#

/ is your python 32 bit or 64

bright dawn
spark flint
#

sudo apt install portaudio19-dev

#

try that

bright dawn
#

im on mac

modest maple
#

well that would explain why you can install that wheel

spark flint
#

oh

#

mac

bright dawn
modest maple
#

yeah he downloaded a windows wheel

#

unfortunately PyAudio on mac seems to be very rare

bright dawn
#

rip

modest maple
#

there is probably a very good chance that you're not gonna be able to install PyAudio without compiling it youself

#

and you'll also probably need to use Python 3.7 or 3.8 for a less painful experience of compiling

modest maple
#

EYES Okay well, for an added bonus you downloaded the 3.9 wheel

#

not that it matters because it was a win wheel not a max wheel but

neat ingot
#
    const { main_obj } = await somefunction();    
    const { prop1, prop2 } = main_obj;
#

any way i can do that in a single line? 0o

round cove
#

I mean, if you for some reason assume the function will ALWAYS return prop1 and prop2 you could do...

const { prop1, prop2 } = (await someFunction()).main_obj;```
neat ingot
#

yea, i was thinking of wrapping it with the parenthesis, but idk, i was trying to be clever and somehow get some destructure-ception going on 😄

round cove
#

Oh that's what you want.

#

I think you can do uh.

pale vessel
#

const { main_obj: { prop1, prop2 } } = await somefunction();

neat ingot
#

oh now thats it! ❤️

round cove
#
const { main_obj: { prop1, prop2 } } = await someFunction();```
#

yeah

#

gg

modest maple
#

flushbomb moment

neat ingot
#

i knew it could be done, but i couldnt remember the syntax for doing so 😄

round cove
#

I have some crazy nested destructoring for an axios call because of data layers lol

boreal iron
neat ingot
#

ewww, axios

round cove
#

Ew? Stay mad.

neat ingot
#

get bent

#

like, the lib, not being insulting.

earnest phoenix
#

ewww, http

round cove
neat ingot
#

😂

#

that latency to discord must be rough!

earnest phoenix
#

use phin instead of axios kthxbai

#

and if you're doing discord stuff use detritus-client-rest

round cove
#

I don't think I use axios for anything currently.

round cove
#

Just usually my go to lib for most http things.

earnest phoenix
#

legends use XMLHttpRequest

boreal iron
#

lol

pale vessel
#

caveman

#

use XMLHttpRequest in your code while editing with Notepad++ on your Windows 7 machine

#

👍

boreal iron
#

Notepad++ superior leader

#

Btw

earnest phoenix
#

why do i have this as your note

solemn latch
#

because, who else will you ping for canvas help

earnest phoenix
#

perhaps tim

neat ingot
#

canvas stuff is fairly easy imo, but im used to canvas and bitmap manipulations

#

whats hard is deciding what components to use in your canvas' to make em pretty 😢

solemn latch
#

Yeah, canvas also has SO many online examples

#

just a bit of googling if you are unsure on how to do pretty much anything you'll find an answer.

neat ingot
#

yea for sure

earnest phoenix
#

Discord.js has so many online examples

solemn latch
#

I was making program to separate a gifs frames into a grid of images.
found an example online in two seconds KEKW

earnest phoenix
#

ctrl c ctrl v

neat ingot
#

i was wanting to make a 'raytraced like' lighting system for my web game, took me a few mintues to find pure js lighting system 😄

earnest phoenix
#

imagine making a website that crashes your browser if you run those commands

neat ingot
#

i made a cheat system for rpg maker, that had a cheat that would launch 999 notepads on the persons pc telling them 'cheating is bad, m'kay?'

#

and you had to close each notepad before the next would open

faint prism
#

I wonder just how many bots are going to break in May

boreal iron
#

We will notice the amount of requests in here saying "my bot isn’t working anymore, yesterday it was still working"

solemn latch
#

I wonder if we will need slowmode 👀

#

probably not

sudden geyser
#

just look at how many people come when an old version of discord.js stops working

boreal iron
#

It’s already sad to see the amount of people copy & pasting the djs guide of slash commands and wonder why they don’t work as supposed when they register their shit every 5 mins

#

Just because nobody carefully reads the guide

sudden geyser
#

I think it's fine

#

they're beginners so they're starting somewhere

#

what they pick however is complex

#

so they end up doing that

#

but it's fun to write discord bots—it's why they got interested in programming anyway

solemn latch
#

the guide is sooo good at explaining stuff, actually insane people dont actually read it

boreal iron
#

Just copying something and putting somewhere because you don’t bother reading is the same as your bot breaks because you don’t update shit or deal with new shit

#

You could easily inform yourself and read guides or docs but that’s what actually like nobody does

#

I mean the code some dudes copy & paste the last days which was obviously to register guild commands and they were wondering why there’s no global commands being registered

#

Not even reading and jumping to the right category is a thing

#

Before copying stuff

#

People always making their own life way more complicated than needed

sudden geyser
#

it's because they don't know

#

when you pick something as complex as a discord bot as your first project

#

especially as your only experience

solemn latch
#

well, a lot of the devs I see having this issue are updating from old djs versions.

sudden geyser
#

making mistakes like not reading guides and copying & pasting is expected at this point

#

of course, we encourage they go back and learn the basics so they have a better grasp

#

but I can say with high certainty that most people in this server learned this way and made similar mistakes

#

and this is not unique to beginners to programmers

#

it's unique to beginners to any subject in CS imo—UI design, servers, embedded devices, memory management, etc.

#

missing these little details because you don't know them yet

#

complaining about lisp having too many parentheses

wheat mesa
#

When I copy paste code, I often spend more time later on debugging that code since I don’t know how it works until I’ve looked at it thoroughly

#

Which is why I don’t copy paste code anymore!

#

Even just typing it out will help you understand it a lot more

sudden geyser
#

I learn best by just reading

#

even without the evaluate part

cinder patio
#

Chakra-ui issue:

    Text: {
        variants: {
            "link": commonLinkStyles
        }
    },
    Link: {
        baseStyles: commonLinkStyles
    }

For some reason the baseStyles for the Link component don't get applied.

<ChakraLink href={props.href} isExternal>{props.children}</ChakraLink>

Any guesses on why this wouldn't work? The styles work for the "link" variant of the Text component

#

It's beseStyle and not baseStyles 😭

earnest phoenix
#

Skill issue

earnest phoenix
cinder patio
#

nah I did

earnest phoenix
#

Oh

#

oof mongoDB atlas is hard with the schemas and that stuff

quartz kindle
#

who likes stairway code?

earnest phoenix
#

looks good

quartz kindle
#

stairway to hell

pale vessel
#

I prefer hadouken code

earnest phoenix
#

I thought literally coding while you are on the stairs

quartz kindle
sudden geyser
quartz kindle
#

xD

quartz kindle
#

ah yes

#

love it

#

btw the stairway code above improved my code's performance by almost 50%

#

compared to using Math.ceil() and Math.log2() to calculate a number's byte size

spark flint
#

dead channel

wheat mesa
#

I love oop so much

spark flint
#

test

wheat mesa
#

damn discord has some hot takes on oop I guess

spark flint
#

good old discord

wheat mesa
#

lmao

#

discord seems to be sending messages rather slowly

#

their servers are getting shit on rn for some reason ig

cinder patio
#

Next.js + MDX is a combination from HELL

#

Using these two together is a massive headache

spark flint
#

both today and yesterday

#

spike in api response time

sudden geyser
#

their api is always spiking

sudden geyser
earnest phoenix
#

Nextjs is just a react framework

#

I think it is well known for being easier to do SSR

native gazelle
#

Hi

final obsidian
#

discord sure is dying

solemn latch
spark flint
sudden geyser
#

start*

compact pier
#

this fucking chakra ui sux man

sudden geyser
#

is chakra like bootstrap or headless ui

compact pier
#

anyone help me :<

<Flex flexDir={"row"} justifyContent={"right"}
  alignItems={"center"}>
  <Link marginRight="auto">
    <Image src="https://cutiecat6778.github.io/cdn/blog-logo.png" />
  </Link>
  <Menu>
    <MenuButton as={Text}>
      Topic
    </MenuButton>
    <MenuList maxW={"200px"} borderRadius={0} padding="0">
      <MenuItem>
        Life in europe
      </MenuItem>
      <MenuItem>
        Daily
      </MenuItem>
      <MenuItem>
        Programming
      </MenuItem>
    </MenuList>
  </Menu>
  <Link ml="40px">
    Random
  </Link>
  <Link ml="40px">
    Về tôi
  </Link>
</Flex>
compact pier
sudden geyser
#

yes but which one

compact pier
#

wdym which one

sudden geyser
#

you use bootstrap with react

compact pier
#

it is like extended react

sudden geyser
#

and same with headless ui

compact pier
#

I don't use bootstrap

#

chakra have built in css

sudden geyser
#

so it's like bootstrap

compact pier
#

yeah

#

i guess

surreal sage
#

Getting "Cannot find module 'node:events'" on Node Version 17.3.0
Any solutions?

compact pier
#

it has many presetup components

surreal sage
#

haha, no.

compact pier
#

yeah... you should google it

sudden geyser
#

I've not used the two, but I hear in general that component-based UI frameworks tend to not be flexible

#

maybe you'll be interested in something like tailwind

surreal sage
#

Haha, what did I do the last 15 minutes lol

sudden geyser
#

where you can apply css classes the utility provides without writing css

compact pier
#

cause you see in those component it support css values

sudden geyser
#

oh that's why it looks awful

compact pier
#

lol

sudden geyser
#

I've only ever used Tailwind, but I suggest you try it out some time in the future.

compact pier
#

:))

#

more u know, more money

lyric mountain
#

You didn't state ur issue

compact pier
#

cause the messages are so fast

#

sorry

lyric mountain
compact pier
#

yes

#

but no need anymore

#

I just make it to absolute

#

a little bad, but nvm

lyric mountain
#

Ah

compact pier
#

it is bad for responsive ui, but :/

analog tinsel
#

how i can run this project? its php api client

sudden geyser
#

check if the readme or wiki contains instructions

slender wagon
#

do u guys know any js obfuscator that keeps the text minimal aka not too many characters

wheat mesa
#

why bother obfuscating

sudden geyser
#

You sure you want an obfuscator? How about a minimizer?

slender wagon
#

short js code + obfuscated

quartz kindle
#

jsfuck

slender wagon
#

BRU

quartz kindle
#

:^)

slender wagon
#

yes thank you that will do the job troll

sudden geyser
slender wagon
#

no but fr i am trying to work on a bookmarklet on edge

#

but they seem to have a limit

#

not sure if it is the character count or the file size

quartz kindle
#

depends on the browser, but its usually about 2k chars

coral palm
#

anyone here understand anything about Error Handling?

slender wagon
sudden geyser
#

or maybe you'll also be interested in webpack

#

or google closure

quartz kindle
#

obfuscation almost always translates to larger code

#

just try a minifier

slender wagon
sudden geyser
#

how about an obscurer then applying that to a minimizer

slender wagon
#

tried

sudden geyser
#

especially throwing logic

coral palm
# modest maple <:sip:898234839562612746>

i made one but i have a little error that i cant solve, soo....

The bot starts and everything ok, it shows the errors on the console without the bot crashing but no command works. Can you explain to me?

coral palm
earnest phoenix
slender wagon
#

obfuscated was at 8k chars

#

minimized went at 4k

#

also tf is up with discord

modest maple
sudden geyser
#

anyway I'd consider something like google closure

#

i think it does both along with some magic tricks

earnest phoenix
#

what even is that

sudden geyser
#

set of javascript tools by google

#

notably the closure compiler

earnest phoenix
#

why does google have so many frontend frameworks

sudden geyser
#

you can think of it like webpack

earnest phoenix
#

angular, closure, flutter

earnest phoenix
eternal osprey
#

How long does it take to verify intents?

sudden geyser
earnest phoenix
#

ok

eternal osprey
earnest phoenix
#

lmao

#

that shit is a joke

#

like is-odd package

eternal osprey
#

Idgaf you just gotta fix that shit lmao

#

Or send me the source code if you don’t have time whahahahs

sudden geyser
#

is it not on github

eternal osprey
#

not sure.

slender wagon
#

is there a way i could possibly call another javascript file hosted somewhere else from a js file

eternal osprey
#

Just know that code913 is a cutie that made it

earnest phoenix
eternal osprey
slender wagon
#

vanilla js

eternal osprey
#

huh

slender wagon
#

no apps

eternal osprey
#

Nvm

#

but it’s hosted somewhere else right? A different folder and storage I would say? Then it’s not possible unless you use a universal database to save the information from the js file that you can pull in the other js

#

But yo I ain’t an expert 🤓🤓🤓

slender wagon
#

and now my bookmarklet decides to accept 8K Chars of codes

#

weirdd

earnest phoenix
#

weird

eternal osprey
#

yeah he does. It’s one of those randomizer packages between strange functions. It’s still pretty cool tho.

#

I used to use it for my bot but idk it seems to be having lots of errors

earnest phoenix
solemn latch
spark flint
#

also just noticed

#

brigthRed

#

should be brightRed i think

earnest phoenix
#

saying your code 'completely sucks' is not helpful its harmful

solemn latch
#

telling someone their code completely sucks doesnt help yeah

earnest phoenix
#

okay

#

damn woo almost as if you're copying me iara_smirk

solemn latch
#

I've been copying people a lot the past few days notlikenoot

earnest phoenix
#

kekw

boreal iron
#

Is there way of getting the user who has authorized your bot to join a guild?

#

Is there way of getting the user who has authorized your bot to join a guild?

#

Is there way of getting the user who has authorized your bot to join a guild?

solemn latch
#

afaik no

sudden geyser
#

You can check the audit logs if you have permission.

solemn latch
#

well

#

or require the user to login to oauth to invite the bot.

boreal iron
#

Hmm sad

#

If a guild matches my filters the bot tries to contact the owner .
But as the DM got send successfully but the bot being reinvited a few more times, it probably means the owner isn’t always the one authorizing the bot

#

Might be worth to think about sending a message in the server

#

But I’m somehow not a fan of sending a message in a random channel by looping them and try to send it somewhere

solemn latch
#

What about the first member with bot invite perm to use a command.
I would bet over 90% of the time the first staff to use the bot is the one to invite it.

boreal iron
#

Nah if the guild matches the filter the bot leaves the guild immediately

earnest phoenix
#

I think the only way to get them to join the guild would be to prompt them on invite to do so

#

You can redirect to a guild invite link

#

Though in the end its up to them whether they join or not

boreal iron
#

Hmm also an idea

#

But regarding user friendliness I will probably just send a note in a random channel why the bot left the guild additionally to contacting the owner

earnest phoenix
#

Mmm

#

No need to send a note in a channel that is too annoying to do.

boreal iron
#

Is there actually a default channel or something similar I can check before checking other channels?

earnest phoenix
#

Not to mention annoying for others as well if it sends in a channel it might have perms in but shouldn't send in

#

such as a rules channel or smth

boreal iron
#

Hmm that’s why I said before I don’t like that idea, too

earnest phoenix
#

Best bet is to just contact the owner of that guild plain and simple

boreal iron
#

Well yeah probably

analog tinsel
#

how i can check if string includes in json or not

earnest phoenix
boreal iron
#

If a string IS JSON?

#

Stringyfied JSON…

earnest phoenix
#

I think they are asking how to check if a value exists in a json thing too tired to use proper terms

#

specifically a stringed value ig?

#

Doesn't js treat json sort of like objects

surreal sage
#

I'm getting a error that too many files are open when running a instance for a while. But the error does not matter.

How do I close files after reading them with FS.