#development

1 messages · Page 1645 of 1

opal plank
#

look at your server screening

earnest phoenix
#

I used those emoji’s at server screening and not o

#

Oo

#

I’m less intelligent

earnest phoenix
#

Yes

opal plank
#

so mine are all null

earnest phoenix
#

O

#

Smort

signal summit
#

Anyone has used to uses aws for bot hosting?

earnest phoenix
#

aws?

#

I use heroku xd

signal summit
#

amazon web services i mean

earnest phoenix
#

o

#

No idea

summer acorn
#

how do I prevent this from happening

#

it tries save too fast but then it ends up not saving for one of them because of it

#

like, it tries to save a version that has already been changed elsewhere

fluid basin
#

code?

#

cant tell anything from that error

willow mirage
#

you have to use <Data>.updateOne({a: <Data>.a})

#

this happened to me before

summer acorn
# fluid basin cant tell anything from that error

it's mongoose, and the issue is that it's trying to save multiple times quickly, causing it to save one version, then the other one that came before the first one saved, tries to save but fails because there is a newer version saved than the one it originally optained

fluid basin
#

why are you trying to save multiple times really fast anyways

misty sigil
#

just save it all in one go

fluid basin
#

use caching to reduce db write

summer acorn
#

that I don't know how to do

tired panther
trim torrent
#

OK not rly coding related but I wanted to know the term for when the source code isn't free like open source but instead is provided if a user pays, let's say, £10. Is it then closed source still?

misty sigil
#

i mean its technically their code then

#

yea this is a weird situation

#

expalin further

opal plank
#

the former would be you providing a service>
in this case, you provide a bots functionality for example, you host it, you write the code, and the user only gets the functionality out of it

#

the second, a job.
they hire you to work per hour, by the end, the code is the company with your name in it

#

the latter, you simply write them the code and sell the intellectual rights to it, they do whatever they want with it afterwards. be host it, modify it, whatever. but the code is theirs, you got no rights on it whatsoever

tired panther
#

7310_clappypepe agree

opal plank
#

even if you created it

#

they may or may not choose to even cite you as the one who made it

#

its theirs, period

#

as an example

#

the first would be something like dyno

#

they use the bot

#

thats it

#

hosting, coding, fixing, all up to you

#

you only offer the fuctionality of it

#

the second would fit into an actual job where you're paid per hour and in the end, the source is company's rights

#

the latter would be making a bot per request

trim torrent
#

I offer the source code of my bots to people who pay a small amount however it is always free to use for others using the hosting I already offer. Yeh idc about credit and they are responsible for fixing ect if they use the code themselves. Its all enthusiast so I do it all myself

opal plank
#

you code it, give them the code, and then wash your hands

trim torrent
#

^

#

OK, I guess it kinda works like the bottom one

opal plank
#

that would fall into the third one i sent you

#

you're selling code

#

thats all

trim torrent
#

Yeh

#

OK ty

opal plank
#

no problomo

trim torrent
opal plank
river panther
#

how can i find who is the server admin through the console?

#

the discord console

#

this one

spark oracle
#

lol

opal plank
#

you shouldnt be using it like that tho lmao

#

fairly certain you'd need client mods to access internal libs

pale vessel
#

server admin?

opal plank
#

i assume they mean owner

spark oracle
river panther
#

like we can get the account made id

river panther
trim torrent
#

That sounds like it'd be against tos

river panther
#

n

#

o

opal plank
#

a bot is the proper way to get it

#

THOUGH

tired panther
opal plank
#

im fairly certain you can use your own token on the API endpoint and fetch guilds/ endpoint

#

but i would highly disencourage that

river panther
#

oh, ok ok

opal plank
#

leak your token account and you'll have a lot of trouble

opal plank
#

i DID warn them afterwards

#

¯_(ツ)_/¯

river panther
#

i added discord extention to VSc and it asked me for the token, so i went and read about it

opal plank
river panther
#

and they said no

opal plank
#

again

#

i recommend NOT doing that

#

this is usually used for bots, but can be used for users too

spark oracle
opal plank
#

general rule you shouldnt be doing anything using your user token

tired panther
trim torrent
#

Repl. It is not a good idea lol for hosting

#

Ur gunna get rate limited to hell

#

Cause everyone is using the same ip

tired panther
tired panther
drifting wedge
#

did discord change their oauth2

#

?

opal plank
#

i doubt they do mesiter

drifting wedge
#

i cant log into my dashboard anymore

umbral zealot
river panther
#

ok ok, thank you guys to help me, i shall never forget you sll

spark oracle
#

I keep getting this error, does someone knoz what i can do?

opal plank
#

if they are using node 15 likely 90% of bots out there would crash

#

cuz node 15 now crashes on code 1 on ANY unhandled rejection

#

or uncaughtException

#

ANY

#

you get one error = bot crashes

tired panther
opal plank
#

so i absolutely doubt they are using lastest version

umbral zealot
opal plank
#

bold of you to assume people who use repl would be catching errors

#

indeed i agree with hind

drifting wedge
#

can anybody help me with quart-discord?

#

it keeps looping in auth

#

like when i auth, it doesnt auth

#

and sends me to auth page again

junior fjord
#

why didnt they check my bot yet

pale vessel
#

because you're impatient

umbral zealot
#

The wait time is 2-3 weeks

junior fjord
umbral zealot
#

False

#

You added your bot on the 5th. That's a week ago

junior fjord
#

i have other bot

umbral zealot
#

which one

junior fjord
#

au

umbral zealot
#

Only bots I See, you added less than 3 weeks ago.

umbral zealot
#

23rd => today = 16 days, certainly not "more than 4 weeks"

#

Really wish people knew who to count calendar days.

junior fjord
#

lol

junior fjord
umbral zealot
#

over 6 months ago, since it's no longer given

junior fjord
#

why did they removed

#

it

umbral zealot
#

Because kids were spamming the queue with shit bots just to get the badge.

opal plank
umbral zealot
#

ikr! how dare I correct a raging karen 😛

opal plank
opal plank
crimson vapor
#

hi Erwin

junior fjord
#

its not a meme

opal plank
#

its media

umbral zealot
#

yeah I don't know what that image is supposed to be telling me.

opal plank
#

hi million

junior fjord
#

its arthur

opal plank
#

its out of context

junior fjord
#

im not doing that

opal plank
#

well, up to you, dont come whinning when a mod tells you

umbral zealot
#

Then stop posting images when reacting to people. Use your words.

junior fjord
#

humans

opal plank
#

regardless, complaints about queue should be asked in #support not here, even though they'll likely yell at you to be patient

junior fjord
#

humans again

opal plank
#

troll spotted, stopping feeding

umbral zealot
#

Yes, we're meat popsicles but at least we know how to count.

boreal iron
misty sigil
#

i'm a meat popsicle?

junior fjord
opal plank
#

idk about a meat popsicle, but im a ghost driving a meat covered skeleton made from stardust riding a rock floating through space

misty sigil
#

coool

crimson vapor
opal plank
#

i told you, stop throwing truths at me, i dont appreciate it

crimson vapor
#

oh im sorry

boreal iron
#

Accept the truth and live with it

misty sigil
#

drunken developers are the best ones tho

tired panther
willow mirage
#

@opal plank how did you do that join discord

opal plank
misty sigil
#

help, docs are terrifyingly bad

willow mirage
#

lmao

misty sigil
#

or im just stupid

opal plank
#

prob the latter

#

since i was able to get the gist of it lul

misty sigil
#

definitely the latter

opal plank
#

discord docs are okay

#

not great, not bad

#

a good 5/7

misty sigil
#

i get it but dont at the same time

willow mirage
#

@opal plank give a gist pls

#

:))

opal plank
misty sigil
#

lmao

opal plank
#

mine is specially complicated cuz its dynamic

#

it updates realtime

misty sigil
#

can i see the complex spaghetti

opal plank
#

so i had to ratelimit it too

#

hell nah

willow mirage
#

nvm imma read docs

misty sigil
#

its too spaghetti innit

opal plank
#

dont want people who know c# copying it

willow mirage
#

try to use 200% braincell

misty sigil
#

nah its too spaghetti

opal plank
#

too spaguetti you say

#

let me show you true spaghetti

misty sigil
#

just show me source from any of my projects

#

ez

crimson vapor
pale vessel
opal plank
#

trying to find it

#

1 sec

#

fuck i give up

lyric mountain
pale vessel
#

LOL

#

that's actually perfection ngl

#

php moment

crimson vapor
#

if I wrote php that would be my code

willow mirage
#

lmao

boreal iron
#

God damn that picture is old

misty sigil
#

php moment

quartz kindle
#

haifelsen!

vivid fulcrum
#

when php

#

🥲

latent heron
#

Thanks for reminding me about how bad PHP gets

latent heron
#

There's actually a new method in PHP 8 called match

#

You could theoretically shorten that code to maybe 4 lines now

pale vessel
#

match is cooler switch

#

but for one line expressions + type checking

latent heron
#

I'm in love with match

#

It's the one thing I don't think other languages support built-in currently

lyric mountain
#

we can say you've got "a match"

crimson vapor
#

we can say that

opal plank
#

idk why i bothered posting all those, its kinda cringe

pale vessel
#

I remember that perms one

latent heron
#

Oh?

opal plank
#

too bad discord doesnt load all the pics

#

gotta open in browser

#

but i assure you they're all bad

latent heron
#

Discord embed moment

opal plank
opal plank
#

that was my third day on js

latent heron
#

Dude account systems in PHP are messy

crimson vapor
#

I hid my old code

quartz kindle
#

jesus christ what

crimson vapor
#

lemme see if I can find it

opal plank
#

and tim thought his code is bad

#

open all of them tim, watch the full glory

latent heron
#

Tim have you seen PHP regex

opal plank
#

or post them in chat to embed them

earnest phoenix
#

My code doesnt work, this is what it said

-bash: node: command not found

Any idea?

crimson vapor
#

that was pog tho

latent heron
#

Most php devs be like

"Yeah I preg match all of my input variables, so what?"

crimson vapor
#

the raid shadow legends

opal plank
#

i actually made an ad in it

#

full on ad

opal plank
#

oh, day of the week

latent heron
#

True

opal plank
#

yeah i had to typecast all that shit

latent heron
#

Ouch

opal plank
quartz kindle
#

thats what you get for using ts

opal plank
#

shush cake boi

quartz kindle
#

:^)

earnest phoenix
#

Sooo any fix for the output?

crimson vapor
#

but this happened

opal plank
#

dunno, looks like node isnt installed

misty sigil
#

is ts

earnest phoenix
#

But the thing is node is installed

latent heron
opal plank
#

i should've used enums for that for sure

latent heron
#

Drunk you must've felt proud for that one LMAO

vestal stirrup
#

How can I do this?

latent heron
#

By coding

misty sigil
#

come on erwin

opal plank
#

absolutely

misty sigil
#

say the thing

opal plank
#

@vestal stirrup SDK

misty sigil
#

pog

opal plank
crimson vapor
#

those are all embed constructors

misty sigil
#

wbat the fuck

latent heron
#

And this is why my embeds are JSON imports mmLol

opal plank
#

fuck i dont have a flamethrower emoji

#

but burn it

latent heron
#

Embeds take up too much space in my command code

opal plank
#

embed builder trash

earnest phoenix
#

I guess i will try to reinstall node

latent heron
#

I just import a json and call it a day

#

More organized too imo

opal plank
#

send the object directly

latent heron
#

No need to hunt through your commands

opal plank
#

its much better

latent heron
#

Eh

opal plank
#

both in performance and readability

latent heron
#

d.py supports a JSON to dictionary converter for embeds

crimson vapor
#

I didn't know how to use a command handler

#

so all of the cooldowns were pasted in the commands

opal plank
#

i benchmarked the methods

#

sending the payload directly is best

latent heron
#

Mine uses slash commands so you can't copy and paste commands PepePoint

#

No need for cool downs at that point

opal plank
#

imagine not having cooldowns handled by the lib cough cough detritus cough cough

boreal iron
crimson vapor
#

fun fct

#

I used var

opal plank
#

or use detritus which handles it for you mmulu

crimson vapor
#

and let

#

interchangeably

pale vessel
#

pls use detritus!!!

crimson vapor
#

its sad

viscid thistle
#

does anyone how to make a second instance of my bot like carl did?

earnest phoenix
#

Whats detritus

opal plank
#

imagine having to write your own cooldown handler when you simply add a single line for detritus

opal plank
crimson vapor
#

@opal plank stop

opal plank
crimson vapor
#

ok bitch

opal plank
#

pull up, no balls

earnest phoenix
#

@crimson vapor so whats it

opal plank
crimson vapor
opal plank
#

those are just tip of the iceberg

opal plank
opal plank
crimson vapor
#

ok

#

I have school

#

gimme a few hours

boreal iron
earnest phoenix
#

So its better than Eris and discordjs and.commando?

pale vessel
#

ew commando

earnest phoenix
#

For reference

pale vessel
#

it's better, yes

#

since you can control cache

#
  • the command client is better
opal plank
earnest phoenix
#

So ya are saying thr truth, i am interested

#

I am putting it on my bookmark

opal plank
#

feel free to write your own ratelimit handler for channels, guilds, dms, im happy with my 3 lines mmulu

boreal iron
pale vessel
#

FakE lost on this one

opal plank
#

@frosty forge i dont accept random friend requests

#

i call that being stubborn

#

its not even my lib tbh

#

dunno why people just dont appreictae and accept its better in every aspect

earnest phoenix
#

I am switching to it

boreal iron
opal plank
#

i only advertise it cuz its good

sudden linden
boreal iron
opal plank
#

i dont get comission for advertising it

crimson vapor
#

this code is pain

#

idk why im reading this

opal plank
#

which?

#

mine?

#

yeah

opal plank
earnest phoenix
#

Dont need to

crimson vapor
#

docs?

#

never heard of this

earnest phoenix
#

I already bookmark it

sudden linden
opal plank
#

@earnest phoenix

frosty forge
crimson vapor
#

@slim heart real docs for discord-rose when?

opal plank
crimson vapor
#

wait

#

this is made by notsobot's dev?

opal plank
#

Do not @mention people randomly. its in the channel topic, this also refers to dm'ing users

opal plank
crimson vapor
#

pog no wonder its so good

viscid thistle
#

how can I get a user by his id if I'm using commands.Bot and not discord.Client??

pale vessel
#

poor cake though, he got banned for submitting notsobot in queue in this server

crimson vapor
#

why

boreal iron
pale vessel
#

because notsosuper is banned?

crimson vapor
#

oh

crimson vapor
#

yes

#

always

vivid fulcrum
#

actually good point gorl using discord is a myth

crimson vapor
#

yeah

#

@drowsy crag doesn't exist

opal plank
#

i just ad it cuz the lib is good

#

unironically

crimson vapor
#

berry's lib is also pog

#

but the command handler isn't powerful enough

opal plank
#

its too early to even begin to put up a fight

crimson vapor
#

yeah

#

agreed

boreal iron
crimson vapor
#

@slim heart add good features so erwin will switch

opal plank
#

might be able to compete with d.js, but i doubt it'll be able to compete with detritus

#

even in a finished state

crimson vapor
#

the way it is built is meant to be really modular

#

like the basic command handler is shit

#

but once you add the middlewares

#

so much more to it

opal plank
#

i usually prefer to tone down the dependencies on my project, its better to have the lib handle all that
the reason is: if theres a breaking change, you'll be relying on other devs to port it for you
it creates too much dependency and removes a lot of indepedence from your own project

drowsy crag
crimson vapor
#

yeah but thats not an issue if you do everything custom

#

or if you are using something built by the same person who make the lib

opal plank
#

it is when you rely on other peoples work

#

say

#

for example

#

theres a middleware that adds slash commands support

#

then berry pushes a change

crimson vapor
#

thats not how it would work but yeah ik what you mean

opal plank
#

now im relying on not only berry, but the dev for that

#

it chains too much dependency on other developers

quiet ore
#

sorry

#

sorry to discord server link 😦

crimson vapor
#

hmm

opal plank
#

i much rather have a single lib with everything in it, then i just cherry pick what im going to be using, since its all in constructors it wont be using extra mem

crimson vapor
#

true

#

How should I be doing cooldowns for my bot?

opal plank
#

with detritus mmulu

crimson vapor
#

use a set and add ID-GuildID-command?

opal plank
crimson vapor
#

but that wouldn't work for buckets

#

bruh

opal plank
#

a map usually works fine

#

userid/timestamp

crimson vapor
#

and map it to what lol

opal plank
crimson vapor
#

hmmm

opal plank
#

OOOOOOOOR

#

alternatively

#

8ads incoming*

crimson vapor
#

fuck

opal plank
boreal iron
#

oh oh

#

another $50 he earns

opal plank
#

you add this on the handler

crimson vapor
#

yeah if I want a limit type, how would I do that

#

without ditrus

opal plank
#

this works in queue iirc

#

so even ratelimited, it'll continue to work and not flatout deny the command from running

#

you'd have to implement a queue'ing system

boreal iron
#

with simple timestamps for the user id or guild you do check on the next message event

opal plank
#

that would work for user ratelimiting

#

for guilds/channel/user you'd have to use 3 different ones

#

check user ratelimit => pass to channel check => pass to guild check => run

#

you'd cascade push them in sequence

crimson vapor
#

hmm

boreal iron
#

stop making Erwin rich...

opal plank
#

but athat'd be the gist

#

imagine getting paid to advertise a good lib

boreal iron
#

bet he's getting a $100 promo if you download the lib

opal plank
#

fat paychecks

boreal iron
#

damn capitalism

crimson vapor
#

ill download it if you give me 1/2 of that 100

opal plank
#

deal

#

you want half?

#

ezpzp

crimson vapor
#

lol

opal plank
#

eval return 0 / 2 // 0

boreal iron
#

lmao

#

better divide by 0 notlikenoot

opal plank
#

they say for every 10 users you get, you get a special donut

crimson vapor
#

where is my free money?????

opal plank
#

here

#

0

crimson vapor
#

ty

opal plank
#

thats half of what i get

#

use it wisely

boreal iron
#

and Erwins wallet is growing

opal plank
#

imma keep this in a tag tbh

crimson vapor
#

pain

opal plank
#

wot? docs, support server and example

crimson vapor
#

yes

#

pain

opal plank
#

welp, time for me to go buy food

#

enjoy your ad-free time while im out

crimson vapor
#

false

zenith terrace
#

@opal plank loli get pat

#

pat

crimson vapor
opal plank
#

oh, now that you're part of us, you're legally required to go at sunday morning knocking doors telling people about our lord and saviour detritus

you're allowed one cuss if they call you a Jeovah Witness

crimson vapor
#

LOL

opal plank
#

well i take my leave now to go buy food, i sent you the docs and support server invite if you have questions

crimson vapor
#

im not gonna use it lol

opal plank
#

blocked

#

bye

crimson vapor
#

does it have voice support?

opal plank
#

i think so? havent used it tho

pale vessel
#

moment

cinder patio
#

ouf I'm struggling implementing function arguments in my interpreter 😩

slim heart
#

rose isn't supposed to be a detritus competitor it's supposed to be a highly scalable production ready library it's not meant to be simple

crimson vapor
#

so?

slim heart
#

i plan on adding built in machine scaling eventually lmao

crimson vapor
#

meaning?

slim heart
#

you can scale a bot across multiple machines

crimson vapor
slim heart
#

?

crimson vapor
#

suggestions

slim heart
#

h

#

why don't you just add the bucket stuff to the middleware urself in a pr

jovial elk
#

hello everyone ^^, i was wondering if anyone knows if there a way to find the id of an emoji that is not custom? for example ➡️ ?

slim heart
#

@rustic nova some guy spamming .'s in this channel check logs pls

rustic nova
#

sec

slim heart
rustic nova
#

@earnest phoenix can you kindly stop spamming dots in here

earnest phoenix
#

➡️

#

yh sorry

#

i was just seeing why it was deleting

jovial elk
slim heart
#

my docs are the discord docs 😎

misty sigil
#

hi

pale vessel
misty sigil
#

fuck

#

man my brain really is dead today

opal plank
#

someone pinged me

#

who was it

#

show yourself coward

slim heart
#

@opal plank pobnk

opal plank
ashen mist
#

sa

earnest phoenix
cinder patio
#

What's the fastest way to concatenate two arrays in JS, without mutating any of them

lyric mountain
#

[...array1, ...array2] ig

pale vessel
sour flame
#

I go into my vscode and see this

umbral zealot
#

You see... what exactly? What's the question?

sour flame
#

Idk what happened? I get pinged here and then I check my vs code to see stuff I ddin't do

waxen cloak
#

discord.js vs Eris?

pale vessel
#

Erwin: Detritus!!

umbral zealot
#

And your VSCode is currently pointed to a file you don't need to fuck around with, honestly, so I'm not sure what you're trying to tell us or ask us.

sour flame
#

kk

slim heart
#

million simps for rose more than me lmfao

old cliff
#

😆

cinder patio
#

weird that spreading is way slower

#

it would make sense .concat and the spread operator would have the same implementation

crimson vapor
slim heart
#

weary

crimson vapor
#

you won't because you're just bad

slim heart
#

i will soontm

#

im gonna rewrite censor bot soon

crimson vapor
#

pog

livid lichen
#

Question relating to Environmental Variables (.env): Can .env hold tables with values? Example: ```
example={
example2="yes I love examples"
}

crimson vapor
#

I don't think so

cinder patio
#

no

crimson vapor
#

@opal plank

cinder patio
#

well technically... you could hold a json string

pale vessel
#

you can stringify a json but just use a json file at that point

sudden geyser
#

You should use another file format, like JSON or TOML

cinder patio
#

but what's the point

crimson vapor
#

time for a fun conversation

livid lichen
#

Whoa

livid lichen
cinder patio
#

Like the others said, use a different format

#

JSON, TOML, YAML

slim heart
#

you should only use .env for sensitive info

#

rarely would you ever have to use an object type of format for said info

pale vessel
#

what kind of env are you talking about?

slim heart
#

u can have all your normal non-sensitive info in a json or some other file format then combine the two at runtime

cinder patio
#

there's nothing wrong with storing sensitive info in any format as long as you're not sharing the file to the public

earnest phoenix
#

noice

slim heart
#

so like what i do is have tokens in my .env and then i have a config.js that reads that env and throw them in the config as well

pale vessel
#

why

slim heart
#

and then config.js can be public and it has all of the non-sensitive info

livid lichen
pale vessel
#

hmm

#

you should just use json

slim heart
#

like this

#

settings being a parsed env

old cliff
#

You cant use objects in env dude

pale vessel
#

ah makes sense

old cliff
#

You can still use json in string

livid lichen
opal plank
pale vessel
#

do like berry

livid lichen
#

I am going to use .gitignore

pale vessel
#

you can make it public that way

livid lichen
#

Thanks for the info.

earnest phoenix
#

.addField("Members", `![TS_User](https://cdn.discordapp.com/emojis/819307875121233960.webp?size=128 "TS_User") ${message.guild.memberCount}`, true) .addField("Roles", `${member.roles.cache.map(roles => `<@&${roles.id }>`).join(" **|** ") || "No Roles"} .addField("Channels", message.guild.channels.size, true) .addField("You Joined", message.member.joinedAt) .setFooter(`Created ${message.guild.createdAt}`);

#

wot did I do wrong

pale vessel
#

¯_(ツ)_/¯

#

Check your error

earnest phoenix
#

Check the log

opaque seal
#

How do I get an array of snowflakes from a Discord.js collection

pale vessel
#

you didn't close your template literal

cinder patio
earnest phoenix
#

Member.roles?

pale vessel
opaque seal
pale vessel
#

keyArray() caches it, but I don't think it matters

slim heart
#

collection.keyArray() smh

old cliff
cinder patio
#

[...collection.keys()] is also a valid way of doing it, it's just that .keyArray() caches the result

pale vessel
#

keyArray() is better

cinder patio
#

that's the only difference.

pale vessel
#

I just checked, it reconstructs it if the collection is modified

slim heart
#

keyArray() caches because it's used constantly throughout the collection internals

cinder patio
#

It's only used in 2 methods, (randomKey() and lastKey())

pale vessel
#

keyArray() is fine but I don't think you should use collection.array()

slim heart
#

oh

#

keyArray is basically the same as array

pale vessel
#

what

slim heart
#

but values instead

pale vessel
#

so if an element is modified then it won't refresh the cache ([...collection.values()] is better in this case)

#

but I digress

slim heart
#

thats just how maps work

earnest phoenix
#

.addField(`Roles [${guild.roles.cache.size(r => r.id !== message.guild.id).map(roles => `\`${roles.name}\``).length}]`,`${guild.roles.cache.size(r => r.id !== message.guild.id).map(roles => `<@&${roles.id }>`).join(" **|** ") || "No Roles"}`, true)

Heh

slim heart
#

you should be saving back a collection if you've updated it

cinder patio
#

but map keys don't get modified

cinder patio
#

it would matter for the values, but not for the keys

pale vessel
earnest phoenix
#

Uh

pale vessel
#

you're looking at the wrong thing

earnest phoenix
#

what

#

heh

#

im too dum

pale vessel
#

it's pointing to guild.roles, yeah

#

it's the text wrapping

earnest phoenix
#

o

#

so how to I define the guild.roles.cache.size

pale vessel
#

what's guild?

earnest phoenix
#

uh the server?

pale vessel
#

which server?

earnest phoenix
#

my server

#

message.guild ?

pale vessel
#

god damn it

earnest phoenix
#

Omg

pale vessel
#

i'm trying to make them understand

earnest phoenix
#

Lol

#

wait wot

#

xd

pale vessel
#

I was expecting "the server the message is from" but I guess I'm not getting any of that

earnest phoenix
#

Lmfao

#

It's not a public bot-

pale vessel
earnest phoenix
pale vessel
#

well I guess that's solved, anyway

earnest phoenix
#

so uhm

#

how do I fix it dx

pale vessel
earnest phoenix
digital ibex
#

Lol

old cliff
#

Which is the better way to get actual ping?

let ping = Date.now() - message.createdTimestamp;
message.channel.send(Ponng ${ping});


2) ```js
await let m = message.channel.send("Pong");
let ping = m.createdTimestamp - message.createdTimestamp;
m.edit(`Pong ${ping}`);
digital ibex
#

2 works?

solemn latch
#

depends on what your measuring

old cliff
#

message ping

solemn latch
#

then 2

old cliff
#

whats bad about 1 then?

solemn latch
#

1 measures just how long a signal from you to discord and back to you takes

#

2 measures how long you till a message is processed takes

#

2 can be a little janky though

old cliff
#

1 checks 1 way ping... ok

solemn latch
#

well, 2 way ping

#

2 includes processing

#

1 doesnt

old cliff
#

for me 2 is 1000 but 1 is 60

dusk scarab
#

hi anyone know how I can modify my message.js to let it navigate into folders... because its getting excruciatingly painful to find each command now that i have like 20000000000 (exaggeration). My message.js: https://sourceb.in/afwInPErZC

solemn latch
old cliff
#

I think its better 3 is better...

#

wait let me send it

pale vessel
#

I think 4 is better message.channel.send("Pong 0ms");

old cliff
#
let time = Date.now()
await let m = message.channel.send('Pong');
let ping = Date.now() - time;
m.edit(`Pong ${ping}`);
#

it checks it according to system time

solemn latch
#

if your servers timestamp is diffrent than discords it will also be janky 👀

old cliff
#

no

#

in this 3 case I am checking server timestamps only

solemn latch
#

oh i see

old cliff
#

let me try it

#

the 3rd option seems the most accurate

slim heart
#

they all mean different things

#

but something is strange about your pings prolly just bad internet

long crow
#

there is <client>.ws.ping as well

#

For djs

slim heart
#

makes sense

old cliff
#

I am trying to get the ping which the user experiences for the bot

pale vessel
old cliff
#

which is the most sccurate?

slim heart
#

the 1st is ws half trip ping, the 2nd is rest half trip ping, and the 3rd is rest round trip ping

old cliff
#

how is roundtrip less than half trip 😆

slim heart
#

internet

#

why i said your pings dont make sense

#

oh you know what

#

no

#

2nd is half trip ws and rest

old cliff
#

wdym?

slim heart
#

because you're comparing the received message timestamp to the sent message timestamp

old cliff
#

yes

slim heart
#

so your ws ping is prolly just really bad which is why your ping is weird

old cliff
#

not true

slim heart
#

run the 2nd again

old cliff
#

ok

slim heart
#

ws.ping is also the roundtrip for a heartbeat

#

you're either doing a lot of processing before a message is recognized or again internet just bad

old cliff
#

yes

#

a lot of process

slim heart
#

100 is also a lot for a heartbeat roundtrip so it wouldnt surprise me

old cliff
#

thats why I set message.ping = Date.now() - message.createdTimestamp before processing

#

which is usually 60-80

crimson vapor
#

wtf

#

why would you do that?

#

that makes no sense

#

Date.now() should be much greater than 60 lol

#

yeah

#

that makes more sense

crimson vapor
#

yea yea

#

I saw

#

even then

#

created timestamp is client side right?

slim heart
#

server side what

crimson vapor
#

idk man

old cliff
#

server side

crimson vapor
#

ok

#

umm

old cliff
#

no... its client side

#

oof

crimson vapor
#

thats still 1/2 of the ping tho

slim heart
#

createdTimestamp is based off the snowflake iirc

old cliff
#

yes

crimson vapor
#

ping is back and forth

old cliff
#

yes

slim heart
#

really its up to you what stat you want to present

old cliff
#

thats why I am trying to figure out the best way

slim heart
#

3rd might be the smallest but it might not be fully accurate

#

it doesnt really matter if ur roundtrip rest ping is 100 if it legitimately takes a full second to respond to a message

crimson vapor
#
    ctx.embed
      .author('Pong!', url)
      .color(ctx.worker.colors.PURPLE)
      .send(true)
      .then(msg => {
        msg.embeds[0].author!.name += ` (${(Date.now() - time).toFixed(2)}ms)`;
        ctx.worker.api.messages.edit(msg.channel_id, msg.id, { embed: msg.embeds[0] });
      });```
#

thats what I do

pale vessel
crimson vapor
old cliff
#

inline reply pog

crimson vapor
#

yea

pale vessel
#

use discord rose to get it /s

slim heart
#

oh nvrm yeah created_timestamp is sent from discord not the snowflake

old cliff
#

nah

#

ts isnt great

crimson vapor
#

wtf?

#

ts is literally js

slim heart
#

moment

pale vessel
slim heart
#

so it doesnt ping

crimson vapor
#

soon™️

tired panther
#

dumb question: but how do I add two arrays?

#

array1 + array2?

slim heart
#

Array.concat()

pale vessel
#

bruh

crimson vapor
#

no

pale vessel
#

array.concat() yes

#

fastest method

slim heart
#

const newArray = array1.concat(array2)

tired panther
#

lol thx

tired panther
crimson vapor
#

@slim heart still pings LOL

pale vessel
slim heart
#

did you do npm i discord-rose@0.2.0

#

smh

crimson vapor
#

yes

#

go to commands

slim heart
#

capapap

#

@crimson vapor change the allowed_mentions on edit

old cliff
#

so...

#

whats the best way to get ping?

slim heart
#

preference

old cliff
#

*cough

crimson vapor
#

idc tbh

slim heart
#

u have ur 3 methods choose one

crimson vapor
#

idc why its such a big deal

old cliff
#

I actually have 4

crimson vapor
#

its not like it actually pings anyone

#

LOL

#

you would have to alt tab just after sending the message for it to matter

slim heart
#

flaze smells thatds why it apparently matters

crimson vapor
#

LOL

slim heart
#

smfh

crimson vapor
#

or have hella shit ping

pale vessel
old cliff
#

I will stick with my pre process ping method

crimson vapor
#

honestly

old cliff
#

It gives very less ping xD

crimson vapor
#

you are correct @pale vessel

#

if you always send 0 its always super fast

pale vessel
#

or math random

#

like 0-10ms

old cliff
#

pog

crimson vapor
#

my preference is math random

#

ngl

pale vessel
#

so less sus

crimson vapor
pale vessel
#

LOL

#

"get the bot's ping"

crimson vapor
#

its very acurate

#

every once in a while

green kestrel
#

i made a better version of my guide video showing users how to update the bots role and change the bots pfp. anone want to see and offer feedback?

crimson vapor
#

yea send it

crimson vapor
#

yeah code yes

#

never used it for prod

#

may or may not have used a json database

green kestrel
#

i added rolling summary at the bottom, re-captured it with my hardware capture card at much higher res and re-cut it

crimson vapor
#
  1. I don't like the scrolling text, in fullscreen it was kinda distracting and confusing
    otherwise its good
green kestrel
#

do you think non-technical users might need the scrolling text bit?

#

to explain what theyre doing and why?

crimson vapor
#

I would say maybe only capture a part of the screen as well

runic depot
old cliff
#

is this the correct way to get memory usage?

(process.memoryUsage().heapUsed) / 1024 / 1024```
crimson vapor
#

yeah 100% explain it but imo you shouldn't have it scrolling

cinder patio
#

the scrolling text is very hard to read for me

runic depot
# runic depot

it just sends the post request to main domain, what should i do?

crimson vapor
#

its distracting and especially confusing for people who are new probably

green kestrel
#

what if it didnt scroll?

crimson vapor
#

probably would be better, its a big also imo

#

especailly in full screen

#

which I assume people will use to see everything

green kestrel
#

let me make a second one without the scrolling text

#

hmm its ten megs smaller for some reason

crimson vapor
#

LOL

#

yeah so thats great, will this be linked in a command or on like a setup page

#

if its a setup page, you could have screenshots with highlightingh

green kestrel
#

its something i want existing users to see, it'll probably be a one off in an embed in !help for existing users or something, and also on a blog post

crimson vapor
#

ah

#

I suggest linking to a post then you can go more in-depth

green kestrel
#

for new users as of a couple of days ago, the bot is invited with the correct manage webhook perm already

crimson vapor
#

thats great

#

so something like a warning for old users

green kestrel
#

its a new feature i didnt consder i'd add when i made the bot last year so now i got like 76000 servers without this perm, encouraging them all to add it is a headache

#

less warning, more encouragement

crimson vapor
#

yeah

green kestrel
#

messages via webhook are a lot less laggy

crimson vapor
#

you are using it to "abuse" ratelimits?

green kestrel
#

and they can control the pfp and name easily on a per channel basis

#

nah they just seem faster

crimson vapor
#

ah

green kestrel
#

probably because im in full control of it and can avoid the library

crimson vapor
#

yeah

green kestrel
#

and i can send through several ips on my system that have different NICs

#

i have 2 nics and no teaming

crimson vapor
#

but I expect that if you send the video with a link to a more in-depth guide, it should be super simple for a user to setup

#

especially since its like 4 things to do

green kestrel
#

yeah

#

and it can be split into two

#

first bit: "i'm an existing user and want to change the bots pfp"
and second bit after it: "i'm a new user"

#

new user is only the one step, go in change webhook 😄

crimson vapor
#

yeah

#

if you will be using the same format as your faq, just link to different places

#

one being adding webhooks

#

one being configuring webhooks

green kestrel
#

yeah

#

if the bot has the right existing permissions it'll just make one on each channel a game starts on

crimson vapor
#

just as my opinion, a video is always nice to have but its probably easier for a user if you use screenshots with highlights and explinations

#

but yeah this idea of using webhooks is pog

#

especially since it seems you can just use the other ips to make the requests

green kestrel
#

yup

#

i have five ips

crimson vapor
#

is it possible to do a request on ipv6?

green kestrel
#

i rotate my calls across all 5, respecting rate limits, with a multi-threaded system of ten queues

crimson vapor
#

yeah so no need to worry about getting ratelimited

green kestrel
#

i threw 41 concurrent games at it earlier on test, hoping to get near the rate limit to test the new rate limiting code.... i couldnt

#

in fact the only place that got rate limited was my client, trying to make 41 channels 😦

old cliff
#

I bet ravy has like 1000 ips

green kestrel
#

i do occaisionally get a rate limit 429

crimson vapor
#

yikes

green kestrel
#

this is because the rate limit for webhooks is affected by other bots and automations on the same channel

#

in total, a channel can receive 30 webhooks per minute

crimson vapor
#

@old cliff music bots use ipv6 rotation which iirc is built into ll

green kestrel
#

but thats spread across ALL webhooks, even ones that arent yours

#

so you cant know if youve hit a webhook till you try to send

#

at which point you just have to respect the headers and back off

green kestrel
#

basically youre at the mercy of other systems

crimson vapor
#

its even possible to do ipv6 rotation with ytdl

green kestrel
#

this isnt the case with standard channel messages

crimson vapor
#

its actually super simple

old cliff
#

@green kestrel took a break?

green kestrel
#

ytdl cant bind client ips

#

iirc

#

i looked into this for someone

crimson vapor
#

its a hidden feature

green kestrel
#

this is my stats for 24 hours

204     172228
404     173
400     42
429     10
500     3
502     2```
crimson vapor
#

here ill send the pr roki made

green kestrel
#

the 500 and 502 may be from my system api, they go through the same scheduler

old cliff
#

wow my bot grew 5 servers while it was offline for 2 weeks

#

thats + 10%

crimson vapor
#

all you need to do in ytdl is specify the ipv6 in the miniget options

green kestrel
crimson vapor
#

pretty cool

#

idk any cpp tho lmfao

green kestrel
#

well it kinda looks like javascript.... in the same way to an alien, a human being might look a bit like an ape

crimson vapor
#

yeah ig you could say that

#

im sure if I sat down one day and actually took the time to learn the basics it wouldn't be too hard to understand

green kestrel
#

theres some low level stuff in c and c++ that are unlike anything you'd find in JavaScript, python, or even java

#

c# has some very slightly similar pointer manipulation stuff

crimson vapor
#

a pointer is just a well pointer to the memory right?

green kestrel
#

if you work in unsafe

#

yes

#

but c++ has pointer maths

#

which iirc isnt a thing for high level languages

crimson vapor
#

wdym by pointer maths?

green kestrel
#

so incrementing and decrementing pointers to walk memory, adding and subtracting pointers, dereferencing pointers and turning standard variables into their addresses and therefore a pointer to the variable

#

stuff like that

#

and the fact you can have references and pointers and references are basically just window dressing and a pretty bow on a pointer

crimson vapor
#

ah

green kestrel
#

but the syntax is the same as making a pointer to a var and it's contextual

#

like if I put int &a as a parameter in a function it means an integer called a passed by ref

#

but if I do this outside a function parameter list: int* b = &a; it means a pointer to variable called a

#

not a reference to a

crimson vapor
#

that seems so confusing

green kestrel
#

although internally they're one and the same

#

yeah I think some things are intentionally confusing

crimson vapor
#

lmao

#

to stop anyone from making applications?

green kestrel
#

like with PHP it has decades of developer warts all over it

#

and about 4 different ways of doing anything

#

between functional, OOP, templating etc

crimson vapor
#

lmao

green kestrel
#

I mean js has similar warts from its origins as a purely web front-end language but being newer it's less warty

crimson vapor
#

well js doesn't know how to compare different types

cinder patio
#

js is great right now

green kestrel
#

ive heard TS is better

crimson vapor
#

from my experience ts js quite literally just typed js

green kestrel
#

type safety is very important

crimson vapor
#

yeah I agree

green kestrel
#

what is it you were saying about js not being able to compare types

#

😄

crimson vapor
#

yeah lmao

pseudo phoenix
#

how i detect missing permissions and request them to server owners.

green kestrel
#

examine channel permissions

lyric mountain
green kestrel
#

its complex though

lyric mountain
#

that's an actual lang btw

#

name's Plain English

green kestrel
crimson vapor
#

oh its quite literally english

green kestrel
#

scroll down to the bit where theres pseudocode

#

you have to take into account the permission overwrites of the channel

#

plus your base permissions from your bot's managed role or at-everyone role

crimson vapor
#

ads?

delicate zephyr
#

@rustic nova ads