#development

1 messages · Page 1774 of 1

lost heath
#

okay

rocky hearth
#

will take some more years

zenith terrace
#

you can add buttons in d.js for now but idk bout responding

lost heath
#

wha

earnest phoenix
#

do you still need the appliciations.commands scope if you don't want to use the slash commands guild based

opal plank
#

you could use detritusjs instead

#

we have buttons already

#

and button builders

lost heath
#

detritwhat?

opal plank
zenith terrace
#

erwin go away

opal plank
#

detritusjs

lost heath
#

whats that

opal plank
#

best discord lib for js

lost heath
#

im not rebuilding my entire bot just for buttons

zenith terrace
#

ofc you have a link ready

opal plank
#

its worth tho

lost heath
#

no

opal plank
#

and i can show u why

zenith terrace
lost heath
#

my bot is thousands of lines long in hundreds of files. id rather not do that

opal plank
#

you wouldnt need to rewrite much

#

if anything, you'd have to remove code

lost heath
#

thats even worse

opal plank
#

not quite

lost heath
#

wh

opal plank
#

mostly because detritus has its own commandHandler

lost heath
#

eew

opal plank
#

so most of the stuff you painfully wrote, it has off the bat

lost heath
#

nevermind then

opal plank
lost heath
#

no

zenith terrace
#

lol

lost heath
#

what i like about my code is that its 96% indepentant. i use almost no modules. and those i use is just for the music part
im not gonna rewrite it all in something that only depends on basic modules

opal plank
#

and im telling you it isnt like that

lost heath
#

wh

opal plank
#

well, either way, you dont know how detritus work, saying "something that depends on modules" while you havent even seen what the lib is even capable of is blatently bad

lost heath
#

i want acces to edit everything on my bot 100% as i wish. if i use something that automatically works. then i cant edit everything

pale vessel
#

really, again?

#

with the detritus

#

😩

lost heath
#

lol

opal plank
#

like i said, i wouldnt recommend implying you know what detritus CAN and CANT do, since you havent tried it

#

nor showed any interest in it

pale vessel
#

Sorry bro

#

rose gang here

opal plank
#

so i'd recommend just letting go of the conversation

pale vessel
#

Cool cache control, raw objects, no bloat /s

#

I'm happy enough

lost heath
pale vessel
#

You can

opal plank
pale vessel
#

They have events

opal plank
#

you are the one who assumed it

zenith terrace
pale vessel
#

Too bad

lost heath
#

you literally said it already has a command handler

pale vessel
#

Doesn't mean you can't use your own?

lost heath
#

omg. this is stupid

pale vessel
#

Detritus still has events like any other lib

opal plank
#

you're the one refusing to even see what the lib is capable of and calling it stupid

#

everything thus far has been you assuming things

lost heath
pale vessel
opal plank
#

if you truly want to keep this convo going(which i recommend u dont), go check the message i sent at least

pale vessel
#

Why wouldn't I back him up

opal plank
#

tis a good lib after all

pale vessel
#

smh

lost heath
opal plank
#

we both have different views at which is the best, but we both agree its either first or second in the js libs

pale vessel
opal plank
#

better than djs by a mile

pale vessel
#

He's gonna bug you with the same thing

lost heath
opal plank
#

when did i say what the command handler had or that it couldnt be expanded then?

zenith terrace
#

erwin just shut up now he aint interested

lost heath
earnest phoenix
opal plank
#

cuz you wont need to wait 6 months to get buttons

#

perhaps?

lost heath
opal plank
#

and other future things added by discord

earnest phoenix
#

Im interested Erwin

opal plank
earnest phoenix
#

imagine not making it for ts

#

:^)

opal plank
#

it IS ts

earnest phoenix
#

I was kidding

opal plank
earnest phoenix
#

Nice

opal plank
#

A wheels-attached, pure-TypeScript library for the Discord API.

earnest phoenix
#

I might look into using it

lost heath
#

detritus is a module? that makes no sense

earnest phoenix
#

What

opal plank
#

check the link i sent misty, it has the pros and cons

#

though the cons are being worked up rn

earnest phoenix
#

Detritus looks like a discord api wrapper

opal plank
earnest phoenix
#

same as discord.js

#

with some bonus shit

opal plank
#

like slashCommandClient and CommandClient

earnest phoenix
#

To me it looks like you can make your own command handler if you want tho it seems he said there is one already provided

opal plank
#

which are handlers

earnest phoenix
#

am I right?

opal plank
#

correct

earnest phoenix
#

So there is a default command handler but you can make your own sick

vivid fulcrum
#

scounting detritus' src, it has a more sane design approach

#

djs abstractions are pure garbage

earnest phoenix
#

Perfect for those who wanna get their hands dirty

opal plank
#

you can always run the commands like you did with d.js, off the message_create event, but theres a handler built in a lot better than the shit they teach u at the d.js guides

earnest phoenix
#

I will look at it

#

Might even switch to it for this open source bot

#

Since I am trying to try new stuff with it

opal plank
vivid fulcrum
#

oh yeah

#

rest client

opal plank
#

me million and a couple other people are getting a basic deploy-ready bot example for you to try out

vivid fulcrum
#

does djs still not have that, in master if anything?

opal plank
#

dont think so

earnest phoenix
#

It does I think

vivid fulcrum
#

lmfao

earnest phoenix
#

Just in a different location

#

It is under something else no?

opal plank
#

the fact that they took 4 months to add slash commands shows how good they are lmao

earnest phoenix
#

Like a manager of sorts

vivid fulcrum
#

i mean if it wasn't clear enough, discord wants bots to move off the gateway and work purely off interactions

#

but that isn't happening anytime soon

#

but they're implying it

earnest phoenix
#

Yea

#

I like slash commands

#

Makes it a lot easier to manage args

#

instead of checking for yourself

vivid fulcrum
#

nah

opal plank
#

buttons are a saviour

hot sage
#

Why isn't this error handler working? It's supposed to be for my user-info command. Using an alias isn't the problem, but I'm not sure why it isn't working.

earnest phoenix
#

You can ensure that arguments will be there

vivid fulcrum
#

slash commands are still heavily garbage, the only pro in my eyes is the native UI you get

opal plank
#

buttons legit cut 40% of my requests, cuz you can send ALL buttons at once rather than having to loop reactions for embeds

earnest phoenix
#

I mean they can be worked on

#

but it is a nice thought

vivid fulcrum
#

but you don't get the flexibility you'd get with your usual command handler

#

they should provide more arg types

opal plank
#

the only issue thus far with slash commands has been handling it

#

but now that detritus added a slashCommandClient

#

check this

#

you can have your functions run directly off what options have been sent

#

rather than having to parse all that shit by yourself with switches on the options

#

let the lib parse which option/s were chosen

#

and just run it off that

rocky hearth
#

whats that 3rd run is for?

opal plank
#

that was the only annoying bit so far with slash commands imo, the handling of it

opal plank
#

since you cant call a group, that'll never run

#

but you get the idea im trying to explain

#

rather than listening to the INTERACTION_CREATE event, see which command was ran and which options, and then go from there

#

the fact that it has that handling makes it doable

vivid fulcrum
#

the enum naming is ugly ew

earnest phoenix
#

Mmmm

vivid fulcrum
#

i hate screaming case

lost heath
earnest phoenix
#

Looks sick

lost heath
#

huh?

rocky hearth
#

yes

lost heath
#

cool

earnest phoenix
#

@opal plank I second this library

#

Ima use it for MistyBoat

opal plank
#

welcome aboard

earnest phoenix
#

One question

opal plank
#

sup

earnest phoenix
#

What is up with the 4 different clients or whatever

opal plank
#

so, let me explain that

lost heath
#

okay uh. dumb question. how can i change to master djs?

zenith terrace
#

bruh

earnest phoenix
#

npm i discordjs/discord.js

lost heath
#

wh.

#

wouldnt that install stable?

earnest phoenix
#

No

#

cause the main branch of the repo is master

lost heath
#

really???

#

how do we install stable then?

opal plank
#

CommandClient is the command handler, it can wrap around a cluster or client.
ShardClient is your normal "discord.js" client, its a single normal client that connects to the gateway.
ClusterClient is a client with multiple shardClients (which are used for sharding, i'd recommend using this right away so you dont have to worry about sharding later down the line)

The commandClient can wrap either around a ShardClient or ClusterClient

earnest phoenix
#

discordjs(github org/user name)/discord.js(repo name)

#

it will install whatever is the main branch

opal plank
#

@earnest phoenix ^^

earnest phoenix
#

which in this case is master

lost heath
#

hm

earnest phoenix
#

to install stable you install it from npm

#

which is yarn add discord.js

opal plank
#

i'd recommend using my example bot to start off

earnest phoenix
#

or same with npm

opal plank
lost heath
#

im very confused

earnest phoenix
#

if you don't supply an org/user name for github it will install straight from npm

lost heath
#

mhm

earnest phoenix
#

orgName/repoName

lost heath
#

i still dont understand how to choose stable or master :/

earnest phoenix
#

Well

#

The stable release is on npm and the master is on github

rocky hearth
lost heath
#

oh so i need to do npm i discordjs/discord.js to install master

opal plank
#

@earnest phoenix seen the messages?

earnest phoenix
#

yea

#

sorry I was helping them

rocky hearth
#

u hv to delete and switch to other package

earnest phoenix
#

nah

#

it should overwrite the other

#

At least it does for me

rocky hearth
#

I read that in doc somewhere

lost heath
#

ill just delete it to be sure

#

:/

earnest phoenix
#

@opal plank I see so command client wraps around the "base" client

opal plank
#

yes

#

theres not 1 BASE command

#

that'd be the shardClient

earnest phoenix
#

Mmm I am trying to figure out which to attatch prisma to

opal plank
#

thats your "base" client per say

earnest phoenix
#

attach*

opal plank
#

prisma?

earnest phoenix
#

Prisma is an orm for typescript

opal plank
#

database?

earnest phoenix
#

yep

opal plank
#

u using my repo?

lost heath
#

but on djs docs it says on both master and stable. to do npm i discord.js

earnest phoenix
#

I haven't looked at your repo yet

opal plank
#

use this to deploy ur bot in

elfin vale
#

detritus?

opal plank
#

it has a lot of stuff already ready for you to use

earnest phoenix
#

but as it stands I have prisma attached to my AkairoClient

opal plank
#

look in...

#

let me get the thing rq

lost heath
opal plank
elfin vale
#

detritus is typescript?

opal plank
earnest phoenix
#

Ah right

opal plank
rocky hearth
earnest phoenix
#

I was planning on starting from scratch tbh

#

Try and learn it as I go

opal plank
#

you can, but i'd recommend looking at the repo example so you have a base/framework to work from

#

the comments should guide you

#

at least to get you acquainted with the lib

elfin vale
lost heath
rocky hearth
#

yes

elfin vale
#

maybe I can try this one

lost heath
#

okay thx

opal plank
#

here, if you curious about it, check this

elfin vale
#

okie

earnest phoenix
#

Erwin is recruiting an army for his lib

#

:^)

opal plank
earnest phoenix
#

So far looks like a nice lib

opal plank
#

its a running joke here that i get paid to recruit people to detritus

earnest phoenix
#

lmfao

#

well do you

opal plank
#

(i dont)

earnest phoenix
#

👀

opal plank
#

i only recommend the lib cuz i've used both discord.js and detritus

#

so i can really give input on how shit discord.js is compared to detritus

earnest phoenix
#

I thought you were a dev of it

#

lol

opal plank
#

nah

#

its just a good lib

#

~~im not like berry who advertises his own lib mmulu ~~

#

right stinky @slim heart ?

slim heart
#

smh im only like

#

1/4th of the messages that contain discord-rose

opal plank
earnest phoenix
#

Discord rose is also nice but

#

I don't really feel like banging my head against a table

opal plank
#

i did not tell them to say that, for the record

slim heart
#

kek

earnest phoenix
#

yes he did

earnest phoenix
opal plank
#

or typescript tsc

#

theres something that needs it

#

i forgot what

earnest phoenix
#

ts-node requires typescript as far as I know

opal plank
#

AH

earnest phoenix
#

I've never had to install tslib

opal plank
#

for helpers

earnest phoenix
#

No idea what that is

opal plank
#

you need tslib to import helpers

#

i think its used for when you want to import .json files and shit like that directly iirc

#

which i do for configs since it pulls the types along with it

earnest phoenix
#

I use yaml files

#

lol

#

@sach1/dahlia good yaml lib

opal plank
#

you can use whatever you want in all honesty, .env, yalm, json, just make sure to add it to the types in the lib

#

/types/detritusOverrides.d.ts

#

basically i'd recommend the following

opal plank
#

the reason i dont recommend his repo off the gate is that it has a LOT of advanced stuff, so it might be hard to catch whats going on off the gate

earnest phoenix
#

Well now I am questioning my knowledge of ts

opal plank
#

look at the second repo from cake then

#

if you confident in ur ts skills, it would be better to get your bot going off a GOOD example, rather than mine

slim heart
#

can t u just use resolveJson or whatever tf it is

opal plank
#

mine is a crude/good/basic example to get you going

opal plank
slim heart
#

ive never installed tslib

opal plank
#

and importHelpers

slim heart
#

nor enabled importHelpers

#

lol

opal plank
#

theres definitvely something there that uses it

#

if u clone and uninstall it, either ts-node or tsc will screech at you

earnest phoenix
#

or you installed it for no reason

opal plank
#

nah, there was definitively a reason for it

earnest phoenix
#

I don't have tslib installed and can use tsc

#

so

opal plank
#

even the DOM lib is there cuz tsc

earnest phoenix
#

and I have never installed tslib with ts-node and it worked

#

it only required typescript

slim heart
#

the only thing that has tslib installed on my entire machine is @typescript-eslint

earnest phoenix
#

Mk I am looking at dans example but I don't understand why he is doing all of this for the command client.

#

I thought it already did half the shit he is doing

#

Actually nvm

#

I am looking at it a lot more now it seems he is doing custom checks for guilds.

earnest phoenix
#

CommandClient

#

I figured out what he was doing now

#

Still a bit confusing at first so ima just stick with looking at your example until I understand the lib more

opal plank
#

lmao i did warn its a bit complicated to understand

earnest phoenix
#

Yea

#

I mean I can tell what hes doing

#

I just don't understand the lib enough to know fully what its doing lol

opal plank
#

his is the only open source repo we had before, thats why i made a simple and well commented one, to give out some general directions

earnest phoenix
#

Ah I see

#

What does supplying shardCount do?

#

tells it how many shards to create?

slim heart
#

i'd assume so

earnest phoenix
#

Same here

slim heart
#

and not passing it will automatically count

earnest phoenix
#

I think that would be the case

#

you can even tell it what to cache neat

slim heart
#

so can rose ok anyways

opal plank
slim heart
#

why lol

earnest phoenix
#

yes but rose makes me wanna bang my head on a table (message approved by Erwin)

slim heart
#

feedback welcome

#

howcome

opal plank
#

i never told them to say that

earnest phoenix
#

Just don't get the worker standpoint

opal plank
slim heart
#

how many servers is your bot in

earnest phoenix
#

Well 1 cause its in development

slim heart
#

well then yeah i wouldnt really recommend my lib then kek

earnest phoenix
#

Ye

#

But I am still interested in how it works

slim heart
#

its made to super scale not be simple

earnest phoenix
#

I figured that when you said for advanced users

#

:^)

slim heart
#

ye

earnest phoenix
#

So I assume workers are like sharding or?

slim heart
#

clusters

earnest phoenix
#

Ah

slim heart
#

workers are spawned from the master and workers take care of x amount of shards

earnest phoenix
#

Ah sick

pale vessel
#

where are the slaves at

ruby sun
#

Morning

#

My bot is working fine but I've got a stupid issue with time

#
.setTimestamp(new Date(quake.time))
#

Any idea why the timestamp is at 12:11 ? wat

vivid fulcrum
#

store and send everything in UTC

#

discord will calculate the timestamp according to end user's timezone

ruby sun
#

Thanks

blissful bridge
#

nice

ruby sun
#

Now I just gotta wake for another quake PU_PepeHappyWait

wheat sun
#

That's quite the way to test if a bot works oof

ruby sun
#

Ikr

#

but it's fine, I'm plugged directly into the seismographs lol so there's a lot of noise

#

if I set the threshold low enough, I could probably trigger an alert just sitting on my computer chair

wheat sun
#

xd

ruby sun
#

didn't work at all KEKW

#

I don't get why

#

turned my date into a Date object

#

Mon Jun 07 2021 16:00:55 GMT+0900 (Japan Standard Time)

#

wait a second

#

Too early for me to code, I'll go grab a coffee

wheat sun
#

lol

hot sage
#

Is there any way to host a bot in the cloud on a Chromebook?

ruby sun
#

I don't think the hardware you use matter since you want to host on the cloud..

sudden geyser
#

This sounds more like a "how to upload my software to the cloud that was developed on a Chromebook" question

#

some just let you pull from github

hot sage
ruby sun
#

?

#

he literally just said some

#

why you saying no lol

hot sage
#

i read it wrong

#

i meant how can i host a bot myself, without using an app/website to host it

#

on a chromebook

earnest phoenix
#

Just run the file

#

and never turn off your chromebook

wheat sun
#

need to download python anyways

earnest phoenix
#

and hope you don't lose internet

ruby sun
hot sage
wheat sun
#

Same way you run a normal python file

hot sage
#

also my chromebook can't run linux

wheat sun
earnest phoenix
#

you don't need linux

wheat sun
#

I've never used a chromebook, so can't really help there

earnest phoenix
#

just run the file and hope you don't lose internet or pc goes to sleep

ruby sun
#

No offense but it sounds like you're asking how to build a bot from scratch

#

which is a totally different question

earnest phoenix
#

What

ruby sun
#

yeah...

#

I think the guy just doesn't know

earnest phoenix
#

You run the file...

ruby sun
#

I think he meant to ask how to build a bot

wheat sun
#

He made a sort of bot

#

@hot sage Sorry to say, but really need to review how to use Python if don't know how to run a file. We can't really help with stuff like this, it's the extreme basics xd

ruby sun
#

it could be TS/JS too, might not necessarily be python

wheat sun
#

Oh, it's python. Seen his questions and some of code

#

xd

ruby sun
#

ohh

#

he does have some things

#

got it

hot sage
lyric mountain
#

I wonder, how did you debug your bot?

hot sage
wheat sun
hot sage
hot sage
wheat sun
rare granite
#

Hey i made something like I store a name and when someone uses =p name it will ping users who have data as "name" But I wanted to make alt names for name ( not storing alt names).
Like someone stored "Astrex" As a name and I have a list in which "Astrex" has a alt name of "coder" So whenever I use =p astrex or =p coder it will ping the user with the data "astrex".
I'm not asking for the database support but I want how to make the list with the alt names.

#

I use djs btw

sudden geyser
#

I feel your question is too abstract.

rare granite
#

Umm

rare granite
sudden geyser
#

Let's say we had a names.json file structured as so:

[
  {
    "id": "1234567890",
    "name": "astrex",
    "alternatives": ["topgg", "coder"]
  }
]

In your program, you could do this for example:

let names = require("./names.json"); // [{ name: String, alternatives: [String] }]

onPingCommand((message) => {
  let user = names.find((name) => name.name === "..." || names.includes("..."));

  if (user) {
    // ...
  }
})

I haven't tested this, but this would look in names.json for any name that matches (.name === ... or if an alternative name exists (names.includes(...))). user will be null if no name exists, but if one exists, you could use the id key to reference the user attached to the name (message.channel.send("<@...>"))

Is this useful? @rare granite

lavish bramble
#

Which is best
fireBase or mongoDb

inland pulsar
#

I cant help you with non sql databases WeirdChamp

drifting wedge
#

how do i import a function from a file in a different folder in py?

opal plank
drifting wedge
#

ive tried everything

#

ive even went to google's second page

lavish bramble
zenith terrace
opal plank
#

DETRITUS

#

USE DETRITUS JS

#

BEST JS LIB

zenith terrace
#

fuck off erwin

drifting wedge
#

how import file pytoon

zenith terrace
#

I only know piefon

inland pulsar
drifting wedge
#

halp

#

ive tried

inland pulsar
#

learn the language

drifting wedge
#

i wouldnt be asking if i hadent

inland pulsar
#

xd

drifting wedge
#

dude

zenith terrace
#

learnt

drifting wedge
#

quiet

inland pulsar
lavish bramble
drifting wedge
#

IVE READ THE DOCS

inland pulsar
#

I doubt it

drifting wedge
#

thats ur problem then

#

someone helllllppp

inland pulsar
#

I think you can do from python from folder.filename import function, function2

#

hope that helps @drifting wedge

drifting wedge
#

the file is above the main file

#

like filename is above main

#

@inland pulsar

slender thistle
#

What's your directory like

drifting wedge
#

got it working

#

i just did a bit of gaming

#

and my brain worked

#

ty tho

#

gn @slender thistle

slender thistle
#

LMAO

#

Sleep well

drifting wedge
#

still gotta read

#

:p

brittle axle
#

<style>
.entity-header__image {
border-radius: 50% !important;
border: 3px solid gold;
animation: float 5s ease-in-out infinite;
}

@keyframes float {
0% {
box-shadow: 0 5px 15px 0px rgba(0, 0, 0, 0.6);
-webkit-transform: translatey(0px);
transform: translatey(0px);
}
50% {
box-shadow: 0 25px 15px 0px rgba(0, 0, 0, 0.2);
-webkit-transform: translatey(-30px);
transform: translatey(-30px);
}
100% {
box-shadow: 0 5px 15px 0px rgba(0, 0, 0, 0.6);
-webkit-transform: translatey(0px);
transform: translatey(0px);
}
}

.entity-wrapper {
width: 100%;
height: 100vh;
overflow: scroll;
overflow-x: hidden;
background: url('https://media.discordapp.net/attachments/851104008349417532/851303355891712020/vaporwave-wallpaper-preview.jpg');
background-repeat: no-repeat;
background-size: cover;
scrollbar-width: none;
}

.entity-wrapper::-webkit-scrollbar {
display: none;
}

body{
scrollbar-width: none;
}

body::-webkit-scrollbar {
display: none;
}

#menu {
background: transparent;
}
.entity-content__description {
background: transparent !important;
border: none;
}

.entity-content__divider {
display: none;
}

.entity-hint {
display: none;
}

blockquote {
background: linear-gradient(90deg, #363636 30%, #fff0 100%) !important;
}
</style>

#

pls telll error in this code pls

old cliff
#

codeblocks exist

#

```css
<Insert css here>
```

feral aspen
#

Hello! 👋

#

I have a for loop for a leaderboard command and for the first one, I want to add a custom emoji, same applies to second one and third one, but the rest has no emojis, is that possible?

#

1st, 2nd, and 3rd will have a custom badge as assigned in code, is that possible with for loops?

proper bolt
#

@feral aspen what language?

feral aspen
#

discord.js

proper bolt
#

are the values in an array

feral aspen
#

I use MongoDB with the sort method.

proper bolt
#
const emojis = [':one:', ':two', ':three:'];
const formattedLeaderboardValues = leaderboard.map((val, index) => 2 > index ? `${emojis[index]} ${val}` : val)
#

something like that

#

you can use .map

feral aspen
#

I'll do that, one moment...

#

Worked on my testing bot, let me try it on my main bot.

#

@proper bolt , I did this. ```js
${2 > i ? ${emojis[i]} : ""}

#

3rd one didn't work...

proper bolt
#

change it to 3 > i

feral aspen
#

Ohh... as per my code, i = start, and i means 1

proper bolt
#

ah ok

feral aspen
#

👍

high spindle
#

Eloooo

lavish bramble
#

Why my bot takes so much time to login?

prime mist
stiff lynx
#

tips about doing an antiraid system?

rapid wharf
#

Whats Self-botting???

lost heath
#

when bots are used on users not clients

rapid wharf
lost heath
#

its against TOS and i dont know how to do it nor do i want to

sick agate
#

its simply using bots on discord users

quartz kindle
#

all users have a token

#

when you login with your username and password, discord gives you your token and saves it into the discord app, until you logout

#

people basically just extract their user token from the app and put it on a bot, the same way they use a bot token

near stratus
wheat sun
#

Next person who gets a shooting star, please wish that we didn't have to deal with user doing dumb stuff and causing errors bcz my code almost doubled in size dealing with those things topggSob

wheat sun
#

I am using it

#

But even then

#

I need a true or false answer, but I know someone somewhere will try to input something different

#

for a command

#

Same thing for so many other things

near stratus
vivid fulcrum
#

end users are dumb

#

like ooga booga dumb

wheat sun
#

Mhm

vivid fulcrum
#

main reason why i stopped doing public bot deving

near stratus
#

ppl were trying to buy Sam Samsung Pantsu in my sfw economy bot

#

like wtf

wheat sun
#

oof

vivid fulcrum
#

i used to have commands come up with its info when they're misused

#

and it says

#

-whois <id>

#

logically, you'd provide an id, yeah?

wheat sun
#

Oh god, I always check the length of inputs like that

#

Bcz I know someone will put something else

vivid fulcrum
#

yeah well I've had people send literally "<id>"

pale vessel
#

-whois <760967718269747201>

wheat sun
#

lol

pale vessel
#

It's very common

#

I don't even think my bot is for average end users

wheat sun
#

average end users sets the bar too low

lusty quest
#

Just expect a donkey to be the enduser

near stratus
wheat sun
#

Another problem is trying to describe the user inputting a value

-whois <id>
-whois [id]
-whois (id)

no matter which, someone will add it in the wrong format

#

oof

lusty quest
lusty quest
#

They wont get it otherwise

wheat sun
#

Even then, in the description, if you write -whois @mention someone will write that literally

pale vessel
#

Brain big

lusty quest
#

Check if he writes exaclty this and let the bot reply with a Gordon Ramsey meme calling him a donkey

wheat sun
#

That would be a nice way to handle errors

lavish bramble
formal pulsar
#

I don't understand why it doesn't make me change the page more than once ,meaning I click on the "2" and it takes me to that page then I click on the "3" and ok but if I click on the "2" again it doesn't work

lavish bramble
#
module.exports = {
  name: "msearch",
  description: "search for music", 
  execute: async(client, message, args)=> {
    const q = args.join(" ")
    ytsr(q, {limit: 1}).then(r => {
    message.channel.send(r.name)
    })
  }
}```
#

Error : cannot send empty message

#

But when I log this

#

Its gives me name

pale vessel
#

Shouldn't it return an array?

#

Log r and see

#

If it's an array r.name would be undefined

crimson vapor
#

yea, considering it has limit: 1

earnest phoenix
#

It's an array where the elements are object with name props

#

||did i really just use the word prop outside of react||

#

can someone explain sharding to me

#

i’ve never understood it

crimson vapor
#

sharding creates multiple ws connections rather than a single one

#

it helps discord reduce their load because they can split it up

earnest phoenix
#

*helps you reduce the load

crimson vapor
#

kinda but also no

earnest phoenix
#

gotcha

crimson vapor
#

sharding its self doesn't

#

the fact that you are required to shard enables you to scale well

small oracle
#

Does anyone have discord group for twitch self promotion

marble juniper
#

no and this is for development related stuff

thin quarry
#

i have got a question

#

so

#

i saw that are bots that instantly change their icon and name send a message and change icon and name back

vivid fulcrum
#

that's a webhook

#

not a bot

thin quarry
#

wdym

opal plank
#

cry means that

thin quarry
#

hmm

thin quarry
vivid fulcrum
#

it's a single webhook

#

read the links you got sent

thin quarry
#

ok

vivid fulcrum
#

webhooks can set the avatar and the username on the go

#

it's set in the payload

thin quarry
#

ok thx

crimson vapor
slim heart
#

im perfectly

#

aware

crimson vapor
#

Error: DiscordAPIError
Maximum number of webhooks reached (10)

slim heart
#

just because its 99% of my errors doesnt mean anything million

crimson vapor
#

mb

opal plank
#

imagine having errors on ur lib

#

couldnt be detritus

slim heart
#

what

opal plank
#

imagine having lib errors

slim heart
#

yikes

crimson vapor
pale vessel
#

I don't think it's the lib lol

slim heart
#

not in the lib in any meaningful way

crimson vapor
#

ik

#

I was blaming you not the lib

slim heart
#

voiding isnt bad

#

it does like

#

nothing

#

its just eslint brr

pale vessel
#

/* Voided */ ing is not bad

crimson vapor
#

no

#

thats different

#

hes like doin

void worker.api.messages.delete('272764566411149314', '851449525960572938')```
slim heart
#

what

#

no im not

pale vessel
#

What

slim heart
#

ok yeah

#

because

#

its void

crimson vapor
#

void

slim heart
#

void just turns a response into undefined

pale vessel
#

Idk man I just

slim heart
#

it does jack shit

opal plank
#

berry getting mauled by his own community

crimson vapor
#

I do that a ton

slim heart
#

million is just brain small

crimson vapor
#

yes

#

you're not handling the possible errors

slim heart
#

what

#

i dont care abt the errors because they shouldnt be happening

#

and then if they do then it logs

#

and if they don't it just continues

crimson vapor
slim heart
#

if i wanted to handle the error / stop i'd do await ... rather than void ...

pale vessel
#

Nice

slim heart
#

which is what i do when i want errors to end execution

opal plank
slim heart
#

how i just .catch(() => {}) any better like

#

i dont do empty catches because i want to actually see errors?

#

because im a decent coder?

#

what

crimson vapor
#

yea but if you're doing something like deleting a message, why void it if its gonna error if your bot gets perms removed

#

its not like you can do anything about that

slim heart
#

because i already check for perms

crimson vapor
#

ok well that was a bad example

slim heart
#

if something else happens then it's an issue with my bot

#

which means i should just be continuing

#

and ill find the error then

crimson vapor
#

I mean I don't think missing perms is an issue with your bot

slim heart
#

if i check for the perms

#

and i still get permission errors

#

then its an issue with my code

#

then i want to see errors

stiff lynx
#

There is a way to create data in the database when the bot joins the server?
All of this bcs I'm doing an option for disable categorys of commands if someone don't wants it inside his server and this is verified with a database

slim heart
#

but i also dont want to affect what would be expected functionality

#

such as muting

#

if the role is too high and it errors then it'll still log it because its a confirmation that the bot is working

crimson vapor
#

wouldn't it be better to handle that and send a mesasge in the logs saying that the role is too high?

slim heart
#

that is exactly what it does

crimson vapor
#

wtf is that

#

ok ig ive not read censorbot's code enough to talk

slim heart
#

i've like 5 years of bot ux experience i know what im doing million lmfao

crimson vapor
#

5 years

slim heart
#

yes

#

5 years

crimson vapor
#

last change was 3 years

#

were you working on v1 for 2 years?

slim heart
#

i only uploaded to github after a while 4head

crimson vapor
#

o

#

well either way

#

2 years of experience led to that shit tho?

earnest phoenix
#

👀

opal plank
earnest phoenix
#

Lol

pale vessel
#

No

crimson vapor
#

a bit longer

#

code is about to talk

pale vessel
#

Why are you like this

slim heart
crimson vapor
slim heart
#

oh

stiff lynx
#

There is a way to create data in the database when the bot joins the server?
All of this bcs I'm doing an option for disable categorys of commands if someone don't wants it inside his server and this is verified with a database

crimson vapor
#

you know what I mean

slim heart
#

my first bots weren't in js nor open source

#

i used to make bots in java

crimson vapor
#

ewww

earnest phoenix
#

ew

#

Kotlin better

pale vessel
#

@slim heart What was the first lib you used, I've been wondering

crimson vapor
#

bro

lost heath
#

i have like 2 years of experience. i started 2 years and 40 days ago

crimson vapor
#

you count that as experience?

#

java

pale vessel
#

Js

earnest phoenix
#

I have like 3-4 years of experience and I still suck ass

pale vessel
#

and Java too, sure

earnest phoenix
#

prob jda

#

for java

pale vessel
#

JDA / D4J ig

slim heart
#

java was jda and js was djs

pale vessel
#

O

earnest phoenix
#

D4J wasn't that popular back then was it

pale vessel
#

No clue

slim heart
#

not rlly

earnest phoenix
#

I mean it still isn't really

slim heart
#

i dont think i ever heard of it

earnest phoenix
#

but it has its user base

slim heart
#

kek

earnest phoenix
#

I only know of it cause I read the docs every now and then

#

:^)

#

discord docs

slim heart
#

back when jda was user bot only kek

earnest phoenix
#

I've got a komplex question:
In my App component I'm managing state which all my child components require and passing it to them with a Context. However, one of my components manages it's own state that other components may need to function. So should I keep the state in the top of the hierarchy or do I just forceupdate the parent when I need?

#

Why not use a state management tool

#

So all components can have access to it when needed

#

and update them as they need it instead of passing it up or down

slim heart
#

well

lost heath
slim heart
#

you should be using hooks and keep it in the parent tbh

earnest phoenix
#

Yea

#

If this is a react/vue question which I assume it is I prefer using a state management tool like Redux or Vuex

knotty obsidian
#

How do I make a hyperlink

#

In java

earnest phoenix
#

I mean ig

#

Depends on your use case

slim heart
#

you should only be using state management for global variables like locales etc

earnest phoenix
#

the state managed by the child component is supposed to forceupdate other components when needed so

#

I just find it easier allowing all components to be able to have access to the state and update it when needed

ember wraith
#

Can anyone explain to me, why does my bot's avatar looks like died top.gg's logo?

earnest phoenix
ember wraith
pale vessel
#

Could be that you changed it

vale garden
#

hey

#

for some reason, when i do this print((await bot.fetch_invite(client_invite)).max_uses)

#

im getting None

#

but .id gives me the right id

#

and stuff

vivid fulcrum
#

then the invite doesn't have max uses set

vale garden
#

what

#

when max isnt set, its supposed to return 0

#

also .uses gives me None

earnest phoenix
rocky hearth
#

wdym

earnest phoenix
#

que

lost heath
#

should i just set it in package.json to discord.js v13?

#

instead of 12.5

digital ibex
#

no

lost heath
#

wh

#

then what

digital ibex
#

it aint gonna change the code

lost heath
#

code? what code?

digital ibex
#

source code?

lost heath
#

if i change it in package.json then run npm i shouldnt it work?

#

okay yea. it doesnt find it if i change the version manually

rocky hearth
lost heath
#

i dont have access to that link

full orchid
#

hello, I'm currently making a discord bot with 100+ commands. And I was wondering if any of you guys would be able to tell me how I could get more people using it across many popular, growing servers.

rocky hearth
lost heath
viral spade
#

Hello!
How should i best implement the bot listening to reactions for a message/voting that people can vote on?
I know how i can listen to the reactions on a specific message and also how to listen to all reactions.

This votings should be able to last very long (day, weeks) My problem is, that i want

  1. the listeners be still active when the bot restarts
  2. being able to show the voting on different channels/guilds and still count all the votes from all channels and also edit the embed on all channels accordingly.
lost heath
full orchid
lost heath
#

about development not advertising

#

if you want advertising, put it on the website and have friends and users upvote it

full orchid
#

mk, thanks

viral spade
#

noone know an answer?

lyric mountain
viral spade
#

discord.js

lost heath
lyric mountain
#

best method is to make a dedicate reaction button handler, but that'd be a lot of work and explanation on how it works

#

djs has reaction collector iirc, use that

lost heath
#

okay ill read thru. thx

rocky hearth
#

that guide is outdated though, but u'll get the idea

lost heath
#

👍 thx

earnest phoenix
#

I'm using Chakra ui's switch component in a form with the name prop to required but when i log the key from the FormData object it always shows an empty string

#

how do you detect if it's selected?

#

weird it's logging null when unselected

#

at least i can check for null tho

uncut swallow
#

ñ

knotty obsidian
#

how can i (or is it possible to) make my bot go to a website and take a picture of it then display it on discord?

earnest phoenix
knotty obsidian
#

i use java

#

maybe theres like a library for it?

lavish bramble
#

How can I make my own AI chatbot

#

Self learning

earnest phoenix
urban cape
#

How to read a : within a json key with nodejs

{
    "_declaration": {
        "_attributes": {
            "version": "1.0",
            "encoding": "UTF-8",
            "standalone": "yes"
        }
    },
    "co:items": {
        "_attributes": {
            "xmlns:ea": "http://platinum.topicus.nl/v0.1",
            "xmlns:co": "http://cobra.topicus.nl/v0.1"
        },
        "rLeerling": {
            "co:link": {
                "_attributes": {
                    "id": "xxxxxxxxxxx",
                    "rel": "self",
                    "type": "leerling.RLeerling",
                    "href": "https://api.somtoday.nl/rest/v1/leerlingen/xxxxxxxxx"
                }
            }
        }
    }
}

I want the rLeerling id
So i thought

school.co:items.rLeerling.co:link._attributes.id

But that didnt work
How to read that id

urban cape
#

that gives udnefined

earnest phoenix
#

You must use the [] object property accessor to access properties with unsupported characters in the property name

urban cape
#

Ok i will try

earnest phoenix
#

school['co:items'].rLeerling['co:link']._attributes.id

sterile lantern
#
return message.channel.send("Test", {
    embed:colors, 
    components: [n, a]
  })```
How come the buttons don't get added
#

i want it to get added on the embed

#

but it doesnt work

urban cape
sterile lantern
earnest phoenix
#

You have to do a raw API request

#

With <Client>.api

sterile lantern
#

i mean this is the error

#
(node:1569) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'map' of undefined```
#

from components: [n, a]

#

buttons: [n, a] just dont work. if its in a non-embed form, it works

earnest phoenix
#

I'm pretty sure that's not where the error is coming from, may you show us the stacktrace of the error?

sterile lantern
#
(node:1664) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'map' of undefined
    at /home/runner/HanaleiNew-Final-1/node_modules/discord-buttons/src/v12/Classes/APIMessage.js:120:50
    at Array.map (<anonymous>)
    at APIMessage.resolveData (/home/runner/HanaleiNew-Final-1/node_modules/discord-buttons/src/v12/Classes/APIMessage.js:117:60)
    at TextChannel.send (/home/runner/HanaleiNew-Final-1/node_modules/discord-buttons/src/v12/Classes/TextChannel.js:18:68)
    at Object.run (/home/runner/HanaleiNew-Final-1/commands/colore.js:35:26)
    at Client.<anonymous> (/home/runner/HanaleiNew-Final-1/index.js:255:18)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:1664) 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: 2)
(node:1664) [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.```
earnest phoenix
sterile lantern
#

only happens when i use components:

#

when i use buttons: it sends the embed but not the actual buttons

earnest phoenix
sterile lantern
#

yep

urban cape
#

console.log(school)

{
    "_declaration": {
        "_attributes": {
            "version": "1.0",
            "encoding": "UTF-8",
            "standalone": "yes"
        }
    },
    "co:items": {
        "_attributes": {
            "xmlns:ea": "http://platinum.topicus.nl/v0.1",
            "xmlns:co": "http://cobra.topicus.nl/v0.1"
        },
        "rLeerling": {
            "co:link": {
                "_attributes": {
                    "id": "xxxxxxxxxx",
                    "rel": "self",
                    "type": "leerling.RLeerling",
                    "href": "https://api.somtoday.nl/rest/v1/leerlingen/xxxxxxx"
                }
            },
            "co:permission": {
                "_attributes": {
                    "full": "leerling.RLeerlingPrimer:READ:INSTANCE(xxxxxxxx)",
                    "type": "leerling.RLeerlingPrimer",
                    "operations": "READ",
                    "instances": "INSTANCE(xxxxxxxxx)"
                }
            },
            "co:additionalObjects": {},
            "UUID": {
                "_text": "xxxxx"
            },
            "leerlingnummer": {
                "_text": "xxxx"
            },
            "roepnaam": {
                "_text": "xxx"
            },
            "voorvoegsel": {
                "_text": "xx"
            },
            "achternaam": {
                "_text": "xx"
            },
            "email": {
                "_text": "xxxx"
            },
            "mobielNummer": {
                "_text": "xxxxxx"
            },
            "geboortedatum": {
                "_text": "xxxxxxx"
            },
            "geslacht": {
                "_text": "xxxxxx"
            }
        }
    }
}
earnest phoenix
# sterile lantern yep

That has issues, which is why that happens; I recommend using raw API requests instead

urban cape
#
console.log(school['co:items']) //undefined

thats also undefined

sterile lantern
#

ic

earnest phoenix
#

What Node.js version are you using?

urban cape
#

node 15.10.0

#

npm 7.11.2

earnest phoenix
#

Then that should work, no idea how it doesn't; can you try logging school.constructor.name?

urban cape
#

TypeError: Cannot read property 'name' of undefined

#

constructor is also undefiend

earnest phoenix
#

The what, that's kinda unusual

urban cape
#

maybe it displays it as text but it looks like json

earnest phoenix
#

Try logging typeof school

urban cape
#

string

#

its just text

#

not json

earnest phoenix
#

Then parse it

urban cape
#

ehh

#

how

earnest phoenix
#

school = JSON.parse(school)

urban cape
#

ok

#
{
  declaration: {
    attributes: { version: '1.0', encoding: 'UTF-8', standalone: 'yes' }
  },
  elements: [
    {
      type: 'element',
      name: 'co:items',
      attributes: [Object],
      elements: [Array]
    }
  ]
}

how to retrieve the elements.elements
i just dont get that array
school.elements.elements
doesnt work. it gives undefined

pale vessel
#

It's an array

#

Access it by its index first, i.e. 0

opal plank
#

or filter() or find() if you looking for something specific inside

urban cape
#

school.elements.elements[0] = undefined

opal plank
#

not twice

#

just once

#

school.elements[0]

pale vessel
urban cape
#

I got it thx

lavish bramble
#

Can I create my own A.I chatbot

opal plank
lavish bramble
opal plank
#

not that im aware, no

#

probably gonna have to use some ai out there to help you

#

whats that one famous one?

#

i think it was from google

lavish bramble
#

ALL AI IS SAME

opal plank
#

tensorFlow

#

@solemn latch ads

opal plank
#

ty

round cove
#

Sorry I got up to get coffee lol

lavish bramble
earnest phoenix
#

🐛 found a bug in opera 76.0.4017.94 on ubuntu

#

you cant visually see the text you type in window.prompt

#

it does get typed tho

opal plank
lyric mountain
#

I found a bug on facebook

#

it lacks dark mode

earnest phoenix
#

it does have dark mode

slender thistle
#

Found a bug on Twitter

#

It exists

opal plank
#

facebook in 2021? THINKING

opal plank
solemn latch
#

i made a facebook for the first time recently... for oculus quest

slender thistle
#

TikTok is fine

lyric mountain
#

I wonder why mark even bought oculus

tardy hornet
#

any idea how to make a new port?

lyric mountain
#

"make a new port"?

#

wdym?

tardy hornet
#

to make that if someone vote for your bot, that it will send a message

#

you need a port right?

solemn latch
#

well, unless you are hosting somewhere without ports available. yes.

tardy hornet
#

with app.listen()

lyric mountain
#

just choose any free port

solemn latch
#

ports are rarely restricted, excluding like replit and stuff.

cinder patio
#

Make sure the port is above 1024 tho

#

4000 or 3000 is a good port that's rarely used by other stuff

earnest phoenix
#

When I try to fetch a 1000 members server, my bot responds after 10-15 seconds. How can i solve this i am using d.js v12

crimson vapor
#

the issue is probably that its just a huge amount of data

lyric mountain
#

yeah, 1000 members is no joke

earnest phoenix
#

😔

lyric mountain
#

not that you're supposed to be fetching very frequently tho

#

you're supposed to use cache

earnest phoenix
#

Okay i will try

willow mirage
#

anyone help me with GraphQL?

#

im got fucked by those unspecified Syntax Error

lyric mountain
#

run it here and show the output

tardy hornet
#

i made a webhook

#

which one is the auth in the link?

lyric mountain
#

whatever u want

opal plank
tardy hornet
#

o okay thx

#

and 1 more problem

#

its not sending it

solemn latch
#

did you fill in the url and auth properly?

tardy hornet
#

i think

solemn latch
#

where are you hosting?
home/repl/heroku/vps

tardy hornet
#

how can i make sure?

#

in the const webhook = new Topgg.Webhook()

#

i need to put the webhook url in there?

solemn latch
#

no

tardy hornet
#

or the auth?

solemn latch
#

the auth

#

the same one you fill in on the site

tardy hornet
#

okay

#

and to send

#

something

#

its

#

webhook.send

#

?

solemn latch
#

you dont send anything with the webhook, you are making a webhook receiver.

tardy hornet
#

wdym

#

cant i just do

solemn latch
#

no

tardy hornet
#

then how exactly

opal plank
#

discord webhooks my dood

#

not topgg webhooks

#

i legit sent u a link

solemn latch
#

then why const webhook = new Topgg.Webhook()

#

👀

opal plank
#

both me and cry

solemn latch
#

oh him

#

yeah, top.gg webhooks are for receiving webhooks, not sending.

opal plank
#

he started this convo asking how do bots send messages with different names/pfp

#

im 90% sure he mistook topgg webhooks with discord's