#development

1 messages ยท Page 1092 of 1

misty sigil
#

public?

obtuse jolt
#

ill remove it

#

hold on

#

now its not

#

do you have sharex installed?

#

install sharex

#

yes

honest perch
#

No

obtuse jolt
#

go away misly

honest perch
#

Why be rude

obtuse jolt
#

that is sharex

honest perch
#

Hahaha hahaha ha

earnest phoenix
#

Misty?

honest perch
#

No

obtuse jolt
#

ok

#

go

#
#

click the thing that says Click here to download your custom uploader file for shareX

#

download that then open it

#

click yes on the popup

earnest phoenix
#

Wat is that?

obtuse jolt
#

done?

#

Right click the shareX icon -> Destinations -> Custom uploader settings

#

then click test next to the image upload one

#

to see if it works

earnest phoenix
#

Can i do that too?

obtuse jolt
#

if you want to

#

nice

#

ok

#

now

#

Right click icon -> Desinations and then change the top 3 options to custom uploader

#

image, text and file

#

Ok now hold shift and click PRNT SCR

#

take a picsure

#

and then send it here

#

oh

#

its

#

ctrl

#

or

#

click the shareX icon

#

so its easier

#

wait

#

right click share X and under after capture does it say upload to host?

#

niceee

#

it works!

#

@earnest phoenix have you got it to work?

#

well you have to have a website host and domain

#

domains are pretty expensive to renew

digital ibex
#

p sure the .cdn is just a subdomain

obtuse jolt
#

web site hosts are quite cheap

digital ibex
#

nothing else

obtuse jolt
#

i dont know if getting a subdomain on a sub domain is a really good idea

digital ibex
#

lul

earnest phoenix
#

@earnest phoenix answer me

#

do you use comic sans ms on your website

#

unironically?

solemn latch
#

lmao

digital ibex
#

i dont get it lol

earnest phoenix
#

thats still bad

#

use arial

#

or consolas

#

but not anything ending with "Sans"

#

JESUS CHRIST THATS WORSE

#

THE FOOTER DOESNT EVEN FIT

digital ibex
#

its actually

#

not cosmic sans

earnest phoenix
digital ibex
#

its "Balsamiq Sans", cursive"

earnest phoenix
#

i saw that

#

@earnest phoenix screen size.

digital ibex
#

sir

#

:yike:

#

you should deploy it with them features already

#

you made a website which only fits on your laptop

earnest phoenix
#

tip:

leaden sage
#

hi

earnest phoenix
#
footer {
  position:absolute;
  left:0%;
  bottom:0%;
  width:100%;
  height:5%;
}
``` @earnest phoenix
#

@leaden sage hi

#

di

jagged sun
#

Hey, I try to code a bot with node.js, with a function that fills an array with random numbers with a while loop, but somehow array.push(value) is not a function. Can someone help me out?

digital ibex
#

send ur code

jagged sun
#
var cards = []
while(counter  < 21) {
            var rand = Math.floor(Math.random() * 10) + 2
            cards.push(rand)
            counter ++
}```
sudden geyser
#

Are you sure the error is coming from there?

digital ibex
#

i see nothing wrong with it

jagged sun
#

100%

digital ibex
#

1 sec

sudden geyser
#

Can you show the stacktrace then show us the line

digital ibex
jagged sun
#
    at Object.test (C:\Users\Admin\Desktop\BETA\commands.js:98:23)
    at Object.cmd_test [as test] (C:\Users\Admin\Desktop\BETA\main.js:90:14)
    at Client.<anonymous> (C:\Users\Admin\Desktop\BETA\main.js:239:26)
    at Client.emit (events.js:315:20)
    at MessageCreateHandler.handle (C:\Users\Admin\Desktop\BETA\node_modules\discord.js\src\client\websocket\packets\handlers\MessageCreate.js:9:34)
    at WebSocketPacketManager.handle (C:\Users\Admin\Desktop\BETA\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:103:65)
    at WebSocketConnection.onPacket (C:\Users\Admin\Desktop\BETA\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:330:35)
    at WebSocketConnection.onMessage (C:\Users\Admin\Desktop\BETA\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:293:17)
    at WebSocket.onMessage (C:\Users\Admin\Desktop\BETA\node_modules\ws\lib\EventTarget.js:99:16)
    at WebSocket.emit (events.js:315:20)
(node:20764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:20764) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
digital ibex
#

whats the error stack?

#

and the code above

sudden geyser
#

Alright, now can you show us commands.js at line 98, column 23 (also can you verify the file is saved)

jagged sun
#

}

lmao

digital ibex
#

whats above?

jagged sun
#

i swear js is so weird sometimes

#

whats above?
@digital ibex the push

digital ibex
#

send it all in one message pls

clever garnet
#

how do i make my bot ping itself in discord.js

digital ibex
#

the code

sudden geyser
#

line 98 would contain the code in which you included the .push from. Maybe you edited the file and never applied the changes

#

Qu1ckly <Client>.user.toString()

quartz kindle
#

never ask someone to post a specific line AND column

#

lmao

clever garnet
#

ok

digital ibex
#

tim

#

i need help

#

pls

#

D:

#

its just: JSON.parse(message.toString());

solemn latch
#

still having this issue?

digital ibex
#

yea :/

sudden geyser
#

would that not return [object Object]

jagged sun
#

I found the problem guys. I tried it with for, but somehow it did not work with while @sudden geyser @digital ibex

digital ibex
#

ohok

jagged sun
#

But tf why?!

digital ibex
#

it returns the object

#

idk

jagged sun
#

js is so weird

digital ibex
#

its not

sudden geyser
#

try logging it officially. pretty sure it would be object Object

digital ibex
#

js is cool

jagged sun
#

i know its simple and cool, but weird

quartz kindle
#

it should work tho

digital ibex
quartz kindle
#

Lost copy and pasted your code and it worked for him

sudden geyser
#

with the .toString() call following message, correct? hmm

digital ibex
#

yeah

quartz kindle
#

what is message?

digital ibex
#

it shows it as a jsontho, the .toString makes it look like that

quartz kindle
#

but what is it?

#

is it a buffer?

digital ibex
#

oh

#

oh

#

no its not

earnest phoenix
#

U making ur own lib?

digital ibex
#

its the for (<this thing>... of the websocket.CreateWebserver or whatever its called

#

im rewriting it

jagged sun
#

Bruh the problem still did not fix. Sometimes it works but sometimes not ๐Ÿ˜ฆ

digital ibex
#

the old version severerly lacked classes, i understand classes better now so ๐Ÿ˜›

quartz kindle
#

@jagged sun show more code

jagged sun
#
        let usercards = [], userresult
        for(let i = 0; i < 21; i++) {
            let randdealer = Math.floor(Math.random() * 10) + 2
            let randuser = Math.floor(Math.random() * 10) + 2
            if(randdealer == 11) {
                if(acecounter >= 4) {
                    dealercards -= 1
                } else {
                    randdealer = 'Ace'
                }
                randdealer = 'Ace'
                acecounter++
            }
            if(randuser == 11) {
                if(acecounter >= 4) {
                    usercards -= 1
                } else {
                    randuser = 'Ace'
                }
                acecounter++
            }
            dealercards.push(randdealer)
            usercards.push(randuser)
        }```This right here is the full code, and nothing changed.
quartz kindle
#

dealercards -= 1 is replacing the original dealercards

#

same with usercards

jagged sun
#

My console looks like this if i call it several times:

Dealercards: 8,Ace,3,9,6,8,4,3,7,3,3,3,8,3,10,3,4,2,8,5,2Dealerlength: 21
Usercards: 8,3,4,2,7,Ace,6,9,9,3,8,2,4,4,3,6,5,5,5,10,9

Dealercards: 8,Ace,3,9,6,8,4,3,7,3,3,3,8,3,10,3,4,2,8,5,2Dealerlength: 21
Usercards: 8,3,4,2,7,Ace,6,9,9,3,8,2,4,4,3,6,5,5,5,10,9

(node:7832) UnhandledPromiseRejectionWarning: TypeError: dealercards.push is not a function
    <stack>

Dealercards: Ace,10,6,8,9,7,7,8,4,10,6,Ace,Ace,8,10,8,10,10,8,2,6Dealerlength: 21
Usercards: 2,4,6,10,10,8,4,9,4,4,4,9,9,5,9,10,9,4,4,2,5
digital ibex
#

any idea tim? :/

quartz kindle
#

you cant -= an array

jagged sun
#

Ah. I understand what you mean

quartz kindle
#

@digital ibex so if you console.log(message) you get that pic?

#

can you copy paste it here as text?

jagged sun
#

So just every time the rand was 11 the whole thing fucked up.

quartz kindle
#

yup

digital ibex
#

kk

#

oh

#

when i remove the .toString(), i get: { code: 4002, reason: "Error while decoding payload." }

quartz kindle
#

then dont remove it

#

but add a console.log(message) before it

digital ibex
#

the docs say i sent a wrong payload

#

yeah, thats what console.log(message) does above it

quartz kindle
#

ah

digital ibex
#

so thats better ๐Ÿ™‚

quartz kindle
#

so its working now or what?

digital ibex
#

im gonna try and send a different payload and see what happens

versed latch
#

how do i make a bot

earnest phoenix
#

As an object

#

Array would be useless for this kind of thing really

#

So if you know about using oauth2... Ever used it to see if it returns any data?

#

I keep on hitting the daily quota limit of YouTubeโ€™s API. Anyone has suggestions on what to do?

solemn latch
#

music bots typically rotate ip's

earnest phoenix
#

wdym

solemn latch
#

they have multiple ip's that they request from

earnest phoenix
#

my bot is hosted on a vps

digital ibex
#

hiii, @quartz kindle i fixed the issue, now im getting a new one :/

earnest phoenix
#

so thats one ip innit

digital ibex
honest perch
#

Use a tunnel

earnest phoenix
#

but thats not the problem

honest perch
#

Then you can have a block

#

It is

digital ibex
#

the code is just: await WS.send(JSON.stringify(GW));

honest perch
#

You will have many ips

#

To rotate

earnest phoenix
#

im confused

#

you say that i now have a lot of ips requesting data from

honest perch
earnest phoenix
#

and that causes the rate limit

digital ibex
#

i dont understand it myself, but what i think they're saying is that you need to have loads of IPs or something so ur not getting ratelimited, like a bot like groovy wouldnt even be functional

earnest phoenix
#

isnt it being simply being causes because of the fact that i hit the limit/day?

solemn latch
#

you have one ip, that ip is getting temp banned

#

you need to have more ips to use when they get temp banned

honest perch
#

Usually ipv6 blocks are the solution

quartz kindle
#

@digital ibex what is GW

earnest phoenix
#

bur

#

but

#

on googles console it says i use 100% of the recources a day

digital ibex
#
  const GW = { 
        op: 2,
    d: {
        token: 'ur mother',
        properties: {
            $os: 'linux',
            $browser: 'karen',
            $device: 'karen'
        }
    }
}```
solemn latch
#

under that ip

#

๐Ÿค”

honest perch
#

@earnest phoenix lavalink?

earnest phoenix
#

how do i check

quartz kindle
#

@digital ibex are you sure thats all?

honest perch
#

What

quartz kindle
#

also are you sure the error is from there?

digital ibex
#

yeah

#

yeah

earnest phoenix
#

idk if im using lavalink

honest perch
#

Bruh

earnest phoenix
#

i dont think use lol

honest perch
#

How do you play the music

quartz kindle
#

@digital ibex did you mess with object prototypes?

earnest phoenix
#

i just use ytdl to play it

digital ibex
#

wdym? ๐Ÿ˜ณ

earnest phoenix
#

on a connection

honest perch
#

Then idk if you can

digital ibex
#

oh

#

i misread that

#

no im not

honest perch
#

In lavalink you can set it in the yml file

earnest phoenix
#

Would you recommend me doing that ?

#

what are the benefits

quartz kindle
#

@digital ibex console.log(GW) before stringifying it

honest perch
#

Better sound quality

digital ibex
#

kk

honest perch
#

Easier to use

#

Soundcloud play

#

But more expensive

earnest phoenix
#

is it?

honest perch
#

As you have to host it

earnest phoenix
#

oh

honest perch
#

As its a node kinda thing

#

It runs as a jar file

#

Although

#

You can run it on the same vps

#

And you can use something lik erela for the client

earnest phoenix
#

but will it fix my problem?

digital ibex
#

oh

#

whoops

earnest phoenix
#

thanks for token

#

lmfao

digital ibex
#

no problem

#

@quartz kindle ^

quartz kindle
#

why is token Client

digital ibex
#

oh

#

im so fucking retarded

#

and wdym tim?

#

oh

#

tbh idek

quartz kindle
#

are you doing GW.token = client?

thin turret
#

For a command that can change the users nickname, do I have to add a rate limit or restriction?

digital ibex
#

im not used to using this many classes

#

i was doing this.GW.token = token when i was meant to be doing this.GW.d.token = token

#

so yeah, i messing with the object prototype by accident

amber fractal
#

I thought browser was supposed to be the os as well

#

I'm wrong though

digital ibex
#

afaik: linux for normal, mobile to show ur on mobile

#

i've only been looking at these docs for 2 days

amber fractal
#

well it's supposed to be the operating system

digital ibex
#

its android then

#

cuz im on windows, its worked in the previous versions of my library

#

never tried using android tho

sinful belfry
#

is there any reason why the messageDeleteBulk event wouldn't be firing when messages are bulk deleted? the messageDelete event is working fine. (using discord.js-light v3.0.6)

quartz kindle
#

let me check

earnest phoenix
#

Does someone know how i can make a command who send a shiba pic (like some nsfw bot but with shiba pic) (in python)?

sinful belfry
#

@earnest phoenix you can probably use an api to do that

#

you'll need to fetch the url of the image from an api and then send it in your message

earnest phoenix
#

yes but what api?

sinful belfry
#

search something like 'shiba pictures api' into google

#

you'll get a ton

tight plinth
#

^

tight plinth
#

leme check smth rl quic

solemn latch
#

super?

digital ibex
#

super is only when you're extending something

tight plinth
#

try doing js module.exports = class { constructor...

#

thats what i do and it works

#

probably wont change anything but who knows

valid frigate
#

class utils doesn't extend anything so it doesn't rquire a super call

digital ibex
#

what exactly logs undefined @summer acorn. first or second one?

valid frigate
#

i suspect that you are assigning this to an undeclared object property

summer acorn
#

console.log(this) is logging undefined

valid frigate
#

basically

#

class utils {
public client;
...
}

#

idk js but iirc thats how it works

digital ibex
#

public isnt a thing in js

#

but ya, same kinda thing

tight plinth
#

sooo idk

digital ibex
#

thats different

valid frigate
#

that is different

tight plinth
#

still same idea

valid frigate
#

show the top of the class

digital ibex
#

its not

#

well idea ya, mb

tight plinth
#

i have no idea how it can solve your problem, but try to console.log(this) in the constructor @summer acorn

#

after you did this.client=client

digital ibex
#

thats the thing which is undefined

summer acorn
#

it exist inside of the constructor

#

inside of the function, nope

tight plinth
#

hm

digital ibex
#

send the whole thing

summer acorn
tight plinth
#

does the error trigger at the line where you require your class in your mute command

digital ibex
tight plinth
summer acorn
#

@tight plinth no, it's when I use the getUser function

buoyant grove
#

https://hastebin.com/qamopateho.js

tight plinth
#

hm

#

why even doing a function like that when message.mentions exists

summer acorn
#

which is the only place where I use this

#

because message.mentions is unreliable as hell

tight plinth
#

not for me

#

well

#

idfk

summer acorn
#

security

digital ibex
#

remove line 9

#

make ur own :o

summer acorn
digital ibex
#

yeah

#

no

#

this

summer acorn
#

that is line 9

#

I was literally told to put it there

tight plinth
#

whats logged

summer acorn
#

the client

tight plinth
#

just curious

#

hmm k

digital ibex
#

its go no need there, nothings gonna log

summer acorn
#

it did log though

tight plinth
#

the error is "this is not defined"?

#

hmmm

digital ibex
#

which one?

summer acorn
#

and Lumap literally told me to put it there to see

tight plinth
#

i'll let pros solve ur problem

quartz kindle
#

@sinful belfry fixed in the next commit (fucking discord.js switching names around)

summer acorn
sinful belfry
#

lmfao

#

tysm โค๏ธ

quartz kindle
#

like

#

why do they do this

digital ibex
#

tim u shud just make ur own library lol

solemn latch
#

lol

quartz kindle
#

the event name is MESSAGE_DELETE_BULK
and they do MESSAGE_BULK_DELETE: "messageDeleteBulk"

tight plinth
#

yeah

digital ibex
#

and name it

#

discord-lbrary-gud-version

quartz kindle
#

why the fuck

solemn latch
#

something lighter than djs

sinful belfry
#

lmao who knows

summer acorn
sinful belfry
#

just can't make their minds up ig

quartz kindle
#

too much work

robust arrow
#

so ur client is undefined

summer acorn
#

no

robust arrow
#
const client = new Discord.Client();```
#

ok

light hinge
#

Crang:entra6

digital ibex
#

this is amazing

summer acorn
#

the parent of client is undefined

digital ibex
#

literally im ded

light hinge
#

Crang:entrar

digital ibex
summer acorn
#

and @robust arrow this isn't the bot file mate, it's the functions class

light hinge
#

Kkkkieueu

#

Eyegeygeggegywgeve eyegegeys eyeyev3 e6ev e77383 337u3 3yeyd7

solemn latch
#

^

#

agreed

quartz kindle
#

"'Email' and 'Gmail' are synonymous."

#

lmfao

digital ibex
#

its 100 facts kek

tight plinth
#

@summer acorn tbh idk

summer acorn
thin turret
#

I have a command that starts a public trivia match in a channel, as of right now people can start new trivia games while one is already going on

#

Is this ok or should I limit the amount of games per channel to 1 for my bot to be accepted?

digital ibex
#

you await the function, getUser

summer acorn
#

I've been going at this for hours, I've just been trying a ton of different things at this point.

#

I think I've figured out the issue now though.

pure lion
#

Not to be political but how the fuck do I get data from a dataurl

quartz kindle
#

you need to await the promise to get its value. the value is delivered in the await line

#

for example ```js
a = promise()
b = await a;

#

only b has the resulting value

#

a is still the resolved promise

pure lion
#

Promises are sexy

#

Use them >:(

digital ibex
#

just you you know: im more sexy than promises, but pls no use me

quartz kindle
#

64: They understand computers.

digital ibex
#

im as hot as a ๐ŸŒถ๏ธ

tight plinth
#

nsfw

#

smh

amber fractal
quartz kindle
#

91-94 lmfao

digital ibex
#

confusin1919

quartz kindle
#

Algorithmic complexity and O-notation are used all the time in the "real world".
Algorithmic complexity and O-notation are never used in the "real world".
Academia somehow is not the "real world".
There is a "real world".

digital ibex
#

yeah, its amazing lmfao

quartz kindle
#

luckily none of that applies to me

#

because i never studied cs

#

:^)

digital ibex
#

lol

amber fractal
#

who actually studies cs

digital ibex
#

im studying cs

#

๐Ÿ˜ณ

amber fractal
#

feelsbad

digital ibex
#

not me

#

idk who does

#

ppfff

#

when im older then i'll probably leave the class im in, i started my gcses last september so idk

pure lion
#

Guya

#

G u y s

#

How to read data url

digital ibex
#

data url?

digital ibex
#

nice url

pure lion
#

How to read

misty sigil
#

wtf is that

digital ibex
#

what do u mean by read it?

pure lion
#

It's meant to be an image

digital ibex
#

like

pure lion
#

Uh

digital ibex
#

a screenshot command or something lul

earnest phoenix
#

that's a b64 image

solemn latch
#

thats not enough data to be an image

earnest phoenix
#

i don't understand what you mean by read it

pure lion
#

How me get from that to image data

earnest phoenix
#

huh?

#

you want to convert the b64 to an image?

digital ibex
#

what do u want it to say when its all done the way u want it?

earnest phoenix
#

that's just a simple case of encoding and decoding

pure lion
#

Oh

earnest phoenix
#

decode the b64 to it's byte variant and you have the data

pure lion
#

What does it encode down to?

#

Oh

#

Decode*

#

Me retar

earnest phoenix
#

just convert every character in the b64 to a byte

pure lion
#

What would I use to do that?

earnest phoenix
#

i don't know

pure lion
#

It's probably fine

quartz kindle
#

where do you want to display the image?

#

or what do you want to do with it

pure lion
#

In an embed

quartz kindle
#

in a discord embed?

pure lion
#

Yeah

#

It's qrcode and it doesn't have a toBuffer() method

quartz kindle
#

is it from a package?

pure lion
#

Yup

quartz kindle
#

which one

digital ibex
#

tim, do u know how to fix my problem? D:

pure lion
#

qrcode

#

What's your problem lost?

#

Just so I know if I wanna stick around with popcord and learn shit

solemn latch
#

you want an image qrcode?

digital ibex
#

lol

digital ibex
#

learn stuff from me ๐Ÿฅด

quartz kindle
solemn latch
#

have you used the toCanvas thingy?

digital ibex
#

thats the error im getting for some reason :/

pure lion
#

Oh cooool thanks Tim

#

And woo

#

:)

#

@digital ibex is this your lib in development?

quartz kindle
#

actually this would be better for you

digital ibex
#

nearly finished tmโ„ข๏ธ

quartz kindle
#

@digital ibex did you not remove the GW.token = client?

digital ibex
#

i removed it

#

same thing

quartz kindle
#

well show code

digital ibex
#

kk

quartz kindle
#

you're still adding something too much to GW

digital ibex
#
GW.d.token = this.token;
console.log(GW);
await WS.send(JSON.stringify(GW));
quartz kindle
#

and what does the log show?

digital ibex
#

it logs:

#

sorry... :/

#

i've got loads of logs and im tryoing to find which one it is

#

there

quartz kindle
#

well why is token a client?

digital ibex
#

idk, i didnt put a class named client

quartz kindle
#

how did you define this.token

digital ibex
#
    constructor(token) {
        this.token = token
quartz kindle
#

and what is token

digital ibex
#

?

#

u do

quartz kindle
#

what do you pass to the constructor

digital ibex
#
const karen = require('karen');
const client = new karen('my token goes here');
solemn latch
#

๐Ÿค”

#

damn it karen

quartz kindle
#

are you sure thats all?

#

because thats not what your logs say

digital ibex
#

yeah

quartz kindle
#

your logs are saying that this.token is an instance of a client

digital ibex
#

well i mean, this is what im doing in the library itself

quartz kindle
#

show the full client.js then

digital ibex
quartz kindle
#

and where is GW defined?

#

in manager.js?

digital ibex
quartz kindle
#

new SocketManager(this)

digital ibex
#

oh

quartz kindle
#

constructor(token) // this/client

digital ibex
#

OHHH

quartz kindle
#

also, why are you importing client again

#

dont circular import

digital ibex
#

ohok

#

what would i define client as then?

quartz kindle
#
// client.js
this.socket = new SocketManager(this);

// manager.js
constructor(client) {
  this.client = client;
  this.token = client.token;
}
digital ibex
#

oh ok

quartz kindle
#

the way you were doing it, not only is a circular dependency, but also this.client would become the class itself, not the instance

digital ibex
#

holy

#

it works now

#

thanks man!!

amber fractal
#

would making a getter for token be more performant?

#

so you dont have 2 token vars

#

It's super negligible tho lol

digital ibex
#

big boi words

#

whats negligible?

earnest phoenix
#

@digital ibex is ur code on github somewhere

digital ibex
#

not this project

#

and its probably gonna be in like

#

a week or two when its finished

earnest phoenix
#

Could u dm me the link when ur done

digital ibex
#

just check my github

#

i'll probably forget

quartz kindle
#

a getter would probably be better yes

earnest phoenix
#

Just make a repo and commit everything later lol

quartz kindle
#

or simply use this.client.token everywhere

proven lantern
#

is there a way to make one api call to delete multiple voice channels?

quartz kindle
#

not afaik

digital ibex
#

why do you want to see it so bad? just look at eris' and d.js' source code, its all the same

#

and would it change anything performance wise, tim?

#

cuz thats why im doing this lul, for performance issues

quartz kindle
#

would save you a few bytes of ram

digital ibex
#

oh

#

a getter for what tho?

#

the logging in?

quartz kindle
#

for the token

digital ibex
#

client.connect

#

confusion1011

quartz kindle
#

because if you define this.token twice

#

once in client

#

and once in manager

#

you have 2 copies of it

digital ibex
#

oh

quartz kindle
#

so the manager should get the token from client instead

#

instead of having its own copy

strange glen
#

What?

digital ibex
#

like this?

strange glen
#

Huh

quartz kindle
#

this.client.token

earnest phoenix
#

There is this youtube video series that uses deno and ts to do what ur doing @digital ibex want me to link it?

digital ibex
#

yeah, but like this?

quartz kindle
#

yes

strange glen
#

What????

digital ibex
#

uh ok

quartz kindle
#

what what?

strange glen
#

@quartz kindle huh?

quartz kindle
#

?

strange glen
#

Excuse me?

earnest phoenix
quartz kindle
#

...

digital ibex
#

1 sec

slender thistle
#

Tim, are you confused or disappointed right now?

quartz kindle
#

im confused

strange glen
#

this confusion

quartz kindle
#

wtf does this guy want

slender thistle
#

bad

solemn latch
#

well thats not appropriate

strange glen
#

Mad?

slender thistle
quartz kindle
#

are you 9?

#

how old are you

strange glen
#

6

amber fractal
slender thistle
#

Are you

quartz kindle
#

really

earnest phoenix
amber fractal
#

Tim you were close tho

#

3 years off

strange glen
#

What

slender thistle
strange glen
#

How does that make sense

quartz kindle
#

what are you even talking about

slender thistle
earnest phoenix
#

Like bruh

solemn latch
#

what

strange glen
#

@slender thistle cringe

earnest phoenix
#

I was talking about moon roock wit a glock @solemn latch

solemn latch
#

yeah

#

but the screenshot, what

slender thistle
solemn latch
#

sorry daddy shiv

strange glen
#

#General

slender thistle
#

@strange glen do I need to repeat myself?

strange glen
#

@slender thistle cringe

quartz kindle
#

ty shiv

nocturne galleon
#

does someone now how to use node.js in visual code studio?

#

:/

solemn latch
#

i dont understand the question

nocturne galleon
#

...

solemn latch
#

like using the terminal to run nodejs in vcs?

nocturne galleon
#

wait...

#

no

#

i want to make some commands in vcs... i dont now how

solemn latch
#

so, the question isnt really about the code editor, but how to make a bot?

nocturne galleon
#

i dont now how to explain... can you speak german a little bit...

earnest phoenix
#

this channel is strictly english only

nocturne galleon
#

kk

#

:/

#

hmm

#

oh

#

HOW TO CREATE ANOTHER BOT

#

this is it

#

i have one bot named Makzzยฒ ... but i want to make another

solemn latch
#

new application

nocturne galleon
#

kk

solemn latch
earnest phoenix
#
 (node:4) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_ARG_TYPE]: The "url" argument must be of type string. Received undefined
nocturne galleon
#

idk

amber fractal
#

your url is undefined

solemn latch
#

im not quite sure which one will get used

#

one of them is probably right, but your setting it to both. so ones winning out, and its the wrong one ๐Ÿค”

amber fractal
#

well it doesnt ever get there

#

the promise gets rejected because the url is undefined

solemn latch
#

i thought the rejection was getInfo()

amber fractal
#

oh true

digital ibex
#

@earnest phoenix when its finished, checked my github and see the difference ๐Ÿ™‚

#

1 or 2 weeks

amber fractal
#

I didnt even see that 2nd method call

solemn latch
#

it could be either or

#

tbh

#

if the args.join(' ') is undefined

amber fractal
#

idk why there would be an await if it's a callback either

#

yeah, but undefined.join would error

thin turret
#

Is there any way to write to a json file without the bot rebooting

honest perch
#

Use a real database

thin turret
#

Yike

bright dove
#

postgresql ๐Ÿ‘

thin turret
#

I have a trivia command that starts a public game within a channel, atm anyone can start multiple games of trivia in one channel

#

There can be multiple games going on, my question was is this ok, or should I find a way to limit 1 game per channel

solemn latch
#

limiting it to one per channel is easy to do, so why not?

slender thistle
#

It can cause some chaos in larger servers

#

So... I suggest limiting it

thin turret
#

limiting it to one per channel is easy to do, so why not?
@solemn latch Im having trouble doing so, can you point me in the right direction?

bright dove
#

"Someone's already started a game! Please wait until they finish"

#

lol

thin turret
#

Thats exactly what I want

solemn latch
#

just create a map of all channels with running games

#

when the game ends, remove it from the map

slender thistle
#

An array might do the job

#

Check if the array includes a channel ID

valid frigate
#

ya it doesnt have to be a map lol

#

unless you want to hold data about the game

thin turret
#

But wont the array be empty on each start of a game, since in that games js file nothing has been added yet

valid frigate
#

or make it viewable elsewhere

slender thistle
#

The array should stay attached to the client object

#

As a property

thin turret
#

Ill give it a shot

solemn latch
#

i use a map for my games, because i attach a timeout for the objects in the map.
i found it easier to cleanup games that didnt get properly deleted with a map.

elder mural
#

Ok so. I have 2 discord servers. I have the same bot in each.
I want someone to come into the 2nd server and type a command such as ;update.
This command then sees what roles the person has in the 1st server and adds them in the second server.
Is this even possible. If so then I would love to know how this would work.

solemn latch
#

is this supposed to be a public bot?

elder mural
#

Kind of.

#

Private/public.

#

Wait no.

#

Private.

#

Private bot.

thin turret
#

How Can I attatch to the client object inside of an exported module

#

Im using a command handler

solemn latch
#

then yeah, not really that hard.
youd have to make sure each role has the same exact name, or map them to each other.
fetch the user in the first community, and add/remove the proper roles one by one in the second

#

you want to pass client in the function? or make a client inside exported modules

elder mural
#

Hmmm. So for example.
First sever has one role. - Member
The second server has the exact same role.
Person types in a command. For example ;update
The bot then gives the roles that the person has in the 1st server into the second.

#

It sounds confusing lol.

#

It is hard to explain.

solemn latch
#

yeah, get the member from the first guild

#

get all their roles

#

get that same member in the second guild

#

make sure all the roles are the same

elder mural
#

Mhm.

solemn latch
#

the docs for your specific language/lib will say how to do each step

elder mural
#

Docs?

solemn latch
#

the place you get info on your library

elder mural
#

Ah yes.

#

Not going to lie. Not the best programmer in the world.

#

But I will give it a shot.

#

Nope.

#

I have no idea what I am doing.

#

:/

solemn latch
#

what lib are you using?

elder mural
#

Shall I store the data of the role name in a global variable?

slender thistle
#

The shot only took 11 minutes

solemn latch
#

yeah the role name can be global if you want

elder mural
#

@solemn latch Discord.js

#

Then after I have stored the data of the role name from the first guild what do I then do with that?

#

Is there a guide in the lib?

solemn latch
#

the guide is more generic djs
this is very specific

elder mural
#

Hmmm.

#

Do you know the doc I should use?

solemn latch
#

theres only one djs docs

elder mural
#

Wait no.

#

Does not matter.

#

Forget that.

solemn latch
#

synchronize roles across guilds

elder mural
#

Yes.

solemn latch
#

for a user doing a command

elder mural
#

Nothing I have ever done before

#

So

#

Sorry for being slow lol

#

Yes.

#

The first guild.

#

Not really.

#

I am currently learning at this stage but the course I was taking did not talk about roles.

#

So I have had to go solo on this one.

#

So thank you for all the help you are giving me.

#

Mhm.

#

It is basically updating the guild perks in guild 2.

#

The roles in guild 1 have already been created and assigned.

#

When the user joins guild 2 the command then run adds the specific role in guild 1 to them in guild 2.

#

If you get what I mean.

#

Exactly!

#

That is exactly what i need

#

I am sorry lol. Do you think it would be easier to test it out first on an app like discord bot maker?

#

And then code it properly after?

#

Mhm.

#

It has all the tools.

#

I use it for messing about.

#

It is good for trying out new things

#

Let me get it up

#

1 sec

#

Discord bot heaven.

#

@earnest phoenix Thank you so much

#

Hmmm.

#

This seems useful.

#

We just need a source role.

obtuse jolt
#

I found a free hosting service

elder mural
#

Eh what???

obtuse jolt
#

I found a free hosting service

#

Localhost

elder mural
#

:/

#

I host it off of my raspberry pi.

#

This look good?

#

Looks useful.

#

True.

#

Yeah...

#

It would have nothing to do with syncing it.

#

Ok.

#

Yes.

#

It only gives them the role if they have the role in guild 1

#

That is what I am aiming for here.

#

No idea how to write it thats the problem.

#

I can actually execute code.

#

So.

#

*script

#

Ok so.

#

This will specify my guild

#

That I want to target

#

If I execute that script

#

Do you want me to store it in a variable?

#

Yes

karmic compass
#

how do i change the nickname of the author of a message in discord.js?
the context is !verify <IGN> and it would set their ign to args[0]

solemn latch
#

make sure you saved it

#

๐Ÿค”

elder mural
#

Done.

#

I am so terrible at making bots. :/

#

Mhm.

marble juniper
#

I am so terrible at making bots. :/
@elder mural after seing dbm yes

elder mural
#

Yes.

#

Yes.

#

Yes.

marble juniper
#

well nothing can be perfect

elder mural
#

I just use it for drafts

#

I just want to sync roles between guilds.

#

It is very hard.

#

Well....

#

It is for me.

#

Oh really?

#

Do you think there is anything online?

#

I mean...

#

It is just for testing purposes.

#

But then again.

#

I'm not going to copy.

karmic compass
#

if i were to do a !userinfo command, and i wanted it to show all of the user's roles (in that server of course), how would it be done?

#

in discord.js*

marble juniper
#

u would get the roles from the member

#

and then you could map them

elder mural
karmic compass
#

would this work:
const rolesOfMember = message.member.roles()
message.channel.send(rolesOfMember)

marble juniper
#

an easier way would be just accesing the roles directly without making a variable for it if you are just gonna use it once

#

also no it wouldn't

karmic compass
#

i didnt think so

marble juniper
#

it would just try to send objects

obtuse jolt
marble juniper
#

nice

#

that image is kinda thicc

obtuse jolt
#

Itโ€™s so low res

marble juniper
#

use svg

#

then it isn't

#

make an svg version of ur image

#

lol

obtuse jolt
#

I wonder if I steal a bots page css then delete it if it makes it all fine

#

LOL

marble juniper
#

or just you know

obtuse jolt
#

The owner deleted their account

#

and the bot isnโ€™t in this server

#

and the bots been offline for over 6 months

#

The owner isnโ€™t in this server too

#

I think Iโ€™m in the clear on that one

marble juniper
#
message.member.roles.cache.map(r => `<@&${r.id}>`).join(', ').replace("@everyone,"")
#

sry im so slow

#

also it was typed on my phone lol

obtuse jolt
#

iOS

#

Unjailbroken

#

So

#

Idk

#

Itโ€™s not safari

elder mural
#

@earnest phoenix

#

I am starting from scratch.

obtuse jolt
#

you can just use client.on

#

But

#

ok

elder mural
#

@obtuse jolt I am a complete beginner.

obtuse jolt
#

use client.on('ready'

elder mural
#

Fixed.

#

Uhhhh.

#

My bad.

#

I deleted a bunch of stuff

#

Fixed.

obtuse jolt
#

Is your ss thing still working?

solemn latch
#

Once works fine too

#

๐Ÿค”

karmic compass
#

i tried to do the thing

#

but

elder mural
#

@earnest phoenix The whole of the index.js . I will not use the script for the real bot. This will be to see if it works to how I want it.

karmic compass
#

i did mentions.users.first or whatever called it mentionDude and got this error when trying to find roles:

obtuse jolt
#

v12?

karmic compass
#

who are we talking to rn

solemn latch
#

Mentions.members if you want membere

karmic compass
#

oh

obtuse jolt
elder mural
#

Wait......

#

@earnest phoenix You have a YT?

#

Thats cool.

#

I was just looking at your tutorials.

boreal latch
#

does inactive bots get removed on top.gg?

karmic compass
#

i finally get users vs members
users are discord specific, can occur in dms, etc
members are guild members with guild data

#

coooool

elder mural
#

How complex is syncing roles from guild 1 to guild 2.

#

Because if it is simple I am just shocking

#

Lol.

solemn latch
#

30 lines of code max

elder mural
#

Well.

#

I will do it eventually.

#

Hopefully.

#

Thank you for all of your help.

#

๐Ÿ‘

obtuse jolt
#

Hey guys is it bad my ready.on event is 10,000 lines long?

solemn latch
#

Only 10,000 lines?

#

Pleb

#

How did you make a ready event 10,000 lines long

obtuse jolt
#

Shut you mortal you underestimate my codes length

#

I regret to inform you my ready even if 10,000 lines and my new Client() is 15,000 lines

#

My database initial loading is 30,000 lines long

#

And one of my functions is 50,000 lines long

#

My message event it over 150,000 lines long

#

And my commands list is over 500,000 lines long

#

My smallest command file is 1,000,000,000 lines long

#

My restart command is over 75,000,000,000 lines long

#

You waffle so much you just changed from millions to trillions

#

WAFFLE

#

My database is a zettabyte

solemn latch
#

I once used a zettabyte of bandwidth on my dedicated servers in a month

obtuse jolt
#

HOW

sudden geyser
obtuse jolt
#

LOL

#

LMAO

#

BRUH

sudden geyser
#

negative

#

that is the greatest calculator of all time

#

20k lines

obtuse jolt
#

Thatโ€™s ducking beautiful

earnest phoenix
#

How do I get the user to show their avatar by simply typing a nickname?
sample: .displayName

solemn latch
#

How long does it go on

obtuse jolt
#

@earnest phoenix could you explain more?

solemn latch
#

I got to 10k

obtuse jolt
#

Yeah that too

#

You could do it with someoneโ€™s ID

earnest phoenix
#

@earnest phoenix multiple people in a server can have the same nick
@earnest phoenix I just want it

obtuse jolt
#

or mentioning them

earnest phoenix
#

i made them

#

just want nickname

sudden geyser
#

Woo it's ~20k lines

solemn latch
#

Oh lol

viral iris
#

any1 know about request package ?
or photo-collage

mild flower
#

How do I get the bot to create these kind of systems where they collect variables one by one? Without using any prefix

#

ok got it on the docs

obtuse jolt
#

Does anybody here speak a language that isnโ€™t English and is willing to help me

remote yacht
#
await Species.findOne({
            name: name
        }, async (err, data) => {
            if (err) console.error(err);
            if (!data) {
                let speciesBody = (await fetch.get(`https://pokeapi.co/api/v2/pokemon-species/${name.split('-')[0]}`)).body
                let speciesCreate = new Species(speciesBody);
                species = await speciesCreate.save();
                console.log('help');
            } else {
                species = data
                console.log(species);
            };
        });
        await Growthrate.findOne({
            name: pokeBody.name,
        }, async (err, data) => {
            if (err) console.error(err);
            if (!data) {
                let body = (await fetch.get(`https://pokeapi.co/api/v2/growth-rate/${species.growth_rate.name}`)).body;
                let createModel = await Growthrate.create({
                    name: pokeBody.name,
                    levels: body.levels
                });
            growthrate = await createModel.save();
            } else {
                growthrate = data;
            }
        });``` can anyone tell me why does it returns, cannot read property growth_rate of undefined, and then console.log('help')
clearly the console.log() is above the species.growth_rate but first i get error of that growth_rate then i get the console.log()
#

https://hasteb.in/koxesoxa.js
console.log('help') -- Line 9
where i get the undefined error --- Line 20,
the code doesnt wait for the species = await speciesCreate.save()

#

it always sends the error first, then the console.log()

earnest phoenix
#

does anyone know how can i do so the bot even if goes offline while someone is muted unmutes it after bot is back online ??

remote yacht
#

save to db?

sick cloud
#

database

mild flower
#

is this correct to check if the bot has permissions for something?
if(!message.guild.me)

sick cloud
#

no

mild flower
#

then what is

sick cloud
#

use permissions.has on that

remote yacht
#

its correct just put hasPermissions()

mild flower
#

yea

#

thats what i want tho

obtuse jolt
#

What language? @earnest phoenix

sick cloud
#

ie

message.guild.me.permissions.has('permisson here')

mild flower
#

ok

sick cloud
#

@earnest phoenix mail in an application to dbl rn prob

#

online apps aren't open

remote yacht
#
await Species.findOne({
            name: name
        }, async (err, data) => {
            if (err) console.error(err);
            if (!data) {
                let speciesBody = (await fetch.get(`https://pokeapi.co/api/v2/pokemon-species/${name.split('-')[0]}`)).body
                let speciesCreate = new Species(speciesBody);
                species = await speciesCreate.save();
                console.log('help');
            } else {
                species = data
                console.log(species);
            };
        });
        await Growthrate.findOne({
            name: pokeBody.name,
        }, async (err, data) => {
            if (err) console.error(err);
            if (!data) {
                let body = (await fetch.get(`https://pokeapi.co/api/v2/growth-rate/${species.growth_rate.name}`)).body;
                let createModel = await Growthrate.create({
                    name: pokeBody.name,
                    levels: body.levels
                });
            growthrate = await createModel.save();
            } else {
                growthrate = data;
            }
        });``` can anyone tell me why does it returns, cannot read property growth_rate of undefined, and then console.log('help')
clearly the console.log() is above the species.growth_rate but first i get error of that growth_rate then i get the console.log()
https://hasteb.in/koxesoxa.js
console.log('help') -- Line 9
where i get the undefined error --- Line 20, 
the code doesnt wait for the `species = await speciesCreate.save()`it always sends the error first, then the console.log()
obtuse jolt
#

wow youโ€™re so funny

mild flower
#

if (args[1] > 99) return message.channel.reply("Please choose a number less than 100.")

is this correct

#

it keeps crashin cus o fthis

#

y the crash tho?

#

oh

#

message.channel.reply is not a function

#

oops

#

(node:46040) UnhandledPromiseRejectionWarning: DiscordAPIError: Invalid Form Body limit: int value should be less than or equal to 100.

#

its not working

sudden geyser
#

limit should be less than or equal to 100

#

so whatever you're doing that has a limit field is the issue

mild flower
#

ok

sudden geyser
#

less than or equal to 100*

viral iris
#
`Server Region: \`\`${[message.guild.region]}
```Cannot read property 'guild' of undefined
slender thistle
#

What's message

viral iris
#
client.on("message", message => {
#

@slender thistle

slender thistle
#

I thought it would be null but oh well

#

The message came from a DM

viral iris
#

no

#

server

#

ofc lol

slender thistle
#

console.log the message.guild

viral iris
#

@slender thistle message is not defined

slender thistle
#

Show your code

viral iris
#

@slender thistle dm ?

slender thistle
#

Preferably here

viral iris
#
 `Server Region: \`\`${[message.guild.region]}\`\` \n Owner:  \`\`${message.guild.owner.user.username}#${message.guild.owner.user.discriminator}\`\`\n Boosts: \`\`${message.guild.premiumSubscriptionCount}/30 (Tier ${tiers.message.guild.premiumTier || 0})\`\``,                                  

slender thistle
#

Show the full message event

torn ravine
#

would this be considered data collection

lusty quest
#

did you store it?

torn ravine
#

Itโ€™s in dms

lusty quest
#

im not sure. usually i would say if you delete it after 30 days you are save. but its annoying to make in discord

viral iris
#
client.on("message", message => {
        if(message.author.bot) return;
        if(!message.content.startsWith(prefix)) return;
        if(message.content === ("-serverinfo")) {
var voiceChannelCount = message.guild.channels.cache.filter(c => c.type === 'voice').size;
          var TextChannelCount = message.guild.channels.cache.filter(m => m.type === 'text').size;
          let embed = new Discord.MessageEmbed()
          .setColor("#0012f5")
          .setThumbnail(message.guild.iconURL())
          .setAuthor(message.guild.name, client.user.avatarURL())
          .addField("Overview:",
              `Server Region: \`\`${[message.guild.region]}\`\` \n Owner:  \`\`${message.guild.owner.user.username}#${message.guild.owner.user.discriminator}\`\`\n Boosts: \`\`${message.guild.premiumSubscriptionCount}/30 (Tier ${tiers.message.guild.premiumTier || 0})\`\``,                                  
                true)
         .setFooter(`ID: ${message.guild.id}`)
message.channel.send(embed)
        }
});
#

@slender thistle

earnest phoenix
#

help meplease

#

It mention.user.first() don't work

lusty quest
#

i wont download random files from Discord

#

use hastebin or something like this

earnest phoenix
#

ok