#development

1 messages · Page 1607 of 1

earnest phoenix
#

stop adding more garbage on top of garbage

glacial pagoda
#

i do

oak cliff
#

Friendly reminder to follow rule 1 and be respectful to other people.

pale vessel
#

he's right though

earnest phoenix
#

do you want me to write a poem lol

#

i'm being 1:1

#

i can't sugar coat it

crystal wigeon
#

@solemn latch

oak cliff
#

You can be helpful without calling someones code garbage.

crystal wigeon
#

sorry for the ping

solemn latch
#

np

crystal wigeon
#

but do you know anoything about sailsjs?

earnest phoenix
#

objectively it's garbage

#

not even subjectively

crystal wigeon
#

im trying to pipe 2 files from react next to sails server 1 to sails server 2

oak cliff
#

And you can say "hey that isnt the best way to do this. Here is a more optimized way to do so:

#

Instead of just calling it garbage.

crystal wigeon
#

if its a single file i can get it in req.file("")

solemn latch
#

nope, I know nothing about it

crystal wigeon
#

there are no docs

#

TT

#

sailsjs so sad

solemn latch
#

no docs? 👀

crystal wigeon
#

yeah it has limited

#

explanations

earnest phoenix
#

i didn't just call it garbage and i very clearly gave examples on how to refactor it above

crystal wigeon
#

there's no explanation for pipes and multiple files

earnest phoenix
#

not like they're going to listen regardless

oak cliff
#

The word garbage or any other demeaning word towards a user or a users code is not appropriate and you can be helpful without using that kind of descriptor

earnest phoenix
#

ok

oak cliff
#

Thank you

earnest phoenix
#

ok

oak cliff
crystal wigeon
#

someone help

#

sailsjs community is so small

#

;-;

warm junco
#

if anyone could help out with this, ive taken a look at the docs and wasnt able to find something on it, is there any way for me to find the system messages channel of a guild so that my bot knows where to send join/leave messages? (discord.py rewrite)

solemn latch
#

system messages?

#

like audit logs?

earnest phoenix
#

how were you not able to find it 🤔

warm junco
#

not sure how i missed that lol

#

sorry!

#

thanks for the help anyways

earnest phoenix
#

no worries

solemn latch
#

since when did system channels become a thing 👀

warm junco
earnest phoenix
#

since ageeeeees

solemn latch
#

oh

leaden lake
#

I have a try, and I want to have the same output for my IndexError error, and for an else. How can I do ?
Without copy / paste my code

f.e : I search in a 2d tab if all values are the same. If the values are not the same or if I got an IndexError error, I want to continue my code

python btw

solemn latch
#

join leave is system channels?

earnest phoenix
#

since the removal of default channel iirc

#

yes

solemn latch
#

ah

earnest phoenix
#

also nitro boosting messages

#

pretty much any message that doesn't have an author is a system message

solemn latch
#

i never knew it was called that

warm junco
#

yep i wanted to send join leave messages there for simplicity's sake

earnest phoenix
#

i really wish discord didn't remove default channels

#

since default channels and system channels have different uses

feral aspen
#

In my messageDelete event, there is a message that gets deleted but I don't know what message, and it's resulting to this error, (node:21) UnhandledPromiseRejectionWarning: RangeError [EMBED_FIELD_VALUE]: MessageEmbed field values may not be empty.

#
.addField(`**Message**`, `${message}`)

Not sure what message is getting deleted to cause this error.

dusky sundial
feral aspen
#

I delete a message like Test

#

It logs it.

#

Did I accidently advertise. no mute pls

blissful coral
#

Show how you setup your event please

feral aspen
#
module.exports = async (bot, message) => {

    // We need to check if the actual message is a blank message, so it can return.
    if(message.content.includes(["_ _"])) return;

    // If the bot was offline or restarting and the bot could not cache the message, it will return so it can not return as "undefined".
    if(message.partial) return;

    // If the message was from a bot, it would return.
    if(message.author.bot) return;

    Server.findOne({
        serverID: message.guild.id
    }, async (err, server) => {
        if(err) console.log(err);
        if(!server) {
            return;
        } else {
            if(server.messageDelete === null) return;

            const time = new Time(message.createdTimestamp);

            const embed = new MessageEmbed()
            .setColor(cyan)
            .setTitle("Message Deleted")
            .setThumbnail(message.author.avatarURL())
            .setDescription(`A message was deleted!`)
            .addField(`**Message**`, `${message}`) // <--- Error part. "(node:21) UnhandledPromiseRejectionWarning: RangeError [EMBED_FIELD_VALUE]: MessageEmbed field values may not be empty."
            .addField(`**Sent By**`, `${message.author.tag}`)
            .addField(`**Deleted In**`, `${message.channel}`)
            .setFooter(`Deleted after ${time.getHumanizedElapsedTime()}`, setTimeout)
            .setTimestamp()

            if(!server.messageDelete) return;
            let channel = bot.channels.cache.get(server.messageDelete);
            if(!channel) return;

            channel.send(embed);
        };
    });
};
dusky sundial
#

What happens if someone deletes an embedded message?

mellow kelp
#

the message might still be empty

dusky sundial
#

I think message.content would be better, rather than just message?

pale vessel
#

does the same

feral aspen
#

I need to quickly edit this if(message.author.bot) return; and add message.channel.type === dm

#

That errored.

mellow kelp
#

also you don't need to use backticks if you're just gonna insert a single variable in them

#

and since your function is async, you can just do const server = await Server.findOne({...})

#

(that's mongoose right? hashflushed )

feral aspen
#

Yeah.

#

.. but may I know why it errors, please?

opal plank
#

ever wondered what happens if you dont catch a rejection inside an interval?

mellow kelp
#

spain without the s

opaque seal
#

How do I do this in grafana / influxDB dashboard?

opal plank
#

this?

#

@opaque seal

opaque seal
#

Uhm yeah kind of

#

(slick)

opal plank
#

everytime a command is run, save it somewhere

#

or if you using a database, just dump it into it

opaque seal
#

I have influxDB

opal plank
#

and query via grafana

opaque seal
#

I save it there already

opal plank
#

(i havent used influx) but i assume its just another db

#

anyway

#

just query from it in grafana

#

add a source

#

and then query it, it should have a query builder to help you set it

opaque seal
#

I did everythin, I just don't know how to query it well with grafana

opal plank
#

add a source first

#

they should have a query builder to help you

feral aspen
opaque seal
#

Right now it looks like that and it's bad

opaque seal
opal plank
#

then you arent querying the properf fields

#

query with a table first

opaque seal
#

I just need to understand the code o the query itself

#
from(bucket: "astro-logs")
  |> range(start: -1h)
  |> filter(fn: (r) => r._measurement == "vc")
  |> aggregateWindow(every: 3m, fn: count)

That's what I'm doing rn

#

I think that the aggregate function is the issue

mellow kelp
#

oh wait i just realized grafana has a free tier

#

another one to my todo list

opal plank
#

Luke might be able to help you with influx

#

he uses it for his microservices too

#

specially because it looks like your panel itself is wrong

#

it seems like you're querying the wrong type for a graph

opaque seal
modest maple
#

erm

fierce ether
#

(node:10828) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'bind' of undefined

#

what does this mean?

opaque seal
#

This means you have to share some code for us to know :)

fierce ether
#

its on this await this.initializeModules()

opaque seal
#

It’s not there because ‘bind’ isn’t there

#

Show the full error

fierce ether
#
(node:10828) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'bind' of undefined
    at PrestigeClient.initializeModules (C:\Updated Bots\Prestige Main\src\base\PrestigeClient.js:47:22)
    at PrestigeClient.initialize (C:\Updated Bots\Prestige Main\src\base\PrestigeClient.js:31:23)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:10828) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:10828) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
quartz kindle
#

Cannot read property 'bind' of undefined <-- this means you tried to do undefined.bind()

#

in PrestigeClient.js line 47

zenith terrace
#

tim.bind()

earnest phoenix
#

how can i make my bot leave a server again?

#

when i do message.guild.leave("id") it leaves my server lol

quartz kindle
earnest phoenix
zenith terrace
#

what does .bind do anyway

earnest phoenix
#

get the guild from your client

#

then call leave on it

quartz kindle
#

guild.leave()
^ not this one

earnest phoenix
#

wait oh yh makes sense now

quartz kindle
zenith terrace
#

ah ok

earnest phoenix
#

internal/modules/cjs/loader.js:883
throw err;
^

Error: Cannot find module 'C:\Users\igoro\OneDrive\Bureaublad\DezorBot\ticket.js'
←[90m at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)←[39m
←[90m at Function.Module._load (internal/modules/cjs/loader.js:725:27)←[39m
←[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)←[39m
←[90m at internal/main/run_main_module.js:17:47←[39m {
code: ←[32m'MODULE_NOT_FOUND'←[39m,
requireStack: []
}

outer perch
#

Date.now() is type number, but how do I convert it to a timestamp?

earnest phoenix
#

error

wind kayak
#

Does anyone know how you get a data uri from a discord emoji link?

summer torrent
#

data uri?

leaden cliff
#

I think I do.

summer torrent
#

wdym

leaden cliff
#

@wind kayak Post the emoji link.

wind kayak
#

Doesn't matter what emoji it is

#

I need to get data uris of whatever link

summer torrent
earnest phoenix
#

thnxx

pale vessel
#

the base64 one?

quartz kindle
devout notch
#

pretty sure that should do it

quartz kindle
#

because Date.now() is already a timestamp

#

just in numeric format

devout notch
#

if you only want the date then do date.toLocaleDateString();

opal plank
#

tim, i did it

wind kayak
outer perch
#

I think it's the way firebase does things

opal plank
#

@quartz kindle

earnest phoenix
#

man

outer perch
#

meh, not a problem working with it

wind kayak
#

Is it in the node-fetch response headers?

earnest phoenix
#

i ahve

#

add

#

dictator named bot

#

how much mroe time

#

for verification

pale vessel
wind kayak
#

Oh really?

earnest phoenix
#
Geen files gevonden...```
its said: "don't have find the files"
pale vessel
dense ocean
#

Hello, I want to add nitro emoji to my bot. Which ones can I put?

pale vessel
#

this?

wind kayak
#

Jesus

#

Yeah

dense ocean
earnest phoenix
#

wtf?

summer torrent
#

english

dense ocean
#

Okay

earnest phoenix
#

who can help?

dense ocean
#

Hello, I can add niteolu emojis that I can add to my bot. Do you know top gg grandpa will be accepted?

wind kayak
earnest phoenix
#

top gg grandpa

pale vessel
#

actually no

#

lmfao i'm retarded

dense ocean
#

Sorry, English translation error

earnest phoenix
#
Geen files gevonden...```` 
its said: "don't find the files"£
(this is from github pls help i need this for me server and i dont know what i must install..
wind kayak
#

Yes mmLol

earnest phoenix
#

code

summer torrent
#

dede means grandpa mmLol

summer torrent
dense ocean
#

Can you help me out as soon as it's accepted

misty sigil
opal plank
misty sigil
#

but its ruined now

#

by your shitty code

quartz kindle
misty sigil
#

i will bet money on that

pale vessel
#

@wind kayak like this? not sure if there's a better way to do it

quartz kindle
#

no need for double await

pale vessel
#

i prefer await than .then()

#

is there a difference

quartz kindle
#

1 await also awaits all chained thens

#

await a.then().then().then().then(x => 10) // 10

modest maple
#

async/await was introduced to make the whole promise system more readable

#

synatactic sugar

dense ocean
pale vessel
#

I'm aware, yeah but I only use .then() if I want to chain .catch() instead of a try catch

#

but otherwise await is just nicer to use

quartz kindle
#

well i prefer to use await a.then(b) than await (await a).b

pale vessel
#

I c

#

oh and .then() if I want to access the property more than once

earnest phoenix
#

std::move(std::promise<T>) mmLol

wind kayak
#

Thanks @pale vessel peepoLove

quartz kindle
#

xD

earnest phoenix
#

yup

#

truly a nightmare

#

you might need a therapist after first working with them

quartz kindle
#

lmao

#

btw i have a question

modest maple
#

rust has little to no concept of promises

quartz kindle
#

i have a C lib that basically has some configuration switches

#

and they are applied process-wide

#

what would be the way to isolate it into instances, so that one could use it concurrently with different settings?

#

put it in different threads?

earnest phoenix
#

i guess so? that would also be what i would try to do at the top of my head, i'm not sure if synchronization would be a problem in this context

#

worth a shot

#

trial and error ig

quartz kindle
#

yeah i figured as much

#

im not gonna do it rn tho

#

its fast enough to allow always resetting configs before calling a function

#

the lib is over 20 years old and fully written in functional programming

#

there is 0 concept of oop in it

earnest phoenix
#

~~zlib mmLol ~~

modest maple
#

well thats alot of C in general

quartz kindle
#

ye

#

but this one is kinda stateful

#

so it feels weird

modest maple
#

actors™️

#

nah

earnest phoenix
#

who can help?

#

How do you make the bank or storage for a economy bot?

#

Like how +Work gets you 200 points, how do I make something like it

quartz kindle
#

get a contract with your government and get a banking license

quartz kindle
#

first you need a database, or a way to store information about a user

earnest phoenix
#

ok

#

dos a raspberry pi 4 work?

placid iron
#

@modest maple is it worth having static content served from nginx rather than my python webserver (I'm assuming you can do that)

#

Is the performance benefit noticeable

earnest phoenix
#

for a small scale site, i personally wouldn't notice really any difference

#

nginx is useful for scaling, i.e. lets say you have thousands of visitors and you have to modify something; you don't have to kill nginx and restart it to apply changes

#

instead nginx will handle all of the old connections and handle new ones with the changes at the same time

#

it has more uses than that obvs

#

but for serving static content just use whatever you prefer

quartz kindle
#

well im assuming cutting off the middleman will be beneficial to the entire system

#

less cpu wasting

misty sigil
#

nginx does add a lot of functionality

earnest phoenix
quartz kindle
earnest phoenix
#

ok

quartz kindle
#

i personally use sqlite

#

other popular options include mongodb and postgres

earnest phoenix
#

did you install on your computer or on another?

quartz kindle
#

on my server

earnest phoenix
#

oof

opaque seal
quartz kindle
#

sqlite is good for small applications like discord bots because it doesnt require installing a database server

opal plank
#

@delicate zephyr

#

this guy

opaque seal
#

For Luke then: I've got a bunch of logs, for example, every time a command is used I save a point in my influxDB with the command_name, the user_id of who used it and the timestamp obv. Now, how do I turn all these logs in a nice graph in the influx dashboard, I would like for example to have a graph that showed the total number of commands used that grows through time.

earnest phoenix
#

ill download that instead.

opaque seal
tardy hornet
#

how can i directly push the data into the json.sqlite file?

(quick.db)

#

is it db.push()

#

?

dusty fern
#

what is this error

(node:4) DeprecationWarning: Collection#find: pass a function instead
#

keeps ruining my bot 😦

lyric mountain
#

that's not an error but a warning

#

you should use functions inside find, not pass a value

dusty fern
#

how do i fix it i really don't know, its really messing with my bot

earnest phoenix
#

i did npm i enmap

dusty fern
#

functions inside find

lyric mountain
#

exactly that

dusty fern
#

how do i do that tho

lyric mountain
#

() => this is a function

dusty fern
#

oh

earnest phoenix
#

help

dusty fern
#

what the pass a value then

lyric mountain
lyric mountain
earnest phoenix
#

VScode?

lyric mountain
#

no

#

visual studio

earnest phoenix
#

k

dusty fern
lyric mountain
#

no

dusty fern
#

then how do i fix that error

lyric mountain
dusty fern
#

im really sorry im not a good bot developer

lyric mountain
#

that's not regarding bot development, but basic js

icy skiff
#

I mean maybe he's not an ES6 Javascript guy

dusty fern
#

i just need to fix this error

#

im so frustrated about it

fossil tapir
#

Just learned how to use mongodb, now... time to implement it into my discord bot! (previously just used JSON)

the green part is what I now have to rewrite!

lyric mountain
#

not an error again

#

that's a warning

icy skiff
#

Look up arrow functions

#

Give a study to it

dusty fern
#

i dont wanna study it at this time, i just really really want to fix this.

lyric mountain
#

no, that's a wrong line of thinking

#

fixing it will not solve the main issue

#

it's like giving a fish to someone starving instead of teaching how to fish

icy skiff
#

The main issue in this case is between the monitor and the chair

#

Take some time and study ES6 Javascript

#

It's essential

dusty fern
#

man you don't understand

#

but alright.

icy skiff
#

Yes i do understand lol

lyric mountain
#

we do understand

dusty fern
#

you do understand

lyric mountain
#

short-term fix will not help long-term issues

dusty fern
#

but you do not understand that many people are spamming me to fix the bot

#

and i seriously dont know how to

lyric mountain
#

just close ur dms then

dusty fern
#

and i am not bothered to look at a paraghraph at 1AM

icy skiff
#

If you don't get urself to learn arrow functions, u Will get into the same issue dozens of times while developing ur bot

lyric mountain
#

users are users, don't give them much priority

#

they'll never be satisfied

icy skiff
lyric mountain
#

do note however that when u fix one bug two new will appear

dusty fern
#

not bothered, thanks for the help.

fossil tapir
#

ouch

icy skiff
#

4K

modest maple
#

its also very RAM intensive due to Python's memory allocation style

#

serving lots of small static files will often lead to ram not being released in the runtime

placid iron
#

cool thank you

crystal wigeon
#

Hey um

#

How do I pipe a file to another server?

#

.pipe(request.post(url))

earnest phoenix
#

you dont

crystal wigeon
#

Doesn't work

earnest phoenix
#

oh

#

that

crystal wigeon
#

I'm sure I'm missing something

#

Yeah

earnest phoenix
#

kind of piping

modest maple
#

what are you trying todo

#

there are alot of diffrent methods

crystal wigeon
#

Trying to send a file

modest maple
#

piping is generally not one of them

crystal wigeon
#

Between 2 servers

modest maple
#

okay

#

so FTP?

earnest phoenix
#

and i have VS

modest maple
#

or do you mean two processes on the same machine

crystal wigeon
#

It's a req, red thing

#

Yeah

#

2 processes

#

2 servers nodejs (sailsjs) actually, but it's all same

modest maple
#

why do they need to be connected?

#

normally thats a bad idea

#

/ not something you really want endgame

crystal wigeon
#

Well there's an Api server which is mainly used for Auth purposes

#

And then there's a main backend which stores data etc

#

Kinda microservices architecture

modest maple
#

pithink Thats not really microservice

#

or atleast thats not the sort of microservice you should be aiming for

crystal wigeon
#

oof

#

So I can't send files between 2 servers?

modest maple
#

i mean you can but its a really bad idea for your application in all honesty

crystal wigeon
#

How so

modest maple
#

having a single server just for authorization and then another server do everything else is fairly pointless when the main server needs that info in the first place

crystal wigeon
#

Well all in trying to do, is whatever the files are in req.file,just stream/pipe it to another server

modest maple
#

easiest is just make a internal endpoint

#

and send it to the main server's endpoint

crystal wigeon
#

I mean, this api server can be exposed to other stuff as well, like if a 3rd party wants access

modest maple
#

piping it is just gonna be slower

crystal wigeon
#

It's fine. I'm not aiming for speed here

modest maple
#

again though, you dont wanna use piping

crystal wigeon
#

so what do I use

modest maple
#

in reality its going to be easier and better to use an internal request

crystal wigeon
#

This is an internal server lel

modest maple
#

002_shrug Doesnt change anything

crystal wigeon
#

well, I just wanna know the syntax of pipe

#

So that'll help

devout notch
#

guys I have a question, I'm new to using databases (other than a basic .json file)
If I'm using MongoDB, should I connect to the database at the start of the code and never end the connection with the db or should I connect/disconnect after every read/write?

crystal wigeon
#

Or a diff way to send it to server

modest maple
#

bro

crystal wigeon
#

Should do

modest maple
#

ive told you

#

use a internal endpoint

modest maple
#

1 connection many operations not 1 connection 1 operation

devout notch
#

gotchu, thanks

crystal wigeon
#

Aight. But what if I still wanted to use external endpoints xD

modest maple
#

thats not how that works

#

internal and external just refer to who's accessing it really

#

if its external then having your 2nd server is pointless and a dead idea

crystal wigeon
#

Well, all I'm trying to understand is how to send a file between 2 servers

modest maple
#

because it might aswell be done by the main server since anyone can access it

#

im telling you how

#

just another endpoint

crystal wigeon
#

Ik

modest maple
#

that only the other server can send to

#

either via just localhost

crystal wigeon
#

Wait

modest maple
#

or an authentication of some sort

crystal wigeon
#

req.file("file").pipe(axios.post(endpoint))

#

Does this look right?

modest maple
#

no..

#

no where near

crystal wigeon
#

Ye

#

So that's what I'm trying to figure

#

What's the correct one

modest maple
#

what is your obsession with pipes

crystal wigeon
#

Just trying to understand nrw things

#

New*

#

Even tho it's inefficient

modest maple
#

but dont use them for things that dont need it or want it blobpain

crystal wigeon
#

I wanna try it out for knowledge purposes

modest maple
#

you cant just slap pipes on anything and everything

#

and you cant expect everything and anything to accept a pipe or being piped to

crystal wigeon
#

So, if I can't use pipe

#

How would I write it

modest maple
#

...

young flame
#

......

placid iron
#

@modest maple thank you, its way faster to embed into discord now

#

and just in general

#

though it was quite a task to set it up

quaint wasp
#

uhh

#

I got this:

#

but....

#

It replys like this:

umbral zealot
#

That'S working perfectly as expected

#

it's asking for a channel, you didn't provide a channel.

quaint wasp
#

but

umbral zealot
#

If you mean it didn't give you both errors

quaint wasp
#

it says you cant use that

umbral zealot
#

it'S beacuse you didn't use return

quaint wasp
#

oh

#

one sec

fierce ether
#
 async load () {
        try{ 
            await this.initializeEvents() 
            return true 
        } catch(e) { this.client.logger.error(e)}
        return false
    }
      /**
   * @param {string} dirPath
   */
  initializeEvents (dirPath = 'src/events') {
    return FileUtils.requireDirectory(dirPath, (NewEvent) => {
      if (Object.getPrototypeOf(NewEvent) !== EventListener) return
      this.addEvent(new NewEvent(this.client)) ? success++ : failed++
    }, this.client.logger.log.bind(this)).then(() => {
        if (failed) this.client.logger.log(`${success} events loaded, ${failed} failed.`)
        else this.client.logger.log(`All ${success} events loaded without errors.`)
    })
  }```
#

what am i doing wrong? no error though?

umbral zealot
#

Well you have a few places where you return stuff so maybe you should, like, log things and figure it out?

fierce ether
#

i try logging stuff, and nothing logs

umbral zealot
#

maybe Object.getPrototypeOf(NewEvent) !== EventListener returns trueso it just returns

fierce ether
#

dosent even get to that point

umbral zealot
#

if nothing at all happens it means that code isn't running

#

which means the problem isn't in this code.

fierce ether
#
  initializeEvents (dirPath = 'src/events') {
this.client.logger.log("test")
    return FileUtils.requireDirectory(dirPath, (NewEvent) => {
      if (Object.getPrototypeOf(NewEvent) !== EventListener) return
      this.addEvent(new NewEvent(this.client)) ? success++ : failed++
    }, this.client.logger.log.bind(this)).then(() => {
        if (failed) this.client.logger.log(`${success} events loaded, ${failed} failed.`)
        else this.client.logger.log(`All ${success} events loaded without errors.`)
    })

  }```
#

that logs

umbral zealot
#

Also you might wanna rething this "random unreadable syntax" thing you got going on

fierce ether
#

wdym?

umbral zealot
#

I mean the random indentation, the absolute lack of semicolons, the horrible failure to use proper line returns

#

this is a mess of unreadable code

fierce ether
#

oh sorry

umbral zealot
#

Already this is easier to read ```js
async load() {
try {
await this.initializeEvents();
return true;
} catch (e) {
this.client.logger.error(e);
}
return false;
}
/**

  • @param {string} dirPath
    */
    initializeEvents(dirPath = "src/events") {
    return FileUtils.requireDirectory(
    dirPath,
    (NewEvent) => {
    if (Object.getPrototypeOf(NewEvent) !== EventListener) return;
    this.addEvent(new NewEvent(this.client)) ? success++ : failed++;
    },
    this.client.logger.log.bind(this)
    ).then(() => {
    if (failed)
    this.client.logger.log(${success} events loaded, ${failed} failed.);
    else
    this.client.logger.log(All ${success} events loaded without errors.);
    });
    }
lyric mountain
#

I mean, semicolons are kinda optionally obrigatory in js

umbral zealot
#

No, they're not optional in all cases and unless you can quote the rules of ASI you shouldn't consider them optional

lyric mountain
#

as I said, optionally obrigatory

#

you either use them or don't code

umbral zealot
#

Why does someone always feel the need to start the damn debate every time I mention semicolons

lyric mountain
#

not starting one

umbral zealot
#

sure, ok. fine.

lyric mountain
#

ah, wait, I forgot this:

#

/s

umbral zealot
#

maybe Object.getPrototypeOf(NewEvent) !== EventListener returns true so the entire thing returns and nothing else runs

#

Honestly I completely and absolutely fail to see the point of using an async function you're awaiting just to call a function that's not async/await. So weird.

outer zenith
#

yo can someone help

#

this is my command

#

and yet its throwing this error

#

and the role var is showing up as None

#

oh wait

#

nvm i feel like ik the answer

lyric mountain
#

you never defined "role" outside of that try scope

dusky sundial
#

Try statements don't create new scopes though, so it should be fine (I think?)

lyric mountain
#

afaik they do create new scopes, never heard of a lang where it didn't

dusky sundial
#

I feel like PyCharm would definitely underline that though

lyric mountain
#

ain't that pycharm?

dusky sundial
#

Yeah, looks like i

#

t

lyric mountain
#

like, only paid intellij has python stuff

static trench
#

hey guys. I want to add an error to my D.py bot that doesnt allow commands in DM's. can someone help?

lyric mountain
#

do you have any prototype code?

static trench
#

wdym?

#

just commands?

lyric mountain
#

something u started

#

or at least tried to

static trench
#

oh ok

#

well no. because i cant find anything to start on

#

well nvm

#

wait

#
async def on_command_error(ctx, error):
  print(str(error))
  if "HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body" in str(error):
    embed = discord.Embed(title="Error", color=0xff0000, description="Enter a valid ID")
  elif "object has no attribute 'name'" in str(error):
    embed = discord.Embed(title="Error", color=0xff0000, description="Enter a valid name or ID")
  elif "UnboundLocalError: local variable 'member' referenced before assignment" in str(error):
    embed = discord.Embed(title="Error", color=0xff0000, description="Enter a valid name or ID")
  else:
    embed = discord.Embed(title="Error", color=0xff0000, description=str(error))
  await ctx.channel.send(embed=embed)
#

i have that

dusky sundial
static trench
#

eh. mayve

#

maybe

dusky sundial
#

Also, you could add a check in the on_message event and check if the channel is a DM channel

static trench
#

ok.

dusky sundial
#

something like

if isinstance(ctx.channel, discord.channel.DMChannel):
static trench
#

ok

dusky sundial
static trench
#

elif if isinstance(ctx.channel, discord.channel.DMChannel):
embed = discord.Embed(title="Error", color=0xff0000, description="no commands in DM's")

#

that?

dusky sundial
#

Yeah, something like that.

static trench
#

ok cool

#

thx

#

@dusky sundial its an invalid syntax

#

im guessing DMchannel isnt a channel type

dusky sundial
#

What is?

static trench
#
    elif if isinstance(ctx.channel, discord.channel.DMChannel):
         ^
SyntaxError: invalid syntax
dusky sundial
#

elif if

#

it's supposed to be just elif

latent heron
static trench
#

wait nvm

static trench
latent heron
#

also

#

nice angels of death pfp

static trench
dusky sundial
#

It might be just discord.DMChannel

latent heron
#

^

#

correct

static trench
dusky sundial
icy skiff
#

Variables defined inside try except work fine outside of it

latent heron
#

you can also use discord.PrivateChannel

icy skiff
#

Python is a chad

latent heron
#

that feels

#

really bad imo

#

i don't like how python allows that

dusky sundial
#

Python is very special in his own little way

static trench
#

it worked

#

thx for the help!

dusky sundial
#

No worries! Just ask if there's anything else

latent heron
#

also question

static trench
latent heron
#

are bot reviews being paused because of the website migration atm?

static trench
#

thx

icy skiff
latent heron
#

i haven't seen a single bot declined or approved since

icy skiff
#

Just like most langs

latent heron
#

if you put it in an inline function of another func

#

i think so

#

then it's forced as scope-only

#

as long as you call that function afterward declaration

hallow shell
#

which do you think is better: index or main?

#

just a poll sort of

icy skiff
#

main all the way

quartz kindle
#

master :^)

icy skiff
#

Hi Tim

summer torrent
#

app.js mmLol

quartz kindle
#

py.js

summer torrent
#

Bot.ts

quartz kindle
#

c.cpp.rs.go.jar.py.yaml.json.ts.js

icy skiff
#

mycutebot.txt

quartz kindle
#

uvuvwevwevwe_onyetenyevwe_ugwemubwem.ossas

hallow shell
#

www.index.js

#

for when you cant decide if it's a website or a js file

finite siren
#

Hi, I have a problem. Can someone help me?

icy skiff
solemn latch
latent heron
#

@icy skiff is that a server rule?

craggy pine
latent heron
#

why

craggy pine
#

It doesn't help when you say "I need help" with no context.

#

We don't want to ask "with what..?"

latent heron
#

oh

#

i mean

#

thats a little different than

#

"can i ask a question?"

#

imo

craggy pine
#

It's exactly the same.

latent heron
#

I think people asking for permission to ask a question is more of being courteous/nice

craggy pine
#

This channel and others are litterally designed for questions

latent heron
#

instead of blatantly asking for that permission itself

#

well that's fair

#

that's if people read the channel description though

#

and ngl not many do that as a generality

craggy pine
#

That's their fault.

latent heron
#

i suppose

icy skiff
finite siren
#

I wanted help with the site top.gg, but thank you, it was canceled

silver mauve
#

what is the best language or program or tool idk to use to code a discord bot?

icy skiff
#

There isn't a best one

silver mauve
#

easiest

icy skiff
silver mauve
#

okies

#

ty

dusky sundial
icy skiff
#

Np

silver mauve
#

you got any like video tutorials dat are good?

icy skiff
#

Sure ill dm them to you

silver mauve
#

okies

#

ty

dusky sundial
#

I wouldn't watch those ones that are like 6 hours long as they easily get boring

icy skiff
#

Yes

#

I sent a playlist to him

#

The one that I used at least

#

And its the rewrite branch

dusky sundial
#

It might be good to get some basics down before delving into bot development though

icy skiff
#

Branch? Brench? Idk

#

I assumed he has basic knowledge with python

silver mauve
#

nope

#

not at all

icy skiff
#

Oh well

gilded olive
#

Dont watch dpy youtube vids

#

They are terrible

icy skiff
#

Dont generalize

gilded olive
#

Much better just going straight on

dusky sundial
#

They're a good way to get started, but I wouldn't rely fully on them no

heavy marsh
#

So in Discord.js v12.5.1
I am trying to get a value if no args
I am not getting it ... - songName

    let songName;
    songName = args.join(` `);

if(!songName) {
    let Stream = data.guild.stream_link.alpha;
    
    internetradio.getStationInfo(Stream, function(error, station) {
          let Info = station;
    try {
        const StationInfo_Raw = Info.title.split(" - ")[1].split('" ').map(x => { let s = x.split('="'); return {[s[0]]: s[1]} });
        let StationInfo = StationInfo_Raw.reduce(((r, c) => Object.assign(r, c)), {});
        songName = StationInfo.text;
    } catch (e) {
        return client.tools.errorcdm(`![rx_error](https://cdn.discordapp.com/emojis/812064534969188412.webp?size=128 "rx_error") **Song can not be found!**\n**To get the lyrics of a diffrent song use \`${data.guild.prefix}lyrics [song name]\`**`, message.channel);
    }
    })
}
gilded olive
#

for dpy I wouldn't watch any videos

#

because of how dpy changes tutorials become outdated quickly

icy skiff
#

Like

#

At least the basic

silver mauve
#

ik some java lmao

#

r dey da same

lyric mountain
#

No

icy skiff
#

Completely different

gilded olive
#

Not at all

lyric mountain
#

Python is the near the farthest u can go from java actually

silver mauve
#

damn there were several people talking when i asked that question

#

lmao

dusky sundial
#

If you have some understanding of basic programming terms it can help, but Java is very different

icy skiff
#

Several people are typing

silver mauve
#

can u code bots with java?

sand bramble
#

help

lyric mountain
#

Yep

#

Mine is java

dusky sundial
#

Yeah, the JDA library

lyric mountain
#

If you do know java, I'd advise to go with it

silver mauve
#

alright i will code in java den

silver mauve
icy skiff
#

Learning New languages is good tho

mellow kelp
#

is kotlin cool

#

im kinda interested

icy skiff
#

But stick with which u prefer

sand bramble
#

How do I get that money from the page?

mellow kelp
#

i think you can use it for auctions or something

#

at the end of the month

lyric mountain
#

It is, but making a bot in java will teach a metric ton of concepts and upgrade ur knowledge

#

Like, you'll become more proficient over time

mellow kelp
#

object oriented ftw

sand bramble
lyric mountain
#

And java is one of the main business langs

silver mauve
#

ALRIGHT THANK YOU GENTLEMEN FOR YOUR HELP

mellow kelp
sand bramble
#

pff

lyric mountain
#

Voting credits are for auctions only

#

No other usage

heavy marsh
mellow kelp
#

makes sense

sand bramble
#

Auctions of what?

mellow kelp
#

still really pog that you can get money for auctions

lyric mountain
#

Basically advertising

#

You buy a space to advertise

#

However it's auctions system

heavy marsh
sand bramble
#

And how I do it?

dusky sundial
sand bramble
#

And another question, how do I make top.gg in my bot show how many servers is it? They go to

sand bramble
#

Is it an api?

weak basin
#

Sent wrong thing / read your message wrong.

heavy marsh
sand bramble
#

is npm i topgg-autoposter?

weak basin
sand bramble
#

the thing is that it explains it as if it were Discord.js and I use another language

weak basin
#

Ahh, I'm not too sure then sorry

sand bramble
#

😦

dusky sundial
#

You could probably just look up how to use the topgg autoposter for your language

dusky sundial
sand bramble
#

Rather, it is a BDFD wrapper

#

but javascript is used just like discord.js

timber quartz
#

why do people keep asking to buy my account

dusky sundial
#

The dev badge, i get that all the time too

quartz kindle
#

because of the badge

#

i got offered 400 bucks today

sudden geyser
# heavy marsh So in Discord.js v12.5.1 I am trying to get a value if no args I am not getting ...

There are a number of possible errors that could have occurred:

  • getStationInfo doesn't update songName in time.
  • getStationInfo's callback function is not called.
  • The statements in the try block cause an error and leave the scope before songName is updated.
  • songName is updated to some value that is also a blank string.

You'll probably want to use a debugger to step through and see why the value isn't being updated.

timber quartz
#

I got offered 2.5k bucks today

sand bramble
quartz kindle
#

nice

dusky sundial
sand bramble
#

f

dusky sundial
#

You needed a verified bot before Oct 17 2020 I think

sudden geyser
#

I've been offered at most $800 for the early supporter badge

dusky sundial
#

it's good money, it's just that the offer is from a random stranger on Discord which instantly breaks the deal for me lol

sand bramble
timber quartz
#

yeah exactly

sand bramble
heavy marsh
# sudden geyser There are a number of possible errors that could have occurred: - `getStationI...
if(!songName) {
    let Stream = data.guild.stream_link.alpha;
    
    internetradio.getStationInfo(Stream, async function(error, station) {
          let Info = station;
    try {
        const StationInfo_Raw = Info.title.split(" - ")[1].split('" ').map(x => { let s = x.split('="'); return {[s[0]]: s[1]} });
        let StationInfo = StationInfo_Raw.reduce(((r, c) => Object.assign(r, c)), {});
        songName = await StationInfo.text;
        console.log(songName) //Givees a value
    } catch (e) {
        return client.tools.errorcdm(`![rx_error](https://cdn.discordapp.com/emojis/812064534969188412.webp?size=128 "rx_error") **Song can not be found!**\n**To get the lyrics of a diffrent song use \`${data.guild.prefix}lyrics [song name]\`**`, message.channel);
    }
    })
}
console.log(songName) //Nothing
icy skiff
#

Is there a New badge or smth or there's no badge at all anymore

sand bramble
#

topgg-autoposter what is it? a number or something?

dusky sundial
heavy marsh
dusky sundial
sand bramble
heavy marsh
spare portal
#

im trying to do a command that plays an audio file in the voice channel

client.on('message', async msg => {
if (msg.content.toLowerCase() === 'play me some tunes') {
  if (msg.member.voice.channel) {
      const connection = await msg.member.voice.channel.join();
      const dispatcher = connection.play('rickroll.mp3');
      dispatcher.on('start', () => {
        console.log('audio playing');
      });
      dispatcher.on('finish', () => {
        console.log('audio not playing');
      });
  }
}});

the bot joins the channel fine, but it doesnt play the audio

icy skiff
#

rip me ig

dusky sundial
#

I mean, they might bring a badge back in the future. Who knows shrug

icy skiff
#

hope so

mellow kelp
#

same

spare portal
#

yeah hold on

#
events.js:292
      throw er; // Unhandled 'error' event
      ^

Error: spawn ffmpeg ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
    at onErrorNT (internal/child_process.js:469:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:273:12)
    at onErrorNT (internal/child_process.js:469:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  errno: 'ENOENT',
  code: 'ENOENT',
  syscall: 'spawn ffmpeg',
  path: 'ffmpeg',
  spawnargs: [
    '-i',               'rr.mp3',
    '-analyzeduration', '0',
    '-loglevel',        '0',
    '-f',               's16le',
    '-ar',              '48000',
    '-ac',              '2',
    'pipe:1'
  ]
}
odd stratus
#

Oh

#

Usually means Ffmpeg crashed

#

🤔

spare portal
#

does that have anything to do with it

odd stratus
#

Could be why

#

What if you do something like this

msg.member.voice.channel.join().then(con => {
        con.play('./rickroll.mp3');
})```
crimson vapor
#

thats a banger

odd stratus
#

I've done something like that before with radio links and it worked for me

crimson vapor
#

yes iirc radio links work

odd stratus
#

It was with Ffmpeg though

#

Is it possible with Lavalink

#

🤔

static trench
spare portal
#

is that the right place to put it

odd stratus
#

Should be

spare portal
#
Logged in as The Worst Bot In Existence#1697!
(node:829) UnhandledPromiseRejectionWarning: ReferenceError: dispatcher is not defined
(node:829) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:829) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
events.js:292
      throw er; // Unhandled 'error' event
      ^

Error: spawn ffmpeg ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
    at onErrorNT (internal/child_process.js:469:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:273:12)
    at onErrorNT (internal/child_process.js:469:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  errno: 'ENOENT',
  code: 'ENOENT',
  syscall: 'spawn ffmpeg',
  path: 'ffmpeg',
  spawnargs: [
    '-i',               './rickroll.mp3',
    '-analyzeduration', '0',
    '-loglevel',        '0',
    '-f',               's16le',
    '-ar',              '48000',
    '-ac',              '2',
    'pipe:1'
  ]
}
#

basically the same but slightly longer

crimson vapor
#

ah yes

#

copy pasting code

#

dispatcher is generally defined as connection.play()

spare portal
#

that's what it was originally

odd stratus
#

What if you try on your PC while hosting locally

spare portal
#

my internet's super slow and it would be like a 2 second ping

#

but

#

i mean i could try it

earnest phoenix
#

i am using @fortawesome/fontawesome-free but the font is not loaded.

registerFont(path.join(__dirname, '..', 'node_modules', '@fortawesome', 'fontawesome-free', 'webfonts', 'fa-brands-400.ttf'), {
    family: 'Font-Awesome-Brands', 
});
(process:16572): Pango-WARNING **: 03:47:03.280: couldn't load font "Font Awesome 5 Brands Not-Rotated 50px", falling back to "Sans Not-Rotated 50px", expect ugly output.
mellow kelp
#

/api/users/@me/guilds

#

np

unkempt ocean
#

@spare geode this channel

quaint wasp
#

How do I make it a function?

#

my full code is this:

#

const activities_list = [
  "For Rule Breakers | ++help", 
  "The purple names | ++help",
  "#general | ++help", 
  "The mods do their job | ++help",
  " for ++help",
  "cats | ++help",
  "dogs | ++help",
  `${client.guilds.cache.size} servers | ++help`
  `${client.channels.cache.size} channels | ++help` 
  ];
  
client.on("ready", () => {
  console.log(`${client.guilds.cache.reduce((a, b) => a + b.memberCount, 0)} users \n${client.channels.cache.size} channels \n${client.guilds.cache.size} guilds.`)
  setInterval(() => {
    const index = Math.floor(Math.random() * (activities_list.length - 1) + 1);

    client.user.setActivity(activities_list[index], { type: 'WATCHING' }); // sets bot's activities to one of the phrases in the arraylist.
}, 15000); // Runs this every 10 seconds.
});```
mellow kelp
#

you're missing a comma

quaint wasp
#

oh

#

thanks

mellow kelp
#

np

spare portal
#

alright so in continuance with my previous issue about the audio file not playing

#

apparently when i uploaded the audio file it corrupted

#

so it turned to a 0 byte file

#

a direct link to the audio file on a different site should work right

silver mauve
#

any help?

crimson vapor
#

whats the error?

silver mauve
#

well

#

when i import the JDABuilder

#

this happens

crimson vapor
#

yes

silver mauve
#

is that okay?

crimson vapor
#

whats the underline?

silver mauve
#

;-;

#

sed

earnest phoenix
#

Why This Error?
It Has Just Begun to Appear.

silver mauve
#

but... but

#

i was here first ;-;

misty sigil
#

not how it works

#

🐓

mellow kelp
#

it's deprecated

silver mauve
#

So is no one going to help?

drifting wedge
#

How can I print a 100 million digit number?

mellow kelp
#

you have to use JDABuilder.createDefault("TOKEN") @silver mauve

#

there are other create methods too

drifting wedge
#

@mellow kelp

#

Yo

silver mauve
#

i was following the other guy

#

thats his not mine

drifting wedge
#

How can I print a "1" with 100 million 0's after it?

craggy pine
silver mauve
#

i kinda have some experience

#

thats why i picked java

#

instead of python

craggy pine
#

That's good then if you have some.

drifting wedge
#

Someone....

#

?

silver mauve
#

just want to fix this

#

thats it

mellow kelp
#

i already told you

craggy pine
#

^

#

It was answered

#

Which is why I said something else.

mellow kelp
#

use JDABuilder.createDefault("<TOKEN>")

silver mauve
#

alright

#

ty

mellow kelp
#

the constructor is deprecated

#

k

mellow kelp
#

and String.repeat

#

and it's probably a bad idea since it just crashed my terminal

#

so uhh don't do it

silver mauve
#

i dont get why is his working but not mine?

#

thats his and mine just does not work

mellow kelp
#

hover over JDABuilder and check what the error is

#

ez

hallow shell
#

Anybody know why foo() in index.js is returning undefined? ```js
// module.js
module.exports = () => {return this.foo};
module.exports.foo = 'a string';

// index.js
const foo = require('./module.js');
console.log(foo()); // undefined
console.log(foo.foo); // a string

mellow kelp
#

this is the global node context by default

#

i'm not really sure, but i think that would work it if wasn't an arrow function

hallow shell
#

I'll try it without a module

#

Oh, I think I figured it out

#

this.foo.foo seems to work

mellow kelp
#

well k

hallow shell
#

but only when it's not a module which is interesting

icy skiff
#

Do u want to just print it to the terminal or send it on a discord chat

#

Cause If its the second option u just cant

drifting wedge
#

I got it

icy skiff
#

K

drifting wedge
#

It's for a contest

mellow kelp
#

imagine if discord allowed messages over 2000 characters

#

oh boy the ddos attacks

icy skiff
#

There would be no Discord

#

xd

earnest phoenix
#

What kinda contest asks u to print that

drifting wedge
#

It's complicated

earnest phoenix
#

Good thing files are also limited to 2000 bytes

queen tulip
#

hi

nimble kiln
#

hi !

queen tulip
#

how are you all?

nimble kiln
#

This is the wrong channel for smalltalk

#

echo "I'm fine, thank you";

#

Lets smalltalk in PHP

queen tulip
#

i forgot

nimble kiln
#

To circumvent the rules

queen tulip
#

sorry man.

nimble kiln
#

I'm obviously coding my bot in PHP, before anyone asks

earnest phoenix
#

can someone help idk whats the problem lol

old cliff
#

rate the complexity of this code between 1 and 10

nimble kiln
mellow kelp
#

ah yes, lolify

old cliff
#

yessir

#

my secret form of encryption

mellow kelp
#

how does loli-encrypted text look

old cliff
mellow kelp
#

lmfao

latent heron
copper cradle
#

it's always gonna return true

#

or am I not seeing something

latent heron
#

also

#

alphabet soup code

copper cradle
#

yeah

#

base64 = bool

#

alright mate

#

Math.random() doesn't return 0

#

the only way for it to be false is for any of those variables to be 0

latent heron
#

im still trying to decipher what the fuck that code even does

copper cradle
#

or another falsy value

zenith terrace
latent heron
#

you see, it's hard for people to read docs

copper cradle
#

the function returns a promise

#

just await it

#

and that's it

#

convert your function into an async func, and then just await it

#

and that's basically it

simple pewter
#

How do I make a bot that logs activity tracking, points, and can update roles and moderate

misty sigil
#

With code and database

copper cradle
#

first, learn japanese, and then cook in a carpeted kitchen

misty sigil
#

and tears and pain

#

ofc

nimble kiln
#

What's wrong with a carpeted kitchen

#

Except if you spill something on it

misty sigil
#

and then have your bot buried because it’s multipurpose

copper cradle
#

then you can summon a bot that logs activity, points, and can update roles and moderate

zenith terrace
#

I agree

misty sigil
#

no reading docs bro

latent heron
#

lmao star

copper cradle
misty sigil
#

not allowed

copper cradle
#

or oil

latent heron
#

im psure like

copper cradle
#

oml

latent heron
#

half of the d.py helpers lose their shit when people don't ass themselves to read the docs

#

and i understand so well why

nimble kiln
#

still dont understand the problems :3

old cliff
copper cradle
latent heron
#

ye

#

it gets super annoying

zenith terrace
#

I wonder what the d.js server is like

#

im in it so gonna have a look lol

old cliff
#

1110.3120.00

latent heron
#

here

zenith terrace
#

d.js server dont seem too bad lol

latent heron
#

well tbf i think a lot of API wrapper support servers are chill

#

but you always get idiots who go "code is broken help guys" and never give context

#

(not directed at you JAGUAR)

zenith terrace
#

lmao

copper cradle
#

wtf is that even supposed to do

fierce ether
#
ReferenceError: primordials is not defined``` any idea how to fix
copper cradle
#

define primordials

#

there u go

tawny cosmos
#

I just was being safe and sorry and removing some things off of here and I'm about to log off and charge my phone I just don't trust certain things right now especially when I'm going through I don't want to b

#

I've been hacked sorry you have a good one

fierce ether
#

but im not using them anywhere

copper cradle
#

show your code

fierce ether
#

its a node error so the stack?

copper cradle
#

All I can get from it is some kind of shuffle system

old cliff
#

yes

copper cradle
#

what do you use the strategy that gets generated afterwards for

old cliff
#

its smaller than

#

not greater

copper cradle
#

yeah I just noticed

#

my bad

#

it's a 50/50 chance

old cliff
#

lol

copper cradle
#

so the output will not always be 1111, but what is it being used for tho

old cliff
#

I just asked whether it was complex or not and I started a debate

#

read the function name

copper cradle
#

yeah but what is that strategy being used for

old cliff
#

I can't tell that

latent heron
#

the real shit is when you code a bot for web scraping

copper cradle
#

alright

latent heron
old cliff
#

it would be open source after 3 weeks tho

copper cradle
#

hmm

latent heron
#

good sir

#

didn't you come in here yesterday saying like

#

"if your code isn't messy it isn't code"

old cliff
#

yes

latent heron
old cliff
#

memes

fierce ether
#

@copper cradle if i remove this theres no error ```js
const { APIWrapper } = require('../')
const Crowdin = require('crowdin-without-vulnerability')
const config = require('../data/config')
module.exports = class CrowdinAPI extends APIWrapper {
constructor () {
super({
name: 'crowdin'
})
}

load () {
return new Crowdin({
apiKey: config.CROWDIN_API_KEY,
endpointUrl: https://api.crowdin.net/api/project/${config.CROWDIN_PROJECT_ID}
})
}
}```

copper cradle
#

if you remove what

#

idk what 'this' is mmLol

fierce ether
#

the file

latent heron
#

what is this in TS?

const { Object } = require(FILE_PATH as String)
#

the { Object } thing

#

i always see it passed like that but i don't get why

copper cradle
#

don't you know what object destructuring is?

latent heron
#

not in TS no

#

idk TS, so i ask

old cliff
mellow kelp
#

ts is a superset of js

latent heron
#

ik what TS is

mellow kelp
#

so it has all js features

copper cradle
#

it's the same

latent heron
#

im asking why that

#

method

copper cradle
#

that way you don't import the entire lib

civic cairn
#

if you only import the sections your are using the compiled code is smaller. Probably other memory benefits also.

copper cradle
#

it's not as if js/ts was compiled

#

that works better on webpack projects

mellow kelp
#

yeah

#

reduces bundle sizes

copper cradle
#

on a normal node project it makes little diff

cinder patio
#

JS does get compiled down to bytecode

tired panther
#

I thought js runs on run time Thinkeng

earnest phoenix
#

node is crack

#

a mix of JIT compilation and interpretation