#development

1 messages · Page 1573 of 1

frozen rock
#

@zenith terrace i just didn't understand

#

will you help or not?

zenith terrace
#

with what

frozen rock
#

leave this link

marble juniper
#

can't you just do it yourself

frozen rock
#

no.

marble juniper
#

you don't need a link for that

frozen rock
#

not speaking with you

zenith terrace
frozen rock
#

:)

marble juniper
#

another "I only want help from this person" guy smh

#

are you on windows 10 maybe

#

lol

#

oh

#

well is there still a node process running in the background maybe

dreamy gulch
#

sudo killall -9 node

marble juniper
#

ye

#

just kill the node processes running if any

#

lol

cinder patio
#

Hmm.. it looks like the error is coming from dblapi.js

marble juniper
#

oh

#

also btw

#

don't use dblapi.js

#

use the new lib

cinder patio
#

dblapi is creating a webhook listening on port 5000

#

yeah

marble juniper
#

kek

#

well

#

the original maintainer is banned here

#

so they made a new lib

cinder patio
#

wait what why were they banned

marble juniper
#

you can read the docs and then the javascript section

#

also original maintainer was tonkku

#

I believe

#

but tonkku is banned sooooo

cinder patio
#

yeah wasn't he part of the team I'm out of the loop on this one

zenith terrace
#

havent heard his name in so long lol

marble juniper
#

he was

cinder patio
#

we shouldn't discuss this here anyways

zenith terrace
#

^

marble juniper
#

yeah

#

my point is don't use the old library

#

its deprecteated and obviously wont be updated anymore

#

just use the new one

#

I think every like 15 minutes

#

not exactly sure

#

but it does its job and wont get you ratelimited

#

lol

#

ok just looked and it says every 30 minutes

earnest phoenix
#

no

#

you have a misunderstanding on how topgg webhooks work

#

webhooks are reverse APIs, instead of you making a request to top.gg, top.gg makes a request to you

marble juniper
#

TL;DR
topgg webhooks and discord ones are not related to each other

earnest phoenix
#

^ therefore, you need to have a HTTP server active to listen for requests from top.gg

#

it's your own arbitrary string

#

you set it on your bot's page and you use it in your HTTP server to verify the request is coming from top.gg

marble juniper
#

you just type in any sort of auth and then validate it in your code that it is the same like you specified

earnest phoenix
#

yes

marble juniper
#

ye

earnest phoenix
#

don't make it a weak one though

marble juniper
#

you can think of it kinda like as a password validation

#

so make it like ur password

#

no

#

you do http://
then followed by the ip of wherever you are running the bot on and then /dblwebhook

#

so for example

#

as an example

#

(not a real ip)

#

id suggest to make it something like 3000 or 4000

#

lol

pale vessel
#

any open port

marble juniper
#

any port that isn't in use

river thistle
#

haha he said 69 funny

lament ruin
#

8080 is the most common

marble juniper
#

or

#

3000

river thistle
#

or

#

8000

marble juniper
#

yes

pale vessel
#

42069

river thistle
#

6666

marble juniper
#

app.listen makes your server listen to requests on the given port

pale vessel
#

took a while for me to realize it was you cstef

river thistle
#

yup

#

its me

#

the overflow guy

marble juniper
#

snack overflow

river thistle
#

I am not a developer anymore sadCat

marble juniper
#

iq overflow

river thistle
#

clearly not my case

river thistle
#

you get the user id

#

so you just have to fetch it

#

on discord.js its simple as client.users.fetch(userID)

tribal siren
#

what's your language tho

cinder patio
#

Are you using discord.js or eris?

summer torrent
#

is it v12

#

client.users.fetch()

tribal siren
#

is there a thing like fetchUser

summer torrent
#

yes, in v11

#

yes iirc

earnest phoenix
sterile lantern
#

i want to set the cname to my github link user.github.io, how would i do it?

#

i tried putting domain in name but didnt work

#

req.vote.user.tag

#

maybe

#

what is req.vote.user?

#

or req.vote actually

#

then req.vote.user.tag would work

mellow kelp
#

no it won't

#

req.vote.user is just an ID string

sterile lantern
#

wh

#

o

mellow kelp
#

you can't use req.vote.user.tag

#

im pretty sure the previous solution was correct

earnest phoenix
#

client.users.fetch() returns a promise so be sure to resolve it

split cipher
#

Anyone know how to avoid getting rate limited from sharding bot? When I login, the rate limit pops up in the log

lament rock
#

Increase the amount of time before connecting each shard. The default recommended is 5000ms

#

That's the ratelimit as well

flat oak
#

Just out of curiosity, what language do you think is better? .py or .js?

#

I have experience in python but I was just wondering what u think

earnest phoenix
#

neither exdee

flat oak
#

Lol

lament rock
#

Depends on your work load. Python is good for AIML and JS is just something easy to learn as it can be used full stack

#

Both are pretty powerful

wicked pivot
#
const {
    CanvasRenderService
} = require('chartjs-node-canvas')
let width = 400
    let height = 200

    let chartCallback = (ChartJS) => {
        ChartJS.plugins.register({
            beforeDraw: (chartInstance) => {
                const {
                    chart
                } = chartInstance
                const {
                    ctx
                } = chart
                ctx.fillStyle = 'white'
                ctx.fillRect(0, 0, chart.width, chart.height)
            }
        })
    }

    let DATE = []
    let PINGBOT = []
    let PINGAPI = []
    Object.values(PING).map(r => {
        DATE.push(r.day)
        PINGBOT.push(r.pingbot)
        PINGAPI.push(r.pingapi)
    })

    var canvas = new CanvasRenderService(
        width,
        height,
        chartCallback
    )


    var configuration = {
        type: 'line',
        data: {
            labels: DATE,
            datasets: [{
                label: "Ping Bot",
                data: PINGBOT,
                backgroundColor: '#1BA0FF'
            },
            {
                label: "Ping Api",
                data: PINGAPI,
                backgroundColor: '#FF1B59'
            }
        ]
        }
    }

    var image = await canvas.renderToBuffer(configuration)


    var IMAGEBUFFER = new MessageAttachment(image, 'PINGINFO.png')``` ```TypeError: CanvasRenderService is not a constructor```
cinder patio
#

It's self-explanatory

lament rock
#

The error explains itself

#

CanvasRenderService doesn't have any constructor signatures. Is it a function or some other primitive type?

cinder patio
#

Looking at the examples of the package you're using, you should use the ChartJSNodeCanvas class

wicked pivot
#

"chartjs-node-canvas"

cinder patio
#

yes

#

the package doesn't export CanvasRenderService at all, it's not anywhere in the code

solemn leaf
#

Lol

#

if you want to explore the package in your vsc ctrl click the require or import for it

wicked pivot
#

replace CanvasRenderService to ChartJSNodeCanvas ?

sterile lantern
#

im using a test domain and i keep geting this Redirected you too many times.

#

<domain> redirected you too many times

#

im using cloudfare

#

these are the A records

#

and are proxied

#

idk why it isnt loading

#

it works non-cloudfare

#

so ugh

#

it happens as soon as i add the name servers for cloudfare

#

so annoyin

wicked pivot
solemn leaf
#

well you ddi something wrong

#

options is required

#

you didnt state soemthing

wicked pivot
#

user.username + "#" + user.discriminator

misty sigil
#

try Full and Full (strict)

#

await the fetch

wicked pivot
#

const user = await ...

misty sigil
#

await client.users.fetch()

sterile lantern
#

Oh that worked

#

WHat did that do??

#

Lmao

tame kestrel
#

the fetch function returns a promise, you'll need to await it or resolve the promise somehow.

wicked pivot
#
app.post("/dblwebhook", webhook.middleware(), async(req, res) => {
static trench
#

hello. i wanted my D.py bot to have an error message if a command is run in Dm's. how do i go about doing that?

earnest phoenix
static trench
#

yes

#

so the bot messages like "no commands in DM's"

earnest phoenix
#

Oh, I misread that

static trench
#

ya

earnest phoenix
#

Are you using the guild_only decorator?

static trench
#

i dont think so

earnest phoenix
#

You want to disable all the commands on DM or just some of them?

static trench
#

all

earnest phoenix
#

Then you can override the default on_message event, check if the guild attribute of the message is None, if so, then it's on DM

static trench
#

ok

#

thx

earnest phoenix
#

Don't forget to process the commands

static trench
#

yes

#

i wont lol

gritty bolt
#

anyone know an easy way to change a bot's status without having to hard code it every single time?

opal plank
#

you cant, you try and catch it

gritty bolt
#

wdym?

opal plank
#

you can call it anytime

#

no need to ONLY call it on the ready event

#

you can call it from a command if you want

gritty bolt
#

alright thanks

opal plank
#

np

#

you should be able to if youre logged in, if not, ask in #support

#

aight, time to get back to coding

#

cant wait to finish it

cinder patio
#

same

frosty valve
#

is it possible to make your bots ping to 69420 ms?

quartz kindle
#

a torrent client and lots of luck

#

or just fake it

cinder patio
#

funny number

agile lance
#
let sorted = Object.entries(db.all().find(dta => dta.ID == "bal").data).sort((a, b) => b[1] - a[1])
if(sorted.length > 10) sorted.length = 10
let sorted2 = Object.entries(db.all().find(dta2 => dta2.ID == "level").data).sort((a, b) => b[1] - a[1])
if(sorted2.length > 10) sorted2.length = 10
if(!sorted.length && !sorted2.length) return message.reply("Wait a minute.. No data found. Sad.")
let field = " ";
let field2 = " ";
for(let user of sorted) {
 field2 += `Used: ${client.users.fetch.get(user[0]).tag} - Balance: ${user[1]}`
}
for(let user2 of sorted2) {
field2 += `User: ${client.users.cache.get(user2[0]).tag} - Level: ${user2[1]}\n`
}
message.channel.send(new discord.MessageEmbed()
.setTitle("**Global Leaderboard**")
.setColor("BLUE")
.addField("**Balance Leaderboard**", field)
.addField("**XP Leaderboard**", field2)
).catch(err => message.reply('Leaderboard failed to load' + '\n\n\n' + err))
}```

Error: Cannot read property of ‘tag’ of undefined

Goal: Show username#tag instead of user id’s on my leaderboard
quartz kindle
#

stupid dog

agile lance
#

lol

umbral zealot
agile lance
#

yeah i changed it to

#

client.users.cache.get()

umbral zealot
#

not in the above code you didn't

agile lance
#
 field2 += `Used: ${client.users.cache.get(user[0]).tag} - Balance: ${user[1]}`
}
for(let user2 of sorted2) {
field2 += `User: ${client.users.cache.get(user2[0]).tag} - Level: ${user2[1]}\n`
}```
quartz kindle
fierce ether
#
if(member.roles.cache.some(role => {roles.includes(role.id)
 member.roles.remove(role)}))``` would check if user has one of the roles in the array if true removes it correct?
agile lance
#

thats my for loop now

#

still same error

quartz kindle
#

use not cached

agile lance
#

dang

umbral zealot
#

Could also be a user that left the guild, that would also break it

#

you'll need to await the fetch and also make sure to ignore/remove the user if they've left.

agile lance
umbral zealot
#

Ah well they might also have left all the guilds, tbh

agile lance
#

true

umbral zealot
#

either way, you have to resolve the user one way or another

agile lance
#

welp ill keep it at id’s then

quartz kindle
#

you can still fetch users even if you dont share guilds

cinder patio
#

Kinda off topic but why are you db calls sync

agile lance
#

i even tried to fetch with client.users.fetch

umbral zealot
quartz kindle
#

which uses better-sqlite3

#

which is sync

humble rock
#

callback(new MongoError(document));
^

MongoError: bad auth : Authentication failed.

Why did i get this err?

quartz kindle
#

authentication failed

tired panther
#

How can the bot delete all messages in dm?

sudden geyser
#

Well are you fine getting rate limited /s

#

You can't do it without abusing the API.

tired panther
#

that are just 3 messages of itself

sudden geyser
#

How are you sure there aren't more?

#

You could just fetch the messages and delete one by one.

tired panther
tired panther
sudden geyser
#

A DM is a channel.

earnest phoenix
#

Why do you need to fetch it just to delete it?

sudden geyser
#

To get the message IDs?

earnest phoenix
#

Ah, fetch the history

cinder patio
#

There's no bulkDelete for DMs afaik

tired panther
#

like this?

sudden geyser
#

Not quite.

cinder patio
tired panther
#

client.channels.dmChannel() ?

cinder patio
#

no

#

I gave a link to the property that you need

#

User#dmChannel

tired panther
cinder patio
#

No, because:

  1. fetch returns a promise, you need to resolve it in order to get the User object
  2. dmChannel is not a function, it's a property
tired panther
#

so just .dmChannel

cinder patio
#

Also, dmChannel can also be null, so make sure to call createDM if it's null

tired panther
earnest phoenix
#

doesn't createDM lazy fetch it

tired panther
earnest phoenix
#

if you read the docs, it returns a DMChannel

cinder patio
tired panther
cinder patio
#

what do you need the id for?

tired panther
#

thats way I need the channel to fetch the message

cinder patio
#

but you already have the channel, it's User#dmChannel

tired panther
cinder patio
#

Yes, that's why I told you to do use createDM

tired panther
#

user.createDM()?

cinder patio
#

yes

#

it returns a promise

jovial nexus
#

what does it mean when the bot emits the shard ready event but without any restart and the presence is gone?

rugged cobalt
#

oh wait

#

if anyone saw that, it's all under control now

#

I hope anyway

merry pilot
#

@voyac bot

jovial nexus
#

and looses the custom status

lyric mountain
#

it'll emit once per shard if you're sharding internally

jovial nexus
#

yes but not randomly

#

only when it starts

lyric mountain
#

maybe it suffered a micro-disconnect

#

like, when discord have a seizure

#

put some check inside it if u want to prevend further calls of onReady

jovial nexus
#

it keeps saying Shard reconecting, shard ready

lyric mountain
#

like if (started) return;

#

then define started as false in a global var

jovial nexus
#

is a host issue?

lyric mountain
#

I don't think so

jovial nexus
#

code issue?

lyric mountain
#

MAYBE it can be code issue

jovial nexus
#

i have a lot of bots in the vps and only one says that

earnest phoenix
#

parden my dumb

#

but what fs thingy would i call to delete a dirent

#

nvm found it

#

fs.unlink(dir)

#

I got some trouble installing node weirdsip

earnest phoenix
#

It's literally not doing anything

#

In PowerShell

#

It has installed some stuff before

#

But now it's just there

#

Nothing is happening

#

¯_(ツ)_/¯

#

i got mine installed like a year ago

#

havent touched it since

#

just use it to ```bat
node index.js

#

type node -v

#

do you get a version ?

#

@earnest phoenix

#

Uh yes

#

Node has been installed

#

But the other things

#

There was an option to install more things using chocolatey or whatever it's called

lament rock
# jovial nexus what does it mean when the bot emits the shard ready event but without any resta...

Whenever a client's ws connection is terminated by Discord for whatever reason or you temporarily loose connection, your client will be forced to re-identify and if applicable, resume its connection to Discord. Discord sometimes closes the ws with code 1000 or something else, I've found. One of them is mostly whenever cloudflare is undergoing maintenance. 1000 is when you fail to heartbeat within the readyevent.d.heartbeat_interval or just sometimes closes it when they feel like it.

#

There is nothing you can do about it if you're using a lib like Discord.js or Eris or Discord.py or whatever

#

If it's your own gateway implementation, then make sure you're heartbeating every readyevent.d.heartbeat_interval

solemn leaf
#

@pale vessel

quaint wasp
#

Can someone help me? My tags arnt working..

crimson vapor
#

I don't see the issue

#

mostly because you didn't tell me what it is

quaint wasp
#

says only 2 users.

#

When its with over 200.

mellow kelp
#

those are just the cached users

crimson vapor
#

because caching™️

misty sigil
#

You should reduce the guilds

quaint wasp
#

. .?

quaint wasp
misty sigil
#

client.guilds.cache.reduce((a, b) => a + b.memberCount, 0) iirc

crimson vapor
#

yep thats what most people do

#

its off by a bit when you get members consistant

quaint wasp
crimson vapor
#

like say im in 5 servers with my bot, ill show up 5 times

misty sigil
#

no

#

it doesn’t

crimson vapor
#

bro

quaint wasp
crimson vapor
#

client (client)
guilds (the guild manager)
cache (all of the cache of the guilds Map<ID, guild>)
reduce (function)

#

why would iirc be in the code

misty sigil
#

but frankly I have lost all care

quaint wasp
#

WOWOWOWOW

#

dang...

#

never knew that my boy is that popular..

misty sigil
#

11 guilds isn’t much

quaint wasp
#

ik..

misty sigil
#

and user count is a stupid metric

#

command usage is the real metric

quaint wasp
#

But the users..

#

oh

#

😐

#

made all my hope go away...

earnest phoenix
#

users don't really mean anything

#

80% of those users aren't going to be using your bot and there's a high chance there's dupes if you're using memberCount

crimson vapor
#

especially big servers

misty sigil
#

Like this one

sudden geyser
#

more like 99.95%

quaint wasp
misty sigil
#

100k members in here

quaint wasp
#

it still counts that as 2 members..

misty sigil
#

how many are using my bot

crimson vapor
quaint wasp
#

when I putted the same code there

misty sigil
#

like... none

crimson vapor
#

bro

#

wtf same

#

you're just stealing my stats

quaint wasp
misty sigil
#

eh wrong

quaint wasp
#

well

#

like 6.

misty sigil
#

people do use my bot sometimes

quaint wasp
#

so..

quartz kindle
#

you want to count active users?

quaint wasp
#

My member count still no work.

#

nah

#

WAIT

quartz kindle
#

like people who actually use the bot?

quaint wasp
#

yes.

quartz kindle
#

or just grand total of all guilds?

crimson vapor
misty sigil
#

wdym bro

earnest phoenix
#

imagine having a bot that's for public use mmLol

quartz kindle
#

imagine publishing a private bot

crimson vapor
#

imagine not praying to Tim every day

#

so uncivilized

quaint wasp
#

ikr

quartz kindle
#

anyone ever used a mapping stack? like google maps-esque apis and such?

quaint wasp
#

nope..

crimson vapor
#

whats it do?

quaint wasp
#

map..

#

I think.

quartz kindle
#

im deciding on one, so far im leaning towards openlayers

crimson vapor
#

map what

#

like Map<K, V>?

quaint wasp
#

Idk

mellow kelp
crimson vapor
#

it was

quaint wasp
#

come someone help me with status member count?

mellow kelp
#

so civilized

crimson vapor
#

lol

#

yes indeed

#

LOL

quartz kindle
#

fail

quaint wasp
mellow kelp
#

wrong ping™️

crimson vapor
#

lol

quartz kindle
#

wait, does discord have any shortcut for replying?

crimson vapor
#

umm

#

probably not

quartz kindle
#

because i keep having trouble replying to the right message when the text moves too fast

quaint wasp
#

I got this for that: js client.user.setActivity(`Serving ${client.guilds.cache.size} servers, ${client.guilds.cache.reduce((a, b) => a + b.memberCount, 0)} users, and currently looking at ${client.channels.cache.size} channels!`);

crimson vapor
#

hold shift on the message tho

#

then you know its the right one

quartz kindle
#

i dont need to hold shift

#

the reply button is there even without shift

earnest phoenix
#

arrow up -> r key

mellow kelp
#

imagine deleting messages without shift 😔

quartz kindle
#

arrow up edits my last message

quaint wasp
#

same

quaint wasp
mellow kelp
#

it's a joke kekw

quartz kindle
earnest phoenix
earnest phoenix
quartz kindle
#

oh

#

i see

#

pressing tab enters selection mode, then you can navigate messages with arrows, then R to reply

earnest phoenix
#

discord claims they improved keyboard shortcuts a ton of but they still suck ass and a lot of hotkeys take up space when nobody uses them

quaint wasp
#

this is totatly related to developing.

earnest phoenix
#

nobody cares

modest maple
#

this^

solemn leaf
#

this^^

quartz kindle
#

this^^^

solemn leaf
#

this^^^^

earnest phoenix
#

there's also undocumented shortcuts for zooming in/out and if you have a non us layout, well, good luck finding your way to reset the zoom

solemn leaf
#

ctrl 0

earnest phoenix
#

doesn't work for qwertz 🤷‍♂️

solemn leaf
#

bruh

#

my keyboard is

#

qwerty

earnest phoenix
#

works with ctrl tilde for me

quartz kindle
#

wait you can disable the member list

#

i didnt know that lmao

solemn leaf
#

pretty surte you can also hide the channels

earnest phoenix
#

to be fair shortcuts are a pain in the ass because key codes vary from keyboard layouts to os'

#

i resorted to using libuiohook for my app in order to register shortcuts

modest maple
#

honestly the tab select message thing pisses me the fuck off

honest perch
#

@misty sigil ask question here

#

i cba anymore

misty sigil
#

I cba either

honest perch
#

bro

misty sigil
#

fiiiine

honest perch
#

ok lemme describe my issue

#

in an image

misty sigil
#

It has admin ^

earnest phoenix
#

That permission bitfield is only for that specific channel

honest perch
#

yes

misty sigil
#

doesn’t take roles into account?

earnest phoenix
#

I'm pretty sure it does

honest perch
#

it has permissions without the role

misty sigil
#

then it should theoretically have admin

#

have I pulled a signature twat moment or has something else died

quaint wasp
#

So how do I make commands like (prefix)prefix !? I got quick.db installed... What next?

earnest phoenix
#

Misly

quaint wasp
#

?

misty sigil
#

!prefix h > store h in db as <guildID>.prefix
and check db on message

#

shouldnt be hard

earnest phoenix
#

Can you try message.channel.permissionOverwrites.has(message.client.user.id)

misty sigil
#

wow wtf bro

#

he really speaking spaghetti

quaint wasp
misty sigil
#

quick.db

honest perch
quaint wasp
#

oh

#

ok

earnest phoenix
#

Hmm

misty sigil
earnest phoenix
#

Try this

message.guild.me.roles.cache.some(({ id }) => message.channel.permissionOverwrites.has(id));```
honest perch
#

@misty sigil ig could check for permissions in the guild

#

not channel

#

anyway i gotta go

#

gn

earnest phoenix
#

The channel doesn't have permission overwrites for the client nor it's roles, that might be the issue i guess

fierce ether
#

bot is not adding to server

rustic nova
#

Known issue

#

Discord is probably aware already

quaint wasp
earnest phoenix
#

discord fucked up something with recaptcha

fierce ether
#

yeh

earnest phoenix
#

all you can do right now is sit, wait and possibly reconsider all of you life choices

fierce ether
#

no idea then

earnest phoenix
#

yez, discord will make his re captcha now yay!

#

discord has a gender now? 😳

#

Yes

#

discord was made by a boy

#

But also a girl

#

So both? Gun_Thonk

#

ok no off topic bye

crimson vapor
#

is jason trans?

earnest phoenix
#

Maybe it was a partnership or made by more than one person GASP

quaint wasp
#

Why is that underlined?

#

It closes the bigging of the cmd..

earnest phoenix
#

no, it closes off the permission check

quaint wasp
#

oh..

#

Alright.

#

I added that one//

#

and still same thing.

earnest phoenix
#

you now closed the function

#

now close the object

quaint wasp
#

oh! Shoot im so blind.. thanks!

#

...

#

Am I blind again?

zenith terrace
#

Switch members and mentions around

odd stratus
#

Because that’s the amount of members the bot has cached, not total users

This is how I do mine:
let totalUsers = await bot.shard.broadcastEval( this.guilds.cache.reduce((a, g) => a + g.memberCount, 0) );
totalUsers = totalUsers.reduce((acc, usersCount) => acc + usersCount, 0);

#

This wouldn’t work with “user”
You will end up with a “cannot find property size of undefined” error

#

Yeah but you could probably do a quick google search on how to do it for a bot without shards

#

Mhm

sour summit
#

yes shut up

quartz kindle
#

broadcastEval takes a string

#

you have to pass the code as a string, like in the eval() function

robust blade
#

does anyone know how to make a bot go from online to idle

#

me needs help

rustic nova
robust blade
#

i meant online to idle

#

not the activity of the bot

misty sigil
#

or sometjign

jolly mortar
#

how can i make my bot alot faster

quaint wasp
#

uhhh

#

I've been trying to create a say command for like past hour..

#

and cant make it..

jolly mortar
#

discord.js?

quaint wasp
#

and its not because I am a dombass.

#

yes.

#

discord.js

jolly mortar
#

i have one lemmi get it

mellow kelp
#

alert spoonfeed alert alert

#

k bye

quaint wasp
#

bra

#

😐

sage bobcat
#

One message removed from a suspended account.

quaint wasp
#

i

#

alr. He doesnt have the command..

#

so I need help

#

and u dont need to spoon feed me..

earnest phoenix
#

Does anyone know how to make a bot on mobile

misty sigil
#

just ask the question

quaint wasp
earnest phoenix
#

Try client.shard

earnest phoenix
#

I've been trying to make a bot on mobile for the past 10 hours

quaint wasp
#

OOF.

earnest phoenix
#

get a development machine

#

ARM devices aren't powerful enough to be one

#

except m1s

#

those are witchery

misty sigil
#

m1s are weird

#

cool

#

but weird

earnest phoenix
#

How long does it take to even make a bot
@earnest phoenix
Depends on what you are intending to make

opal plank
#

@quartz kindle come check THIS out

tulip wave
#

Wtf

mellow kelp
#

what the

tulip wave
#

How many awaits and asyncs do you need

mellow kelp
opal plank
#

imagine not waiting for promises

#

smh

quaint wasp
tulip wave
#

Imagine having promises

quaint wasp
#

why it no work?

earnest phoenix
#

Use backticks?

opal plank
#

ah, i see you run js on node 8

#

or ES5

glossy spoke
tulip wave
#

I just chuck raw data around

mellow kelp
quaint wasp
#

oh

tulip wave
mellow kelp
#

kekw

opal plank
#

i legit cannot believe i actually wrote that

tulip wave
#

U should see some of my crappy code

opal plank
#

i dont even think a d.js noob would do this

earnest phoenix
#

Can confirm

quartz kindle
tulip wave
#

Tbh when I first started programming I had no clue how to async and await

#

Or what it did

opal plank
tulip wave
#

I just knew where I had to use it

mellow kelp
tulip wave
#

Now I'm comf with a lot of js shit

mellow kelp
#

same

opal plank
mellow kelp
#

true

quartz kindle
#

i was well a couple years into js and still didnt know how async/await worked

tulip wave
#

I'm about 2 years into js properly

opal plank
#

i think im 7 months into js

mellow kelp
#

im like

#

10 months into js

tulip wave
#

I'm also a year into java

#

Very basic java but still

quartz kindle
#

im about 3 years into the third wave

#

my first wave of js was like 10 years ago

#

lmao

blissful coral
#

That is literally creating a application

tulip wave
#

I'm moving Into c++ next year in college

quartz kindle
#

nice

blissful coral
#

And he is literally wasting 5 minutes of it to make the oauth link

opal plank
#

actually, a year

#

this is the latest log i could find

tulip wave
#

I'm still surprised I was able to keep my bots memory down to like 300-400 mb on full fat d.js

#

With 3.4k servers

glossy spoke
#

lol

quaint wasp
tulip wave
#

Recently moved to Eris and I'm down to 300 at 3.7k

glossy spoke
#

400mb for a bot on 3.4k servers

#

that's apparently impossible but you already did it lmao

tulip wave
opal plank
tulip wave
#

Lmao

sudden geyser
#
  • Ddossed Twitch hard
    Could put this on your resume
glossy spoke
#

why would someone refuse to use an embed builder?

opal plank
#

cuz its shit

#

n.tag embder builder bad

sudden geyser
#

They like using the key-value way

tulip wave
#

The shits in d.js part I can vibe with that

tulip wave
#

Once I moved to Eris I just seen the light

opal plank
glossy spoke
#

lmao

tulip wave
#

I need to improve my embed builder

glossy spoke
#

i still laugh when i remember these people that puts their bot's code inside their bot's page description xD

tulip wave
#

It's currently like the d.js embed builder

glossy spoke
#

lmao

opal plank
#

3gb

#

for 1600 server

#

its insane

#

no sane lib would ever do this

#

it fucking saves EVERY EDIT YOU MAKE

glossy spoke
#

uh

#

did you think that probably would crash the db?

tulip wave
#

HOW IS IT AT 3GB

opal plank
#

I KNOW RIGHT!

tulip wave
#

EVEN FOR D.JS THATS HIGH

opal plank
#

my stuff is only using 312MB from my profiler, the rest is all D.JS CACHING SHIT

glossy spoke
#

lmao

tulip wave
#

I never had d.js cache that much

sharp thicket
#

Hi

tulip wave
#

How many users?

opal plank
#

400k basically

#

yeah, click me

sharp thicket
tulip wave
#

Bitch at 600k I was at 350-400mb

opal plank
sharp thicket
#

Lol

opal plank
tulip wave
#

I'm crying just thinking about it

#

Use d.js-light or Eris

opal plank
#

sane bot

#

same*

tulip wave
#

Oof

opal plank
#

only difference is the library

#

fuck d.js

#

literally

#

fuck d.js

blissful coral
#

d.js-light

#

kek

sharp thicket
#

Lel

#

Tim

opal plank
#

fuck that whole thing

tulip wave
opal plank
#

im rewriting everything

sharp thicket
blissful coral
#

Just don't use a lib

#

lul

tulip wave
#

This is on eris

opal plank
#

i cache a shit ton more stuff btw

sharp thicket
opal plank
#

i got custom users

#

and a ton of other shit cached, such as buffers

#

and images

sharp thicket
#

Oh god

#

For 400k guilds that must be a lot of cache

tulip wave
#

Explains a lot

opal plank
#

indeed, though im at 400k users, not guilds

tulip wave
#

U have bad memory management

sharp thicket
#

Oh

tulip wave
sharp thicket
#

Lol

#

Rip

opal plank
#

also my bot is cache full

#

messages, guilds, updates, presences, reactions

tulip wave
#

I cache prefixes and that's about it

opal plank
#

to be holding at 320 is quite good

#

nah, im caching everything

#

i got a bit of ram

#

just a bit

tulip wave
#

I got 30 Gigs dedicated to my bot

#

And I'm using not even 10%

opal plank
#

i got.... erm.... a couple

tulip wave
#

But still 3gb

#

Yikes

#

It hurts me thinking about it

opal plank
opal plank
#

fuck that

tulip wave
#

Kekw

#

What u using insted of d.js

opal plank
#

detritus

tulip wave
#

Never heard of that one

opal plank
#

its a pure Ts lib

tulip wave
#

Ah

opal plank
#

not gonna bother with anything else that has .js in the name

tulip wave
#

lowkey was gonna make a pure TS lib myself cuz I'm bored

opal plank
#

if you bored, why not work on dossing Facebook or Instagram this time?

#

i already took care of Twitch

tulip wave
#

Lmao

earnest phoenix
#

lol wtf

tulip wave
#

Facebook ain't worth my time

opal plank
#

never again am i messing with twitch

#

its the worst api i have ever touched

#

shit docs with poorly written and sometimes plain wrong shit

#

api keys randomly resetting

#

its a whole mess all around

earnest phoenix
#

haha

opal plank
#

and thats not even the tip of the iceberg

earnest phoenix
#

just watching and laughing alone

opal plank
#

twitch is not meant for bots

earnest phoenix
#

interesting...

opal plank
#

you want a bot for 5-10 servers? sure, go ahead

#

the moment you get into 30 ish channels

#

you fucked

tulip wave
#

Kekw

earnest phoenix
#

hm

tulip wave
#

What way fucked

opal plank
#

like, twitch is gonna bend you over and **** you like a lil ***

lyric mountain
#

1 channel in twitch equals to 1000 servers on discord

#

Performance-wise

opal plank
#

its not even performance related

#

it simply doesnt hold

#

none of the twitch libraries out there are meant for scaling

tulip wave
#

I'm.not surprised tbh

earnest phoenix
#

hmmmmmmm

opal plank
#

they'll just yell at you to use kubernetes

#

thats it

#

which wont be as simple of a task

#

hence why i made my own lib

lyric mountain
#

Actually, what's a kubernete?

opal plank
#

that shit was the worst experience of my life(dealing with their API), the lib was fun to make

#

clustering and shit, promisifying IPC pipelines

lyric mountain
#

Oh

opal plank
#

it was a fun thing to play around with

opal plank
tulip wave
#

I'm getting into clustering on nodejs

opal plank
#

i did that with the twitch

#

thats how i ended up

#

well..

tulip wave
#

I'm gonna try make a Discord lib that supports clustering out of the box

#

And not d.js cluster per shard shit

#

Gonna yeet 10+ shards into one cluster KEKW

tulip wave
#

Oh god

opal plank
#

lets just say some dumb fuck made 2 configs very similarly named, one being slaveMax and SlaveTop

final lava
#

What in the hell

opal plank
#

one of them in charge of how many channels each shard would hold and one would be how many it should spawn on startup

#

thanks to some dumbfuck who made those configs

quartz kindle
#

anyone said ram? :^)

tulip wave
opal plank
#

||(the dumbfuck was me btw, if it wasnt clear)||

quaint wasp
#

lol

tulip wave
#

Oh no the 2nd ram monster is here

quartz kindle
#

im the reverse ram monster

tulip wave
opal plank
#

tim poops ram for you

tulip wave
#

You give us our ram back

opal plank
#

tim is the golden goose of ram

tulip wave
#

Tim how does one stop discord from eating ram

quartz kindle
#

by shouting at it

opal plank
#

dont use discord

#

problem solved

tulip wave
#

Lol

opal plank
#

iirc there was an IRC client for discord

glossy spoke
opal plank
#

lul

quartz kindle
#

imagine if discord allowed third party clients

glossy spoke
#

the real enemy here is Chrome

lyric mountain
#

Wasn't someone here making a Termcord?

glossy spoke
opal plank
#

nono, not a third party client, im fairly certain there was an actual app that you could use discord into

#

well, technically a third party app

#

but not a client mod

#

a full blown app that was IRC based using discord

lyric mountain
#

Termcord is not a client mod KEKW

opal plank
#

you just get messages

quartz kindle
#

ye, a third party client

opal plank
opal plank
lyric mountain
#

Mkay

tulip wave
#

Pretty sure discord doesn't want 3rd party clients

opal plank
#

just use postman to talk, there, no more ram issues

solemn latch
tulip wave
#

But how do you get messages in postman

lyric mountain
tulip wave
lyric mountain
#

Best site evur

opal plank
#

no clue, you'd need a websocket connection

quartz kindle
#

apitester ips were all blocked

opal plank
#

and keepalive

lyric mountain
#

Meh

opal plank
#

imagine not using reqbin

quartz kindle
#

at least last time i tried using apitester on discord it gave me forbidden

opal plank
#

plebs

tulip wave
#

Imagine testing

opal plank
#

imagine not using reqbin

tulip wave
#

I make first then worry about testing

quartz kindle
#

same

#

reqbin also gave me forbidden

opal plank
#

oh rip

lyric mountain
#

Forbidden fruit

tulip wave
#

F

opal plank
#

im amazed i didnt get banned from twitch tbh

lyric mountain
#

Use telnet

quartz kindle
#

you know nasa uses telnet

tulip wave
#

I think in gonna make #development my home channel, stay away from all the meanies here

opal plank
#

i literally joined around 100k streams within 20 seconds with a normal ratelimit(25 joins every 10 seconds)

quartz kindle
#

and they offer public apis via telnet

#

and email

lyric mountain
#

Telnet is nice and all

#

Just hard to understand

quartz kindle
#

imagine building an email-based api

lyric mountain
#

280000 ping

tulip wave
#

Imagine using telnet

opal plank
#

imagine imagining

quartz kindle
#

welcome to nasa/jpl

lyric mountain
#

Imagine dragons

tulip wave
#

Here's an idea. Make an API based on mailman

#

2day ping at best

lyric mountain
#

So webhooks?

tulip wave
#

Hand delivered packets

quartz kindle
#

compared to nasa's apis, even that shitty sattelite tracking api that uses cookies for auth and urls like /key/value/key/value is better

#

lmao

opal plank
#

can i mail Discord with my token asking for a gateway indentify?

tulip wave
lyric mountain
#

Tim, why do you know so much about nasa satellites?

tulip wave
#

Yes

opal plank
#

cmon that was star worthy

tulip wave
#

No star for you today

quartz kindle
#

well partially

opal plank
#

so hard to get starred nowadays

quartz kindle
#

the telnet api is horrendous, i didnt understand shit

glossy spoke
lyric mountain
#

Tim be spying you all the whole time

tulip wave
#

Tim is nasa

quartz kindle
#

but i use a library that was build from the email api

opal plank
#

tim messaging from the moon

lyric mountain
#

Tim doesn't use the cloud

#

He uses the moon

quartz kindle
#

no im not related to nasa lol

lyric mountain
#

Has more space

grizzled raven
#

not related?

#

like

#

step worker

glossy spoke
#

lmao

quartz kindle
#

i work with astrology and astronomy, and nasa/jpl has the best calculations getting the coordinates of planets n shit

#

but their shit is impossible to use

lyric mountain
#

You can also use russian satellites u knoe

glossy spoke
#

So you work for the CIA

lyric mountain
#

But well

#

Russian

tulip wave
#

I recently made a rich presence thing and everyone just asked why u didn't use premid or discord-RPC

glossy spoke
#

Tim isn't a worker from the nasa, he works for the CIA

grizzled raven
#

i recently made a rich presence thing and no one said anything

tulip wave
#

Boredom is fun

grizzled raven
tulip wave
#

Jk ily

quartz kindle
grizzled raven
lyric mountain
#

TIM means Telnet Investigator Man

quartz kindle
#

ew

tulip wave
grizzled raven
#

the planet coordinates change irl when tim makes a calculation error

quartz kindle
#

lmao

tulip wave
#

Tim accidentally send us into the sun

lyric mountain
#

Did u hear about millennium bug?

#

It was when Tim took a break from work

tulip wave
#

Fun bug

quartz kindle
#

yes my bad

glossy spoke
grizzled raven
#

chrome updates javascript when tim makes a syntax error mmLol

tulip wave
#

Single handedly broke the world

glossy spoke
#

So, what's my IP adress?

tulip wave
#

I need more project ideas

quartz kindle
#

127.0.0.1

lyric mountain
#

The queen is only immortal because tim forgot to add a break on the loop

glossy spoke
tulip wave
#

Jokes on you again my IP is 127.0.0.2

quartz kindle
#

hax

lyric mountain
#

Imagine having ip 255.255.255.255

glossy spoke
#

i'll call the cybernetic police

tulip wave
#

Imagine having an ipv6 address that's just dead

glossy spoke
jolly mortar
#

i dont know what i left out but it is spamming, the code is ```client.on("message", message => {
if (message.content.startsWith(".purge")) {
let args = message.content.split(" ");
if (message.member.hasPermission("MANAGE_MESSAGES")) {
let clear = args[1];
if (!clear)
return message.channel
.send(<a:NotApproved:806602509870301214 | \Incorrect usage of command you need to provide an amount of messages to Clear.`
Example: `.purge 50` `);
if (isNaN(clear))
return message.channel.send(
":NotApproved: | Please Put a Valid Number to Clear messages."
);
if (clear > 100)
return message.channel.send(
":NotApproved: | I can't Clear more than 100 messages."
);
if (clear < 1)
return message.channel.send(
":NotApproved: | You cannot Clear less than 1 message."
);

  message.channel.bulkDelete(clear);
  message.channel
    .send(
      `:checkmark2: | \`Succesfully cleared ${clear} messages! | If purge fails please make sure I have MANAGE_MESSAGES to make the purge seccessful.\` `
    )
    .then(message => message.delete({ timeout: 10000 }));
} else {
  message.reply("You dont have perms!");
}

}
});```

tulip wave
#

dead*8

lyric mountain
#

Ip with letters?

#

Only in ipv6 right?

jolly mortar
#

my purge command spams after it deleted the messages

tulip wave
#

Ipv6 is hexadecimal

glossy spoke
#

i mean hidding your IP to show a different one with letters

lyric mountain
#

Ah, that

glossy spoke
lyric mountain
#

Ipv6 is fucksadecimal

glossy spoke
#

lol

#

today i tried to get down a web page

tulip wave
#

I can convert hex to binary and hex to decimal in my head

glossy spoke
#

i bypassed the proxy

quartz kindle
#

ipv6 is a clusterfuck

tulip wave
#

Thanks College

quartz kindle
#

ipv4 is so nice and easy to understand

#

nobody understands ipv6

mellow kelp
#

ipv6 is the jsfuck of ips

tulip wave
lyric mountain
#

Imagine debugging an ipv6 network

mellow kelp
#

oh dear god

lyric mountain
#

Gl typing that ip

glossy spoke
#

or trying to get info from that ip

#

uh

lyric mountain
#

ping idunnowhatstheiphalp

glossy spoke
tulip wave
#

Honestly I don't find ipv6 hard to understand

lyric mountain
#

The issue is that it's large

#

Very large

tulip wave
#

That's supposed to be the upside to it

glossy spoke
#

like my ||dick|| lmao

tulip wave
#

Iirc we have ran out of ipv4 ips

lyric mountain
#

Why couldn't they use regular ipv4 but with hex?

#

Like, expand to hex instead of 256

tulip wave
#

Not that easy

#

You'd need mass router firmware updates

lyric mountain
#

Meh

tulip wave
#

Same with switches

quartz kindle
#

dont you already need that with ipv6

glossy spoke
#

Guys

lyric mountain
#

Also where's ipv5?

quartz kindle
glossy spoke
#

I think i attacked the wrong IP 😦

quartz kindle
#

k i s s i n g

tulip wave
mellow kelp
#

remember how github survived the biggest DDoS attack in history

#

what an absolute unit

lyric mountain
#

It git gud