#development

1 messages · Page 1577 of 1

delicate zephyr
#

Oh wait

#

Hold the fucking phone

quartz kindle
#

ofc you can

delicate zephyr
#

bot offline status = still send messages

#

nani defuq

quartz kindle
#

rest and gateway are independent

delicate zephyr
#

Yea

#

but it said you have to identify atleast once

quartz kindle
#

wut

delicate zephyr
#

on the docs

quartz kindle
#

at least once based on what?

delicate zephyr
#

thats what im curious about

quartz kindle
#

could be at least once ever since you first created the application

delicate zephyr
#

how long do I have until I cant send messages again

#

hmm

#

microservice fun time coming pog

quartz kindle
#

basically to prevent you from creating accounts and immediately posting i guess

delicate zephyr
#

ah yea

#

thats fair

#

Im mosting thinking

#

because I can make things that aren't 100% gateway dependent into microservices

quartz kindle
#

ye

opal plank
#

so, 15 seconds?

quartz kindle
#

i mean

#

your main bot is still gonna be online eitherway no?

opal plank
#

presences updates every 15 secs

quartz kindle
#

so it doesnt really matter

delicate zephyr
#

nah i just checked Erwin

#

can still send messages

delicate zephyr
opal plank
#

thats odd design but okey

delicate zephyr
#

reminders are kinda non-gateway dependant

quartz kindle
#

ye

delicate zephyr
#

and if they can still be sent during downtime

#

its nice to have the reminders still working

#

if you get my drift

quartz kindle
#

ye

opal plank
#

imagine seeing the bot offline and it miracuriously sends messages

delicate zephyr
#

"HOW JUST HOW"

#

uh yes

#

also

#

i just realised

opal plank
#

NOTHING works, JUST the reminders

delicate zephyr
#

the only thing that should fuck me

#

is cloudflare bans

#

but Im gonna handle those

#

because yes

opal plank
#

sounds like a ratelimiting issue

delicate zephyr
#

yea

#

uh

#

Discord.js's bug

#

with gateway/bot

#

uh

quartz kindle
#

are you sending a gazillion reminders concurrently?

delicate zephyr
#

got chip ratelimited

#

HEAVILY

delicate zephyr
#

gonna be pumping money into it

#

auctions™️

quartz kindle
#

xD

delicate zephyr
#

I dont wanna hit stupid amount of guilds and be like "Dumpster fire initiate"

tribal siren
#

lmao

delicate zephyr
#

i already have rolling restarts and everything

#

so

zenith terrace
#
.addField('bla bla bla', 'bla bla bla')```

How to trigger erwin, embed builders
quartz kindle
#

lmao

tribal siren
#

maybe add new?

#

or idk

zenith terrace
#

O

#

Yea

#

New

delicate zephyr
zenith terrace
#

Idc

delicate zephyr
#

and yes

#

you need new

zenith terrace
#

Leave me alone its 3am

#

:(

delicate zephyr
#

same

#

I feel ur pain

tribal siren
#

brhuh

delicate zephyr
#

Im at work tho

#

Im being paid

tribal siren
#

noice

zenith terrace
delicate zephyr
#

{title: "yes"}

zenith terrace
#

Love you too Erwin

delicate zephyr
#

its fucking easy

#

to manually build your embeds

zenith terrace
#

❤️

delicate zephyr
#

saying that

#

(I built my own embed builder)

#

so I cant say much

delicate zephyr
opal plank
#

embed builder is the equivalent of the is-undefined pakcage

#

something simple, that you can do in one line, that you decide to rely on something thats bloated

delicate zephyr
#

I mean thats fair

tribal siren
#

that's why i hate builders too

delicate zephyr
#

but when you're doing it 400 times and shit it gets annoying typing the whole thing out

zenith terrace
#

I am now learning that console.time & timeEnd are a thing

tribal siren
#

i think there's also such stuff as console.error

zenith terrace
#

I know that one lol

tribal siren
opal plank
delicate zephyr
#

I mean, autocomplete

zenith terrace
#

writing*

delicate zephyr
zenith terrace
tribal siren
opal plank
#
message.channel.send({embed: {title: 'test', description: 'something'}});

//vs

const { MessageEmbed } = require('discord.js');
let embed = new MessageEmbed().setDescription('title')
  .setTitle('test');
message.channel.send(embed)

Which one is shorter luke?

delicate zephyr
#

See yea

#

but thing is erwin

#

hold on

zenith terrace
#

@opal plank not pog, didnt add Tims special bla bla bla

delicate zephyr
#

building embeds like this

#

get annoying

#

can you see how picking embed templates works?

zenith terrace
#

H

opal plank
#

how is that annoying at all?

delicate zephyr
#

like storing premade embeds in an object

crimson vapor
#

hi Erwin and Luke

opal plank
#

how is it different than making a function?

delicate zephyr
#

it just gets annoying on one line

#

plus its just pain

zenith terrace
#

Wow no hello to me?

delicate zephyr
#

i find it easier to read the constructor functions

crimson vapor
#

I don't see why its an issue

delicate zephyr
#

100x slower

crimson vapor
#

for send message functions its better to just use embed objects

#

but its fine for other things

#

imo

delicate zephyr
#

erwin I meant

#

client.embeds.thing = {}

#

how would selecting from that fair

#

and then just updating the values in the template

opal plank
#
function getDescription(input:string, output = ''):MessageEmbed.description {
return `***Git input***\n${input}\n***Git Output***\n${output}`.slice(0,1990)
}
#

there

crimson vapor
#

also Erwin which file was the one you hated the most?

opal plank
#

no constructors

#

no useless functions

#

no classes

#

no bullshit

#

no bloating

delicate zephyr
#

Erwin

opal plank
delicate zephyr
#

did you see what I just sent

opal plank
#

i did, just didnt understand it

delicate zephyr
#

So

#

you have the constructors which i understand the dislike of

#

but

opal plank
#

and classes

#

and tons of methods

#

but go ahead

mellow kelp
#

i'm on team luke coolflushed

#

i use embed constructors

#

it's just a lot more readable to me

delicate zephyr
#
let embeds = {
  a: {}
}

const embed = Object.create(embeds.a).description = 'f'

send(embed)
#

how would that fair

opal plank
#

huh?

delicate zephyr
#

time wise

mellow kelp
#

i don't have any performance issues either

delicate zephyr
#

using premade object templates

#

rather than calling new every time

opal plank
#

not as bad

delicate zephyr
#

and updating the data as it comes

#

I was wondering if you could test

opal plank
#

let me run some tests rq, the issue would be having to clear the object everytime, if you want to re-use it

crimson vapor
#

bro what are you on about

#

both of you

delicate zephyr
#

Object.create() works tho right?

#

@crimson vapor finding faster methods than new Embed

opal plank
#

i assume luke wants to attach a single object onto client

crimson vapor
#

ah

opal plank
#

and re-use it across commands

crimson vapor
#

just create functions

#

that has scoped objects

delicate zephyr
#

thats why Object.create() comes in since it makes a new instance of the object in memory

crimson vapor
#

then best of both worlds

delicate zephyr
#

and then it gets gc'd at the end of the scope

opal plank
#

let me test it rq

delicate zephyr
crimson vapor
#

Erwin I "removed" the embed builders from my code

delicate zephyr
#

functions are just annoying to me

crimson vapor
#

I don't mind the functions

delicate zephyr
#

I wanna be able to manipulate it within the scope

crimson vapor
#

especially they way the library is setup

delicate zephyr
#

rather than making a function everytime

crimson vapor
#

if you want to manipulate it more, just do it manually

#

but for standard shit use standard functions

delicate zephyr
#

I want templates

#

because of the way my embeds work

crimson vapor
#

hmm

delicate zephyr
#

hence why I asked if Erwin could test this

#

cause if its any faster I have an easy way of implementing it

crimson vapor
#

ah

#

Hi Tim

quartz kindle
#

beware that Object.create does not deep clone

delicate zephyr
#

yes discord dont reply to the message like I told you to

delicate zephyr
quartz kindle
#

nested objects will not be copied

#

so you will have leftovers from previous embeds

#

and embeds altering each other's values

delicate zephyr
#

example?

#

legit just wanna learn

quartz kindle
delicate zephyr
#

oh

#

Yea that should be fine

#

Considering the nested objects will likely always be the preset

quartz kindle
#

depends

delicate zephyr
#

I mostly change description

#

like 100% of the time

#

only thing I see becoming an issue would be the footer

quartz kindle
#

also, object.create adds the argument to the prototype

#

which is kinda not what you want

delicate zephyr
#

isnt there a way to do it

quartz kindle
#

better to use object.assign

delicate zephyr
#

hmm

quartz kindle
#

if you want deep cloning, the only way is JSON

delicate zephyr
#

Object -> JSON -> New Object?

quartz kindle
#

ye

delicate zephyr
#

@opal plank ^^ check how long that would add

quartz kindle
#

thats the only way to fully copy an object

delicate zephyr
#

im genuinely curious

quartz kindle
#

its slow

delicate zephyr
#

If thats faster than new Embed i'd be surprised

quartz kindle
#

same

delicate zephyr
#

We're back at it again

#

testing random shit

quartz kindle
#

xD

delicate zephyr
#

honestly

#

we could make a youtube series out of half the shit we do

opal plank
#

urs is by far the worst

delicate zephyr
opal plank
#

today we learned

delicate zephyr
#

I mean tbh, I'll take 300ms for just personal preference

opal plank
#

might switch that to my current n.tag embed builder bad tag

delicate zephyr
#

I get the performance aspect

#

but

#

eh

#

maybe™️

#

I'll think about it

opal plank
#

cleaner, shorter, more performant

#

¯_(ツ)_/¯

delicate zephyr
#

Like i said

#

personal pref

opal plank
#

ik

#

but still, cleaner, shorter, more performant

delicate zephyr
#

i might go round and just change them all eventually

#

not hard to do

#

just easier atm

opal plank
#

should be super easy

delicate zephyr
#

I dont like writing object manually

#

becomes a pain for me after a while

simple nexus
#

what can the node-canvas show squares instead of the font?

delicate zephyr
#

its not something I cant change down the line anyway

opal plank
#

i need to always choose the more performant way

#

cuz scaling

delicate zephyr
#

yea

#

thats fair

quartz kindle
#

object cloning has always been a pain in js

#

i pretty sure a recursive function to copy primitives is faster than JSON

#

try this

opal plank
#

tim be legit writing for the past 10 minutes

#

kinda scared

quartz kindle
#

im trying to thing this through

#

wait

delicate zephyr
#

mans about to send a file instead of a message

quartz kindle
#

fuck brb

opal plank
#

careful with the 2k limit tim

delicate zephyr
opal plank
#

why are we so good at procrastinating and not at other stuff?

delicate zephyr
#

Because we're developers

quartz kindle
#

there

#
function copy(obj) {
  const handle = (x, target) => {
    for(let [key, value] of Object.entries(x)) {
      if(typeof value === "object") {
        target[key] = {};
        handle(value, target[key]);
      } else {
        target[key] = value;
      }
    }
    return target;
  }
  return handle(obj, {});
}
#

try this vs the JSON method

opal plank
#

@delicate zephyr u try it

#

imma head to bed

delicate zephyr
#

Ok uno momento

opal plank
#
let embed = {};
    function varEmbed() {
      let embed = { embed: { description: 'hi' } };
      return embed;
    }
    function embedBuilder() {
      let embed = new MessageEmbed();
      embed.setDescription('hi');
      return embed;
    }
    function createEmbed() {
      let obj = JSON.parse(JSON.stringify(embed));
      obj.description = 'hi';
      return obj;
    }
    function rawEmbed() {
      return { embed: { description: 'hi' } };
    }
    let times = 1000000;
    console.time('var embed');
    for (let i = 0; i < times; i++) {
      varEmbed();
    }
    console.timeEnd('var embed');
    console.time('embed buider');
    for (let i = 0; i < times; i++) {
      embedBuilder();
    }
    console.timeEnd('embed buider');

    console.time('createEmbed');
    for (let i = 0; i < times; i++) {
      createEmbed();
    }
    console.timeEnd('createEmbed');

    console.time('raw embed');
    for (let i = 0; i < times; i++) {
      rawEmbed();
    }
    console.timeEnd('raw embed');```
#

stack ontop of that

delicate zephyr
#

kek thanks

opal plank
#

For Gondor, and for not using embed builders anymore

solemn leaf
#

what

delicate zephyr
#

I dont wanna npm install discord.js

#

because documents folder

quartz kindle
#

i win

opal plank
#

i rest my case

quartz kindle
#

deep cloning done right

delicate zephyr
#

pog

#

thanks for that Tim

quartz kindle
#

can look into microoptimizing it further

opal plank
#

be sure to post whole snippet along

quartz kindle
#

but now time for bed

opal plank
#

for a world without embed builders

#

but tomorrow

#

im tired

delicate zephyr
#

@opal plank i didn't use embed builder

#

because documents folder

opal plank
#

du it

#

whole thing

#

all of em

dusky sundial
#

How does one not stay up until 5am?

opal plank
#

the one snippet to rule them all

delicate zephyr
#

im going to sleep

quartz kindle
#

shush its 4am

delicate zephyr
#

im on laptop

quartz kindle
#

its good enough

delicate zephyr
opal plank
#

why am i mixing LOTR with coding jokes?

delicate zephyr
#

yes

opal plank
#

🤔

delicate zephyr
#

because programming

opal plank
#

fair point

#

none of us are sane anyway

#

wel,, anyhow, good night fellas

quartz kindle
#

kthxbye fui

delicate zephyr
#

gn lads

crimson vapor
#

what did you guys get from all that time and effort?

opaque cipher
#

i am brasileiro

#

I do not speak english very well

#

but can someone explain to me what happened to the bot?

pale vessel
#

What bot?

earnest phoenix
#
let menu = new Discord.MessageEmbed()
      .setTitle("Special Moves")
      .setColor("#cb00ff")
      .setDescription("Pick the number of the move you want to use and send it here.")
      .addField("[1] Charge", "Usable: ✅ (Always)");
      acted.bey.specials.forEach(async move => {
        let usable = false;
        try{
          usable = await move.requires(acted, victim, logger);
        }catch(err){
          console.error(err);
          usable = false;
        }
        let emj = "❌";
        if(usable){
          emj = "✅";
          reqmet.push(acted.bey.specials.indexOf(move)+2);
        }
        menu.addField(`[${acted.bey.specials.indexOf(move)+2}] ${move.name}`, `Usable: ${emj}`);
        console.log(move.name);
      });
      dmchannel.createMessage({embed: menu})
``` I don't know if it's just me being dumb but the fields after `[1] Charge` aren't getting added. If someone can help me solve this it will be much appreciated.
#

also dont ask why am i using djs' embed builder for eris

#

console.log(move.name) works, its just that the embed isnt getting updated

hallow shell
#

it might help if you disable async, idk

earnest phoenix
#

i need async for the await

hallow shell
#

try .then

earnest phoenix
#

alr ill try it

hallow shell
#

wait

earnest phoenix
#

uh ok

hallow shell
#

are you sure that it's actually running the code?

earnest phoenix
#

uh yes?

hallow shell
#

it could be just skipping over the for each

#

is what i mean

earnest phoenix
#

the console.log that the bottom works

hallow shell
#

oh ok good sorry

earnest phoenix
#

its fine

hallow shell
#

maybe you could try using forEachSync

earnest phoenix
#

removing async works, thanks a million!

hallow shell
#

i've heard that's a thing

#

oh, cool!

hallow shell
#

ohhh i was trying to use error.trace and kept getting undefined

#

k thx 👍

fluid rampart
#

hi

earnest phoenix
twilit rapids
#

Track your growth per week, do some fancy maths based of that and stonks

opal plank
#

i figured it out lol

#

but i dont like the thought of having to make a new panel for it

#

cuz you cant reallocate buttons

twilit rapids
#

I made a separate dashboard for it

opal plank
#

variables are annoying

#

i'll probably feed the bot some pre determined tresholds and query it

#

to display it in panels

#

unless i figure out a way to move those buttons around

delicate zephyr
#

@opal plank sleep bonk

delicate zephyr
#

im at work

twilit rapids
#

This is my query btw
SELECT ($Goal - last("servers")) / (last("servers") - first("servers")) * 7 * 86400000 FROM "total" WHERE ("host" = 'chip' AND "time" > Now() -1w) fill(previous)

#

You can make it more accurate by basing it of monthly growth I suppose

delicate zephyr
#

timo

#

140k today?

twilit rapids
#

probbaly

delicate zephyr
#

pog

twilit rapids
opal plank
#

this would work too

#

rate()

#

actually, lets see if my query works

#

@delicate zephyr u too

#

let me try with weekly rates instead, today i had a lot of joins

#

there we go

#

avrage 53 servers per day, would take 5.6 days to get to 2k servers

#

i cant set an input, but there you have it

delicate zephyr
#

pog

tribal siren
#

53 servers per day?

#

seems like something cosmic for me

opal plank
#

?

#

🤔

tribal siren
#

0-1

#

about 0 servers

opal plank
#

when you said cosmetic i thought you were gaining a lot more

#

like, thats just change for me

delicate zephyr
#

he said cosmic

opal plank
#

nonono

#

i read it cosmetic

delicate zephyr
#

oh lmfao

opal plank
#

blaming it on the sleep

delicate zephyr
#

idk why i cant sleep

opal plank
#

werent you working?

delicate zephyr
#

i am

#

but i wanna sleep

#

so I can play vr

#

without having to nap

tired panther
#

xD

severe cedar
#

So I am making a buy command for my bot and I used a function as my buy thing I guess but whenever I try to use it to buy an item it says: Command raised an exception: NameError: name 'update_bank' is not defined even doe update_bank is a function. Help?
buy_this function: https://srcb.in/ZIE3aGawTw
update_bank function: https://srcb.in/7F7bAO9Bmq
Command: https://srcb.in/yQKegUubvX
PS: This is in a cog so no solutions that work only in the bots main file.

severe cedar
#

thanks

earnest phoenix
#

hey, how can you directly redirect to your website of the bot, like MEE6 does it on their entry?

#

I mean is it allowed as for normal users?

twilit rapids
#

That's an ad spot, not their actually bot card

#

You can click the advertise tab on the website to learn more about that

#

But basically that's a paid ad

summer acorn
#

#development message

manager.on('shardCreate', shard => {
            console.log(`Launched shard ${shard.id}`);
        });
        manager.spawn('auto', 5500, -1).then(() => manager.broadcast("All Shards Ready"));

got the error again when updating my bottum, @summer torrent :sad:

summer torrent
#

🤔

tired panther
summer torrent
#

it is correct

#

click that message link

tired panther
summer acorn
#

yes it's supposed to be mongodb://mongo

earnest phoenix
#

Can anyone tell me how to add a database for economy commands?

tired panther
summer acorn
#

it shouldn't

earnest phoenix
tired panther
#

okay perfect

#

Do you wanna use mongoose?

earnest phoenix
#

What is mongoose?

#

idk about it

golden condor
#

mongoose is a mongodb wrapper

summer acorn
#

I always connect with mongoose in the bot file because it's required for me to connect it before I start the process of starting the whole bot

earnest phoenix
#

i want to add with quick.db

golden condor
#

to let you use mongo db database

tired panther
earnest phoenix
#

I want add with quick.db

tired panther
tired panther
#

In mongoose you can search after every value

earnest phoenix
#

Oh

#

Iam a beginner

tired panther
earnest phoenix
#

For beginners quick db is best know

golden condor
#

you can use quick.db

earnest phoenix
golden condor
#

nothing wrong with it

tired panther
golden condor
#

how-

tired panther
golden condor
#

how is quick.db complicated

summer acorn
marble juniper
earnest phoenix
golden condor
#

no it isn't

earnest phoenix
marble juniper
#

lol

golden condor
#

it really isn't

marble juniper
#

quickmongo is even easier

#

lol

summer acorn
#

it is, Callum, it's like using a json db

#

the most simple thing to understand

golden condor
#

man

#

if he is just starting coding

#

isn't the best thing to start with

marble juniper
#

try this

#

easy to understand

#

and easy to use

#

lol

golden condor
#

quick.db is easier as it doesn't require you to make a mongodb cluster

tired panther
golden condor
#

plus it has great support

marble juniper
#

lol

#

also quickdb was updated many months ago

golden condor
#
const db = require('quick.db');

// Setting an object in the database:
db.set('userInfo', { difficulty: 'Easy' })
// -> { difficulty: 'Easy' }

// Pushing an element to an array (that doesn't exist yet) in an object:
db.push('userInfo.items', 'Sword')
// -> { difficulty: 'Easy', items: ['Sword'] }

// Adding to a number (that doesn't exist yet) in an object:
db.add('userInfo.balance', 500)
// -> { difficulty: 'Easy', items: ['Sword'], balance: 500 }

// Repeating previous examples:
db.push('userInfo.items', 'Watch')
// -> { difficulty: 'Easy', items: ['Sword', 'Watch'], balance: 500 }
db.add('userInfo.balance', 500)
// -> { difficulty: 'Easy', items: ['Sword', 'Watch'], balance: 1000 }

// Fetching individual properties
db.get('userInfo.balance') // -> 1000
db.get('userInfo.items') // -> ['Sword', 'Watch']

// Showing dot notation setting
db.set('userInfo.difficulty', 'Hard')
// -> { difficulty: 'Hard', items: ['Sword', 'Watch'], balance: 1000 }

db.get('userInfo.difficulty') // -> 'Hard'```easy
marble juniper
#

quickmongo is being updated more

#

lol

golden condor
#

that's because sqlite doesn't need updating

#

but mongodb does

marble juniper
#

yeah whatever

#

installing quick.db is a pain though

golden condor
#

not really

marble juniper
#

it never worked when I tryed to install it on the vps

golden condor
#

just have to have a system that isn't fucked up 🙂

marble juniper
#

lol

#

no

#

it didn't work on 2 vps

#

sometimes not even my own pc

golden condor
#

contabo?

marble juniper
#

lol

marble juniper
golden condor
#

contabo is crap

marble juniper
#

I don't even use contabo

#

anymore

golden condor
#

their ddos protection is god awful

marble juniper
#

im using ravy's dedi

golden condor
#

ik

marble juniper
#

lol

modest maple
#

Cloudflare™️

marble juniper
#

and ravy is using galaxy gate

#

at least atm

golden condor
marble juniper
#

yes

modest maple
#

just doesnt expose your IP lol

marble juniper
#

lol

modest maple
marble juniper
#

my ip was not exposed in any kind of site

golden condor
#

cloudflare proxies aren't as secure as you think

#

My vps IP was exposed despite using cloudflare proxies

modest maple
#

pithink I think they are as secure as i think

lament rock
#

proxy all your traffic through China /s

marble juniper
#

China's great firewall

blazing portal
#

Just don't have people that want to ddos you weirdsip

modest maple
#

Just send it all to the goverment mmLol

#

also that

golden condor
#

route direct ip to return 444, 521 or 522

#

and you'll be fine

marble juniper
#

just get a trillion ipv4 ips

#

lol

modest maple
#

that is sadly impossible now

lament rock
#

just don't accept inbound traffic

golden condor
modest maple
#

normally you can only get a couple ipv4's now blobpain

marble juniper
#

I mean groovy has more than a million ipv4 ips

#

quite litterally

golden condor
#

bruh just use ipv6 block

#

if you need it for music

marble juniper
#

lol

lament rock
#

ipv6 gets filtered more aggressively by YT

marble juniper
#

yes

golden condor
#

I have a /64 block which has too many ips

modest maple
#

They get banned by the 64 block

lament rock
#

entire blocks can be banned very quickly

#

/48 is better for YT

marble juniper
#

yes

golden condor
#

My vps comes with a /64 so I just use it

marble juniper
#

yt and ip banning ffs

modest maple
#

thats the same as using a ipv4 callum to YT

marble juniper
#

they probably ban a million ips every hour

golden condor
#

haven't been rate limited

marble juniper
#

lol

modest maple
marble juniper
#

oh no

#

anyways

modest maple
#

the roll out of Wasm based players and ciphers will kill everything at once

marble juniper
#

lol

golden condor
#

i've used /64 before and I've never had a problem with lavalink rate limiting

lament rock
#

Having multiple servers to balance your traffic is superior. It has the added benefit of allowing you to stream to proper voice regions

#

Probably because your traffic is low enough

golden condor
#

if it gets to the point where I am rate limited, I'll stop using my vps's block and just use tunnelbroker

modest maple
#

or just dont make a music bot mmLol

marble juniper
#

just buy a million ipv4 addresses like groovy lol ez fix lmao bruh

#

jk

lament rock
#

music bot worst mistake of my dev career

marble juniper
lament rock
#

I could have been generic and made some mod bot and called it a day, but no

modest maple
# marble juniper what would that even do

The binary section would firstly take out every scraper on them for probably a good few months before even getting onto the fact that they can then make their ciphers alot more cryptic

lament rock
#

3 years of maintenance for what BocchiHands

marble juniper
lament rock
#

Yikes.

marble juniper
lament rock
#

Image classification is kind of hit or miss

marble juniper
#

ye

#

kinda

#

but

#

it works ig

lament rock
#

until you photoshop Luigi's face onto an anime girl

marble juniper
#

people seem to like it based on the reviews I got

eternal osprey
#

hey

#

so my question is kinda strange. I am 17, i have one year left at my highschool. I am actually going to a university next year. I was thinking about studying computer science / software engineering. I now have to ask a programmer question about the study and need to interview the person (just text). Is there anyone that could help?

summer acorn
#

my bot seems to be having an unavailable guild :sad: @summer torrent @tired panther

summer torrent
#

😳

summer acorn
#

that seems to be the reason it's not able to launch the shards

misty sigil
#

just make it available

summer acorn
#

and how would I do that

misty sigil
#

no idea figure it out

spiral crag
#

hey guys, i wanna verify my discord bot and i am 14 so i tried using my international student id card for verification but it says my documents are invalid

#

what should i do

summer acorn
#

they don't accept student id cards

zenith terrace
misty sigil
#

I know

summer acorn
#

they accept passports and other identity documents that you would be able to use to board a plane

spiral crag
summer acorn
#

yes

#

Discord doesn't even get access to the picture

#

they only get to look at it if you're appealing a ban for being underage

#

but still then

#

you should still cover your personal id

spiral crag
#

is there a minimum age

#

or something

misty sigil
#

13/discord age in your country

summer acorn
#

which in Norway at least is your birthdate and then 5 random numbers

spiral crag
#

i am 14 so i guess age shouldn't be a problem

summer acorn
#

birthdate being like e.g. 100200

#

that number meaning you were born 10th of February 2000

#

make sure to cover it with a piece of paper just to feel more comfortable with showing your passport

#

since they can't do any identity theft without your personal id

spiral crag
#

k thanks!

summer acorn
#

it's the same as earlier

#

but I am more certain it's an unavailable guild

#

since no matter what I do, remove, add, rearrange, etc.

#

the issue remains the same

gloomy mountain
#

npm init command doesn't work in my command prompt path. any suggestions

misty sigil
#

what doesn’t work

earnest phoenix
#

Hey what i have to give in

message.channel.send(????)
db.get(`balance.${user.id}`)
}```
cinder patio
elder oxide
#

@library

#

what

#

is

misty sigil
#

@sinful belfry stinky ads

#

aw they’ve been got

sinful belfry
rustic nova
#

Yeah got it peepoHappy

sinful belfry
#

hope too quick pogey

misty sigil
#

hope be going

zenith terrace
steel arch
#

How do i delay the response of the bot?

tired panther
summer acorn
#

skellton code??

tired panther
summer acorn
#

that is what I am already doing

tired panther
summer acorn
#

I can't do that

#

if I do that, it won't function like normal

tired panther
#
const { token, prefix , mongourl} = require('./config.json');  
const Discord = require('discord.js-light');

const manager = new Discord.ShardingManager('./bot.js', { token: token });

 manager.on('shardCreate', shard => console.log(`Launched shard ${shard.id}`));
manager.spawn(undefined, 400, -1)
``` just this
summer acorn
#

and besides, it doesn't change anything anyway

tired panther
summer acorn
#

I just tried it locally

#

and I use normal djs, not djs-light

tired panther
tired panther
summer acorn
#

nearly 4k

tired panther
#

but why does it work by me lol?

summer acorn
#

most likely, it's an unavailable guild

tired panther
tired panther
earnest phoenix
#

@earnest phoenix

summer acorn
tired panther
summer acorn
#

yes

#

it does

tired panther
#

client did not get ready?

summer acorn
tired panther
#

maybe your device (connection is to slow)

tired panther
earnest phoenix
#

Hmm

summer acorn
#

that is not the case

#

I can run the test bot

tired panther
#

and does the test bot work ?

#

probably yes

summer acorn
#

[WS => Manager] Exceeded identify threshold. Will attempt a connection in 76851646ms

#

I think that might be an issue

#

oh, looks like it apparently got ratelimited for a day

#

bruh why

tired panther
tired panther
summer acorn
#

bruh

#

it got ratelimited for a day like 3 hours ago

#

which was when the issue occurred

#
  • when it started happening
#

I hadn't been logging in that much before that

earnest phoenix
#

Hey

#

Anyone got any ideas

tired panther
earnest phoenix
#

Also my bot has an error with the currency

#

When the bot is reset it resets currency

summer acorn
tired panther
restive furnace
#

smh

#

send it hee

tired panther
#

lol

midnight spoke
#

How I can fix this ?

quartz kindle
#

bot is undefined

midnight spoke
spiral crag
#

@summer acorn hey i used my passport as you said but i blurred out my passport number but it says i should show the full document

summer acorn
#

don't blur

#

just put a piece of paper on your personal id

spiral crag
#

ok

summer acorn
#

and make sure it doesn't cover anything other than your personal id

spiral crag
#

@summer acorn i tried that as well but it says show the full document

summer acorn
#

then you must be doing something wrong

#

you'll have to show the full page but you don't need to show your personal id

signal summit
#

I had struggle verifying my id with the stripe website as well

#

It'll take some good amount of attempts until it finally verifies your document. Just make sure you follow the steps properly.

lyric mountain
stable eagle
#

@earnest phoenix What database do you use?

#

Json? Please not.

modest maple
#

I only use JSON BlobThinking Its the fastest

misty sigil
#

json sped and powr

stable eagle
#

i use my brain as my database.

near stratus
#

Okay I know it's silly but
When I apply for bot verification (It asks for my passport) Does the DOB have to be the same on with Discord ?
cuz when I started Discord I was 2 months behind of turning 18 and I set my DOB to 2 months later and I was 18.
Now after 2 years Discord wants me to verify my Identity and my DOB is not matching. Should I apply anyway ?

misty sigil
#

It should be fine

#

really

modest maple
misty sigil
#

you don’t have to edit

#

if you’ve got roles

umbral zealot
#

I didn't do it to try to bypass the invite filter Matt, just because I mistyped 😛

misty sigil
#

oh ok

#

lol

umbral zealot
#

y'know, it's like, top.gg , dis.gd, discord.gg , sometimes they get jumbled. I'm an elder millennial, sometimes I get confused.

signal summit
midnight spoke
near stratus
umbral zealot
#

What's with the function arguments? ({bot, message, args, client}) ???

#

how do you have two client variables

near stratus
#

wait a second What's bot ?

umbral zealot
#

and are you really the only person here that actually uses an object for multiple function arguments? lol

midnight spoke
#

;-;

#

I don't know why I put the arguments

near stratus
#

And he is also using msg.delete() not message.delete()

umbral zealot
#

well maybe you should know what you're doing

umbral zealot
near stratus
#

why would he name message as message as another message cus IDK how scope should be ?

umbral zealot
#

because it's the sent message, not the incoming command message

#

message.channel.send("blah").then(msg => msg.delete()) is perfectly valid JS

near stratus
#

wait it was JS ?

umbral zealot
quartz kindle
#

lmao

earnest phoenix
umbral zealot
#

You know that feeling when you either want to strangle a kitten, bash your forehead against a wall repeatedly, or scream from the top of your lungs, and you're not sure if you want to do one or the other or all 3 at the same time? That's how I'm feeling right now.

quartz kindle
zenith terrace
quartz kindle
#

Lol

zenith terrace
#

first gif to show up when searching Tim

near stratus
quartz kindle
#

you bid, then someone else bids, then you bid more, then someone else bids more, then top.gg gets rich

umbral zealot
near stratus
umbral zealot
#

what

#

that's a client bug probably

near stratus
quartz kindle
#

discord mobile is speshul

crimson vapor
#

discord IOS works fine for me

near stratus
quartz kindle
#

when? i didnt get any

crimson vapor
#

I read something about that

lyric mountain
zenith terrace
#

derpy discord version

lyric mountain
#

couldn't think about any better logo lul

cinder patio
#

looks like the logo isn't centered

#

it probably is, but it looks like it isn't because of the text on the right

lyric mountain
#

hm

#

I'll try making it smaller to leave more space to the text

zenith terrace
#

by 0.1

tired panther
lyric mountain
#

oh wait

#

forgot bold letters

earnest phoenix
#

I would give everything more breathing room.

lyric mountain
#

maybe I could align the icon to the left

#

idk, I'm bad at design

earnest phoenix
midnight spoke
#

bruhhhh

lyric mountain
#

that indentation...

earnest phoenix
#

What?

quartz kindle
#

that code makes 0 sense

earnest phoenix
#

Hm why?

umbral zealot
# earnest phoenix

The following trick is a lifesaver, so pay attention: Your code editor is trying to help you. If you're using any code editor (VSCode, Atom, Etc), clicking on any (and I mean any) separator token such as parentheses, square brackets, curly braces, double and single quotes, will automatically highlight the one that matches it. The screenshot below shows this: the bottom curly brace is selected, and the one on top is highlighted by surrounding it with a square. Learn this, and how different functions and event handlers "look" like. Even in long bits of code, this works. If you don't have a proper editor, here's a guide: https://discordjs.guide/preparations/setting-up-a-linter.html
brackets matchingbrackets syntaxerror

pale vessel
lyric mountain
#

oh, the arrows

pale vessel
#

yeah they're little big imo

quartz kindle
#

id make the font smaller as well

#

improve the spacing balance

quartz kindle
#

also clarckson, you cant mix assignment like that

earnest phoenix
#

Oh

quartz kindle
#

if you do const x = something; that means you want to use x after something, not inside it

earnest phoenix
#

Ahhhhhh

#

Thanks

cinder patio
#

Also, bot is not defined 😛

lyric mountain
earnest phoenix
#

Lol thanks too

earnest phoenix
lyric mountain
#

the arrows are smaller

earnest phoenix
#

Ohh the white yes!

pale vessel
#

logo is good

earnest phoenix
#

Yes true, better

crimson vapor
#

bro

#

.then(msg => {}) not const msg = x.then()

umbral zealot
crimson vapor
#

don't mind if I do

pale vessel
#

it still returns void and they're not awaiting it

crimson vapor
#

it hurts to read

umbral zealot
#

and it looks ugly as fuck which is why it's in the section that teaches you async/await

crimson vapor
#

ik you have it there to explain things

#

but still

#

reeeeee

umbral zealot
#

The whole point is "this is bad, here's how to make it better"

#

So your reaction is very appropriate

crimson vapor
#

yea ik im reading

umbral zealot
crimson vapor
#

getData().then(getMoreData).then(getMoreData).then(getMoreData)

#

would that not work

umbral zealot
#

of course

crimson vapor
#

pain doing callback hell then

#

is there an advantage to using new Promise() or async function () {}?

umbral zealot
#

not really, but you can use the former if you're promisifying a callback or something

#

since you can't await callbacks

#

For example ```js
const wait = (timeout) => {
return new Promise(res => {
setTimeout(res, timeout)
});
}

// or cleaner
const wait2 = timeout => new Promise(res => setTimeout(res, timeout));

grizzled raven
#

await getMoreData(await getMoreData(await getMoreData(await getMoreData(await getData()))))

pale vessel
#

no

grizzled raven
#

kekw

solemn leaf
#

That wouldn't work

umbral zealot
#

actually yes it would work

solemn leaf
#

Not in the wal you want

#

Wouldnt it just return the value of the first one

umbral zealot
#

wouldn't have any args in there, you're right 😄

crimson vapor
#
function wait(time: number) { return new Promise(r => { setTimeout(() => r(null), time); }); };``` this is berry's wait function
cinder patio
#

Which do you think is faster?:

const Stuff = {};
Stuff[1] = () => {...};
Stuff[2] = () => {...};
... imagine 50 more functions

if (Stuff[n]) Stuff[n]();
else error;

vs

switch(n) {
  case 1: 
   ...
   ... imagine 51 more cases
  default:
    error;
}

The first one is easier to modify and add new stuff, but my number one priority right now is the performance

umbral zealot
#

switch/case is faster.

crimson vapor
#

iirc if else is faster but shit to read

#

ah

#

im wrong

#

poggers

lyric mountain
#

switch-case is O(1)

crimson vapor
#

it is?

cinder patio
#

So is the object method

crimson vapor
#

does it use a map or something?

tired panther
#

Can I make my canva design online, then import the sizes to generate the image with correct sizes?

umbral zealot
#

the v8 JIT will convert a bunch of identical if/elseif/else chain to switch/case for performance, so switch/case is definitely faster than if/elseif/else

crimson vapor
#

ah

lyric mountain
crimson vapor
#

is there a point, like 1 statement, where switch/case is slowed because of the amount of operations it does?

umbral zealot
#

and, no, Map() wouldn't be faster. neither would an object. Because switch/case is direct access just like an object, there would be no performance benefit to switching to a map/object/collection

lyric mountain
crimson vapor
#

probably the same as an object or a map

lyric mountain
crimson vapor
#

oh

#

what

cinder patio
lyric mountain
#

nice, 16k case switch

#

ig its limit must be integer's max value maybe

cinder patio
#

Depends on the implementation

lyric mountain
#

who tf would use more than 2 billion cases lul

cinder patio
#
switch(num) {
  case 1:
   return "1";
  case 2:
   return "2";
}

smirk

crimson vapor
#

its not even possible tbh

#

a file can't have 2 billion lines

lyric mountain
#

who said one case per line?

#
switch(num) {
  case 1: return "1"; case 2: return "2"; case 3: return "3";
  case 4: return "4"; case 5: return "5"; case 6: return "6";
}
cinder patio
#

Also, a line break is stored as \n (in linux) which is 2 bytes, if there were 2 billion lines, that would be 4 billion bytes, that's 4gb

pale vessel
#
Stuff[n]?.() || error;```
crimson vapor
#

@umbral zealot is there a reason Advanced Data Types are before Understanding Conditions?

umbral zealot
#

because I put all data types together basically

#

but honestly this is more of a hodge-podge resource not a "top to bottom" tutorial

#

lots of things missing in there

crimson vapor
#

ye

#

it has the basics and they are explained very well

umbral zealot
#

Thank you ^_^

crimson vapor
#

it could do with some organization

pale vessel
#

organization?

#

oh

umbral zealot
#

yeah putting things in a better order

#

I'm good at writing, bad at organising and managing

crimson vapor
#

lol

#

imo conditions should be before data types

#

but maybe add an advanced conditions where you explain how something can be truthy and not true

cinder patio
#

I disagree, it should be after the basic data types

crimson vapor
#

hmm

#

ig yea

umbral zealot
#

everyone's gonna have their opinion on that and I don't think it really matters

cinder patio
#

in order to compare two values, and to understand the difference between == and ===, you first need to know what data types are

umbral zealot
#

it's a website, you can click wherever the hell you want 😛

crimson vapor
#

lol

cinder patio
#

yea true

scenic kite
#

How do I use top.gg api urls in my code?

crimson vapor
#

so

variables
simple data types
understanding conditions
mid level data types
advanced data types
...```
#

good order probably

#

get all the basics then explain the cool shit

umbral zealot
#

there's really no ultimate order to learning things imho

near stratus
umbral zealot
#

the first page I wrote for this guide was literally the modules one

scenic kite
#

Python

crimson vapor
#

LOL

#

I feel modules are more advanced than data types

near stratus
umbral zealot
#

I added things gradually as they became useful to explain to people how to do stuff in javascript since they didn't want to read MDN (which imho gets things reversed sometimes, like learning how to make promises before learning how to use them)

crimson vapor
#

maps are easier to understand than why this. doesn't work like you think it would sometimes

scenic kite
#

Does anyone know?

crimson vapor
umbral zealot
#

not even sure what use top.gg api urls in my code means

brave cypress
#

S.a

umbral zealot
#

english only in this channel please, you can use #general-int for turkish ^_^

eternal osprey
#

hey

#
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
            var stringChars = new char[8];
            var random = new Random();

            for (int i = 0; i < stringChars.Length; i++)
            {
                stringChars[i] = chars[random.Next(chars.Length)];
            }

            var finalString = new String(stringChars);
            Program.namelmao = finalString;
 ``` why is this not generating a new character?
umbral zealot
#

is this java or javascript?

rustic nova
#

looks like javascript

#

oh lol ngl looks like a mix of both

earnest phoenix
#

it's c#

#

horrid c# at that

umbral zealot
#

JS, Java, and C#, are much too easily confused to not tell people what language you're using, clearly.

#

@eternal osprey wanna clear things up for us?

eternal osprey
umbral zealot
#

Alright. Well then let's hope someone that knows C# can help ya because I can't 😄

earnest phoenix
#

Lol

spiral crag
#

@summer acorn hey do you know what i should upload for the back side of the passport

lyric mountain
#

the back side of the passport

spiral crag
#

like what is the backside

umbral zealot
#

you know how a page has 2 sides

#

the front side

#

and the back side

spiral crag
#

i know

#

i tried

#

uploading that

#

stripe accepts that

#

but

umbral zealot
spiral crag
#

when discord finally processes it in the end

#

discord does not work

umbral zealot
#

this has nothing to do with development, ask Discord support

spiral crag
#

k sure

eternal osprey
#

why should discord want to ask his passport?

cinder patio
#

bot verification

eternal osprey
#

owh okay

spiral crag
#

this process is a headache

#

especially the identity verification

umbral zealot
#

still has nothing to do with development ¯_(ツ)_/¯

crimson vapor
#

it is actually really simple

long timber
#

Guys I feel so proud of my self for making a ranking bot

blissful coral
#

pog?

earnest phoenix
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

shy turret
#

does anyone have experience use namecheap's premium dns?

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

you can also just generate characters within a unicode range

#

instead of wasting memory on an array

#

but that's nitpicking

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

blissful coral
crystal wigeon
#

hey, quick question

#

does djs give the ip address of the author? alt detector seems to be down for quite a while

#

wait nvm wrong server to ask that

opal plank
#

what?

#

@crystal wigeon you cant get ip adresses via discord my dude