#development

1 messages · Page 1900 of 1

earnest phoenix
#

hm

lament rock
#

is open synchronous or async

earnest phoenix
#

async

lament rock
#

Then you need to await it

earnest phoenix
#

alright

proven lantern
#

i defeated dynamodb

#
            ':hkey': "team-up",
            ':rkey': new Date().getTime()
        }),```
#

needed to add marshall

lament rock
proven lantern
#

oh nice. and that avoids using the new keyword which you are never supposed to use in JS

lament rock
#

new is even pre es-6 and people who say that are dumb because it's just an initializer. The fact that JS is now mostly class based is good because less duplicated allocs in memory because of prototypes

errant flax
#

stop using json as db

#

or atleast it seems a db

lament rock
#

They said it's for 1 server. JSON is allowed

proven lantern
#

he categorizes the language into good parts and bad parts

#

The worst is class. It's only for Java programmers, who don't want to learn JavaScript. For those "Who don't know how miserable they are."

#

kinda a mean thing for him to say

lament rock
#

Great. It's one thing for someone to make such a claim and it's another to provide actual tangible evidence as of why and not just some edge case

#

It sounds like this guy is petty because he's shitting on parts of the language which make javascript high level and modern

#

for what purpose?

proven lantern
#

it's pretty old, but most of it is still true

#

i bet it's been update too

pastel ruin
#

out of curiosity is there a way to show on my website if my bot is online (I know that there is one by top.gg but it seems to show always online)

pale vessel
pale vessel
pastel ruin
#

that sounds smart, thanks

#

but is showing online

pale vessel
#

It's not reliable anymore

#

Pretty sure it used to use Luca to get a bot's status until they kicked all bots from this server

pastel ruin
#

oh ok that makes sence

#

anyway i think i will use your idea
thanks again

wheat mesa
#

Would [] technically be Array<undefined>, or just something like Array<>?

lyric mountain
#

Array<> depends on the other side to define typing

#

Well, at least in java

wheat mesa
#

I know, but I mean if I have an empty array, what would I call the type?

lyric mountain
#

Ig Object

wheat mesa
#

object is probably the best option

lyric mountain
#

Since everything extends Object

wheat mesa
#

I'm talking about TypeScript, but yes the same thing applies I'm pretty sure

lyric mountain
#

Ik, but even in js everything extends Object

#

It is like, the common ancestor of all non-primitive types

earnest phoenix
lyric mountain
#

They all say that

#

Know what? A single spark is enough to destroy a building

slender thistle
lament rock
#

They make sense for object oriented programming

lament rock
#

if you plan on actually pushing anything to the array, then it will inherit the type being pushed to it if all items are of the same type

#

if you have mixed types, use unknown

wheat mesa
#

Oh, thanks

earnest phoenix
#

ive even moved it on to my vps to run it

#

doesn't help

lament rock
#

Then look at a tutorial to load a JSON because idk how python works

earnest phoenix
#

What im doing rn

#

that is what they say todo, it may be something with discord.py

#

I'm using Google Translate to speak. Does anyone, when they go to vote for such a bot, and try to login, go back directly to a page with the 500 error?

lament rock
#

Nah. d.py's command handlers are awaited so async contexts work just fine. d.py doesn't do anything to python internals

drifting wedge
#

in enhanced dpy (dpy fork), how do i make a component usable more than once?

#

like when i click the button more than once it says interaction failed

royal pawn
#

How do you put hex code in Embed color - Not hexadecimal in discord.py

drifting wedge
#

i got it

#

i fixed it

royal pawn
# drifting wedge wat

Example:
@bot.command()
async def test
embed=discord.Embed(title="", description="", color=[Hex color code] but we can only put Hexadecimal

drifting wedge
#

yeah i mean just make it hex

#

like what else do you want to put?

#

@royal pawn

royal pawn
drifting wedge
#

yes

#

whats the issue?

#

ohhh

#

ohoohoh

#

replace the "#"

#

with 0x

#

0x

royal pawn
#

Ok

drifting wedge
#

so 0x43549

#

not #383249

royal pawn
drifting wedge
#

like an example

#

so like put the 0x then the code

#

not # then the code

royal pawn
#

So 0x383249?

drifting wedge
#

yes

royal pawn
#

Let me have a look

drifting wedge
#

instead of #383249

royal pawn
craggy pine
#

@ripe prairie

visual bone
#

How can i access it then?

slender thistle
#

Anything that subclasses it has access to its fields

#

I don't understand what you're trying to do

small tangle
#

I'm wondering, does a slashcommand only bot even needs permissions besides the application scope?

hybrid cargo
small tangle
#

I see, i came to that conclusion because i removed the abiltiy to write in a channel and my bot was still able to respond

hybrid cargo
#

Well thats something which slash commands override, yeah

small tangle
#

but yeah makes sense that these actions are still tied to the permission

#

but in theory, when my bot dont need any guild based permissions like kick / ban, im fine as long as he is granted the application scope

earnest phoenix
#

can i make an slash cmd handler for v12?

small tangle
#

Does v12 support slash commands?

#

if yes, then sure

pearl trail
earnest phoenix
pearl trail
#

listein to INTERACTION_CREATE event in client.ws

#

and for replying, you need to play with the token given there

earnest phoenix
#

ok ty

vital void
#

How can I fetch the ids of all the mentions in a message not like message.mentions.members.first() I wanna fetch ids of all mentions for an afk command? Can anyone please help

boreal iron
#

You don’t need to fetch them

#

The property mentions contains any mention

#

No matter it’s a user, channel etc.

nimble kiln
#
const bigCanvasRenderService = new ChartJSNodeCanvas({ width, height, chartCallback: (chartJS) => {
    chartJS.register(chartjsPluginDatalabels);

    chartJS.register({
        beforeDraw: function (chartInstance: any) {
            const localCtx = chartInstance.chart.ctx;
            localCtx.fillStyle = 'white';
            localCtx.fillRect(0, 0, chartInstance.chart.width, chartInstance.chart.height);
        }
    });
}});
#

is fun

nimble kiln
#

log it

vital void
boreal iron
#

Well if it’s only one mentioned member, then yes

#

If more got mentioned the property members is a collection

#

Which means you need a loop then or filter etc.

vital void
nimble kiln
#

That's what the errors say?

#

How would I go ahead and return a value there properly? As far as I understand it .register() adds that stuff into the chart and doesnt require and returned values

#

@ripe prairie

#

👍

spark flint
#
const express = require('express')
const app = express()
const router = express.Router();
const axios = require('axios')

app.set("trust proxy", true)

router.get('/', function(req, res) {
    const response = axios(`http://IPADDRESS/check/USERID`{headers: {"Authorization": "APIKEY"}});
    res.send(response.data)
});

app.use('/api', router);
app.listen(3001);

console.log('Running at Port 3001');```
#

whats going wrong here

rancid kite
#
const express = require('express')
const app = express()
const router = express.Router();
const axios = require('axios')

app.set("trust proxy", true)

router.get('/', function(req, res) {
    const response = axios(`http://IPADDRESS/check/USERID`{headers: {"Authorization": "APIKEY"});
    res.send(response.data)
});

app.use('/api', router);
app.listen(3001);

console.log('Running at Port 3001'); 
#

@spark flint now check

spark flint
#

alr

rancid kite
#

?

spark flint
#

trying it now

rancid kite
#

K

spark flint
#

same issue

sacred aurora
spark flint
#

Ah

feral aspen
#

What does this mean?

#

I am not sure where this is at.

cinder patio
#

looks like an internal error

cinder patio
#

@rustic nova ^

eternal osprey
#

any ideas on how i can pull these info's based on the day:

#

so tomorrow, it would move pull info from the oct 15 tab

#

v

#

ping me if you know the answer. Thanks!

pale vessel
#

use new Date().getDate()?

#

Actually just use the whole date, day isn't enough

eternal osprey
#

but how would i pull info in the first place

#

i tried the networking inspection method but couldn't really find anything useful

sacred aurora
#

so you need to scrape it by yourself

eternal osprey
#

hmmm..

#

How would i ever scrape these info's.

#

i mean i know how to make get requests

cinder patio
#

GET request and use a package like cheerio

sacred aurora
#

well using either fetch or any other package

eternal osprey
#

Would that work too

sacred aurora
#

yeah of course

cinder patio
#

axios can only be used for getting the HTML

#

you'll need something to extract the text with

eternal osprey
#

cheerio?

sacred aurora
#

yup

#

or other html parser

eternal osprey
sacred aurora
#

nah

cinder patio
#

Personally I'd use JSDom

eternal osprey
#

but what part of the site should i actually put in to parse and get.

#

justt the whole website link

#

i suppose that's not the right approach

cinder patio
#

...

#

Make HTTP request to get the site's html, load it in cheerio then get the table via the following query: .tablesorter

#

and there you go, then you'll have to go over all the rows to get the actual data

sacred aurora
cinder patio
#

if there is no official API for the site then this is the only approach

eternal osprey
cinder patio
#

It's a few lines of code but yeah

sacred aurora
#

its easy when you used to it

#

@cinder patio you can run script with jsdom??

cinder patio
#

jsdom is a little overkill

#

but I don't like cheerio's jquery syntax

sacred aurora
#

i just read this and its kinda lit

eternal osprey
#

okay so i've used fetch to get the whole webpage.

#

i would need to load it into cheerio now?

sacred aurora
#

yes

cinder patio
eternal osprey
#
var fetchUrl = require("fetch").fetchUrl;
fetchUrl('https://www.marketwatch.com/tools/earningscalendar', function(error, meta, body){
   
let result = body.toString();
});
eternal osprey
eternal osprey
#

but the response (result) is damn long. How would i know what attribute to load in

sacred aurora
#

isn't fetch already build in node js

eternal osprey
cinder patio
sacred aurora
#

wutt

#

i thought it was built in bruh

cinder patio
earnest phoenix
#

where i can learn how to make bot??

#

steps??

sacred aurora
#

there's a lot of tutorial online

earnest phoenix
sacred aurora
#

yt?

earnest phoenix
#

okh maam

eternal osprey
#

and i need to assign it to a variable and use .tablesorter?

sacred aurora
#

.tablesorter is the selector for the table

eternal osprey
sacred aurora
#

use $(selector) to get the element you looking for

#

and then get the data that you needed

eternal osprey
#

And we are trying to get the .tablesorter right?

cinder patio
#
const $ = cheerio.load(result);

for (const child of $(".tablesorter").children("td")) {
     console.log(child);
}

try this

sacred aurora
#

ex: ```js
const {data} = await axios.get(....);
const $ = cheerio.load(data);

const companyNames = $(".daypage.selected tbody tr").map((i, e) => $(e).find("td").first().text()).get()
/// ["Sensient Technologies Corp.", ......]

cinder patio
#

ugh I hate cheerio

sacred aurora
#

lol

eternal osprey
#

owh that actually worked!

#

And how would i get all the numbers?

sacred aurora
#

which number

eternal osprey
#

these bassically

sacred aurora
#

its all td element so uhh

#

ex: ```js
const {data} = await axios.get(....);
const $ = cheerio.load(data);

const theData = $(".daypage.selected tbody tr").map((i, e) => {
const td = $(e).find("td");
return {
companyName: td.eq(0).text(),
symbol: td.eq(1).text(),
....
}
}).get()
/// [{companyName: "Sensient Technologies Corp.", symbol: .....}, ......]

#

something like that maybe

#

i dunno if the eq index is start from 0 or not

#

so try it yourself

eternal osprey
#

that actually does work

sacred aurora
#

aye

eternal osprey
#

yeah it goes from 0-5!

#

Thank you so much buddy!

sacred aurora
#

just continue that code then

#

np

lyric mountain
#

@rose warren

rose warren
#

Ty

past geyser
#

How to open in new tab link with css in discord bot page anchor tag

#

That's it 😉

lyric mountain
#

errr...why u wanna open an anchor url in a new tab?

cinder patio
#

target="_blank"

outer perch
#

how can I do so embed waits for the promise to be fulfilled on the previous forEach

#

the strings are going empty, even if I fill them after the promise

#

and even if the embed fields are only added later in the code

cinder patio
#

🤔 show your code

outer perch
#

.then() doesn't work on void

#

forget the redlines, I have neither NodeJS or eslint on this machine

#

the code is skipping to .addFields before forEach is finished

#

if I do something else other than a promise, everything goes fine and in order

cinder patio
#

yeah because for each is sync, you cannot do async work inside the callback (I mean, you can, but the code later will be executed before the forEach is complete)

#

use a regular for loop

outer perch
#

so how do I get the docs?

cinder patio
#

with a regular for loop instead of forEach

outer perch
#

i know

#

but I can't think rn

#
for (i = 0; i < query.size; i++) {
  const doc = query.document;
}
#

something like this?

cinder patio
#

sure, or

for (const doc of query) {
   // code...
}
outer perch
#

I always forget that's possible

#

tysm

#

@cinder patio query has no iterator

#
const refP = db.collection('perfis');
const query = await refP.orderBy('xp', 'desc').limit(10).get();
cinder patio
#

is that mongodb?

outer perch
#

Firestore

cinder patio
#

well find a way to convert query to an array

slow terrace
#
        const msg = await message.channel.send({ embeds: [pages.firstPage] });
    
        if (pages.size === 1){
          return;
        };
    
        const prev = client.emojis.cache.get('890490643548352572') || '◀';
        const next = client.emojis.cache.get('890490558492061736') || '▶';
        const terminate = client.emojis.cache.get('888264104081522698') || '❌';
    
        const filter = (_, user) => user.id === message.author.id;
        const collector = msg.createReactionCollector(filter);
        const navigators = [ prev, next, terminate ];
        let timeout = setTimeout(()=> collector.stop(), 90000);
    
        for (let i = 0; i < navigators.length; i++) {
          setTimeout(async () => {
              msg.react(prev);
            }, 1000)
            setTimeout(async () => {
              await msg.react(next);
            }, 2000)
            setTimeout(async () => {
              await msg.react(terminate);
            }, 3000)
        };
    
        collector.on('collect', async reaction => {
    
          switch(reaction.emoji.name){
            case prev instanceof GuildEmoji ? prev.name : prev:
              msg.edit(pages.previous());
            break;
            case next instanceof GuildEmoji ? next.name : next:
              msg.edit(pages.next());
            break;
            case terminate instanceof GuildEmoji ? terminate.name : terminate:
              collector.stop();
            break;
          };
    
          await reaction.users.remove(message.author.id);
          timeout.refresh();
        });
    
        collector.on('end', async () => await msg.reactions.removeAll());

It's react to the embed then it remove the reactions what is the problem?

outer perch
past geyser
hollow depot
#

does anyone know why the fuck is the bot login request being aborted? this has been going on for 16 hours repeteadly

brittle oyster
#

bad wifi connection?

hollow depot
#

seemed strange as its a vps, usually they have pretty good internet

#

tried pinging the ip from my local and seems ok

earnest phoenix
#

@top-gg/sdk isn't wokring in djs v13

#

what do you mean with that

#

whats not working

boreal iron
split hazel
#

discord would be too kind to give you an error message

earnest phoenix
#

When i regenerate it there was no any problem

#

Reason should be something else

spark flint
#

wow

#

didin't know that was a thing

#

(the dm, not token resetting)

split hazel
#

bruh

#

that was in place for like a year now

spark flint
#

I've only had one before

#

when i accidentally leaked my token

#

but a different message

boreal iron
#

Well some people working on their code need to test any line or few characters they wrote by starting the bot and see what’s going on.
1000 logins per 24 h can be reached damn fast then

past geyser
lyric mountain
#

Feud already answered

earnest phoenix
#

How can i get i.reply id

earnest phoenix
spark flint
#

i'm working on a python module - how do i do something like this:

blacklist = blacklister.join("APIKEY", member)
if blacklist == True:
  reason = blacklist.reason()
 else:
  pass``` etc
#

so like if blacklister.join returns True, then be able to get the reason from that

wheat mesa
boreal iron
#

Aye

slender thistle
#
blacklist = blacklister.join("APIKEY", member)
if blacklist == True:
  reason = blacklist.reason
#

I'll give you some time to think about this

outer perch
spark flint
#

i know i also need () on the end of blacklist.reason

slender thistle
#

Do you?

slender thistle
#

And look at that snippet

earnest phoenix
past geyser
flat copper
#
.addFields([
                  {
                    name: "Synonyms", 
                    value: data.anilist.synonyms.length ? data.anilist.synonyms.length.join("\n") || "Not Provided.",
                    inline: false,
                  },
                  {
                    name: "Episodes:",
                    value: data.episode.toString()
                  },
                  {
                    name: "Duration:",
                    value: `${formatTime(data.from).toString()} - ${formatTime(data.to).toString()}`
                  },
                  {
                    name: "Similarity:",
                    value: data.similarity * 100).toFixed(2).toString() + "%"                  }
                ]) 

error: unexpected token ","

wooden ember
#

what line does it say the error is on?

#

would say at a guess where it says inline: false,

#

cuz there is no line under it

earnest phoenix
#
i.guild.channels.cache.find(c => c.name === "t")

I have channel named as t but it returns false

earnest phoenix
#

find returns a result or undefined

old cliff
earnest phoenix
#

I solved it

brittle oyster
#

no

boreal iron
#

you better ping @everyone

modest maple
#

ping?

boreal iron
modest maple
#

ipng?

grim aspen
#

🤨

spark flint
#

how tf can i send daily emails

#

I'm doing a daily capybara email thing for no reason and I've got a way to give random images everyday, but how do I automatically send these emails to a mailing list?

boreal iron
#

You can just use a relayer to send mail to your list

#

Like google or Amazon

#

Just as example

#

A mail framework or library will usually make sending emails easy

proven lantern
#

imagine if americans didn't invent computers and the internet.

#

@rustic nova

spark flint
#

so thats not an issue

rustic nova
spark flint
#

but how do I automate the daily sending

proven lantern
#

stick with the American(🇺🇸) Standard Code for Information Interchange

cinder patio
#

Actually

#

The first computer was invented by a Bulgarian :<)

boreal iron
#

cough JavaScript

cobalt spruce
#

POV : Your trying to make a v2 of ur bot that support slash commands and start over
cmd
i get this error when trying to start the bot

Error: Cannot find module 'node:events'
Require stack:
- C:\Users\Islam\Desktop\Eqtron V2\node_modules\discord.js\src\client\BaseClient.js
- C:\Users\Islam\Desktop\Eqtron V2\node_modules\discord.js\src\index.js
- C:\Users\Islam\Desktop\Eqtron V2\index.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 Module.require (internal/modules/cjs/loader.js:952:19)←[39m
←[90m    at require (internal/modules/cjs/helpers.js:88:18)←[39m
    at Object.<anonymous> (C:\Users\Islam\Desktop\Eqtron V2\node_modules\←[4mdiscord.js←[24m\src\client\BaseClient.js:3:22)
←[90m    at Module._compile (internal/modules/cjs/loader.js:1063:30)←[39m
←[90m    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)←[39m
←[90m    at Module.load (internal/modules/cjs/loader.js:928:32)←[39m
←[90m    at Function.Module._load (internal/modules/cjs/loader.js:769:14)←[39m
←[90m    at Module.require (internal/modules/cjs/loader.js:952:19)←[39m {
  code: ←[32m'MODULE_NOT_FOUND'←[39m,
  requireStack: [
    ←[32m'C:\\Users\\Islam\\Desktop\\Eqtron V2\\node_modules\\discord.js\\src\\client\\BaseClient.js'←[39m,
    ←[32m'C:\\Users\\Islam\\Desktop\\Eqtron V2\\node_modules\\discord.js\\src\\index.js'←[39m,
    ←[32m'C:\\Users\\Islam\\Desktop\\Eqtron V2\\index.js'←[39m
  ]
}
#

Code:

const { Client } = require("discord.js");
const client = new Client({intents: 3});
const { Token } = require("./config.json");
client.once("ready", () =>{
    console.log("Working")
});

client.login(Token);
cinder patio
#

what's your node.js version?

cobalt spruce
#

how do i check that

#

npm version?

cinder patio
#

node -v

cobalt spruce
#

14.15

cinder patio
#

discord.js requires node.js 16.6.0 and up

cobalt spruce
#

ok

#

ty

limber mica
#

someone got any ideas for something to make?

cobalt spruce
#

when i start the bot
err

PS C:\Users\Islam\Desktop\Eqtron V2> node .
C:\Users\Islam\Desktop\Eqtron V2\node_modules\discord.js\src\client\websocket\WebSocketManager.js:249
        throw new Error(WSCodes[error.code]);
              ^

Error [DISALLOWED_INTENTS]: Privileged intent provided is not enabled or whitelisted.
    at WebSocketManager.createShards (C:\Users\Islam\Desktop\Eqtron V2\node_modules\discord.js\src\client\websocket\WebSocketManager.js:249:15)
    at async Client.login (C:\Users\Islam\Desktop\Eqtron V2\node_modules\discord.js\src\client\Client.js:245:7) {
  [Symbol(code)]: 'DISALLOWED_INTENTS'
}
#

@cinder patiohelp

#

anyone

#

help

boreal iron
#

Did you read the error message?

#

Probably not.

cobalt spruce
#

i did

#

but didnt understand

#

cuz am dumb

#

af

boreal iron
#

Enable the privileged intent if you use it

cobalt spruce
boreal iron
#

Member or presence intent whatever you use

#

Need to be enabled in the developer portal

cobalt spruce
#

i will learn abt them in yt

boreal iron
#

If you don’t need them in your bot then don’t subscribe them

cobalt spruce
#

ty anyways

lyric mountain
#

why yt tho, documentation is complete enough

#

yt is a dangerous place

cobalt spruce
#

fr

#

mods

spark flint
cobalt spruce
#
client.user.setPresence({ activity: {name: 'Crypto, Hash {//}',type: "WATCHING"}, status: 'dnd' ,})

it be dnd but it dont set the activity

#

V13

stuck star
#

How to keep bot status dnd with eval command

#

Wt

#

What

#

Lib???

#

Js

#

Repl

#

Yes

proven lantern
#

the next level is class free oop

stuck star
#

Not working

#

And bro u u know about how to connect database to 24/7 command in DJs music bot@opaque fern

#

@opaque fern I need my bot in vc 24/7 with out paid vps

small tangle
#

Poor init about to get pinged a hundred times

quartz kindle
#

@opaque fern

small tangle
boreal iron
#

Fuck why not

#

@opaque fern

spark flint
grim aspen
#

Python?

spark flint
#

yes

boreal iron
#

"7" is a string not an integer

spark flint
#

so what is the fix?

boreal iron
#

If that’s your error oldEyes

spark flint
#

im clueless

#

I usually don't get this error

grim aspen
boreal iron
#

1 is an integer, "1" is a string

spark flint
#

I know that

#

I'm getting data from an API and thats the output

boreal iron
#

Ah

#

Is your r[data][servers] a string then instead of an integer?

spark flint
#

Fixed it

#

r["data"][0]["servers"]

boreal iron
cobalt spruce
#
    client.command.set(command.name, command);
                   ^

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

uhh

boreal iron
#

The property command is undefined

#

Is it maybe a typo?

#

cough commands

cobalt spruce
#

it is

#
await PG(`${process.cwd()}/Commands/*/*.js`)).map(async (file) => {
    const command = require(file);
boreal iron
#

Did you define client.command as map/collection somewhere? Probably not

cobalt spruce
#

nvm

#

i did client.commands = new Collection();

boreal iron
#

Yeah s as I assumed

cobalt spruce
#
 MainGuild.commands.set(commandsArray).then(async (command) => {
              ^

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

#

commands is defined

boreal iron
#

Wtf set() and then()

#

set() is no promise

cobalt spruce
boreal iron
#

Hmm good time to not follow it anymore

spark flint
#

how do I get information in a class with python

#

ah wait

#
class Person:
  def __init__(self, name, age):
    self.name = name
    self.age = age```
#

thats the w3schools tutorial

split hazel
#

if you want to get data inside the class externally you just do <person instance>.name

#

lt and gt symbols omitted of course

wheat mesa
#

python oop 🤢

spark flint
#

yup

spark flint
wheat mesa
#

Have you looked into other OOP langs like Java or C# zoomeyes

spark flint
#

I'm gonna use JS soon

#

as I will do that in computer science

split hazel
#

are you trying to convert them on the fly

wheat mesa
#

Just saying!

#

Python OOP looks painful

split hazel
#

you lucky shit

#

why is my cs course so shit

wheat mesa
#

My cs course uses Java

#

Which is eh

#

But better than python

split hazel
#

for gcse I only had python and now I have python + lua as a 2 year course

wheat mesa
#

I just wish our class went faster

#

I'm only taking it because it gives me college credit

#

otherwise I'd jump to the level above it

split hazel
#

and I have to make a game in a crappy lua game engine as my course work

wheat mesa
#

roblox smirk

split hazel
#

I really don't like lua

#

it's so unpredictable

#

a lot of shit that would usually error in even loosely typed languages doesn't error there

#

it just silently dies

wheat mesa
#

my languages of choice are typescript, c#, and C++

#

maybe java if I really have to use it, just because it's easily portable

split hazel
#

same except i replace ts with js+jsdoc since ts for me personally limits productivity

#

I end up sitting fighting with the ts compiler over minute shit most of the time

wheat mesa
#

ts compiler prevents a lot of shitcode in js tbh

boreal iron
split hazel
#

that's the point of js!

wheat mesa
#

You're right, I never have used PHP

split hazel
#

and I love it because it allows you to build something so fast

wheat mesa
#

It does

boreal iron
#

Poor fellow

wheat mesa
#

However I prefer to be told if I have mismatched types at compile time and not runtime

split hazel
#

I also prefer something like what deno does, abstracts the compilation process of ts behind the scenes

#

otherwise I always get reminded typescript just becomes js at the end of the day 😭

cobalt spruce
spark flint
#

and I'm learning it

#

the exam will be in OCR reference language

#

which is like psuedocode mixed with Python, JS and Java

wheat mesa
#

wtf

spark flint
#

so pretty much nothing works on it

wheat mesa
#

our exam is gonna be handwriting java and hoping to god it compiles and works as intended first try

#

which I think is stupid

spark flint
#

len(variable) nope
variable.length() nope
variable.length yes

wheat mesa
#

I think that's counterintuitive

#

Because it's very difficult to write complex code that works correctly on the first try

boreal iron
# cobalt spruce than what to do

Well good question, I’ve no clue what you wanna do
If you’re command got added to the collection then do whatever you need with it

spark flint
#

example of ocr rl

wheat mesa
#

what the hell is that

#

🤮

spark flint
#

ocr reference language

#

its horrible

wheat mesa
#

I'd rather write jsfuck than that

spark flint
earnest phoenix
boreal iron
spark flint
#

if this != that nope
NOT if this is that yes

wheat mesa
#

why would they not just have you write... in a real language

spark flint
#

the exam board thinks its more fair

wheat mesa
#

but how? It's teaching you useless information

spark flint
#

and also probs can't be bothered to write three different papers

wheat mesa
#

I guess it's not COMPLETELY useless since it teaches the fundamental ideas of languages, but still

#

why bother learning a fictional language when they could just not be lazy fucks and accept a real language

spark flint
#

exactly

boreal iron
wheat mesa
#

I've literally learned WAY more from just doing things on my own than I've learned from school (in comp sci)

boreal iron
#

Yeah life is an ongoing learning process

spark flint
#

finally progressing on my useless module

#

how tf do i make it public on pypi

lyric mountain
#

some say javascript is better
others say it's java

but everyone agrees, pseudocode is shit

boreal iron
#

lol some say Java is better? Wtf who is this guy

#

Must be on crack

split hazel
#

yes

#

I have to know a language called "Little man computing" which is basically the cheap discounted expired version of assembly language

#

I know all the assembly operands which makes learning this annoying btec assembly seem pointless

#

and we absolutely cannot learn modern cpu architectures we have to learn the decades old terrible vonn neumann architecture

#

which only consists of one general purpose register and is bottlenecked by the ram

lament rock
#

TIL: In JS, writing an Error to process.stdout or process.stderr from within a worker_thread doesn't work and will only show an empty object in the console. {}

You have to write the error message and stack in a string in order for the error to show in the console.

Kinda weird, but okay.

Edit: Or it may have been my jank json stringify method not collecting the props correctly

boreal iron
#

You mean you replaced || by a :

#

Since it’s not a valid syntax for shorthand statements

hybrid cargo
#

Broo why did I get pinged

lament rock
#

at everyone is at here

winged mulch
#

If I put MongoDB Collection objects in a dictionary and use them from there, will that work?

#

Will calling methods and getting attributes work if they are in a dictionary?

#

I figured it would be more efficient if I did it like that instead of calling getCollection every time

lament rock
#

If you're caching results from your db, that could be efficient if that data is "hot" and needed often. The problem might then be data parity between cached results and what's in the database as you read/write

past geyser
#

How can I make anchor href open in new tab target= _blank doesn't work on top.gg

pale vessel
#

It's target="_blank"

past geyser
cinder stratus
#

Hey anyone here has worked with patreon API?

blissful coral
#

Patreon API is a mess

#

Outdated as hell

cinder stratus
#

I wanted to make my premium system automated through the API but now I'm not sure how to do it....

rose warren
#

Dump Patreon altogether

cinder stratus
#

Thanks the patreon api gave me a headache so I took painkillers and I'm on bed I will really check it out once I feel little better 😅

past geyser
#

How can I make anchor href open in new tab target= _blank doesn't work on top.gg

earnest phoenix
#

@drowsy crag

final obsidian
#

hi, so i keep on getting this error when i go to the profile's page of my website, what do i even do because i dont really know what the error means.


If the above error is not helpful, you may want to try EJS-Lint:
https://github.com/RyanZim/EJS-Lint
Or, if you meant to create an async function, pass `async: true` as an option.
    at new Function (<anonymous>)
    at Template.compile (/home/runner/kore-botlist/node_modules/ejs/lib/ejs.js:662:12)
    at Object.compile (/home/runner/kore-botlist/node_modules/ejs/lib/ejs.js:396:16)
    at handleCache (/home/runner/kore-botlist/node_modules/ejs/lib/ejs.js:233:18)
    at tryHandleCache (/home/runner/kore-botlist/node_modules/ejs/lib/ejs.js:272:16)
    at View.exports.renderFile [as engine] (/home/runner/kore-botlist/node_modules/ejs/lib/ejs.js:489:10)
    at View.render (/home/runner/kore-botlist/node_modules/express/lib/view.js:135:8)
    at tryRender (/home/runner/kore-botlist/node_modules/express/lib/application.js:640:10)
    at Function.render (/home/runner/kore-botlist/node_modules/express/lib/application.js:592:3)
    at ServerResponse.render (/home/runner/kore-botlist/node_modules/express/lib/response.js:1012:7)
    at ServerResponse.res.render (/home/runner/kore-botlist/node_modules/express-minify-html-terser/minifier.js:82:16)
    at /home/runner/kore-botlist/src/routers/profile/index.js:18:13
    at processTicksAndRejections (internal/process/task_queues.js:97:5)```
prime glacier
#

no need kido

#

can someone help

earnest phoenix
prime glacier
earnest phoenix
#

v13 at least needs node v16.6

prime glacier
#

ok

#

done

#

hankst

eternal elbow
#

I'm trying to fetch Discord API guild data (https://discord.com/api/v9/guilds/guild_id) but some guilds are returning 403 Missing Access. How can I fix this? What is the reason for this error ?

eternal osprey
#
  <div class="card-content-inner">
                            Current Market Price: <strong>9,769 Silver</strong> <a href="steakhistoryk.php">```how do i get this info from the current code i have: ```js
  var fetchUrl = require("fetch").fetchUrl;
    const cheerio = require('cheerio');
    fetchUrl('https://farmrpg.com/steakmarket.php', function(error, meta, body){
    let result = body.toString()
    
    const $ = cheerio.load(result);```. Would i have to do $(".card-conent-inner")?
#

could anyone help me with this. Never really got the hang of it.

surreal sage
#

JS Question:

I have a json with 2 subs, 'yes' and 'no'
I have a variable that is default on 'no' and if a thing is enabled then it will change to 'yes' but that won't matter currently.

I'm trying to reach the sub by using that one variable.

#

I remembered that it would've looked something like this: json.`${variable}`.value

#

But it gives errors

#

Identifier expected

eternal elbow
#

json.["yes"].value

surreal sage
#

Thanks I just saw that on a Overflow post thanks

#

Double Thanks!

eternal elbow
errant flax
eternal elbow
errant flax
#

@drowsy crag

pale vessel
eternal elbow
surreal sage
#

What's the event for DOM that triggers if a number input has updated by user input or the arrows?

eternal osprey
#
   const $ = cheerio.load(result);
    let m = $.html()
    const theData = $(".card-content-inner")
    let g = theData.html().toString()
    let final1 = g.replace( /^\D+/g, '');```i am trying to only get numbers, but it doesn't seem to work:
eternal elbow
eternal osprey
#

10,282 Silver</strong> <a href="steakhistoryk.php">[View History]</a>

index.js:45

errant flax
#

show the code were its requesting stuff to the api

pale vessel
errant flax
#

where*

pale vessel
#

There's no period.

eternal elbow
surreal sage
#

I had to use it double

pale vessel
eternal elbow
errant flax
surreal sage
#

currently using oninput

#

aint workin

boreal iron
#

Would be easier for you to scrap the content between the <strong> tags

eternal elbow
eternal osprey
#

i tried doing: const theData = $(".card-content-inner .strong")

#

but that's as dumb as my ass

boreal iron
#

.strong doesn’t exist as strong is no class

boreal iron
#

.card-content-inner > strong

errant flax
eternal osprey
#

that's all no . needed

pale vessel
surreal sage
#

Thanks

errant flax
#

no i meant show ur code

#

here

eternal elbow
eternal elbow
errant flax
#

yes

boreal iron
#

Missing Access has nothing to do with a wrong authorization header

#

That would return unauthorized

errant flax
#

it sent a 403

#

doesnt that means "Unauthorized"

boreal iron
#

lol nope

#

401 is unauthorized

eternal elbow
#

Yes but axios give me data: { message: 'Missing Access', code: 50001 }

boreal iron
#

403 is forbidden

eternal elbow
slender thistle
#

Missing Access

errant flax
#

oh

#

OhHHHHh

#

what does the endpoint ur trying to request does anyways

slender thistle
#

To rephrase that, the client may be authorized within the API itself, but it does not have access to that specific route/resource

#

It gets guild data

eternal elbow
boreal iron
#

Can you even fetch guild data your bot isn’t in?

slender thistle
#

You can't

boreal iron
#

Well then you got your answer

eternal elbow
boreal iron
slender thistle
eternal elbow
boreal iron
surreal sage
#

dont click

#

@unkempt ocean

pale vessel
#

I clicked.

#

Got free nitro.

sacred aurora
#

anyone know what kind of thing is this?

array(2) {
  ["time"]=> int(1634383502)
  ["title"]=> string(28) "Shuumatsu no Harem Episode 1"
}
#

and how to parse it

surreal sage
#

@rustic nova

#

There we go

rustic nova
#

yup

surreal sage
#

Thanks Mods

slender thistle
#

Preview is different endpoint

boreal iron
#

Yeah the ressource is publicly open

eternal elbow
#

Just change guilds/guild_id to guilds/guild_id/preview and no errors

slender thistle
#

The preview one?

boreal iron
#

But the preview object only return a few details

boreal iron
#

Returns the guild preview object for the given id. If the user is not in the guild, then the guild must be lurkable (it must be Discoverable or have a live public stage).

eternal elbow
#

Thanks @boreal iron

boreal iron
#

But there’s not much info you can get

eternal elbow
#

All I need is banner, icon and name

boreal iron
#

Ah ok

slender thistle
#

If the user is not in the guild, then the guild must be lurkable (it must be Discoverable or have a live public stage).

eternal elbow
#

Just name and icon

#

It shows emojis but no banners, really discord?

boreal iron
#

Don’t forget to check if the preview object is empty if a guild is unavailable or private as shiv said

eternal elbow
#

Thanks

surreal sage
#

another one

#

lets go

boreal iron
slender thistle
#

It returns 404 if the guild isn't public

boreal iron
#

Good to know

slender thistle
boreal iron
#

Could be such a good morning… then I saw python hashflushed

slender thistle
#

I live for your tears. iara_evil

boreal iron
#

lmao

surreal sage
#
<div class="input-group mb-3">
                                        <div class="input-group-prepend">
                                            <label class="input-group-text" for="inputGroupSelect02">Heats</label>
                                        </div>
                                        <select id="selectdetect2" class="custom-select" id="inputGroupSelect02">
                                            <option selected>Kies</option>
                                            <option value="1">1 Heat</option>
                                            <option value="2">2 Heats</option>
                                            <option value="3">3 Heats</option>
                                        </select>
                                    </div>```
slender thistle
#

Why do you have 2 IDs attached to the select element

surreal sage
#

Does it matter?

slender thistle
#

It might as well

sharp saddle
#

someone help me with html/css?

surreal sage
#

Ight I'll replace things and try

slender thistle
#

Remove one

#

You can't have 2 IDs on one element

boreal iron
#

It does matter

#

Since your label element uses for

#

Targeting the ID of you select tags

surreal sage
#

Doesn't change

#

a thing

boreal iron
#

The second ID tag doesn’t overwrite the first one

surreal sage
sharp saddle
#

I wanted the site to have different styles on different devices.
I made each one have a different background, but it doesn't work

#

Phone:

surreal sage
#

What's your code?

sharp saddle
#

wait lol

slender thistle
#

I wonder if those labels are doing anything in the first place

surreal sage
#

I'm also getting this error

boreal iron
#

They are the wrapper of the select element

sharp saddle
#

android.css:

body {
  background: grey;
  color: white;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}```
pc.css:
```css
body {
  background: #42445A;
  color: white;
  font-family: Arial, Helvetica, sans-serif;
}

html:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=Edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <title>TestSite</title>
  
  

  
  <link rel="stylesheet" href="/css/android.css" media="(min-width:320px)">
  <link rel="stylesheet" href="/css/pc.css" media="(min-width:1281px)">
   <link rel="stylesheet" href="/css/pc.css" media="(min-width:1025px)">
</head>

<body>
  <p>Nothing to see here...</p>
 
  <script src="main.js"></script>
</body>
</html>
slender thistle
#

You're using the media attribute wrong

boreal iron
#

Instead of working with different files use media queries to scale by screen size not user agent

sharp saddle
#

okeh

boreal iron
#

Oh lol I see

slender thistle
#

And for a note: as FakE said, it's better to refer to screen size as that's always present by the browser, as opposed to User-Agent, which is not what I'd consider a reliable source for such data

surreal sage
slender thistle
#

What does updateResults do?

surreal sage
#
function updateResults() {
                var current = "no";

                if (inputs.$ === "1") {
                    // Weekend on
                    current = "yes";

                    var childst = 0;
                    var oldert = 0;

                    childst = defaults[`${current}`][`${inputs["d2"]}`].child * parseInt(inputs.childs);
                    oldert = defaults[`${current}`][`${inputs["d2"]}`].older * parseInt(inputs.older);

                    var temp = childst + oldert; passInfo(temp.toString().replace('.', ','))
                } else {
                    // Weekend off
                    current = "no";

                    var childst = 0;
                    var oldert = 0;

                    childst = defaults[`${current}`][`${inputs["d2"]}`].child * parseInt(inputs.childs);
                    oldert = defaults[`${current}`][`${inputs["d2"]}`].older * parseInt(inputs.older);

                    var temp = childst + oldert; passInfo(temp.toString().replace('.', ','))
                }
            }```
#

kinda repeated code which i could've done way easier

#

error is under else {

#

childst = to be precise

slender thistle
#

Why all the string templates

surreal sage
#

sorry what

boreal iron
# sharp saddle okeh
@media only screen and (min-width: 1921px)
{
  body
  {
    ...
  }
}

@media only screen and (max-width: 1920px)
{
  body
  {
    ...
  }
}

@media only screen and (max-width: 960px), (hover: none)
{
  body
  {
    ...
  }
}

@media only screen and (max-width: 960px)
{
  body
  {
    ...
  }
}

@media only screen and (max-width: 480px)
{
  body
  {
    ...
  }
}

That's the scrren sizes how I scale

slender thistle
#

Template literals, sorry

surreal sage
#

don't know that one either

#

oh

slender thistle
#

The string within backticks

surreal sage
#

it doesn't have to be that

boreal iron
#

(hover: none) represents a device using TOUCH not a mouse

surreal sage
#

I'm used to doing that

slender thistle
#

Why are you stringifying them in the first place

surreal sage
#

in each bracket

slender thistle
#

I assume

defaults[`${current}`]

returns undefined

surreal sage
#

No it doesn't

#

Wait let me show you

boreal iron
#

What's the sense of using template strings if the value is a string already?

slender thistle
#

^

boreal iron
#

defaults[current][inputs["d2"]]

slender thistle
#

Most of the time you shouldn't stringify values you use as map/object properties

boreal iron
#

As seen in your code

#

current = "yes"; is yes or no

#

Which is already a string

#

No need to use template strings to stringify a string

surreal sage
boreal iron
#

That's like parseInt(3)

surreal sage
#

c my issue now?

#

the yes part works fine but the no part doesnt

#

I'm not a very experienced programmer

boreal iron
#

inputs.$ === "1" is one actually a string?

surreal sage
#

'also why are you making it a string if it is already'

#

aintt

#

1 is a value on selection

slender thistle
#

current = "no"

surreal sage
#

what's with it

slender thistle
#
let current = "no";
defaults[`${current}`]
#

Do you have no in your defaults?

surreal sage
boreal iron
#

nope he hasn't

surreal sage
#

i see my damn prob

#

none > no

boreal iron
#

STOP ADDING COMMAS TO THE LAST PROPERTY

#

ARRRRRRRRRRRRRRRRRRR

surreal sage
#

lmao

boreal iron
#

<a href="..." target="_blank">pew pew</a>

past geyser
#

And I checked view source target doesn't show up there

boreal iron
#

huh wut, lemme check

surreal sage
#

Ight my issue has been revolved expect for the css bootstrap thing.

I changed things during testing but didn't do the others because I wasn't doing that one yet.

past geyser
boreal iron
#

Yeah, works for me

past geyser
boreal iron
#

Would have wondered if not

past geyser
#

Check my bot

slender thistle
#

-bots 625673210729332736

#

k

surreal sage
#

I'd still appreciate a solution to the stupid bootstrap issue

past geyser
#

@boreal iron dmed

slender thistle
#

Are you having issues with the styling?

past geyser
#

Who me?@slender thistle

slender thistle
#

No

boreal iron
#

<a href="https://top.gg/" target="_blank">test link - shivaco sucks</a>

#

Opens a new tab

surreal sage
#

empty console

past geyser
#

Styling

boreal iron
#

gimme a second

slender thistle
#

It works for my server page

surreal sage
#

Ight figured out that I had to add form-control to the select class="custom select"

boreal iron
#

Yeah, can confirm

surreal sage
#

but

boreal iron
#

target option been removed

boreal iron
#

Works in preview but not after saving your code.

slender thistle
slender thistle
boreal iron
#

Must be some of the new features

slender thistle
#

@modern sable is this intended behavior?

surreal sage
#

form-select ight

modern sable
#

I think JS isnt being filtered out in the preview but is in the actual page

#

might be why

#

not sure tho

surreal sage
boreal iron
#

not needed to share the link as it won't work for us anyways

surreal sage
#

lmao dns cache ig

boreal iron
#

nope, the content security policy will block your inline scripts

#

on any "modern" browser

surreal sage
#

that's funny af

#

edge works fine

boreal iron
#

lol

#

nobody counts edge as browser

#

It's an accident, a happy little accident

surreal sage
#

<script src""></script> right

eternal elbow
#

@boreal iron Can I preview more than one server at a time ? Rate Limit

past geyser
#

Any other way?

boreal iron
#

I didn't see any note about special rate limiting this ressource, means global rate limits are in place

past geyser
#

Of opening in new tab

boreal iron
#

wut heh

#

Errr... no there's no other way then

past geyser
#

Oof

boreal iron
#

JS will be thrown out as well

slender thistle
eternal elbow
boreal iron
#

? global rate limits allow... what 60 requests / min

#

idk

#

take a look on the dev page

eternal elbow
#

Okki thanks

boreal iron
#

All bots can make up to 50 requests per second to our API. This is independent of any individual rate limit on a route. If your bot gets big enough, based on its functionality, it may be impossible to stay below 50 requests per second during normal operations.

#

just a little bit more than 60/min

#

but I was close

eternal elbow
#

I fetch 9 guild in one time

#

how

#

Oh right

boreal iron
#

?

eternal elbow
#

The last part is not talking to myself

boreal iron
#

If you wanna fetch 9, create a loop or better a function of your API request using the guild ID as parameter

#

boom call the function in your loop or 9 times per hand

earnest phoenix
#

how do we upload websites to our topgg page?

eternal elbow
boreal iron
cobalt spruce
#

err

C:\Users\Islam\Desktop\Eqtron V2\index.js:24
client.handleEvents(eventFiles, "./src/events");
       ^
TypeError: client.handleEvents is not a function

full code handleevents ```js
module.exports = (client) => {
client.handleEvents = async (eventFiles, path) => {
for (const file of eventFiles) {
const event = require(../events/${file});
if (event.once) {
client.once(event.name, (...args) => event.execute(...args, client));
} else {
client.on(event.name, (...args) => event.execute(...args, client));
}
}
};
};

#

anyone

earnest phoenix
#

the file that sets the handleEvents method is being imported and run after you try to use the method

errant flax
#

@drowsy crag

cobalt spruce
#

bruh

earnest phoenix
#

you're running client.handleEvents before you set it as a function

rose warren
#

Ty

earnest phoenix
#

you're welcome Mac

earnest phoenix
#

set the function before you run it

cobalt spruce
earnest phoenix
#

whats to think about that

#

@drowsy crag

cobalt spruce
boreal iron
#

He means did you import your module before using it?

past geyser
boreal iron
#
fuckThis()

function fuckThis() {}

Will log your error

boreal iron
boreal iron
#

He means did you import your module before using it?

past geyser
errant flax
#

guys which one is better?

first pic:
loc: US
second pic:
loc: Germany

cobalt spruce
errant flax
cobalt spruce
errant flax
#

so second pic?

past geyser
#

Yes

cobalt spruce
#

this

past geyser
#

More memory more disk

#

Choose second

#

More memory and disk is better

earnest phoenix
#

Do you have any experience with the language you are using, even basic knowledge ?

past geyser
errant flax
#

well my bot runs around 100mb+ memory

limber mica
#

Prove to me mongo DB is better than PostgreSQL

errant flax
limber mica
#

Because mongo sucks

earnest phoenix
#

If you lack the basics please learn them

boreal iron
earnest phoenix
#

This is a fairly simple issue to resolve

boreal iron
#

(your event module)

errant flax
limber mica
#

TIL that dyno discord bot is a terminal application, and 2 that dyno discord bot runs off of mongo

errant flax
past geyser
#

Pic*

limber mica
#

i managed to get my hands on the dyno discord bot V4 source code

errant flax
#

imagine using v12 topggSmirk

earnest phoenix
#

you are still using nodejs v12

past geyser
limber mica
#

Imaging not using eris

cobalt spruce
limber mica
#

OMG

boreal iron
#

Prove to me mongo DB is better than PostgreSQL

Well all this depends on your needs, document based or table (relational) based database

past geyser
#

Scam scam scam

limber mica
#

Eris is god

cobalt spruce
errant flax
#

not nodejs v12

cobalt spruce
earnest phoenix
#

I see

errant flax
#

either way bad

limber mica
#

I found the code that starts dyno

#
async function init() {
    log(logo, '\n');
    log(`Starting [${env} ${config.pkg.version}]`);

    if (env === 'production') {
        return Promise.resolve();
    }

    try {
        log(`Packages:`);
        await listPackages();
    } catch (err) {}

    try {
        log(`Repo:`);
        await gitInfo();
    } catch (err) {}

    return Promise.resolve();
}

errant flax
limber mica
#

:)

cobalt spruce
limber mica
#

Nope thats it

earnest phoenix
#

No one would make something so useless

limber mica
#

Here, ill dm you the whole start file

#

i found it on github

earnest phoenix
#

Im good

limber mica
#

idk

errant flax
#

dyno?

limber mica
#

its called init so i guess thats to start dyno

errant flax
#

u mean the bot or something else

limber mica
#

the bot

#

I found the source code

#

on github

#

it got leaked apparently

earnest phoenix
#

dyno isn't even open source last I heard

errant flax
#

say what

limber mica
#

yep

errant flax
earnest phoenix
#

its not actually dynos code I can bet that much

limber mica
#

Its actually cool

limber mica
#

it has the docker file and env and all the cool stuff

errant flax
#

tbh why clone an already popular discord bot

limber mica
#

im not

#

im just getting ideas

#

(Also getting some cool NPM packages)

earnest phoenix
#

Even if it is dynos code it is probably old

limber mica
limber mica
#

so yeah, its old

#

But its still cool

cobalt spruce
earnest phoenix
#

still a big if tho

limber mica
#

Ewww

#

I found if statement hell

#
    if (process.env.hasOwnProperty('awaitReady')) {
        options.awaitReady = process.env.awaitReady;
    }

    if (process.env.shardId) {
        options.shardId = parseInt(process.env.shardId, 10);
    }

    if (process.env.clusterId) {
        options.clusterId = parseInt(process.env.clusterId, 10);
    }

    if (process.env.shardCount) {
        options.shardCount = parseInt(process.env.shardCount, 10);
    }

    if (process.env.clusterCount) {
        options.clusterCount = parseInt(process.env.clusterCount, 10);
    }

    if (process.env.firstShardId) {
        options.firstShardId = process.env.firstShardId ? parseInt(process.env.firstShardId, 10) : null;
        options.lastShardId = process.env.lastShardId ? parseInt(process.env.lastShardId, 10) : null;
    }
#

.......

#

If satement hellscape

#

there is more too

boreal iron
spark flint
#

How do I package a module to publish on Pypi

boreal iron
limber mica
#

hmmmm

#

Dyno has some interesting admin commands

earnest phoenix
#

I honestly doubt it's even dynos code even if it's old

limber mica
earnest phoenix
#

It's probably just some random guy claiming it

limber mica
#

If the devs confirrmed it. its kinda true.

marble juniper
#

lol

#

using a for loop and stuff

limber mica
#

thats not my code