#development

1 messages · Page 1546 of 1

opal plank
#

its that big of a whiny bitch

quartz kindle
#

try it

#

copy paste a hello world in jsfuck in a ts file

opal plank
#

gib jsfuck

quartz kindle
opal plank
#

it didnt like it

trim saddle
#

@woeful pike come here i need help with something

sudden geyser
#

Give me JSFuck or give me death

quartz kindle
#

lmfao

opal plank
#

oh god

#

this is what i dont get

#

why make a troll package and bother adding ts support?

#

it feels too much effort for a joke

cinder patio
#

Tim test the speed of JSFuck code vs normal js code

slim heart
#

i tried googling it i cant seem to find anything

opal plank
#

omg, i got the perfect idea

#

how about we make d.js in jsfuck and distribute it?

slim heart
#

cuz when i go to a new page on the site it doesnt technically load a new page, so like on the live location map it doesn't update where people actually are for example

woeful pike
slim heart
#

it only shows where people load in

sudden geyser
#

sad

#

thought we unlocked the secrets to JS performance

opal plank
solemn latch
#

Wait what. 🤔

slim heart
#

anyone have any idea bout my issue or?

opal plank
#

@quartz kindle , now compile d.js into jsfuck and distribute it

quartz kindle
opal plank
cinder patio
#

That's 59 milliseconds right

quartz kindle
#

ye

cinder patio
#

it's not that bad. I would use it in production

#

thanks

slim heart
#

i-

misty sigil
#

what

quartz kindle
#

good luck

#

its still faster than a 30yo pc

#

probably

#

probably not

opal plank
#

what you said is literally the equivalemnt of saying no homo after saying something really homo

trim saddle
opal plank
#

scratch is better than typescript

#

probably

quartz kindle
#

scratch my back

misty sigil
#

sure

opal plank
#

bet

#

bend over

quartz kindle
#

gay

woeful pike
#

I don't want to get pinged for help

misty sigil
#

you too

woeful pike
#

if I'm around when you're asking I'll help, sure

opal plank
#

i do wonder what would come out of a properly coded scratch interface

cinder patio
#

I did this for one of my bots. People could code their own stuff using a scratch-like interface

woeful pike
#

but if there's something I've learned over 300k messages of helping people with programming stuff is if you let people ping or dm you with problems you become their google until you tell them to stop. So please don't

#

That being said, just go ahead and ask I'm already here so whatever

quartz kindle
#

i dont tell them to stop, but i ignore them until they do

#

also works

opal plank
#

i prefer the more direct method "get off my dms, keep support in the server"

misty sigil
#

i prefer the best method "get the fuck out of my dms and go to the fucking development channel you absolute stupid cunt"

opal plank
#

unless you:
a) got something to say to me
b) need support rgarding something i made
c) found a bug using something i own/make

do not dm

woeful pike
#

9/10 times if you answer someone's questions in dms they will continue to ask you their questions with absolutely no shame like it's extremely sad to see people just abuse help like this but it happens almost every time

opal plank
#

^^

marble juniper
#

feels sad

misty sigil
#

^^^

cobalt spruce
#

oh shit time to start learning dart

earnest phoenix
#
if (!oldMember.premiumSince && newMember.premiumSince){
  return client.channels.cache.get('768887065638600705').send ({
    embed :{
      color: 'PINK',
      description: `Thanks ${newMember} for boosting`

    }
  })
}```
#

is there any prob with this code?

misty sigil
#

apart form the terrible formatting and the fact that discord accepts hex integers for embed colour and not colour resolvables like djs does

opal plank
#

you can send that]

misty sigil
#

oh ok

opal plank
misty sigil
#

you win erwin

opal plank
#

i use it quite often, its quite handy

misty sigil
#

gg

earnest phoenix
#

yea color works

#

i dont remember all hex codes so i use the name

misty sigil
#

i dont remember any hex codes

#

lmfao

opal plank
#

thats precisely why i said it was handy

#

oh, BROWN doesnt work

earnest phoenix
#

is the code good if yes i didnt get a message

opal plank
#

keep that in mind

misty sigil
#

apart from 000000 and fffffff

earnest phoenix
#

ohk

restive furnace
#

0099ff is the only one i remember

opal plank
#

oh shit, did my presence stop?

#

fucking hell

#

is the 24h bug still a thing?

restive furnace
#

no, i see it

earnest phoenix
opal plank
#

where presences need to be restarted after 24h?

#

hmmmmmm

#

oh, reload client fixes it

earnest phoenix
#

Erwin can u look at my code

opal plank
#

thats weird though

#

send it here

misty sigil
#

damn

#

how did you make that presence

earnest phoenix
#

i did

opal plank
#

SDK

earnest phoenix
#
if (!oldMember.premiumSince && newMember.premiumSince){
  return client.channels.cache.get('768887065638600705').send ({
    embed :{
      color: 'PINK',
      description: `Thanks ${newMember} for boosting`

    }
  })
}```
opal plank
#

lots of pain and tears to use n-api with csharp

opal plank
graceful shore
#

do i have to change my code so server count updates for over 100 servers?

earnest phoenix
#

boost server event

opal plank
#

hmmm, apart from that, it looks fine

earnest phoenix
rustic nova
graceful shore
# opal plank what?

do i need to change any code so server count updates after the bot reaches 100 servers

graceful shore
opal plank
graceful shore
restive furnace
opal plank
#

no, like feud said, all guilds are cached

graceful shore
#

ok good

restive furnace
#

ok

cinder patio
#

you will have to after you start sharding though

opal plank
#

not necessarily

#

internal sharding should haev no affect

#

clustering would though

graceful shore
earnest phoenix
opal plank
earnest phoenix
rustic nova
#

reading the pins isn't that difficult

opal plank
#

do NOT add a postStats attached to every message event

graceful shore
#

ok

spare goblet
#

question in discord's api is there an event for boosts now? is it on guildupdate or something

opal plank
#

you'll spam the api good time

graceful shore
#

yeah i was asking if i should remove it

rustic nova
#

ngl i see iara in development for the first time flushed

spare goblet
#

lol u gonna get ratelimited from dbl like me KEKW

graceful shore
#

i think i did XD

earnest phoenix
spare goblet
#

isaflush im here sometimes but then sometimes the stupidity gets to me

#

i'm aware

#

i wanna know if i can not rely on the system message

cinder patio
#

oh, like a separate event?

#

Afaik the system message is the only way

opal plank
#

when its reliable, yes, absolutely, but not most of the times in my experience

#

check this for example

spare goblet
#

bro then tf are bots doing it without system message

#

are they setting an interval and checking or sumn

#

lmao

tame pike
#

how can I make my bot to mute people?

restive furnace
opal plank
#

@spare goblet

#

you could iterate through members every so often

spare goblet
#

gross 😭

opal plank
#

premiumSince flag should be attached on member

spare goblet
#

discord needs to give me my event

opal plank
#

they DO

#

but its as reliable as i am when it comes to c#

tame pike
#

how can I make my bot to create a muted role and give it to people?

opal plank
#

aka, very poorly lmao

spare goblet
#

wheeze

opal plank
#

not only system events

#

but also audit logs

spare goblet
#

but yeah sometimes system message doesnt work propelry

opal plank
#

its really inconsistent sometimes, but you could listen to events

spare goblet
#

which is why i expected them to have an event by now

#

its not a new feature now lmao its been like a year

opal plank
#

if it didnt come already, i doubt it will anytime soon

spare goblet
#

disappointment is real discord

opal plank
#

for now your best options is to listen for updates like you said

#

that'll the most performant

spare goblet
#

wait listen to system messages or set interval

opal plank
#

^^

#

correct

graceful shore
#

e

opal plank
#

or, not even

spare goblet
#

its so gross tho if you listen to system messages you have to ask for the user for a channel that has system messages in it

opal plank
#

just add this

graceful shore
#

i got some crisps

spare goblet
#

setting an interval to do something is also notsopog with large bots

opal plank
#
let premium = message.guild.members.cache.filter(u => u.premium !=== undefined);
#

though, this just runs a loop internally

spare goblet
#

pain

cinder patio
#

but not all members are cached

opal plank
#

and that

spare goblet
#

oh right lmao

#

YIKES HAHAHA

#

yeah i guess system message it is

#

my bot caches less than like 10% of members in most guilds

opal plank
#

you could fetchAll on startup

spare goblet
#

almost 200k server gang

opal plank
#

eeeey nice

spare goblet
#

erwin ill send you my ram bill

opal plank
#

i just hit 1k yesterday

#

LMAO

spare goblet
#

thanks for offering to pay for my ram

opal plank
#

you think urs is high?

graceful shore
#

im probably the youngest bot dev here lol

spare goblet
#

bro my server is at 32gb

opal plank
#

2gb for 1k servers, fuck me

#

its definitevely a leak

#

i start at 800 and it slowly builds up

spare goblet
#

that's a memory leak if i see one

opal plank
#

but i cant find the damn leak anywhere

spare goblet
#

back when i was at 2k servers i was at around 800mb and i was already thinking i had a memory leak LMAO

opal plank
restive furnace
#

also why people prefer thing !== undefined over thing

opal plank
#

though, mine is cachign a shitton of stuff

#

so its really heavy

#

thats likely d.js doing some fuckery

#

fuckers cache every single message edit

#

like, literally, fuckoff

cinder patio
#

discord.js-light moment

spare goblet
#

oh i have an extended file that

#

removes edits from cache

restive furnace
opal plank
#

theres an option to remove edits

spare goblet
#

djs light gets big bots banned from cloudflare

cinder patio
#

because of the intensive fetching?

opal plank
spare goblet
#

nod

#

even rn im geting banned from cloudflare just from using djs lmao

#

botum growum bigum

earnest phoenix
#

Hello I am currently seeing a new arrangement. It's difficult because it's an array statement that I've never tried so far. The array statement is as follows.
ulList[i] = {
name: ${message.channel.send},
}
This is just an example. Value is not a problem. The question is how to get the value

cinder patio
#

damn

opal plank
#

ipv6 block rotation

spare goblet
#

yea

opal plank
#

have each shard use a proxy

spare goblet
#

still imagine rewriting to djs light then getting banned

restive furnace
spare goblet
#

ion wanna test that theory thanks

opal plank
#

thats abig ragequit right there

earnest phoenix
#

Umm..

opal plank
#

no preblomo

cinder patio
#

Another thing you can do is horizontal scaling, have some shards on one server, some others in another

spare goblet
#

sorry i suck at python @earnest phoenix

#

im assuming thats python but i honestly have no idea what that is

slender thistle
#

I heard Python

opal plank
#

i suck at everything, except maybe drinking

spare goblet
#

that doesnt loook like python cuz you have a random template literal in it

slender thistle
#

You're an expert in that field dw

spare goblet
#

but if its js you would have ` around it no

opal plank
spare goblet
#

confusion

#

let us know what language that is and we helpums

slender thistle
#

Das nae Py'thoon ye babeh cheks

spare goblet
#

i guessed it was python cuz they named it list

#

LMAO

restive furnace
spare goblet
#

why else would you name something list if its not py pain

#

free is op mmLol

opal plank
slender thistle
#

because PEOPLE

opal plank
#

completely uncessaery

stuck pike
#

@opal plank bro typescript Is interesting

opal plank
#

ikr

#

its really good

spare goblet
#

someone teach me how to horizontal scale my 200k bot

#

😳

restive furnace
opal plank
spare goblet
#

uh oh

opal plank
#

actually

#

how many guilds is it in?

spare goblet
#

194k

#

or somehting

opal plank
#

55k twitch streams

#

had to take it from the logs

#

cuz that shit turned off rn for maintenence

cinder patio
#

I don't use twitch so I don't know if that's a lot or not

opal plank
#

i think Zoro remembers me literally logging with sharding and IPv6 rotation to twitch and literally connecting to 110k servers within 34 seconds

#

fyi, my bot wasnt verified

#

so i had a ratelimit of 10 JOINS in 20 seconds

#

110k in 34 seconds

#

fuckers probably saw a huge ass spike in websocket connections

#

but the idea was to prepare all guilds and shards before connecting them, and doing them as quick as ratelimit would allow

#

since they have their internal ratelimiters

#

so the controller just dispatches requests to the shards, and they each handle it, and passes back to the controller

#

it shoulodnt be too difficult, its just the ipv6 rotation thats a bitch

#

cuz you need a proxy for it

#

so you can rotate them, which is kind of annoying since it breaks quite often

restive furnace
#

i think i'm going to get ipv6 rotation to my bot mmLol

opal plank
#

tldr; use a pre-built proxy, dont write one from scratch

restive furnace
#

no, i've written literally everything except coloured logging and discord connection myself

#

even loading from .env weirdsip

gilded olive
#

reinventing the wheel for no reason

jolly knot
#

Hey

restive furnace
#

well, it (might) be faster than using 3rd libs

cinder patio
#

but libs are well-tested

#

and probably faster

earnest phoenix
#

Does anyone here know how to do node.js??

restive furnace
#

meh, how much loc is dotenv?

cinder patio
#

I don't think loc matter, the thing with dotenv is that you call a function at the start and then it doesn't do anything else, so there is no reason not to use it. There's no overhead

restive furnace
#

well, one thing is that it does not support different .envs, like .env.devel and .env.prod

bitter badger
#

I need some help if anyone has a solution.

restive furnace
#

unless, i'd just do process.env.NODE_ENV === "production" ? "../.env.prod" : "../.env.devel" in the options ¯\_(ツ)_/¯

#

why didn't i realize that when i wrote my own loader

#

lol

bitter badger
#

I have an object (typescript) and then have partial that is the same type of the object. I have to set the fields in the full object to the fields of the partial and keep the rest of the original object fields the same. I don't know how to do it dynamically.

fresh spruce
#

hello

i would like to make a bot with simple 3 commands:
ban
kick
mute

pls anyone who can help me doing it as simplified as in this main.js comannds i would appreciate

cinder patio
bitter badger
#

Awesome. Thanks!

#

Do you know, if I pass my original object, it merges it in place, right?

cinder patio
#

yeah, it modifies the target and returns it

#

it doesn't create a copy

quartz kindle
#

but at that scale you probably wanna use a barebones gateway instead of a general purpose lib

misty sigil
#

i kinda wanna scale that big eventually

#

but i kinda dont

opaque acorn
#

Does anyone know how I can create a command for my bot to exit the voice channel?

fervent goblet
#

fixed

wet hazel
#

Hey guys, is it normal that custom css animations aren't working if we put em in the description part? Normal css works just fine but just not animations

#

It says <script> beacons will be deleted but not @keyframes in <style>

earnest phoenix
#

Hello I am currently seeing a new arrangement. It's difficult because it's an array statement that I've never tried so far. The array statement is as follows.
ulList[i] = {
name: ${message.channel.send},
}
This is just an example. Value is not a problem. The question is how to get the value

solemn latch
# fervent goblet fixed

honestly, i have zero idea why most of the stuff in this pagation is in there.
why do you need promises for this?

fervent goblet
#

but its the new Array part

solemn latch
fervent goblet
#

it changes it permanently in the cache

drifting wedge
#

how can i find what the type of a var is in python

#

like if var is an int do this

#

else do that?

solemn latch
#

typeof?

drifting wedge
#

its type() just found out

#

ty

solemn latch
# fervent goblet it changes it permanently in the cache

its super dirty, but why not do something like this.

pageItems.map(arr => {
     return arr.map(wall => {
         return `the string for this wallpaper ${wall}`;
     })
})

obviously, instead of returning the return arr.map(wall => {
youd make your embeds there and return the embed instead. then youd just set p to the outer map.

distant cobalt
lyric mountain
earnest phoenix
#

@solemn latch Umm It seems that [i] should not be entered because this is the data value loaded when crawling with cheerio [ { name: value } ] Because it is expressed as

#

I have succeeded in crawling, but I want to send the information received by discord embed.

solemn latch
#

if you wanted the title its
variablename[0].title for example.

trim saddle
#

@opal plank come here i need help with something

solemn latch
#

erwin going to bonk you 🤔

quartz kindle
#

lmao

trim saddle
#

i don't care

#

xet is stingy and tim is brazil

earnest phoenix
#

let ulList = []; But when I do ulList.name it doesn't work

quartz kindle
#

erwin is brazil too tho

trim saddle
#

@earnest phoenix [] isn't {}

solemn latch
#

ulist is empty in that case

trim saddle
#

you don't get attributes from []

earnest phoenix
solemn latch
#

it has no properties

trim saddle
#

@quartz kindle whatever you're good at ts stuff right

solemn latch
#

you didnt define ulist as whats shown in the screenshot

#

you defined it as []

#

which doesnt have a property .name(at index 0, or any index.)

earnest phoenix
cinder patio
trim saddle
#

so i'm trying to generate a d.ts, for my modules index.js, from an index.ts if that makes sense

mellow kelp
#

set declaration to true in your tsconfig.json

trim saddle
#

not done

mellow kelp
#

that will generate declaration files on compile

trim saddle
#

but when i import everything

#

and put it into an object

#

everything is any

#

so no actual types are being put out

cinder patio
#

do you have "types": "index.d.ts" in your package.json

trim saddle
#

no, but that's not my problem

cinder patio
#

well then add it

distant cobalt
#

the type of text and font

quartz kindle
#

with `

distant cobalt
#

o ok

trim saddle
#
import AllowedMentions from "./lib/models/allowedmentions"
let petals
petals = {}

petals.AllowedMentions = AllowedMentions
// petals.AllowedMentions is any
distant cobalt
#
-Like this?```
trim saddle
#

like this

#

``

distant cobalt
#

how about the text color?

#

like red

mellow kelp
#

that's "diff" language

trim saddle
#

that depends on what language you choose to use in a code block.

distant cobalt
#

Okay

mellow kelp
trim saddle
#

what you want is a code box

quartz kindle
#

if you're talking about the description in top.gg, then its a matter of css

distant cobalt
#

Oki

quartz kindle
#

top.gg description accepts markdown as a scripting language

#

and markdown accepts both quote blocks with 1 ` and code blocks with 3

#

then top.gg colors them based on css

trim saddle
#

welp i got no help

#

i guess i'll take my question elsewhere

distant cobalt
#

for masked links, can you do [text](link) on the page?

quartz kindle
#

yes

stable eagle
#

Im trying to add reaction roles, but the bot doesnt give the role nor respond to the reaction if the reaction appeared before bot started, how can I fix that? Enable some intent or?

mellow kelp
#

djs?

stable eagle
#

Yup

mellow kelp
#

i think you have to add a partials array in ClientOptions

stable eagle
#

I tried that once but uh my messageEdit event went crazy lol

mellow kelp
#

something like new Client({ partials: ['REACTIONS', 'CHANNELS'] }) i think

rocky hearth
#

@mellow kelp I tried to define a class constructor like this, in react

class AnyClass {
  constructor(readonly val:number){}
}

And it is showing error for using readonly. It says, a ',' is expected after readonly it

#

and typecasting with as is also not working for me

mellow kelp
#

maybe you have an outdated typescript version or something?

rocky hearth
#

i hv 4.x

#

If I remove this class, completely. Then it works fine

mellow kelp
#

well it says "unexpected token"

#

maybe you got something wrong somewhere else

rocky hearth
#

I checked, 5 times. Nothing is wrong.

mellow kelp
#

no idea then tbh

rocky hearth
#

where can I share my code?

earnest phoenix
#
getHtml()
      .then(html => {
        let ulList = [];
        const $ = cheerio.load(html.data);
        const $bodyList = $("###").children("###")
    
        $bodyList.each(function(i, elem) {
          ulList[i] = {
              title: $(this).find('div.profile-header').attr('data-nick'), // 플레이어 닉네임
              updata_time: $(this).find('p.mb-0').text().replace(/\s/gi, ""),// 
              image_url: $(this).find('div.profile-header__icon img').attr("src"), // 플레이어 프로필 사진
              lankimage: $(this).find('div.profile-tier-competitive img').attr('src'), // 플레이어 랭크 사진
              lankname: $(this).find('b.mt-1').text().replace(/\s/gi, "").substr(0,7), // 플레이어 랭크
              send: "ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ",
              lank_info_1: $(this).find('div.float-right').text().replace(/\s/gi, "").substr(0,3),//  평균 판수
              lank_info_2: $(this).find('div.float-right').text().replace(/\s/gi, "").substr(3,5), //  승률
              lank_info_4: $(this).find('div.float-right').text().replace(/\s/gi, "").substr(8,3), //  평균 딜량
              lank_info_5: $(this).find('div.float-right').text().replace(/\s/gi, "").substr(11,4), // 킬뎃
              lank_info_6: $(this).find('div.float-right').text().replace(/\s/gi, "").substr(15,5), //  평균 헤드샷
              lank_info_7: $(this).find('div.float-right').text().replace(/\s/gi, "").substr(20,3), //  평균 킬
              send1: "ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ",
          };
        });

 console.log(ulList.find(lank_info_1)) // here is ReferenceError: lank_info_1 is not defined

        const data = ulList.filter(n => n.title);
        return data;
      })
      .then(res => {
        log(res)
})

Even though I have defined [], I can't get the value in the name of ulList by any method...

#

Can someone give me an idea of how to await events in node js? For example a message has been edited. The bot waits 1 sec for another message edit. If it finds another edit it sends 2 embeds using a webhook

mellow kelp
#

you can make a sleep function using promises and setTimeout

earnest phoenix
#

And maybe a map for the events collected?

trim saddle
#

shoosh

#

i got my answer faster elsewhere

#

y'all move as fast as the mcdonald's i work at

opal plank
#

imagine:

  1. ordering people around
  2. thinking #development is here for your will
  3. assuming you are entitled to an answer
  4. pinging and then telling me to "shoosh"
  5. complaining about how fast i answer knowing people have stuff to do irl

grats, you earned yourself a block

crimson vapor
#

oh wow

solemn latch
opal plank
#

@scenic kelp ^^

#

i shouldnt ping two mods, but i realised i wanted to bother shiv too

scenic kelp
#

do it anyways

opal plank
#

@slender thistle

scenic kelp
#

hi shiv

solemn latch
#

Oh shoot, I need to start pinging shiv for mod issues.

#

Make sure he really feels welcome

misty sigil
distant cobalt
misty sigil
#

Delete the json.sqlite

distant cobalt
scenic urchin
#

Is there any property or method to see how many boosts a user has given?

earnest phoenix
#

nope

#

the api doesn't provide it

#

there's ways to estimate it but it isn't reliable at all

#

basically me and a few other people brainstorming

scenic urchin
#

Ok, thank you

earnest phoenix
#

uh

drifting wedge
#

nothing

earnest phoenix
#

lmfao

drifting wedge
#

it was my fault got it

#

simple mistake

coral token
#

aiohttp

#

example pls

earnest phoenix
drifting wedge
#

how can i make a str into an int?

#

with js

#

number i mean*

earnest phoenix
#

there should be a number function

quartz kindle
#

yes js number is fun

earnest phoenix
#

too lazy to type the rest 🥲

quartz kindle
#

who would have thought we would live in a world where typing 5 extra characters would take longer than the time it takes for the search request to make several trips over thousands of kilometers and return an autocompleted answer

drifting wedge
#

why isnt this working? ```js
<body>
<div class="hide"><input id="counterCount" value="0"></div>
<h1 class="counter" id="counter">0</h1>
<input class="button" type="Submit" value="Click Me!" onclick="updateCounter()"></input>

    <script>
        function updateCounter() {

            let counter = document.getElementById("counter");

            let count = document.getElementById("counterCount");

            count.innerHTML = `${Number(count.value) + 100}`;

            counter.innerHTML = `${count.value}`;

        }
    </script>
</body>```
#

what i want to happen is every time u click the button, the counter which isnt hidden goes up by one

quartz kindle
#

you're setting the innerHTML for counterCount

#

not the value

drifting wedge
#

o ok yu

#

ty*

#

worked but is there an easier way to do this?

quartz kindle
#

you want to update both numbers at once?

earnest phoenix
#

guys can i ask something i have a problem i want make A status of the bot when i add this for how many guild he join it says on his Status undefine Ples Help

${client.guilds.cache.size}

quartz kindle
#

english please?

drifting wedge
quartz kindle
#

there are two numbers

#

you want both to be updated the same way?

drifting wedge
#

no i just want the counter class one to be updated

#

i added the input one cuz its the way i thought of making it work

quartz kindle
#

you dont need the input

drifting wedge
#

well ya i know but i cant think of another way to do it

quartz kindle
#

just do what you're already doing, get the innerHTML, convert to number, increse, set innerHTML

earnest phoenix
#

no one okay sorry

quartz kindle
odd stratus
#

Maybe you defined your client weirdly or something which causes it to be undefined

#

It should show the server count

earnest phoenix
#

i want make on my bot status how much Server On it
this what i add
${client.guilds.cache.size}
it say undefined on his status

zenith terrace
quartz kindle
#

yes

earnest phoenix
misty sigil
#

give us more context

misty sigil
#

show ALL code

earnest phoenix
#

i do Status on .env wait

misty sigil
#

?

earnest phoenix
#

const stat = process.env.BOT_STATUS;

misty sigil
#

?

earnest phoenix
#

BOT_STATUS="${client.guilds.cache.size}"

quartz kindle
#

you cannot do that with env

misty sigil
#

can we see ALL relevant code and ^^

quartz kindle
#

env files are not code, they are text only

misty sigil
#

wait Tim

quartz kindle
#

variables inside env do not work

misty sigil
#

if they got undefined

#

they must be doing something

zenith terrace
odd stratus
#

🤔

earnest phoenix
quartz kindle
#

yes because its text

#

not a variable

misty sigil
#

but variables don’t

quartz kindle
#

client doesnt exist inside env

earnest phoenix
#

oh i undrestand

earnest phoenix
#

can i have any source code of multi status

smoky herald
#

Hey guys! Today I had my first crash when reaching memory limit on my AWS node.js free plan 👀
Made a provisional memory logs and found out the usage almost lineary increases, found out about "data leaks" which I suppose is the issue during some googling but it seems like quite complicated topic so, any ideas what could be the biggest most common issue so I can make a provisional fix before fixing the issue completely?
This is the memory log
21:00 - 436
21:30 - 483
22:30 - 533
23:30 - 574

quartz kindle
#

discord.js?

smoky herald
#

yesyes

quartz kindle
#

thats the issue

#

xD

smoky herald
#

ooof 😂

quartz kindle
#

meet discord.js caching

errant perch
#

its awful

#

speaking of ram

odd stratus
#

Memory leaks always happen with discord.js

errant perch
#

is there a way i can get the maximum amount of ram a node.js process is allowed from node.js

odd stratus
#

You can increase the limit with the startup command

errant perch
#

i mean

#

how can i view the maximum amount it is allowed

misty sigil
smoky herald
#

sooo, how can I make it not cache and where is it caching most of the times? 😆

misty sigil
#

how many servers is your bot in btw

#

I’m just curious

earnest phoenix
#

Emm another error

odd stratus
#

Mine is in about 7.5k and apparently it’s using about 550 MB 🤔

earnest phoenix
#

client.user.setActivity("INSERT TEXT HERE");
^
TypeError: Cannot read property 'setActivity' of null

client.user.setActivity("INSERT TEXT HERE");
client.on("ready", () =>{
console.log(Logged in as ${client.user.tag}!);
client.user.setPresence({
status: "online", // You can show online, idle... Do not disturb is dnd
game: {
name: "!help", // The message shown
type: "PLAYING" // PLAYING, WATCHING, LISTENING, STREAMING,
}
});
});

odd stratus
#

That good or bad lol

drowsy grail
#

You can start by sweeping messages, modify ClientOptions so that not all messages are being cached

misty sigil
#

that’s when user is created

errant perch
smoky herald
#

mine is 550 with 1k users, starts up at 380MB but eats up to that 1G in a day 🥴

odd stratus
misty sigil
errant perch
#

nice

misty sigil
#

ikr

errant perch
#

ye

odd stratus
#

I usually use this one Linux command which can clear all caches

misty sigil
errant perch
#

so uhhh

#

im trying to figure out what they gave me

#

since i bought the yearly plan

#

h elp

proven lantern
drowsy grail
#

mine uses like 5.8 gb of ram what the

errant perch
#

how many servers do you have

drowsy grail
#

w 16k servers

errant perch
#

bruh

opal plank
#

5.8gb of ram[

odd stratus
opal plank
#

what the fuck

drowsy grail
#

gonna have to improve that

errant perch
#

if u dont mind me asking

odd stratus
#

I use this npm package called os

errant perch
#

thanks g

misty sigil
#

LMFAO 96mb for 369 servers

opal plank
#

@quartz kindle they using 10+GB for their bots, wtf

errant perch
#

is this not normal

misty sigil
#

I used like 150mb for 50 servers in djs

errant perch
#

i mean

misty sigil
#

wtf are they caching

errant perch
#

it is discord.js

errant perch
misty sigil
#

yes it’s normal then

drowsy grail
#

yes djs is an oof

opal plank
#

bruh im using 700mb for 1k servers and 300k+ users

errant perch
#

messages, channels, servers, users

drowsy grail
#

should i just clear out my caches

misty sigil
opal plank
#

(of course theres a leak somewhere that i havent fully figured out)

drowsy grail
#

periodically

opal plank
errant perch
#

ohwaitthatswhatthatmeans

misty sigil
opal plank
#

dont forget i have a completely different user object ontop of that

#

which is quite hefty and big too

misty sigil
#

optimisation

opal plank
#

i dislike manipulating stuff from other libs

drowsy grail
#

just run everything through jsminify problem solved

errant perch
#

optymazatyn

opal plank
#

i wont push my custom user object onto d.js's

misty sigil
#

why not

opal plank
#

that'll likely create a ton of bugs, specially with their caching resetting mine

drowsy grail
#

do partials use considerably less memory w djs

odd stratus
#

Does Eris cache less than discord.js

quartz kindle
#

lmao

opal plank
quartz kindle
#

im sitting comfortably at 140mb

#

7.5k servers

errant perch
#

you could restart the bot every six hours lol

drowsy grail
#

excuseme

errant perch
#

just write a script

#

waitwhat

misty sigil
#

tim holy fuck

drowsy grail
#

tim is a wizard

errant perch
#

hes hacking

opal plank
#

i really would rather have caching, though i might switch to redis instead of process memory

misty sigil
#

that’s just a bit more than me and I have like 370 servers

drowsy grail
#

just store everything in swap

misty sigil
#

wtf tim

errant perch
opal plank
#

fuck swap

drowsy grail
#

no memory usage kappa

opal plank
#

to the hell with that

#

swap is only useful if you dont have ram

quartz kindle
misty sigil
#

storing in swap is just a worse version of a database

#

innit

smoky herald
opal plank
#

i can literally run 20 instances of the same bot for no reason whatsoever and still have 100gb leftover

errant perch
#

wha

misty sigil
#

why 20

opal plank
#

cuz 126gb of ram

misty sigil
#

and not 200

opal plank
#

cuz i already did that with twitch

#

but, add an extra 0

misty sigil
#

oh ofc I forgot

drowsy grail
#

can you loan me some ram in this trying time

quartz kindle
#

try running 100 instances of mine

drowsy grail
#

i'll just download it from your server

opal plank
#

no can do mmulu this is all for me to gurgle on

drowsy grail
#

sftp

misty sigil
#

Erwin I’m just gonna steal your server

quartz kindle
#

700k guilds for only 14gb ram

drowsy grail
#

srtp

misty sigil
#

you’ll notice nothing

drowsy grail
#

@quartz kindle what lib are you using?

quartz kindle
#

discord.js-light

opal plank
#

take a guess

drowsy grail
#

because that number is insane

opal plank
#

lmao

drowsy grail
#

yeye

marble juniper
#

I get 401 errors after regenerating my token and I did change the token in my code

misty sigil
#

of course it’s djs light

marble juniper
#

which makes no sense

misty sigil
#

djs light is very pog I like it

marble juniper
#

at first it responds to commands

opal plank
#

it would be funny if tim used eris, after having made djs-light

quartz kindle
#

lmao

marble juniper
#

and then it just throws out 401 errors

#

like crazy

quartz kindle
#

i tried using eris

marble juniper
#

hello?

quartz kindle
#

but ran into weird bugs

opal plank
#

its like making postgres and using mongo

#

wrong emote

misty sigil
#

redis is cool

#

I like it

opal plank
#

i have it on the prod server

drowsy grail
#

oh tim literally made djs light

marble juniper
#

why does my code throw out 401 errors

opal plank
#

but installing it locally is a pain cuz windows

misty sigil
#

idk ask discord

marble juniper
#

I changed the token in my code after regenerating

#

it makes no sense

#

in the first 10 seconds it works

misty sigil
marble juniper
#

after that

misty sigil
#

Ubuntu server

marble juniper
#

it just throws 401 errors

misty sigil
#

just sits and runs

opal plank
marble juniper
#

that

#

makes

opal plank
#

brb in 30

marble juniper
#

no sense

errant perch
misty sigil
#

oh god Erwin what are you doing

marble juniper
#

im just gonna ask untill I get an answer then

#

why do I get 401 errors even tho I regenerated the token and put the new one into my code

#

it works in the first 5 to 10 seconds but afterwards it throws out 401 errors

#

oh I see why

#

lol

earnest phoenix
#
107

0

71

0.45

4.1%

0.4

145

50.0%

129

0.78

0.1%

0.5

0

0

0

0

0

0

0

0



0

-

0

This is the user information I get, but this is tied to one, so it's difficult. I thought, so how do I do it, how to recognize the next digit separately from the beginning and ending point with all spaces left behind?

#

I want to skip the point where the space starts and ends

opal plank
#

10 more mins

misty sigil
#

what have you done

opal plank
#

what i AM doing, you mean

misty sigil
#

what are you doing

misty sigil
#

installing it locally

opal plank
#

read what you said before for context

misty sigil
#

it was something about redis

#

my short term memory isnt that bad Sad

opal plank
#

correct

#

so, i got fed up with my own bitching and whining that im doing it rn

#

there we go, ubuntu running

misty sigil
#

wsl?

opal plank
#

2, yes

#

i hate navigating folders with ls

misty sigil
#

cool

opal plank
#

its so annoying

#

ls, cd, ls, cd, ls, cd

misty sigil
#

not as good as my entire pc dedicated to it tho

earnest phoenix
#

cli ftw mmulu

misty sigil
#

i agree

earnest phoenix
#

i started navigating through folders with ps on windows

#

i find it easier and faster to just type what i need and autocomplete with tab

#

instead of clicking through folders, waiting for it to load...

opal plank
#

just finishing tests

#

and should be usable

misty sigil
#

plot twist:

#

it isnt

opal plank
#

though i wonder if i can access redis from my windows

#

rather than putting the code in the vm

misty sigil
#

tias ig

opal plank
#

i assume i should be able to websocket into it

misty sigil
#

websocket?

opal plank
#

iirc redis has support for websockets

misty sigil
#

cool

opal plank
#

so i can run redis instance and connect it via TPC

#

hpoefully

#

perfect

#

now to setup the websocket clients

misty sigil
#

ALL of the tests

#

thats pretty pog

opal plank
#

its annoying that it doesnt list all dependencies BEFORE it tries to install itself

#

had to install it 4 times

#

but the test only needed to be ran once

distant cobalt
odd stratus
#

By the error, it looks like one of your embed fields is empty

distant cobalt
#

really? I checked

#

they're not empty tho

misty sigil
#

the db values might be empty??

odd stratus
#

Try console logging your db values

distant cobalt
vague yoke
#

Hey is the members bot going good???

#

Members plus

odd stratus
solemn latch
#

members plus was shutdown wasnt it?

distant cobalt
#
db.set(`${message.guild.id}.${message.author.id}.houseAddress`, undefined)``` i tried this but how do i make the value `undefined`?
vague yoke
#

Oh rip

#

Hey what is the quickest way to get people on my discord

misty sigil
#

also this is dev so you might wanna get out

opal plank
#

redis done

misty sigil
#

PAIMON FOOD

opal plank
#

no more bitching about redis not being on windows anymore

misty sigil
#

poggers innit bruv

#

fuck im out of pringles

opal plank
#

thats the beta bot though

#

if i were to run the main one shit'd probably scream

misty sigil
#

try it mmLoL

opal plank
#

hell naw, i enjoy having a computer not overheating and possibly melting

zenith terrace
#

dam its only been 30 mins

misty sigil
#

i'll run the main one

zenith terrace
#

still too early for top gear

opal plank
#

heres my token then

#

Nzc3NGQ0ANg4NDExNjI7HDA0.X6_Kqw.jtTsloTGHFTrJ2hlficlCnYyAu7

#

there we go

#

spin er' up

misty sigil
#

aye aye

opal plank
#

imagine if thats someone's actual token

#

👀

zenith terrace
#

user token zoomeyes

opal plank
#

the odds of randomly getting one are pretty miniscule

zenith terrace
#

gimme ur token erwin

misty sigil
#

tokens

earnest phoenix
#

Nzc3NGQ0ANg4NDExNjI7HDA0 doesn't even represent the user id lol

opal plank
#

look, it was a meme, im not actually gonna encode a random id to b64

#

too much effort for a joke

earnest phoenix
#

exdee

opal plank
mellow kelp
#

developergasm

opal plank
#

Internal API
IPC pipe
Top.gg webhook
Redis
Postgres
Discord-SDK
Discord.js
Teyvat Library

#

what else i got thats notable?

misty sigil
#

yourself

opal plank
#

oh, wait, you meant the role

mellow kelp
misty sigil
opal plank
#

actually

#

question

#

@misty sigil can u try something for me rq?

misty sigil
#

aye?

opal plank
#

voice*

#

does the buttons and presence display there?

misty sigil
#

aye

opal plank
#

oh shit, thats interesting

#

ty

earnest phoenix
#

Guys i need help i made this for Count on his status But it say on his status like this
${client.guilds.size} Servers

var statuss = ["${client.guilds.size} Servers","${client.users.size} Members","${client.channels.size} Channels","taybot.ga","${prefix}"];
var secound = 8;
client.on("ready", () =>{
var timeing = Math.floor(secound*1000);
setInterval(function(){
var ammount = statuss.length;
var num = Math.floor(Math.random() * ammount);
client.user.setActivity(statuss[num], {type: 'PLAYING', url: ''})
}, timeing)
});

#

Help

#

you're using the wrong quotes

#

backticks for template literals

earnest phoenix
#

wheres problem

opal plank
#

also, really, stop using var

earnest phoenix
#

shy?

#

why?

mellow kelp
#

var has a weird variable scope

#

use let or const

earnest phoenix
#

okay now?

#

let statuss = [${client.guilds.size} Servers,${client.users.size} Members,${client.channels.size} Channels,"taybot.ga",${prefix}help];
let secound = 8;
client.on("ready", () =>{
let timeing = Math.floor(secound*1000);
setInterval(function(){
let ammount = statuss.length;
let num = Math.floor(Math.random() * ammount);
client.user.setActivity(statuss[num], {type: 'PLAYING', url: 'https://twitch.tv/taybot'})
}, timeing)
});

opal plank
#

you didnt read what i said

earnest phoenix
#

can you do ex

drowsy grail
#

does discord.js-light require any configuration outside caching

opal plank
#

no, its a basic moving 2 lines 2 lines down

drowsy grail
#

like is it just the normal library otherwise

earnest phoenix
#

oh i unrestand

#

undrestand

earnest phoenix
opal plank
#

you moved it too far

#

just UNDER 'ready'

#

dont put it lower

mellow kelp
#

variable scope pEnSiVe

opal plank
#

above timeing and below "ready"

earnest phoenix
#

thank you sir

smoky herald
#

Kinda solved the memory crashes, just put those parameters into previously vanilla client constant

    messageCacheMaxSize: 1000,
    messageCacheLifetime: 310,
    messageSweepInterval: 310
});```
And here are the new logs instead of the previous ones increasing by 50MB/30min
1:00 - 440
1:30 - 445
2:00 - 454
2:30 - 443
earnest phoenix
#

How would I check if a user has voted for my server on top.gg

earnest phoenix
#

My friend has an auth token and he’s confused aswell

#

He did it in jda

opal plank
smoky herald
opal plank
#

and it has to be an approved bot

#

you cant use top.gg's api without the bot being approved @earnest phoenix

earnest phoenix
#

My friend has an approved bot

#

He’s trying to help me make it

#

I’m just confused

#

Someone said I need a webhook

quartz kindle
#

He said he wants server votes, not bot votes

earnest phoenix
#

It’s for a guild not a bot

opal plank
#

OOOOOOH

#

my bad

smoky herald
#

🙈

opal plank
#

it should work the same as bot, no?

earnest phoenix
#

It’s very confusing dude I’ve been trying to figure this out forever

#

No it doesn’t apparently I need a webhook

opal plank
#

webhook part should be the same as bot, the only difference is that you'd use the server auth , not the bot

rustic nova
#

servers does need a webhook

opal plank
#

you mentioned jda, so i assume your code is in java?

#

or do you not mind which lang?

earnest phoenix
#

I can do it in java js python php

opal plank
#

js would be the easiest imo

earnest phoenix
#

Okay how would I do it?

quartz kindle
#

php would be even easier

#

xd

opal plank
#

i would assume the node-sdk would work with guilds

#

cuz i think internally it only checks the auth

#

let me ping rq

#

@slim heart oi

#

do you recall if you can use the sdk for servers?

slim heart
#

you can

#

it has types for it too

opal plank
#

then here it is

#

@earnest phoenix

quartz kindle
#

Including server webhooks?

slim heart
opal plank
#

you should be able to simply copy the example and change the auth key

slim heart
#

not me forgetting the name of the package

opal plank
#

wrong name btw

#

thats invalid link

#

i just sent the github one, it was on my history

opal plank
# earnest phoenix Okay how would I do it?
const express = require('express')
const Topgg = require('@top-gg/sdk')

const app = express() // Your express app

const webhook = new Topgg.Webhook('topggauth123') // add your top.gg webhook authorization (not bot token)

app.post('/dblwebhook', webhook.middleware(), (req, res) => {
  // req.vote is your vote object e.g
  console.log(req.vote.user) // 221221226561929217
}) // attach the middleware

app.listen(3000) // your port
quartz kindle
#

npm install 404

opal plank
#

this is the example, this is basically what you need

#

rather than console.log(), you'd dump it into a database

#

THEN you can reliably get which users voted or not

#

i can show my vote logs and shapes, one sec

misty sigil
#

dump into db

quartz kindle
#

dumb into dp

slim heart
#

uhm,

opal plank
slim heart
#

linux doesnt have a /dist right?

#

root/dist

opal plank
#

just timestamp and user, thats it

slim heart
#

please tell me not

opal plank
#

not sure, let me check

slim heart
#

cu z i accidentally just compiled to the dir and overwrote it if it does exist

lyric mountain
#

It does iirc

#

Lemme check

slim heart
#

fuck

#

well

lyric mountain
#

No

#

It doesn't

misty sigil
#

berry be paniking

slim heart
#

alr

lyric mountain
#

Neither ~/dist nor /dist

opal plank
#

welp, something fucked up

#

wtf

lyric mountain
#

Logger.wtf()

#

What a Terrible Failure

#

Yeah, sure

opal plank
#

not loading

lyric mountain
#

So, you're indeed brazillian ain't u?

quartz kindle
#

ofc he is

#

huehuehue

earnest phoenix
#

// add your top.gg webhook authorization (not bot token) where would i find this?

lyric mountain
#

He?

#

Too much for a single day

quartz kindle
#

he/she/idk

#

they

lyric mountain
#

It

raw talon
#

anybody using heroku and python here? i was wondering how you setup your Procfile to also listen to the Top.gg webhooks

lyric mountain
#

That's something I think ain't possible

#

It has nothing to do with procfile actually, it's just about the address + port

#

You see, heroku only opens ports for web dynos

#

Not worker

earnest phoenix
opal plank
quartz kindle
#

stupid is bronzillian

opal plank
#

on the settings page

lyric mountain
#

So you kinda can't have both worker dynos and open ports

earnest phoenix
#

oh okay so that

lyric mountain
#

And without ports u can't listen to webhooks

quartz kindle
#

you can run the whole thing in a single web dyno

opal plank
lyric mountain
#

But it'll turn off after a while

raw talon
lyric mountain
#

So uptimerobot ig

quartz kindle
#

doesnt worker also turn off?

raw talon
#

because the bot is working during that 60secs

lyric mountain
#

Worker dynos only turn off once a day

#

Or once you run out of hours

#

Web dynos are glitch-like

quartz kindle
#

ah

lyric mountain
#

So you gotta ping once every 15 min i think

raw talon
lyric mountain
#

Web dynos will shut your bot down

raw talon
#

thats only if you don't pay right? i'm paying

lyric mountain
#

No

#

Web dynos always turn off

#

Also, you're paying?

#

Heroku is overpriced af

quartz kindle
#

if you're paying you can run both

raw talon
#

yes, but then i'm paying for two dynos the worker and the web

#

for just webhook functionality

lyric mountain
#

That's crazy but ok

quartz kindle
#

what are you paying for then?

raw talon
#

just the worker

#

i was hoping to switch to web and figure how to bind the port

lyric mountain
#

It'd be cheaper and more versatile if you used a vps

raw talon
#

i know

#

i just want to get something going

quartz kindle
#

which plan are you paying for?

#

hobby or standard?

raw talon
#

i was using hobby but standard now, i needed the preboot

lyric mountain
#

Wow

#

You're crazy

#

Like, literally

raw talon
#

many of my users were facing issues whenever i pushed updates

#

ahhh, don't talk me into starting a VPS

#

where should i consider?

lyric mountain
#

Dude