#development

1 messages ยท Page 1166 of 1

honest perch
#

But if you really want java

#

Then lavaplayer

earnest phoenix
#

javascript suck

#

No u

delicate shore
#

no

digital ibex
#

eh

delicate shore
#

w

#

w

digital ibex
#

js is meh

delicate shore
digital ibex
#

donโ€™t care

viral spade
#

Do i put my 4 apps that are part of my bot in one git repo or do i make one repo for each? all run on different vps.

The 4 apps are: 1. node.js bot docker, 2. node.js website docker, 3. database docker 4. manager server docker

restive furnace
#

js is meh, agreed

#

but still its usable

eternal osprey
#

hey guys

#

how do i remove decimals from a python calculation

neat harness
#

Can you save files with a custom extension but with a json format and still open it the same as json?

earnest phoenix
#

You realize everything you put in a file with a json extension an for example change the extension to txt, the content still stays right?

neat harness
#

yes

earnest phoenix
#

I mean the content would only stay if you change the extension to something that can be opened as a text file

neat harness
#

yes

earnest phoenix
#

So yes

neat harness
#

Awh

#

That's great then xd

#

Also I still remember my bot removed for leaking the eval command, any better way to do it than "return"

#

?

#

@earnest phoenix

earnest phoenix
#

What you mean by any better way to do it than "return"

#

Like make the eval only usable to the owners or wot I'm confused

neat harness
#

YesLiLike

#

Damn my computer lagging

#

Like that yes

#

My cmd crashed, hmm

earnest phoenix
#
let ownerIDs = ["ID of owner", "ID of another owner", "ID of the another owner"];
// There can be one owner too, this just depends how many owners the bot has

// Start of the eval command
//
// If owner ids array doesn't include the user's ID, just return
// Or just send a message by `return message.channel.send("You\'re not an owner");` for example
if (!ownerIDs.includes(<message>.author.id)) return;

// Do the eval command

// End of the eval command```
neat harness
#

Oh okay thanks

golden condor
#

Why use a \ on an apostrophe if you are using speech marks

earnest phoenix
#

Wot

golden condor
#

You escaped the apostrophe

#

But you didn't need to

earnest phoenix
#

Yes, if there's 2 of them, this would not work

golden condor
#

Because you are using speech marks

delicate shore
#

what is exact

#

exact

#

use of intents

golden condor
#

What

#

uh

#

Well

#

It is supposed to tell the discord gateway which events to send you, and which not to send

#

And also which properties you need to access

#

Such as presence

#

Or guild members

delicate shore
#

i mean is there any benefit

#

Such as presence
@golden condor presence of users?

golden condor
#

Recieving... Specific events?

delicate shore
#

like dnd online invisible

earnest phoenix
#

Saving of memories, it just identifies what to send and what not, for example it doesn't return the properties that is not used

golden condor
#

@golden condor presence of users?
@delicate shore yes, that is a special intent

#

It also saves memory

delicate shore
#

but my bot can tell if user is dnd , online or offline

earnest phoenix
#

Only returns the properties used

delicate shore
#

without it

golden condor
#

but my bot can tell if user is dnd , online or offline
@delicate shore won't be able to after October

#

You need the presence intent after October

#

It is required.

neat harness
#

Discord is using 90% CPU and 2 GB RAM dfq...

delicate shore
#

oh

earnest phoenix
#

Intents usage is required after October 7th of 2020

delicate shore
#

but now i said i don't need intent

golden condor
#

You have to declare intents after october

earnest phoenix
#

Events will be intents

golden condor
#

I've already done it

delicate shore
#

You have to declare intents after october
@golden condor and how to use it i my code

golden condor
#

Declare it in the client

delicate shore
#

do i need to declare it

#

how ?

golden condor
#

In ws options

#

Read the docs

terse gust
#

hey you know how to see where my bot have joined server (maybe with web or something?)

delicate shore
#

guildCreate

golden condor
terse gust
#

see all server list

earnest phoenix
#
<client>.guilds.cache.map(g => g);```
delicate shore
#

ok and @golden condor do i need to change something in command file also?

terse gust
#

k

golden condor
#

No

#

Not at all

delicate shore
#

ok

golden condor
#

Should be the same

#

But

#

You need to apply for the presence intent

delicate shore
#

ok

zealous vortex
#

Hi

eternal osprey
#

could anyone help me with removing decimals from a python calculation

earnest phoenix
#

:-

eternal osprey
#

?

ionic warren
#

hello, I am making a bot that will send photos of cats when requested. anybody know how to make a command that will pick a random photo each time but with the same command?

eternal osprey
#

you have to create a databasse for that

#

or scrape it from an existing source

#

beatifulsoup is a good library for that

sinful belfry
#

or an api

eternal osprey
#

but i am not that good with python

#

am i allowed to ssend pastebin links here?

#

because i am trying to remove decimals

sinful belfry
#

sure

eternal osprey
#

from my calciulation

sinful belfry
ionic warren
#

ty ill take a look

sinful belfry
#

you need to send a GET request

eternal osprey
#

owh yeah that is a good one

sinful belfry
#

and it'll return a url for the image

#

(a random one)

eternal osprey
#

could anyone help me with my code please?

sinful belfry
#

what exactly are you trying to do?

eternal osprey
#

to remove the extra decimals

#

in my calculation

#

look:

#

i am trying to make it a whole number

sinful belfry
#

(sorry i don't do python but i'll try to help)

#

can you convert it to an int ?

eternal osprey
#

no it gives me lots of errors then

#

converting to int failed for coordinatex1

terse gust
#

k

eternal osprey
#

?

#

if you have nothing useful to say, don't say these useless things.

#

i am asking for help and you respond with k?

#

like you don

#

care

ionic warren
#

questionnnn: how do i even use the cat api paha

eternal osprey
#

python or javascript?

sinful belfry
#

i'm not entirely sure @eternal osprey, i guess try asking someone who knows python when they come online

#

sorry

eternal osprey
#

that is okay starman!

#

atleast you tried ๐Ÿ˜‰

sinful belfry
#

@ionic warren you need to use a module to make a GET request to that URL i sent earlier

#

the response body will contain JSON, and you just need to extract the URL from there

ionic warren
#

ohhhh okie ty

sinful belfry
#

if you're still unsure, feel free to ask lol

ionic warren
#

im gonna be honest im kinda lost

#

im new to the api

#

ive never used it

sinful belfry
#

don't worry too much about the api itself, that is pretty simple

#

it will just return a response which looks something like:

[
  {
    "breeds": [],
    "id": "1it",
    "url": "https://cdn2.thecatapi.com/images/1it.jpg",
    "width": 500,
    "height": 375
  }
]
#

but in order to get that response (which returns a random image btw), you need to make a GET request to a specific URL

ionic warren
#

do i need to download axios?

sinful belfry
#

yeah, you can npm install axios or any other module you may prefer to use, if any

ionic warren
#

okay its installed

sinful belfry
#

it is pretty simple to use (this is the example given on the npm page)

axios.get('/user?ID=12345') // this is the URL you are sending the GET request to
  .then(function (response) {
    // this is the response returned by the api
    console.log(response);
  });
#

so just replace the '/user?ID=12345' bit with the api URL

delicate shore
#

@sinful belfry out of curiosity
Do you also use discord canary version?
if yes then what's so special about it

golden condor
#

Updates all the time

sinful belfry
#

^

golden condor
#

You get features early

delicate shore
#

Oh

golden condor
#

But it's unstable

delicate shore
#

features like

sinful belfry
#

yeah there are lots of dumb bugs lol

delicate shore
#

new features which are under testing

#

oh ok i get it

golden condor
#

I'm making my dual boot tutorial by using a virtual machine

#

lol

sinful belfry
#

nice

ionic warren
#

@sinful belfry where abouts in the code will i put the url to be exact?

ionic warren
#

oh sorryy i didnt see

#

even the ' ' marks?

sinful belfry
#

you need to keep the ' ' marks

#

because it is a string

ionic warren
#

i was confused on when you sent the ' ' because they were in the image sorry

sinful belfry
#

oh lol

ionic warren
#

okay is there anything i do after that?

sinful belfry
#

so you need to extract the URL of the image from the response

ionic warren
#

how does one do that?

sinful belfry
#

and then send the URL/put it into an embed etc.

delicate shore
#

oh

#

k

sinful belfry
#

i think axios parses it for you, so you just need to do response[0].url to extract the URL

delicate shore
#

nice

ionic warren
#

im so confused rnnn im new to all this aaa

#

i feel like that one kid who tries to blend in with the others by pretending he knows what hes talking about

sinful belfry
#

we all have to start somewhere

#

you'll learn over time

golden condor
ionic warren
#

true

sinful belfry
#

no clue

#

not used either lol

#

actually i probs use medium more to follow tutorials

ionic dawn
ionic warren
#

where do i extract the url huh

sinful belfry
#

inside the .then bit

#

it will run as soon as the response has been returned

ionic warren
#

do i replace anything?

sinful belfry
#

nope, no need

ionic warren
#

only the user12345 thing

sinful belfry
#

yeah

ionic warren
#

okie ty

#

what do i do once i put the link? sorry for back tracking im just trying to wrap my head fully around it so i can learn it

sinful belfry
#

you need to then add your code which handles the response you get from the api

#

which goes inside the .then

delicate shore
#

yo

ionic warren
#

no idea how to do that ๐Ÿ˜ญ

delicate shore
golden condor
#

Immause medium then, I wish it supported markdown tho ๐Ÿ˜”

delicate shore
#

it says bad request

sinful belfry
#

no idea how to do that ๐Ÿ˜ญ
@ionic warren don't worry, just break it down into smaller steps

delicate shore
#

@ionic warren you are new to coding ? right ?

ionic warren
#

mhmm

delicate shore
#

ok

sinful belfry
ionic warren
#

i should probably start with something a lot more basic but we roll

sinful belfry
#

and then do whatever you need to with that URL (this is the URL of the image returned from the api btw)

delicate shore
#

u

sinful belfry
#

then you can just send that URL in a discord embed, or just as an ordinary message

ionic warren
#

how do i do it in an ordinary message?

#

also whats an embed?

sinful belfry
#

you need to do channel.send(response[0].url); in order to just send the url to the channel

#

and in most cases, you can just get the channel from the command message

ionic warren
#

will it upload the photo its self or a link that takes you to the photo?

sinful belfry
#

it will show you the photo within discord

ionic warren
#

okay nice

sinful belfry
#

discord handles all that

#

like this:

#

i just sent a url, and discord has automatically turned it into a viewable image

ionic warren
#

oh nice yay

ionic warren
#

back to the .then thing

#

im still confused about the extracting part

sinful belfry
#

ok so because you're making a request to the api, it takes time and the response will not be instant. so as soon as the api has returned a response to your request, the code in the .then will run (which is just a function)

#

you can do .then(function (response) { // code here is run when a response is given });

ionic warren
#

i dont need to change anything in the .then right?

sinful belfry
#

you just need to add to it

golden condor
#

Or you can use async but let's like not do that rn lol

sinful belfry
#

so as soon as the api has sent you the stuff you want, you just need to extract the stuff you truly want (the url) and then send that into a channel

ionic warren
#

im not sure what im meant to add- aghhhh

ionic warren
#

do i copy and paste that?

sinful belfry
#

you can, yeah

delicate shore
#

also whats an embed?
@ionic warren Discord Message Embed

sinful belfry
#

but you need to make sure you're defining channel

delicate shore
#

like this

cinder sandal
#

how var works in discord.js?

ionic warren
#

okay we are getting somewhere ig

sinful belfry
#

it is just a variable @cinder sandal

ionic warren
#

so how do i define channel?

cinder sandal
#

can you use it everywhere in the code?

sinful belfry
#

yup

#

it has global scope

delicate shore
#

but you need to make sure you're defining channel
@sinful belfry I mean. u can do <message>.channel.send

sinful belfry
#

^

cinder sandal
#

tried to put it in another block, but it says undefined

sinful belfry
#

that is how it is accessed in pretty much all cases when using commands

#

@cinder sandal can u send ur code

ionic warren
#

ohhh i get it

delicate shore
#

why i did <message> is because some people async it to msg

earnest phoenix
#

how var works in discord.js?
@cinder sandal Global variable, var is not scoped but let and const are block scoped

delicate shore
#

so they need to replace it with thing they defined it as in event

ionic warren
#

what do i put after message.channel.send?

sinful belfry
#

within the .send(), you need to put the url in that you got from the response

#

as shown in the linked message

cinder sandal
#

message.channel.send(<MessageEmbed> <'Text'>)

earnest phoenix
#

No Actually

west agate
earnest phoenix
#
message.channel.send(<Text>, { embed: <embed> });``` @cinder sandal this is how it's
ionic warren
#

im so lost oh dear god.

cinder sandal
#

i use the embed constructor istead of this

sinful belfry
#

@ionic warren dont worry about embeds

#

you had the right idea

#

just send the image link

cinder sandal
#

const(or let) Embed = new Discord.MessageEmbed
i use those

ionic warren
#

so where exactly do i put the message.channel.send part

sinful belfry
#

within the .then

#

as soon as you've gotten a response from the api, you want to extract the url and send it to the channel

cinder sandal
#
.then(function => {
// some things
}```
ionic warren
#

hhh

earnest phoenix
#

.then can take both js <Promise>.then((...parameters) => {}) and js <Promise>.then(function(...parameters) {})

eternal osprey
#

hey boys i am back

#

if i use $po weather (and i dont include a place or name) the bot exits out with these typerrors:

#

var current = result[0].current;
^

TypeError: Cannot read property 'current' of undefined

#
   if (result.length === 0) {
                message.channel.send('**Please enter a valid location.**') 
               
                
            }```
#

i want it to send this code

west agate
#

how would i make a message collector in a users dm?

eternal osprey
#

it clearly doesn't

earnest phoenix
#

Just js if (!result) { // Send the message }

eternal osprey
#

is that meant for me?

earnest phoenix
#

Yes

eternal osprey
#

okay

west agate
#

can anyone help me pls?

cinder sandal
#

my random status changes to the same status sometimes, how do i stop that?

#

so it would select a diffrent status and not the same every time

eternal osprey
#

''TypeError: Cannot read property 'length' of undefined

earnest phoenix
#

Did you even do what i said

eternal osprey
#

yes

#

owh fuck

#

sorry

#

sorry

cinder sandal
#

my random status changes to the same status sometimes, how do i stop that?
@cinder sandal

eternal osprey
#

@west agate i think you can use this: if ( message.channel.type === 'dm'){
message.channel.createMessageCollector(filter, { time: 15000 });

#

i am not sure tho

earnest phoenix
#

@west agate This

let dmChannelU = await <Message>.author.createDM();
dmChannelU.createMessageCollector(...parameters);```
faint prism
#

That third = means type specific as well. Is .type a string?

west agate
#

oh thanks

delicate shore
#

@uneven yarrowrs

#

wtfh

earnest phoenix
#

@faint prism type of the channel

faint prism
#

Right, is that property a string?

delicate shore
#

@eternal osprey u can use if special type of para is undefined

#

then it can return

earnest phoenix
#

returns an string

eternal osprey
#
if (!result === 0) {
                message.channel.send('**Please enter a valid location.**')   ```
earnest phoenix
#

Bruh

eternal osprey
#

var current = result[0].current;
^

TypeError: Cannot read property '0' of undefined

faint prism
#

Is result an array? And not null?

earnest phoenix
#
if (!result) {
return message.channel.send('**Please enter a valid location.**');
}```
eternal osprey
#

i know i've done that

earnest phoenix
#

You did not

#

Try it

eternal osprey
#

var current = result[0].current;
^

TypeError: Cannot read property 'current' of undefined

delicate shore
#

@eternal osprey i mean if result.parahere === undefined return

eternal osprey
#

i did

golden condor
#

result is not an array then

delicate shore
#

@eternal osprey which package?

eternal osprey
#

weather-js

delicate shore
#

i also use that

earnest phoenix
#

What's result defined as? @eternal osprey

golden condor
#

Why do people use packages for everything

#

Lol

split hazel
#

It would show that if the 0 indexed element doesn't exist?

delicate shore
#

and u know what i do

#

      if (result === undefined || result.length === 0)
        return msg.channel.send("**Invalid** location");
earnest phoenix
#

@split hazel No, it would show it if the result isn't an array

eternal osprey
#

Why do people use packages for everything
@golden condor because it makes it easier , lol

delicate shore
#

this works for me

#

tho

eternal osprey
#

okay

earnest phoenix
#

Or it's undefined

golden condor
#

Just use an api

delicate shore
#

^^

golden condor
#

Not an API wrapper

delicate shore
#

i use api for almost everything

#

except weather

#

and currency

earnest phoenix
#

Using api for everything is a bad practice, sometimes you gotta make things native

golden condor
#

You don't do your own currency

delicate shore
#

You don't do your own currency
@golden condor no

earnest phoenix
#

Remember that apis don't always return a response

golden condor
#

Sometimes I just code stuff into my code

delicate shore
#

ok

eternal osprey
#

return msg.author.send("Invalid location");
^

TypeError: Cannot read property 'send' of undefined

delicate shore
#

wha

eternal osprey
#

ya

cinder sandal
#

my random status changes to the same status sometimes, how do i stop that?
@cinder sandal still not answered

delicate shore
#

have u defined msg?

split hazel
#

bruh what is msg defined as

delicate shore
#

have u defined msg?

#

i think u just copy pasted

split hazel
#

please try to understand and integrate the code into yours instead of just straight up copy pasting

west agate
#

didn't work

eternal osprey
#

let msg = message.content.toUpperCase();

delicate shore
#

no

#

just replace msg with message

earnest phoenix
#

@cinder sandal Just make it iterate through the array of status without picking a random index from the array

cinder sandal
#

code?

delicate shore
#

just replace msg with message
@eternal osprey

eternal osprey
#

i already have done that

#

it wroks

#

wokrs*

#

fuckin hell

delicate shore
#

k

eternal osprey
#

*8works

#

works*

cinder sandal
#
setInterval(() => {
    const randomStatusMessages = // random status messages
    const randomStatus = randomStatusMessages[Math.floor(Math.random() * randomStatusMessages.length)]; // does math to make them random
    client.user.setActivity(randomStatus); // bot status
    }, 300000); // updatd once 5 min```
How to make it not select the same status sometimes
quartz kindle
#

you have 2 options:

earnest phoenix
#
let activityList = [<activities here>];

let copyActivity = [ ...activityList ];

setInterval(() => {
<client>.user.setActivity(activityList[0]);
if (activityList.length === 1) {
return activityList = copyActivity;
} else {
return activityList.shift();
}
}, <Amount of time in milliseconds to change activity in>);```
cinder sandal
#

what to put in the copyavtivity list?

quartz kindle
#

a. keep track of which status is currently selected, for example by saving the status number in a global variable or attached to client
b. before setting a new status, get the current status, find its index in the status list and prevent the same index from being used again

earnest phoenix
#

Just exactly what i put

cinder sandal
#

you need to put the activities again in let copyactivity?

earnest phoenix
#

No in the activityList

quartz kindle
#

c. instead of random activity, make them sequential instead

earnest phoenix
#

Just like mine ^

#

I showed

delicate shore
#

Remember Kids! Never copy paste

#

bruh

cinder sandal
#

bruh

delicate shore
#

i sent this msg 8 mins ago

#

it reached now

#

anyways

#

how can i use set timeout for every changing status

honest perch
#

@fiery light console logs client.shards and client.shard

delicate shore
#

every 5 mins

quartz kindle
#

use an interval

delicate shore
#
setInterval(() => {
    const randomStatusMessages = // random status messages
    const randomStatus = randomStatusMessages[Math.floor(Math.random() * randomStatusMessages.length)]; // does math to make them random
    client.user.setActivity(randomStatus); // bot status
    }, 300000); // updatd once 5 min```
#

i found this above

#

but i think

#

something

earnest phoenix
#

@cinder sandal How did it go?

delicate shore
#

hm

vapid moat
#

!invite

fiery light
#

@fiery light console logs client.shards and client.shard
@honest perch [Wed Aug 19 2020 11:42:15] Launched shard #2

cinder sandal
#

@cinder sandal How did it go?
@earnest phoenix changes status, but sometimes not every 5 minutes because it changes it to the same status

delicate shore
#

do i need shard for 600 guilds

honest perch
#

@fiery light which one was that for

#

shard or shards

vapid moat
#

Invite bot server?

delicate shore
#

do i need shard for 600 guilds

#

Invite bot server?
@vapid moat ????????

vapid moat
#

Invite bot

delicate shore
#

what ?

vapid moat
#

My discord

delicate shore
#

wth?

#

your discord bot?

#

wym

vapid moat
#

How do I invite the bot to my discord server?

fiery light
#

@fiery light which one was that for
@honest perch console.log(client.shard)
^

TypeError: Cannot read property 'shard' of undefined

cinder sandal
#

should i put something in the let copyActivity [ ... ativityList]

vapid moat
#

How do I invite the bot to my discord server?

lean wing
#

i need help
i want my bot send a message to a channel when it joins a server
can someone help me ?

delicate shore
#

How do I invite the bot to my discord server?
@vapid moat which one ?

#

i need help
i want my bot send a message to a channel when it joins a server
can someone help me ?
@lean wing
yes it's easy

lean wing
#

but how ?

delicate shore
#

u need to create a event listner

#

of guildCreate

lean wing
#

i have

delicate shore
#

then u have to get a channel with id

lean wing
#

guild create event for my data

vapid moat
#

F

earnest phoenix
#

@earnest phoenix changes status, but sometimes not every 5 minutes because it changes it to the same status
@cinder sandal Huh?

vapid moat
#

Lol

cinder sandal
#

wait

#

didn't tried it

lean wing
#

i dont want to have channel id i ust want when the bot join to send a message to a text channel @delicate shore

delicate shore
#
client.channels.cache
    .get("channelid")
    .send(message here)``` @lean wing
#

i dont want to have channel id i ust want when the bot join to send a message to a text channel @delicate shore
@lean wing u need to get channel id

#

of the channel

lean wing
#

can i use the bot to find all channels ids and use the first one ?

delicate shore
lean wing
#

nope

delicate shore
#

oh

#

then ?

#

okk i get ut

#

it*

lean wing
#

like rythme when it join a server and send a message like default

delicate shore
#

yess

#

He knows that tho

lean wing
#

i have this event

delicate shore
#

he wanna send a msg to frirst chanen

honest perch
#

@delicate shore im not sure thats allowed

delicate shore
#

first channel*

honest perch
#

as you are publicly posting server names

cinder sandal
#

@earnest phoenix bot starts too long with that

delicate shore
#

as you are publicly posting server names
@honest perch
Oh really?

honest perch
#

mhm

delicate shore
#

then

faint prism
#

What does that mean?
@earnest phoenix You're referencing a value in your config you haven't defined

delicate shore
#

should i

#

do with server id

honest perch
#

or just make it private

earnest phoenix
#

@faint prism what?

cinder sandal
#

@earnest phoenix bot offline, logs don't show the error

split hazel
#

They are probably using a forked bot from github

sick fable
#

Guys? I have a question

delicate shore
#

They are probably using a forked bot from github
@split hazel me?

#

no

earnest phoenix
split hazel
#

Not you

eternal osprey
#

hey, how do i make sure someone cannot use the commands in the dms of a bot (python)

#

i know how to do it in node

delicate shore
#

ok

faint prism
#

You don't have to double post. I can scroll up..

delicate shore
#

bruh

#

u don't have token

#

bot token

split hazel
#

Read the mod mail setup docs

delicate shore
#

it says everything

split hazel
eternal osprey
#

hey, how do i make sure someone cannot use the commands in the dms of a bot (python)
@eternal osprey anyone that knows the answer on this question?

delicate shore
#

@split hazel these kind of bots cannot be approved for top.gg right ?

#

as it's simply clonning

split hazel
#

It cannot be a direct clone but as long as its significantly modified we allow it

delicate shore
#

Do u guys check it ?

#

if it is modified

#

because u cannot remeber eveyr bot structure

#

every*

split hazel
#

We can see if it's been modified or not

faint prism
#

git diff - Compare the difference between two project's source files using git-scm

split hazel
#

Most have a github page linked and we remember a lot of commonly cloned bots

eternal osprey
#

i think that hey have programs for that

delicate shore
#

oh nice

#

git diff - Compare the difference between two project's source files using git-scm
ooh nice but what if they don't have a github page @faint prism

#

i am talking about one who is clonning

split hazel
#

We look at the help command

#

Most of the information comes from there

faint prism
#

If you have a copy of the source you can compare, otherwise you'd just have to check it's behavior differences

delicate shore
#

ok

#

I deleted my bot

eternal osprey
#

how do i block commands from working in dms ? In python.

delicate shore
#

if(message.channel.type === "dm") return

eternal osprey
#

that isn't python

delicate shore
#

oh sorry

pallid igloo
#

if(message.channel.type === "dm") return
@delicate shore THATS DJS

#

BRUH

eternal osprey
#

iss okay

pallid igloo
#

He doesn't has an idea of what hes using..

eternal osprey
delicate shore
#

He doesn't has an idea of what hes using..
@pallid igloo who

pallid igloo
delicate shore
#

i did not read his message second part

#

i did not read his message second part

eternal osprey
#

PGamersX

pallid igloo
eternal osprey
#

if someone makes a mistake

#

or does something wronmg

delicate shore
eternal osprey
#

yeah

#

you make fun of other people

delicate shore
#

stop

#

lol

eternal osprey
#

but this is your channel lmao

delicate shore
#

don't send my yt

#

it's self promo

eternal osprey
#

wahahhahah

#

i am not promoting my own channel

delicate shore
#

but i will be warned

eternal osprey
#

i just want to prove you that karma can be a pain in the ass

#

do not make fun of anyone if the makes mistakes

#

you think that you are sooo much better than other

delicate shore
#

what

#

what the fuck

#

someone stop thi guy

eternal osprey
#

and then saying bruh

delicate shore
#

he copy pasts code and says msg isn't defined

eternal osprey
#

i've seen it several times in this channel

#

still not something to make fun of

delicate shore
#

i never used this emoji as insult

eternal osprey
#

instead of making fun of me, you could also tell me that that wouldn't work

delicate shore
#

i told u

eternal osprey
#

would you like it if you made a mistake

delicate shore
#

i never used this emoji

#

on u

eternal osprey
#

and then bruh

delicate shore
#

bru

eternal osprey
delicate shore
#

Yes

pallid igloo
#

Stop.

#

Thats it.

#

This is development

delicate shore
eternal osprey
#

sure

#

i laugh at your youtube channel lmao

delicate shore
#

@green kestrel

#

he is not going off-topic

#

despite me saying

eternal osprey
#

i already stopped

delicate shore
#

despite me saying
twice

pallid igloo
#

i laugh at your youtube channel lmao
@eternal osprey I cannot see that you stopped

sinful belfry
#

both of you, drop it now

delicate shore
#

Yeh

pallid igloo
delicate shore
#

i already did anyways

pallid igloo
#

Is it more efficient to fetch all messages and the filter them, or fetch them with a filter?

pale vessel
#

i don't think you can filter using fetch

delicate shore
#

^^

pale vessel
#

but you can filter the cache

#

so if you need to filter using fetch, you have to fetch them first

earnest phoenix
#

@cinder sandal This is what i tried and it worked for example

let activities = ["Bruh moment?", "Nani", "Wtf", "Hol up", "Wot"];

let copyArray = [ ...activities ];

setInterval(() => {
bot.user.setActivity(activities[0]);
if (activities.length === 1) {
activities = copyArray;
} else {
activities.shift();
}
}, 300000);```
cinder sandal
#

didn't work

earnest phoenix
#

Did you try the exact way i did?

cinder sandal
#

yea

earnest phoenix
#

What's the problem tho

cinder sandal
#

bot starts

#

but it doesn't show a message

#

and goes offline

earnest phoenix
#

Wait i think i know why

#

Where are you putting that?

cinder sandal
#

changing them from const to let works fine

earnest phoenix
#

In the ready event?

pallid igloo
#

constants cannot be changed..

eternal osprey
#

hey boys, how do i block comamnds from working dms in python language?

cinder sandal
#

yes

pallid igloo
#

Oh wait..

earnest phoenix
#

That's why

#

It's overloading the ready event

#

Which leads to a crash

slender thistle
#

hey boys, how do i block comamnds from working dms in python language?
@eternal osprey Could you please elaborate?

#

You want commands to only be used in servers?

earnest phoenix
#

@cinder sandal You need to put what i said inside the message event

eternal osprey
#

i can still use my distance bot in the dms of the bot

slender thistle
pallid igloo
#

the python equivalent of if(message.channel.type == 'dm') return;

eternal osprey
#

and it will actually still work

#

eventhough i am not in a server

slender thistle
eternal osprey
#

i don't think so

slender thistle
#

Do you have your commands in on_message with if statements or @commands.command()?

eternal osprey
#

no

pallid igloo
#

Idk python so iamma head out..

slender thistle
#

it was one or another, not a yes/no question

pallid igloo
#

no
that wasn't a boolean question..

eternal osprey
pale vessel
#

no is not a boolean but okay

eternal osprey
#

i was responding to this question

#

i am using @bot.command

#

and @bot.event

slender thistle
#

So that's a yes, then

pallid igloo
#

xD..

eternal osprey
#

oowpsie

slender thistle
#

In any case, you can use the @commands.guild_only() decorator

eternal osprey
#

okay, thanks!

pallid igloo
#

Decorator is like the python name for methods?

slender thistle
#

(or go the "fuck all" way and do if not message.guild: return)

pallid igloo
#

XD

eternal osprey
#

wahahhah okayyy

delicate shore
#

๐Ÿ‘

slender thistle
#

The difference between that if and the decorator is that the decorator will raise an error that you can handle in the on_command_error event

delicate shore
#

My bot got flagged for discord whitelisting
Will it take more time to verify ?
It has already been one month and 5 days

slender thistle
#

Decorator is like the python name for methods?
No, methods are the same methods

pallid igloo
#

Classes are called decorators?

slender thistle
#

Give me a second

#

decorators wrap a function, modifying its behavior.

earnest phoenix
#

My bot got flagged for discord whitelisting
Will it take more time to verify ?
It has already been one month and 5 days
@delicate shore It's infact unknown but surely will take more time than usual

delicate shore
#

oh sad pikachu noises

lean wing
#

how can my bot send a message to the first channel that can find when it join a discord server ?

west agate
#

how would i get a channel in a message?

delicate shore
#

i was wondering how people do that thing in which if i did !Hell bot will not respond
But if i edit msg to !help it will respond

slender thistle
#

Essentially, a decorator can modify what the function happens to be

#
>>> from discord.ext.commands import Bot
>>> a = Bot(command_prefix="None")
>>> from discord.ext.commands import command
>>> @command()
... async def yeet(ctx):
...     return "yeet"
...
>>> yeet
<discord.ext.commands.core.Command object at 0x0000021E419A3880>
>>> del yeet
>>> async def yeet():
...     return "yeet"
...
>>> yeet
<function yeet at 0x0000021E419A4D30>
ivory seal
#

hi

delicate shore
#

hi

west agate
#

how would i get the channel in text? like if i say "i select #random-chanel"

ivory seal
#

with a client.on(message function how do you get the guild id?

delicate shore
#

ig

slender thistle
#

i was wondering how people do that thing in which if i did !Hell bot will not respond
But if i edit msg to !help it will respond
@delicate shore listen for the message edit event and check the message content

#

oh, you mean physically send another one.

ivory seal
slender thistle
#

message.content.startsWith("!help")

earnest phoenix
#

@lean wing js <JoinedGuild>.channels.cache.filter(c => c.type === "text" && c.permissionsFor(<client>.user).has(["VIEW_CHANNEL", "SEND_MESSAGES"])).first().send(<content>);

slender thistle
#

aka don't use toLowerCase or anything of that sort

ivory seal
#

pls help

slender thistle
#

@ivory seal Show your current code

carmine summit
#

why is my bot taking so long to get verified?

ivory seal
#

one sec

slender thistle
carmine summit
#

top gg

earnest phoenix
#

It might be whitelisted or discord staff doesn't have much time to verify bots as they say just like DBL mods

slender thistle
earnest phoenix
delicate shore
#

i mean in

ivory seal
#
const Enmap = require("enmap");
const client = new Discord.Client();
const scoopEnmap= new Enmap({
    name: "scoop",
    autoFetch: true,
    fetchAll: false
  });
  const guildEnmap=new Enmap({
      name:"guild",
      autofetch: true,
      fetchAll:false
  })
  const guildprefix="";

  client.on("guildCreate",function(guild){
    scoopEnmap.set("sahhasdetails",`${guild.id}`);
    console.log("New Server Joined. ID: "+scoopEnmap.get("sahhasdetails")+" Recorded on Enmap");
    const structure={
        id:`${guild.id}`,
        name:`${guild.name}`,
        welcomemessage:"`Welcome to server ${member}`" ,
        welcomechannel:"general",
        prefix:"!"
     };
     guildEnmap.set(`${guild.id}`,structure);
  });
  client.on("guildMemberAdd",function(member){
  var guild=member.guild.id;
  var welcomemess=guildEnmap.get(guild,"welcomemessage");
  console.log(welcomemess);
  });
  client.on("message",function(message){
       var guildformessage=message.guild.id;
      const prefix=guildEnmap.get(guildformessage,"prefix");
      console.log(prefix);
      if(message ==`${prefix}prefix`){
       message.channel.send("The Prefix is"+prefix);
      }
  });```
lean wing
#

@lean wing js <JoinedGuild>.channels.cache.filter(c => c.type === "text" && c.permissionsFor(<client>.user).has(["VIEW_CHANNEL", "SEND_MESSAGES"])).first().send(<content>);
@earnest phoenix
thanks

eternal osprey
#

but should to be clear, i should remove the @bot.command() and replace it with @commands.guild_only()

slender thistle
#

No

ivory seal
#
       var guildformessage=message.guild.id;
      const prefix=guildEnmap.get(guildformessage,"prefix");
      console.log(prefix);
      if(message ==`${prefix}prefix`){
       message.channel.send("The Prefix is"+prefix);
      }
  });      ```
#

this is where i have a problem

eternal osprey
#

i cannot type

#

my gosh

delicate shore
#

listen for the message edit event and check the message content
does message edit event comes under message event?
i mean in

ivory seal
slender thistle
#

@bot.command() marks the function as a command, you don't remove it

#

You just put the second decorator above or below the command one

eternal osprey
#

ooowh

#

okay

#

you are the best!

cinder sandal
#

@earnest phoenix , the problem with the same status is fixed. i just needed to change const to let.

pallid igloo
#
       var guildformessage=message.guild.id;
      const prefix=guildEnmap.get(guildformessage,"prefix");
      console.log(prefix);
      if(message ==`${prefix}prefix`){
       message.channel.send("The Prefix is"+prefix);
      }
  });      ```

@ivory seal What is the error? cannot read property of x of undefined or smth else?

ivory seal
#

it says undefined

#

in console

slender thistle
#

message.content.startsWith("!help")
@delicate shore you'll need the thing above

delicate shore
#

I was wondering if you are discord.js or py since u are asking questions of both lib

slender thistle
#

Show the full error please

earnest phoenix
#

@cinder sandal Of course, i already stated that earlier

ivory seal
#

@slender thistle are u asking my error

slender thistle
#

Yup

pallid igloo
#

it says undefined
I'm not so sure abt enmaps so sowwyy..

ivory seal
#

it just says undefined

slender thistle
#

Screenshot or send the error here please

ivory seal
#

no error

#

it just says undefined

earnest phoenix
#

What says undefined and where?

ivory seal
#

undefined in console

slender thistle
#

Seems that console.log(prefix); returns undefined

ivory seal
#

for my prefix var

#

yes

delicate shore
#

@ivory seal i really appreciate you helping me and everyone who doesn't know how to install bot on vps

eternal osprey
#
@bot.command()
@commands.guild_only()
``` is there any way to check if the channel is dm, then it will say this: this command cannot be used in dms?
ivory seal
#

@delicate shore NP

eternal osprey
#

because now it sends the error to the console.

delicate shore
#

for my prefix var
@ivory seal Define prefix with let or const

#

don't use var

ivory seal
#

ok one sec

earnest phoenix
#

@ivory seal btw don't do js if (message == `${prefix}prefix`) { because you're comparing a message object to an string

delicate shore
#

idk if that chages anything

#

changes*

ivory seal
#

then what should i do @earnest phoenix

delicate shore
#

but let is better

earnest phoenix
#

message.content

#

Instead of just message

delicate shore
#

or message.content.startsWith

ivory seal
#

i tried both suggestions

delicate shore
#

so if someone does !prefix wrg rwhw hrheh

earnest phoenix
#

But the best of is

if (message.content.startsWith(`${prefix}prefix`)) {```
delicate shore
#

it stilll reples

maiden whale
#

hi

#

ineed bot

opal plank
#

bot or bot help?

maiden whale
#

bot

opal plank
#

if its the former, we dont give spoonfed code here

#

against the rules

maiden whale
#

wat

delicate shore
#

he means a bot for a server i guess

opal plank
#

no free code here

maiden whale
#

server code

opal plank
#

cant make it more clear than that

delicate shore
eternal osprey
#

is there any cath(err) in python?

slender thistle
#

Two options, @eternal osprey.

The event below is triggered whenever a command errors out.

@bot.event
async def on_comamnd_error(ctx, error):
# You need to check if the error is coming for a command with "@commands.guild_only()" being ran in DMs.
# For that, you would need "commands.PrivateMessageOnly".
# To actually check that, you need to use the built-in "isinstance" function and compare the error to the class above.
if isinstance(error, commands.PrivateMessageOnly):
await ctx.send("Command(s) must be used only in DMs.")


2) In the command itself,
```py
if not message.guild:
    await ctx.send("Command(s) must be used only in DMs.")```
delicate shore
#

you can find best bots here

eternal osprey
#

ah okay

slender thistle
#

hold on

delicate shore
#

no

eternal osprey
#

lovely shivaco

delicate shore
#

wat

#

wait

#

there

cinder sandal
#

Remember Kids: Do not copypase code from here.

slender thistle
#

there we go, edited the message

storm bluff
#

i have a problem with luffybot
luffybot have a problem from discord he disconectted auto and
when i test the files with testing token
he is work
why

cinder sandal
delicate shore
earnest phoenix
#

Remember Kids: Do not copypase code from here.
@cinder sandal Correction:
Remember kids: don't copy paste code from anywhere

opal plank
#

except stackoverflow

delicate shore
#

^^

cinder sandal
#

^^

opal plank
#

snort some blow and leave it to stack overflow

earnest phoenix
#

uh

delicate shore
#

uh

slender thistle
#

is there any cath(err) in python?
@eternal osprey
There is the thing called try-except that can be used as following:

try:
    a_function_that_raises_an_exception():
except Exception as e:
    # the `except` branch will handle all exceptions and Python will store the actual exception under the `e` variable```
eternal osprey
slender thistle
#

inside your command itself

eternal osprey
#

okay

#

i get it now

cinder sandal
#

Remember Kids: Do not copy paste from anywhere including discordjs guide except stackoverflow

pale vessel
#

what oh

eternal osprey
#

i just made a mistake on where to put the code

slender thistle
#

mhm

#

"in the command" as in,

async def your_command(...):
    if not message.guild:
        # la la la```
cinder sandal
#

i opened stackoverflow 1 million times fear me

opal plank
#

ive only copied a regex from stackoverflow, everything else was from docs

#

fear me

earnest phoenix
#

Opened it only 50 times Sadge

#

ive only copied a regex from stackoverflow, everything else was from docs
@opal plank That's the biggest lie i have ever seen

opal plank
#

nah, actually

earnest phoenix
#

We all been to stack overflow many times to learn something

slender thistle
#

I don't even copy regexes tbh, regex101 is nice

opal plank
earnest phoenix
#

Wtf

opal plank
#

this regex here is the one

slender thistle
#

Haven't learned much from StackOverflow tbh

cinder sandal
#

We all been to stack overflow many times to learn something
@earnest phoenix ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

opal plank
#

learn? yes, absolutely, ive been there many times, never have i copied shit from there

#

except that regex up there in sc

#

i even let var for that reason

#

if you find vars in my code, know its not mine

cinder sandal
#

let > const

opal plank
#

two cases for each

#

let is mutable, const is immutable

#

use it for which cases needs it

earnest phoenix
#

Actually none are better, their use cases are just different, they must seem the same to beginners.

opal plank
#

the noob rule is: change everything to const and fix the errors

#

it'll error the ones you trying to change the value of, so just switch to let

cinder sandal
#

imagine if u were allowed to change the tag of a bot

opal plank
#

thats a bad way of doing it, but it'll get you by

#

6969

#

100%

cinder sandal
#

^^

#

basically u cant bypass permissions with bots

#

the command that does something that needs a permission wont even work if you don't have one

earnest phoenix
#

People who hate var is kinda wrong, because as much as i hated var, now i understand that, after i define something inside blocks and try to use it somewhere else, vars are really useful

eternal osprey
cinder sandal
#

People who hate var is kinda wrong, because as much as i hated var, now i understand that, after i define something inside blocks and try to use it somewhere else, vars are really useful
@earnest phoenix tried using them in diffrent blocks, returns undefined

slender thistle
#

Use ctx.message

#

Because ctx is an instance of Context class, and it has a .message property

eternal osprey
#

okay

slender thistle
#

which will give you the Message object

eternal osprey
#

got it

cinder sandal
#
var AbcDef = Math.floor(Math.random() * 100);```
tried using in other blocks, undefined
earnest phoenix
#

@cinder sandal

if (3 > 1) {
let something = "Bruh";
}

something; // undefined```
<=>
```js
if (3 > 1) {
var something = "Bruh";
}

something; // "Bruh"```
opal plank
#

@earnest phoenix it does have it uses, but if you dont know how to use it, it'll cause unintended bugs, as the value changed and it wont be good code wise
if you were to have same named variables that are scoped block, those values might overflow to when you call it again because it wont respect the scopes. For people who dont know better, always tell them to not use vars, regardless. 99% of the time, they are just declaring a variable, not that they need the fuction that var provide

earnest phoenix
#

I know lol

pallid igloo
#

Uhh, While using use strict, I think they are the only way to reassign values.

opal plank
#

almost all cases you'd much better using let to get you a good hang of local scopes

earnest phoenix
#

I always use let or const, just var when only needed

pallid igloo
#

Uhh, I never use let or var. Const is needed for some shit. but As a person who doesn't use "use strict", = works just fine for me.

opal plank
#

thats indeed the correct way of doing it

cinder sandal
#

vars are just basically for embeds or other things if you want to put the embed or something again in another command.

pallid igloo
#

vars are just basically for embeds or other things if you want to put the embed or something again in another command.
@cinder sandal Let and = also work for that case.

opal plank
#

even if its just meme'ing at this point, just point out that using vars is bad unless you know what you doing. Will save you and them a headache

pallid igloo
#

iiirc, You can overwrite let.

eternal osprey
#
 if not ctx.message.guild:
        await ctx.author.send("Command(s) cannot be used in dm, please use the command in the server")
``` for some reason the bot works great right now, but it still doesn't send the desired message?
pallid igloo
#

What is ctx?

opal plank
#

context?

earnest phoenix
#

@pallid igloo let and var can be overrided again

slender thistle
#

Because ctx is an instance of Context class, and it has a .message property

carmine summit
#

what is the use of shards?

eternal osprey
#

uhhm the ionstance of context class

earnest phoenix
#

But not const

eternal osprey
#

shivaco said that

#

instance*

cinder sandal
#

someone thinks that discord.py is official

opal plank
#

Const => shorten for constant, not mutable, constantly(unchangeable)

pallid igloo
#

what is the use of shards?
@carmine summit It divides the guilds into (arrays) some properties. Thus making the bot faster.

cinder sandal
#

i explained him that discord cant even make a client

opal plank
#

technically you using a discord client

pallid igloo
slender thistle
#
 if not ctx.message.guild:
        await ctx.author.send("Command(s) cannot be used in dm, please use the command in the server")
``` for some reason the bot works great right now, but it still doesn't send the desired message?

@eternal osprey Does the command work in DMs still?

opal plank
#

though i think i know what you meant

earnest phoenix
#

@pallid igloo Not arrays, it just makes it run different instances of the bot

cinder sandal
#

we are techinically bots but we can type anything

pallid igloo
#

Yeah, I didn't have a solid idea.

eternal osprey
#

it doesn;t anymore

earnest phoenix
#

Therefore you can't access all guilds of a client easily unless you broadcast an eval

eternal osprey
#

but i'd love to send a message that they have to try it in the server

opal plank
#

im 100% becoming a sex offender and idk if its a good thing or not

viral iris
#

heroku can't save fs files ?

pallid igloo
#

client.guilds.cache.size gives specific shard count in an array iirc?

#

im 100% becoming a sex offender and idk if its a good thing or not
@opal plank Just dont ask their gender.

opal plank
#

becoming a dataphile

earnest phoenix
#

@pallid igloo It gives the amount of guilds that specific shard is handling

opal plank
cinder sandal
#

heroku can't save fs files ?
@viral iris i host on herokuKEKWand they don't even work

opal plank
#

set this up yesterday

pallid igloo
#

Heroku sucks.

#

Migrate to a actual VPS

earnest phoenix
#

@viral iris Heroku doesn't save overwritten files

pallid igloo
#

Like maybe redhat if you need a free one.

viral iris
#

@viral iris Heroku doesn't save overwritten files
@earnest phoenix thats why when the bot restarts send the embed again

earnest phoenix
#

Yes

opal plank
#

dont use heroku nor glitch

#

ยฏ_(ใƒ„)_/ยฏ

cinder sandal
#

imagine if we could send embeds

earnest phoenix
#

You can

pallid igloo
#

imagine if we could send embeds
@cinder sandal before 2019 november, yes.

earnest phoenix
#

If you were a self bot

opal plank
#

easy way to trigger internal flags

viral iris
#

any1 can change the fs to mongd.db ?

opal plank
#

send embeds with client

#

THOUGH

cinder sandal
#

self bots bannable

earnest phoenix
#

Yes

opal plank
#

you CAN do it without selfbotting

midnight blaze
#

Can I ask a general question? My native language aint English, so I am always struggling to fully understand documentations. Pepeg. Can someone expalin to me what exactly Map does in javascript? I managed yesterday to use Map to save message.guild.id so more than one users can use my music bot :> But how exactly does it work?

viral iris
#

Yes
@earnest phoenix can u ?

pallid igloo
#

You can send embeds, Not richembeds.

#

Embeds are like the embeded links

earnest phoenix
#

You can't send rich embeds unless a self bot is used, you can only send plain embeds showcasing links

pallid igloo
#

or maybe a link that u posted which is displaying an image

opal plank
#

if you get your token(which isnt modding client) and send it via axios or postman or anything really, TEACHNICALLY you arent modifying the client in any way shape or form while still sending an embed payload via a user account

#

though good luck explaining them that

pallid igloo
#

if you get your token(which isnt modding client) and send it via axios or postman or anything really, TEACHNICALLY you arent modifying the client in any way shape or form while still sending an embed payload via a user account
@opal plank Iamma ring them up to confirm that.

earnest phoenix
#

any1 can change the fs to mongd.db ?
@viral iris Mongo.db would work but still changing from keroku to a vps is a better idea

opal plank
#

reminder that im not a discord emplyee, i dont judge whats ToS or not

#

ยฏ_(ใƒ„)_/ยฏ

#

im going by the book

viral iris
#

@earnest phoenix can u come dm ?

earnest phoenix
#

K

cinder sandal
#

what's the most best free hosting for bots (not repl.it pls)

opal plank
#

danbot?

delicate shore
#

your own vps

opal plank
#

self host

#

f1 micro?

delicate shore
#

danbot?
@opal plank what is this

#

many people say it

opal plank
#

danbot hosting

cinder sandal
#

danbot?
@opal plank what

delicate shore
#

is it free

opal plank
#

been recommended quite a few places

#

yeah

#

i dont have a link, but it was recommended quite a few times here and some other places

#

DanBot xyz or something

delicate shore
#

this?

pallid igloo
#

He said danbot.xyz

opal plank
#

like i said, i dont have the link to it since i self host, never had the need to check it

#

though yes, quite a few people recommended it

#

there was a discord iirc

cinder sandal
#

danbot is a malware name lmao

delicate shore
#

He said danbot.xyz
@pallid igloo it's a website for a discord bot

opal plank
#

i think this is it

cinder sandal
#

bruh

pallid igloo
#

danbot.host

cinder sandal
#

the name is a malware name

opal plank
#

theres a discord for them somewhere

#

though idk where it is

pallid igloo
opal plank
#

this one

#

not that one

#

they have a discord where you sign up

#

but i cant find the invite

pallid igloo
opal plank
#

found it by simply searching danbot in this server

#

ยฏ_(ใƒ„)_/ยฏ

#

you might find it

pallid igloo
cinder sandal
#

You could go with something like DanBot but I wouldn't recommend it

pallid igloo
#

Yes.

opal plank
#

if you dont trust that, go for f1 Micro or AWS

#

f1 micro is free forever

#

aws is 1 year free

pallid igloo
#

Aws is only 1 yr

#

redhat is free iirc.

opal plank
#

f1 micro too

pallid igloo
#

Wait no

#

It's for static

cinder sandal
sick fable
#

Guys is there any bit that can advertise for free in other servers?

#

Bot**

opal plank
#

isnt that what bot lists are for?

sick fable
#

I can't find one

opal plank
#

you ARE in one

sick fable
#

So, That's why I asked

opal plank
sick fable
pallid igloo
opal plank
#

not related to dev either way

#

prob better off asking in #general @sick fable

#

what you are looking for is bot recommendations, not on topic here, we offer development support

sick fable
#

Kk

visual lake
#

Cannot read property 'on' of undefined

#
dbl.webhook.on('vote', vote => {
    console.log(`User with ID ${vote.user} just voted!`);
    const centa = new Discord.WebhookClient('xx', 'xx');
  centa.send(`User with ID ${vote.user} just voted!`)
  });
opal plank
#

thats cuz webhook can be undefined

#

my typescript warned me there

cinder sandal
opal plank
#

want a simple way? conditional chaning

#

@visual lake

visual lake
#

yes

opal plank
#

dbl.webhook?.on
if you want the tl;dr

#

not going to force es6+ syntax onto someone

#

i think conditional chaining is es11

#

or if your node version doesnt support it, just do
if(dbl.webhook) => {//continue code here}

pallid igloo
opal plank
#

CHAINING

#

as in chain

visual lake
#

@opal plank thanks i did

#

working

opal plank
#

๐Ÿ˜‰

#

conditional chaining is basically a if inline[

pallid igloo
#

Oh, I understood by that example, I was just looking for more info on it (Like other uses)

opal plank
#

im fairly confident thats es11 or es20 syntax

#

i cant remember which

midnight blaze
#

anyone who is into react here? Have you guys see this :/ Kinda scary

delicate shore
#

i made a new text for people who ask to ask

delicate shore
#

There are 3 easy steps to getting help!

  1. Post your code
  2. Post your errors
  3. Send a short description of what you are trying to make

NEVER ask โ€œwill anybody help me?โ€ or โ€œHello is anybody willing to help me outโ€ as it wastes and makes helping you out slower, simply post your issue and a helper will get to you as soon as possible.

This is a serious issue and you need to work on this
Visit https://dontasktoask.com/ for more info about this issue.
I hope you understand !
Regards ,
A well wisher

pallid igloo
#

Against popular belief "does not work" is not sufficient information to provide to receive help.
What's the expected (wanted) behaviour, what's the actual (unwanted) behaviour? Do you get any errors? What's your relevant code that might be causing the issue?

  • Discord.js official bot.
opal plank
#

'how bot go online?'

pallid igloo
#

haha discordjs.guide go brrr

opal plank
#

im not gonna lie, im impressed

#

i thought my code was going to get 2 or 3 stars

#

was not expecting this

pallid igloo
#

Ohh

#

You haven't seen my tic tac toe code yet..

#

also

#

seriously, do you not use a command handler?

opal plank
#

that was 5 days into learning JS dude

delicate shore
#

I have 2k lines of code in my index

#

despite fact i use js

pallid igloo
visual lake
#

@opal plank one more question

pallid igloo
#

@delicate shore I have 100 lines in my index, But a total of 13k lines in my whole bot.

#

Command handler is pretty usefull.