#development

1 messages · Page 626 of 1

mossy vine
#

its a special way to spell "special"

real helm
#

aaaa

#

thanks xd

#

How I change my name?

mossy vine
#

you cant, and wrong channel for that anyways

ashen walrus
#

javascript is just a mess

idle basalt
#

stop bulli

quartz kindle
#

@real helm your name was changed because your username contains special characters that would put you on top of the user list

#

if you change your username into a normal name without special characters, then you can ask a mod to change your name back

unique nimbus
#

Remove the !

earnest phoenix
#

^

real helm
#

hello
how can I do to put in the bot log of my bot the amount of channels in which they are

idle basalt
#

depends on your lib

real helm
#

js

mossy vine
#

Just loop through the channels and log what you need

real helm
#

the ammount of discord servers

idle basalt
#

with discord.js its client.guilds.size and client.channels.size

real helm
#

thanks

#

its working

#

thanks

idle basalt
real helm
#

And know what servers are the bot?

#

the names

mossy vine
#

Loop through the guilds

#

With a forEach

real helm
#

wtf

short portal
#

anyone know an easy image editor for node js? (ping)

idle basalt
#

canvas probably

#

learning js will help you write a bot in js lol

opaque eagle
#

Great, someone finally recommending discordjs.guide to ppl... I’m fed up with ppl sharing anidiots.guide shit with others

#

That belongs in the garbage can of discord.js history, not in a help channel

mighty verge
#

Does anyone know what static website generator/theme discordjs.guide uses if it uses any. I'd love to use it for my bot it looks very nice

opaque eagle
#

Vuepress? @mighty verge

#

It looks like vuepress to me

earnest phoenix
#

em

mighty verge
#

Looks like it, thanks 😄

idle basalt
#

aig isnt that bad

#

i just think the djs guide is better

#

and more thorough

opaque eagle
#

It just gives large codeblocks of code and than tiny bits of explanations at the bottom

#

And most ppl just copy-paste that code

idle basalt
#

cant really fault the writers for the inability of their readers

opaque eagle
#

I mean I don’t blame them... if I were that dumb and I saw someone giving “free codes” for cool shit like star boards and tracking used invites, I’d copy-paste it too

idle basalt
#

when i was getting started i never even knew there was an official guide so i learned from aig and shudder tsc/plexi

opaque eagle
#

But the writers should be held responsible for the consequences of their site

#

Plus the stuff that aig makes pages for r just basic logic that any real dev should be able to write

#

Look at that junk... JSON and Enmap shouldn’t even be taught cuz of how shitty they are, and the rest are just bait for those suffering from imposter syndrome

#

Also last bit of criticism, GitBook, really? That shit is slow af

idle basalt
#

man what have evie and york done to you

opaque eagle
#

Also last last last bit I swear, it has guides on how to host on fucking Heroku and Glitch

idle basalt
#

i agree that json should only be written about to tell people that its NOT a database but enmap is fine and all the other topics are popular

#

why wouldnt they write about what people find popular

#

heroku is also fine, i dont know why everyone hates it so much

opaque eagle
#

Enmap is popular? Enmap is pretty much keyv but worse

idle basalt
#

i said enmap is fine

#

and the other topics are popular

opaque eagle
#

Loading an entire dB into memory is a dumb idea

#

I mean Enmap was flawed from the start

#

It’s another piece of bait for beginners to get caught on... poor fellas can’t manage to escape it

idle basalt
#

its a decent starter database

ivory hazel
#

i just use mongodb

#

free 512mb online

idle basalt
#

it would be nice if they taught people how to use something like mongo though

opaque eagle
#

Not a database... again if you want simple key/value storage why not use keyv

idle basalt
#

and then also had a tut on hosting a remote db

ivory hazel
#

there are countless video's

#

it works tho

#

gets the job done

#

like i mean, if something works for some people, then great! they must use that

opaque eagle
#

Users having trouble with keyv can get support from a much larger and well-maintained library and a well-built community than just a small bunch of weirdos

ivory hazel
#

just cause it doesnt work for you then meh

idle basalt
#

calm down my guy. we get it, you really hate york and evie

ivory hazel
#

me .. lol i dont xD

opaque eagle
#

That’s not the case with Enmap, you have to rely on Evie’s good graces cuz virtually no one of trustworthiness uses it

ivory hazel
#

i dont hate

idle basalt
#

not you spiky

opaque eagle
#

I don’t hate them... I just wish they did better

ivory hazel
#

oof

opaque eagle
#

Look, when discordjs.guide got out, York should’ve archived anidiots.guide...

idle basalt
#

honestly my biggest problem with them is that evie is very selective with her help

ivory hazel
#

couldnt agree more

idle basalt
#

but if youre not mega stupid she can be helpful

ivory hazel
#

with eslint statement

idle basalt
#

best part of the djs guide is the page on eslint no cap

opaque eagle
#

Exactly... with keyv, it’s not like that

ivory hazel
#

i didnt even bother trying enmap and that stuff

opaque eagle
#

Discordjs.guide is reviewed and maintained by multiple valued members of the djs community... aig on the other hand is run by evie and York and is ultimately subject to their opinion and their opinion only

ivory hazel
#

but i am learning mysql atm

#

@opaque eagle what database do you use?

#

i tried using firebase the other day, and it just didnt work xD

opaque eagle
#

Prob not the best idea for u atm

#

But I use Redis

ivory hazel
#

i have to learn it for school

idle basalt
#

ive been putting off learning mongo for the longest time oof

ivory hazel
#

so i might aswell learn it

opaque eagle
#

MySQL is fine

ivory hazel
#

@idle basalt there some great video's online

opaque eagle
#

Fire base imo I don’t see myself using it but if u have to learn it for school you’ve got no option

idle basalt
#

firebase seems cool

opaque eagle
#

It’s pretty restrictive and it’s noSQL, and ur data is subject to Google’s privacy policy

wooden prawn
#

I use MYSQL, I don't see much point in using anything else (also I don't much choice on my server)

ivory hazel
#

firebase didnt work for me xD i was messing around, trying to get it to work, but i was having issues

opaque eagle
#

Fire base is really only meant for front end sites

idle basalt
#

yea

ivory hazel
#

i was experimenting xD

opaque eagle
#

You really should avoid using it

ivory hazel
#

i know

#

spend 6 minutes on it

idle basalt
#

im gonna try it for auth on my website

ivory hazel
#

gave up xD

opaque eagle
#

Lol

ivory hazel
#

but i try to go with free as much as i can, cause in my country, everything is really expensive

#

the good thing, we getting AWS in 2020

opaque eagle
#

If you’ve got a VPS you can do whatever u want in it

#

Heck you could even use Redis or pg, which is cool

copper cradle
#

hmm

ivory hazel
#

the price for a decent VPS per month is $25 to $50, that is for 3gb ram and 2 vCPU xD

copper cradle
#

oof

ivory hazel
#

that is south africa

#

everything is shit expensive

#

but ive given up. i ordered some server stuff, gonna run a server closet at home xD

wooden prawn
#

Daaaaamn

opaque eagle
#

Lmao gl

copper cradle
#

lol

opaque eagle
#

Also you can check out some of the options in the pins, they’re pretty cheap @ivory hazel

#

Much cheaper than $25

ivory hazel
#

the problem is, nothing is in south africa

opaque eagle
#

Wait just to be clear $ refers to USD here right?

ivory hazel
#

yes

#

i just roughly converted it from my currency

opaque eagle
#

Yeah then why bother... with DO is roughly $5/mo

#

In USD

#

And price won’t vary by country

#

If it’s a physical product being shipped to u, sure, rates might differ

ivory hazel
#

its R14.58 per 1$, so $5 is R72... that wont even get me a McD's burger xD

#

maybe a small one xD

opaque eagle
#

Oh

quartz kindle
#

you can get a vps from any country, doesnt need to be yours

opaque eagle
ivory hazel
#

but we want low latency discord bots so on, for music

#

locally hosted

quartz kindle
#

well then rip

shy rose
#

server region only applies to voice

and voice for music at least doesn't really matter the latency
latency only really affects you for real time chatting

fading wigeon
#

@shy rose it doesnt

#

it also affects text

#

and the latency does matter

#

instable latency can cause distortion and weird artifacts

#

especially with opus

shy rose
#

@fading wigeon text servers are all US based (central discord) afik
voice servers are the only applicable part

fading wigeon
#

not so sure about that

#

their status display shows voice servers yes

#

but ive seen messages react differently when selecting different regions

shy rose
#

hence when you connect a to vc you get given a vc IP in the region you connect to

how ever the websocket you chat over all runs to the same place

#

@fading wigeon if you know/find anything about text region would be good to know so can load balance it out nicly but so far only seen for voice

also when US dies all servers normaly die

fading wigeon
#

yeah since us servers handle load balancing

#

ill see if i find something

#

might message discord idk

shy rose
#

*meant load balancing out bot hosting sry

#

cause currently the strategy for low latency is jam all the hosting in to the most centeral discord area possible

fading wigeon
#

lol

#

i think it connects to the nearest endpoint anyway

#

and thru it to the central servers

shy rose
#

aka make it the biggest central point of failure possible

fading wigeon
#

they use cloudflare for a reason

shy rose
#

ws all resolves to same place with i believe cf just fowards it

#

cf will make it way nicer for them 😛

fading wigeon
#

cf acts as a reverse proxy

#

normally that is

shy rose
#

yeah ik i love it

fading wigeon
#

in this case its used as a cdn

#

i love it bcus i can host on ipv6

#

xD

shy rose
#

lol

fading wigeon
#

yeah tbh they should do something about their server structure

shy rose
#

found a fun one the animated server icons if they are big enough always result in a miss

#

so on a mega server i was on they avg 250GB per hour sending the always miss icon which is

fading wigeon
#

having central failure points has been popular in the 197s phone networks

#

jesus

shy rose
#

i mean when ever discord has a db failure the entire thing topples

#

except vc lol

#

you can still talk to people and ask if they can talk in chat

fading wigeon
#

lol

#

yeah

shy rose
#

you cant connect or leave though which is odd you cant leave

fading wigeon
#

they enforce sharding for bot creators but dont do it themselves

#

kind of ironic

#

its not that hard too

shy rose
#

it is kind of hard for real time chat tbh

fading wigeon
#

might result in a bit more traffic between data centers because of data references but still

shy rose
#

nah its really hard

fading wigeon
#

its not as hard as u think

shy rose
#

they already run clusters and shards

fading wigeon
#

there are solutions for it

shy rose
#

i mention specifically for real time chat

fading wigeon
#

having an internal bit-torrent like system for example

shy rose
#

like in normal semi realtime systems you can do rolling aggregation clusters which works amazing but the moment you bring realtime in it really starts to hit the fan

fading wigeon
#

hmm

#

i wonder why they didnt bother using a peer to peer backend

shy rose
#

cause thats still really hard

fading wigeon
#

which would make them not need servers at all

#

(well only one for auth)

shy rose
#

if both pairs reviece an event at same time aka 2 people in diff part of world

then its question of who gets presence

#

if they use p2p for the whole network seen that somewhere cant remember its name but you end up with no chat history

#

and also tons of script kiddies trying to dos one another

fading wigeon
#

you could

#

and yes that might also happen

#

but still

#

the history thing wont be a problem if they use custom cachers to support the network

#

the only problem i see is privacy

shy rose
#

if you bring cachers in then your back to same issue

fading wigeon
#

not really

#

caching only the last 20 messages

shy rose
#

if 2 people send message at same time each to a different cluster then who has presidence

fading wigeon
#

so new users have a bit of context

#

also member lists wont exist lol

#

none

#

the tasker will handle it

shy rose
#

i mean the member list is already lazy af

#

"the tasker" someone needs to handle it

fading wigeon
#

no it wont exist

#

it cant exist

#

it will come down to the client then

#

to decide which message will be first

shy rose
#

also interesting thing discord has tried and does have a form of rolling aggregation

fading wigeon
#

decision will probably be made according to current cluster connection

shy rose
#

after 2 weeks messages message move to cold

#

which is interesting

fading wigeon
#

did you know the recaptcha for new temp accounts is just a local form dummy?

shy rose
#

but also why you cant bulk delete past 2 weeks as they are no longer on hot

fading wigeon
#

you can

#

but it takes ages

shy rose
#

what do you mean sry?

fading wigeon
#

and the client glitches

#

do u know u can create temporary unregistered discord accounts?

shy rose
#

bulk delete past 2 weeks

is the idea of fetch then send single delete evens

fading wigeon
shy rose
#

gg redierects to main page?

#

man i cant type today

fading wigeon
#

yeah

shy rose
#

its a 300 now

fading wigeon
#

wha?

shy rose
#

it just redirects

lofty hamlet
#

Hi

fading wigeon
#

yeah

shy rose
#

301 or 302 i didnt have tools open

fading wigeon
#

but everything else is a cname

shy rose
#

hello

lofty hamlet
fading wigeon
#

if you dont have a request for it it redirects to main

shy rose
#

cname is very diff from 300 lol

lofty hamlet
#

Who can help me ?

fading wigeon
#

yeah i know

#

if you go to index it redirects

#

anything else is a cname

shy rose
#

@lofty hamlet does it give you line number?

lofty hamlet
#

It's all 😉

#

When i use includes

#

Wtf

#

const switcher = message.content.slice(prefix.length).trim().split(/ +/g); switch (switcher[0].toLowerCase()) {

#

My switch if you want

#

For the case

shy rose
#

ah ik this

#

mainly cause just hainvg this issue 5min ago on another project lol

#

if you do a double split then you get a null entry

lofty hamlet
#

?

#

You can explain where i do change line and explain me after

shy rose
fading wigeon
#

alright

shy rose
#

you get empties

lofty hamlet
#

?

fading wigeon
#

ill just fade out now

#

lol

lofty hamlet
#

Me ,

#

?

shy rose
fading wigeon
#

will save it

#

good night

lofty hamlet
#

So ?

shy rose
#

@lofty hamlet the codes thats throwing the error isnt in the sent file?

lofty hamlet
#

Of course, lmao

shy rose
lofty hamlet
#

?

#

She is in do not be silly dude

ivory pebble
#

For some reason, my webhook isn't even running at all...

module.exports.startUp = async (client) => {
  const dbl = new DBL(dblToken, { webhookPort: 5000, webhookAuth: dblAuth });
  
  dbl.webhook.on("ready", async (hook) => {
    console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
  });```
grizzled spruce
#

What are you hosting ur bot on?

ivory pebble
#

ubuntu

grizzled spruce
#

Any error messages?

ivory pebble
#

nope

grizzled spruce
#

Was the webhook running before or was it just never running?

ivory pebble
#

It was running before

#

but it recently stopped, not sure why

grizzled spruce
#

Have you made any changes?

ivory pebble
#

Nope

grizzled spruce
#

Hmm

#

Have you rebooted ur bot?

ivory pebble
#

Yes

grizzled spruce
#

Hmmm

#

I dunno what the error could be

ivory pebble
#

Normally it prints out: Webhook running at http://${hook.hostname}:${hook.port}${hook.path}

#

But for some reason it just stopped running the script

grizzled spruce
#

Hmmm

#

Try adding another log to the beginning

ivory pebble
#

I tried

grizzled spruce
#

Hmmm

#

I dunno

#

See if you can get a cert dev to help you

ivory pebble
#

ok

#

thank you

grizzled spruce
#

Yeah, sorry I couldnt solve the issue 😬

sinful lotus
#

Ports pls

#

never forget to open ports

#

a webhook will never work if your ports are closed

ivory pebble
#

Can you elaborate a bit more?

sinful lotus
#

Dont you know what port is?

ivory pebble
#

I have it set to 5000

prime cliff
#

It's where ships go to dock and make sweet love @sinful lotus

sinful lotus
#

then open the port 5000

#

lmao yes shipgirls port

ivory pebble
#
Error:    Could not connect to server
Status:    Disconnected from server```
#

It can't connect to port 5000

sinful lotus
#

then open it

#

it will obviously wont connect if the port is never opened

ivory pebble
#

And how does one do that? :>

west spoke
#

Google

ivory pebble
#

I just searched it up before I asked that question

#

And I got like 1000+ different results

sinful lotus
#

read and try

#

every server is different

#

usually servers has firewall

ivory pebble
#

Really weird

sinful lotus
#

start from figuring out what is your firewall

ivory pebble
#

This webhook used to work last week

#

I'm so confused

#

port 22 works

#

I mean, port 22 is open

earnest phoenix
#

port 22 is your ssh port. try avoid using ports 1-1024, most are reserved for common services

sinful lotus
#

lmao why cant you just learn to open port

#

we are pointing you to the right direction

ivory pebble
#

i'm trying to

#

but i dont know how to

sinful lotus
#

we all started from I dont know how to

#

we just have the drive to learn and explore

#

why dont you try that

#

I cant spoonfeed you how because every system is not same

ivory pebble
#

I ain't lying

#

I'm going through each and every search result

sinful lotus
#

reading without comprehending is useless too

ivory pebble
#

Is there a way to do have webhooks without using ports?

earnest phoenix
#

@ivory pebble open your router settings and look for a tab called Port Forwarding
webhooks need to be accessible to the public which is why your port that the webservice (apache im assuming) is listening on needs to be open

ivory pebble
#

Sorry, I really don't have that much knowledge about VPSs

fiery stream
#

ayy i get this as response from api `action: 'getWeather',

parameters: { 'geo-city': 'Los Angeles' },

allRequiredParamsPresent: true,`

#

'city' is not defined error

#

help me

knotty steeple
#

Do not @mention people randomly.

fiery stream
#

ik him not exacly know him but he helped me few times

#

btw do u know the fix*

knotty steeple
#

no

#

what are u even trying to do

fiery stream
#

ayy i get this as response from api action: 'getWeather',

parameters: { 'geo-city': 'Los Angeles' },

allRequiredParamsPresent: true,
'city' is not defined error
help me

#

that what i get from api at the top

knotty steeple
#

reposting doesnt help

amber fractal
#

we dont even know what api that is

fiery stream
#

its dialogflow

knotty steeple
#

what is ur code

fiery stream
#

var url = `http://api.apixu.com/v1/current.json?key=4b17315c17394d40ac6232419191001&q=${req.body.queryResult.parameters.geo-city}`; request(url, function(err, response, body) { body = JSON.parse(body); if (body.error) { //console.log(body.error); return res.json({"fulfillmentText": `**Data not found:** ${body.error}`}); } res.json({ "fulfillmentText": `` })

#

it gives error at the end of url

knotty steeple
#

parameters.geo-city

fiery stream
#

it says geo-city is not defined because of -

knotty steeple
#

thats not how js works

fiery stream
#

so how it owkrs

knotty steeple
#

iirc you have to do parameters["geo-city"]

fiery stream
#

thats what i needed thx you

real helm
#

hello

idle basalt
#

hi

lapis meteor
#

How to add 2 prefix ?

#

e.x:

  1. @turbid dune help
  2. !help
#

Lib: Discordjs

#

I don't mean setprefix

#

Because i saw people doing "@botname help"

fleet flower
#

!play s

fleet flower
#

@idle basalt

idle basalt
#

hi

fleet flower
#

Hi

#

Can you come to my server and invite bot for me? Pleasr

#

E

idle basalt
#

why cant you invite a bot yourself? but also, no

#

and this isnt the right place to ask

fleet flower
#

😭

#

Ok tnx.

#

Sorty

#

R

real helm
#

Hello, does anyone know how to make a command in discord.js that indicates how long the bot has been active?

#

ping me

quartz kindle
#

what do you mean active? you mean uptime? how long it has been running since last restart?

real helm
#

yes

quartz kindle
#

process.uptime()

real helm
#

mmmm

#

okay

oak moat
#

@peak glade why crossposting

real helm
#

chaos, hello

oak moat
#

I told you on thesourcecode

#

But nobody will answer you if you croddpost

#

Cross*

peak glade
#

no

idle basalt
#

thesourcecode pikaOh

earnest phoenix
#

😐

earnest phoenix
#

hi

#

Its good @earnest phoenix

#

Whats your host?

sinful lotus
#

make sure your ports is open

earnest phoenix
#

omgserv

sinful lotus
#

if you set it to 9000 then make sure port 9000 is open

earnest phoenix
#

k

#

i have changed my port and now it is saying
listen EACCES 0.0.0.0:XX

sinful lotus
#

dont use port 22

#

or any port below 1k

#

Take the time and learn how to open the port

earnest phoenix
#

ok

lofty hamlet
sinful lotus
#

theres no includes there

opaque eagle
#

An empty hastebin, half of an error message, and the wrong piece of code?

hushed berry
#

lmfao

earnest phoenix
#

@lofty hamlet show the error in console

shy turret
#
client.on('message', message => {
  if (message.content === 's!fight') {
    if (!message.mentions.users.size) {
      return message.reply('You have to mention a member to fight them!');
    }
    var opponent = message.mentions.users.first();
    return message.reply(opponent.username)
  }
});

I'm trying to make my own fight command. It does say You have to mention a member to fight them! if there is no mention, but there isn't any message if a user is messaged.

#

No console error message.

mossy vine
#

because message.mentions.users.size is 0

shy turret
#

I'm going to try something first

#

how do I fix it?

#

it also seems like it isn't allowing to pass any args

#

wait I think I what I messed up and how to fix it

#

I used message.content so any args wouldn't work

#

if (message.content.startsWith('s!fight')) {

#

fixed it

#

my code was right

#

it was just the message.content

earnest phoenix
#

@shy turret what ?

shy turret
#

nvm

lofty hamlet
#

@earnest phoenix already say

earnest phoenix
#

Its a half on an error message

#

Just screen the error

#

In the console

opaque eagle
#

@lofty hamlet

  1. That HasteBin is empty.
  2. That's not the full error... some of the error message gets cut off, so show us the full error + stack trace.
  3. That's not the actual file that the error comes from.
grizzled spruce
#

Hello

#

So could someone point me toward a guide that explains how to open ports and such? I’ve tried doing the research myself and I can’t find anything

opaque eagle
#

Open ports?

#

Like on a router/switch?

lofty hamlet
#

This a few party of my code

earnest phoenix
#

and the error is ?

mossy vine
#

thats still irrelevant code

real helm
#

Hello

#

Who have code to welcommer, or guide to do it

opaque eagle
#

welcommer?

unique nimbus
#

You mean the bot Welcomer?

opaque eagle
#

Idk how to welcommer either

unique nimbus
#

or whatever it is

opaque eagle
#

teach me when u learn how to do whatever that is

earnest phoenix
#

const dbl = new DBL(token, {
    webhookPort: 8780,
    webhookAuth: "password"
  }, Client)


  dbl.webhook.on('ready', hook => {

    console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
  });
  
  dbl.webhook.on('vote', vote => {

    con.connect(function (err) {
        if (err) throw err;
    con.query("UPDATE players SET megabox=megabox+1, hasvoted=" + Date.now() + " WHERE id=" + vote.user); () => {}

    Client.users.get(vote.user).send("Thanks for voting you receive a Vote Box, do ``&open votebox`` to open it. *Don't forget to vote again in 12 hours !*")

    Client.channels.get('566730124066684949').send("**" + message.author.tag + "** have upvoted the bot, thanks !")
    })
  });```
#

with this code

#

what's wrong ?

inner jewel
#

you already have something listening on that port

#

are you starting the webhook in an event handler

real helm
#

welcommer is a welcome message that a bot send when somebody join

inner jewel
#
client.on(..., ... => {
    const dbl = ....
})```
real helm
#

I don't know the name in english

#

Who help me?

earnest phoenix
#

ok thx

unique nimbus
#

That is the bots name

earnest phoenix
#

how to see my port that are already used ?

unique nimbus
#

The bot is private

real helm
#

mmm

#

in cmd

#

ipconfig @earnest phoenix

#

i think

#

@unique nimbus and how I do a welcome message

unique nimbus
#

Look in docs

#

I don't know js

earnest phoenix
#

@real helm on guildMemberAdd events

digital sparrow
#

what is easy mongodb or mysql?

copper cradle
#

mysql

earnest phoenix
#

or even better use postgres

#

mysql is absolute trash

digital sparrow
#

i know mysql but i dont understand on javascript 🖕

copper cradle
#

Woah

slender thistle
#

Been using mongo cuz it's convenient in a way

digital sparrow
#

so what is easy?

copper cradle
#

Nothing

west spoke
#

lol

carmine echo
#

Does anyone here have any experience with createjs or webpack? I'm trying to make the two work together. To use createjs I need to make a Stage which takes in an ID of a canvas as a parameter. Well I did all of that, but I'm getting an error because I think it can't access the html or something? The error itself is not of any use this.Container_constructor is not a function. Does webpack prevent that? how can I fix that?

late hill
#

@digital sparrow I'm pretty sure both are easy once you understand how to use them.

carmine echo
#

I'm very new to both so I have no idea what I'm doing

digital sparrow
#

@copper cradle tf?

slender thistle
#

What are you surprised about

#

Nothing is easy if you don't want to learn

digital sparrow
#

so what is good mongo or mysql?

carmine echo
#

just use a json database /s

copper cradle
#

no

#

pls no

carmine echo
#

do you know what /s means

copper cradle
#

oof

knotty steeple
#

@digital sparrow preference

copper cradle
#

forgot about it

knotty steeple
#

i like mysql

west spoke
#

@digital sparrow s3 is gud

#

Easy to learn ngl

#

Just have to upload a few more files than others

lofty hamlet
#

@earnest phoenix error is includes of null

digital sparrow
#

i think json gud

copper cradle
#

oof

earnest phoenix
#

well you're thinking wrong

#

@lofty hamlet screen the error

lofty hamlet
slender thistle
#

Do you have a list of posts like that

earnest phoenix
#

basically yes

#

less effort to deal with low iqs

digital sparrow
#

so how to use mongodb?

slender thistle
#

Mind sharing it? dogeKek

digital sparrow
#

how to use mongodb

#

tf

slender thistle
#

Are you banned from Google

west spoke
#

Google

lofty hamlet
#

Who me ?

west spoke
#

No

#

@digital sparrow

lofty hamlet
#

Oh ok

jolly sentinel
#

I would try to search this up / look it up on the docs but I've no clue how to word this question for google nor what it'd be under in the docs;

digital sparrow
#

whaaaat

lofty hamlet
#

And you can help me plz ? @west spoke

#

Or other peaple

west spoke
#

...

#

With?

jolly sentinel
#

Is it possible to fetch a message in discord.py without getting the discord.TextChannel first?

west spoke
#

Idk anything about java

lofty hamlet
#

Or other people

#

Oh ok

slender thistle
#

@jolly sentinel no channel - nowhere to get message from

jolly sentinel
#

sweet

#

Now I just need to decide whether or not I want my quote command to require the channel the message is from or the channel you want to send it to.

real helm
#

try {
message.member.send({ embed1 })
} catch (e) {
{const embed= new Discord.RichEmbed()
.setAuthor(message.author.username, message.author.avatarURL)
.setColor(color.rojo)
.setDescription(":x_: ERROR:\n No te he podido enviar los comandos, revisa que tengas activados los mensajes directos de este servidor.")
.setFooter("Programado por @real helm")
message.react("581159019633180756")
message.channel.send({ embed })
}}

#

what is wrong

mossy vine
#

message.member.send(embed)

#

you dont need the {}

#

just because of how richembed constructors work

real helm
#

mmm

#

all is okay?

mossy vine
#

what?

real helm
#

if the code is okay

mossy vine
#

no

#

i told you what to fxi

real helm
#

aa okay, and what

mossy vine
#

remove the {} in the .send() calls

#

smh i cant type today

leaden gust
#

Also you have an extra scope for no reason I believe

#

Like you have a pair of {} inside your catch that don't seem to do anything

#

that won't cause an error but yknow

mossy vine
#

theres no reason for it

#

but javascript accepts it perfectly

leaden gust
#

Right, which makes sense, it's a scope

#

most languages will accept it

#

i just wouldn't want him double-scoping every try catch block for some reason because this code works

mossy vine
#

yeah

digital sparrow
#

aaa

leaden gust
#

@digital sparrow ?

digital sparrow
#

?

fiery stream
#

Can lava link take voice in

inner jewel
#

you mean receiving audio?

earnest phoenix
#

If that’s what you mean, then no.

fiery stream
#

thats what i meant

#

so i want it to receive audio then send it to api then get back response

#

just like okaygoogle

sacred minnow
#

i have a music command but it only works with links, how can i make it so i can just put in some keywords and its plays the first thing it finds?

earnest phoenix
#

where

#

youtube?

fiery stream
#

Ignoring exception in command ping

#

help idk python so im nub

earnest phoenix
#

find a library that searches youtube

sacred minnow
#

i have ytdl

#

ytdl core

fiery stream
#
from discord.ext import commands

client = commands.Bot(command_prefix='>')


@client.event
async def on_ready():
    print("Bot is ready.")


@client.event
async def on_member_join(member):
    print(f'{member} has joined a server')


@client.event
async def on_member_remove(member):
    print(f'{member} has left a server')


@client.command()
async def ping(ctx):
    await ctx.send(f'Pong! {round(client.latency * 1000)}ms')


client.run('')
``` get error when i use ping comd
jolly sentinel
#

What's the full error?

earnest phoenix
#

if you don't know python... why are you making a bot in python

fiery stream
#
Traceback (most recent call last):
  File "C:\Users\Jassm\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\ext\commands\bot.py", line 846, in process_commands
    yield from command.invoke(ctx)
  File "C:\Users\Jassm\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\ext\commands\core.py", line 367, in invoke
    yield from self.prepare(ctx)
  File "C:\Users\Jassm\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\ext\commands\core.py", line 345, in prepare
    yield from self._parse_arguments(ctx)
  File "C:\Users\Jassm\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\ext\commands\core.py", line 304, in _parse_arguments
    transformed = yield from self.transform(ctx, param)
  File "C:\Users\Jassm\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\ext\commands\core.py", line 212, in transform
    raise MissingRequiredArgument('{0.name} is a required argument that is missing.'.format(param))
discord.ext.commands.errors.MissingRequiredArgument: ctx is a required argument that is missing.```
#

cuz thats how i learned js

#

and i believe i can learn py with it too

earnest phoenix
#

"lets learn spanish by just reading spanish books and not understanding the context whatsoever!!"

sacred minnow
#

i didnt know js at all when i started making a bot but now i can make a lot of stuff with it

fiery stream
#

its just a way people learn stuff some learn from vids some from experimenting and some from self learning

#

see rezno is wit me

jolly sentinel
#

Are you using rewrite or async?

fiery stream
#

its the latest one

earnest phoenix
#
i didnt know js at all when i started making a bot but now i can make a lot of stuff with it```

a result of that is shitty unoptimized code
sacred minnow
#

actually everything works fine

fiery stream
#

thats kinda rude to him

sacred minnow
#

im still not very good at js but still better than before

fiery stream
#

its all good

#

pythr do u know why?

jolly sentinel
#

I think you're using async because that should work on rewrite.

#

It's saying you're missing the ctx argument

fiery stream
#

lol im learning from lucas new tut videos

#

and i believe he is using the latest one rn

#

thats what he said

earnest phoenix
#

here we have it boys, the golden combo, youtube tutorials and not knowing the language whatsoever

jolly sentinel
#

lmao

fiery stream
#

cry just help if u want to or dont reply to my stuff

earnest phoenix
#

just me telling you to not use youtube tutorials and to learn the language you're working in is helpful

slender thistle
#

Lucas tutorials...

earnest phoenix
#

to your sanity

jolly sentinel
#

That tutorial is probably using async

slender thistle
#

Sounds about as shit as it can get

jolly sentinel
#

Or you installed async

#

and he's using rewrite

slender thistle
#

He is using async

#

None of tutorials on d.py on YT are good

fiery stream
#

oh uh

slender thistle
fiery stream
#

so should i not watch him

slender thistle
#

Yes

#

You should not

west spoke
jolly sentinel
#

You should probably get a basic understanding on the language first

west spoke
#

That's what I did

slender thistle
#

Learn the language, read the docs

west spoke
#

^

slender thistle
#

Two things

fiery stream
#

ik the basics

#

of py

jolly sentinel
#

which is a heaping load of irony seeing as how my first bot was how i learned the language but whatever

fiery stream
#

A!eval message.author.send("getlife")

slender thistle
#

So do you know how to update d.py

fiery stream
#

--upgrade

west spoke
#

pip install discord==0.16.12
(async)
pip install discord
(Latest)

fiery stream
#

so which one should i do

jolly sentinel
#

I remember having a horrible time trying to install discord.py-rewrite

slender thistle
#

-U for update

west spoke
#

Async is easiest but hardest to find help for

#

Imo

slender thistle
#

discord-rewrite is shit

fiery stream
#
Successfully installed aiohttp-3.5.4 attrs-19.1.0 discord.py-1.1.1 idna-ssl-1.1.0 typing-extensions-3.7.2 websockets-6.0 yarl-1.3.0```
slender thistle
#

cuz it wasn't even official

jolly sentinel
#

isn't every tutorial on yt under async

fiery stream
#

is that what i need

slender thistle
#

Yes

jolly sentinel
#

i mean

slender thistle
#

And yes

jolly sentinel
#

they might not be good

fiery stream
#

so there we go i made progress

jolly sentinel
#

but whatever

fiery stream
#

finally it replied thx

shy turret
#
          enemyhpstring = fs.readFileSync('data\\battles\\' + opponentid + '-hp.txt').toString().split('\n');
          enemyhp1 = parseFloat(enemyhpstring, 10)
          enemyhp = enemphp1 - move1damage
#

what's wrong with this?

#
[ '20' ] // This is enemyhpstring
20 // This is enmyhp1 
C:\Users\Username\Desktop\Discord Game\bot.js:229
          enemyhp = enemphp1 - move1damage
          ^

ReferenceError: enemphp1 is not defined
mossy vine
#

you did a typo

#

you wrote enemphp instead of enemyhp

shy turret
#

?

#

oh

#

I hate typos now

late hill
#

Is a txt file really your best option

west spoke
#

For simple games yea

amber fractal
#

well json is more organized atleast

lapis meteor
#

@idle basalt I'm in handler and it dont work

idle basalt
#

um...

lapis meteor
#

i already tried:
if(!message.content.startsWith(prefix)||message.content.startsWith("<@" + bot.user.id + ">")) return;

#
client.on('message', async message  => {
 let messageArray = message.content.split(" ")
    let cmd = messageArray[0].toLowerCase();
    let args = messageArray.slice(1);
if(!message.content.startsWith(prefix)||message.content.startsWith("<@" + bot.user.id + "> ")) return;
  
    let commandfile = bot.commands.get(cmd.slice(prefix.length)) || bot.commands.get(bot.aliases.get(cmd.slice(prefix.length)))
    if(commandfile) commandfile.run(bot,message,args)
});
#

only &&help work

opaque eagle
#

The mention doesn't work, right?

idle basalt
#

you need another !

opaque eagle
#

^

warm sail
#
! message.content.startsWith(prefix) || message.content.startsWith("<@" + bot.user.id + "> ")

will be false when your prefix is not present or when the mention is present

opaque eagle
#

You need another ! after || @lapis meteor

warm sail
#

^ (actually you need to use && ! instead of ||)

idle basalt
#

or you need to group the conditions and keep one !

opaque eagle
#

I do an overkill thing lol

idle basalt
#

or use arr.includes

opaque eagle
#
["!", `<@${client.user.id}>`].every(e => !msg.content.startsWith(e))```
idle basalt
#

or use fancy regex

#

straight flexing now

opaque eagle
#

lol

warm sail
#

Why not encrypt a bitmap with the matching bytes and run it through a block chain?

idle basalt
#

i think you mean .some btw

opaque eagle
#

No, I mean every()

idle basalt
#

doesnt every check if everything passes 🤔

opaque eagle
#

If I used some() it'll return true and then it will stop running the code

warm sail
#

every is correct, because of the negated startsWith

fiery stream
earnest phoenix
#

How do i make the background on discord bots list to black

warm sail
#

There's a dark-mode switch in the footer, if that's what you're looking for

earnest phoenix
#

where at the bottom?

mossy vine
#

on your bots page or the entire website?

earnest phoenix
#

bots page

mossy vine
#

use style tags in long description

earnest phoenix
#

how do i do that i am not smart with html

warm sail
#

<div style="background-color:black"> .... </div>

mossy vine
#

in long description, just do

<style>
css code here or something
</style>```
#

or that but it will only be inside that one div

#

which is meh at best when using light mode on the website

earnest phoenix
#

i cant install better sqlite 3

#

i hardly installed enmap and quick.db

#

but it cant find the module even i installed for 5 times

#

I mean Geotims worked right but i want the stuff that i have already the bottoms and shit but it wont work

#

nvm i have it how i want it know thanks tho!

knotty steeple
#

ps in the code before you could've done this

if(!(message.content.startsWith(prefix) || message.content.startsWith("<@" + bot.user.id + "> "))) return;```
carmine echo
#

Is anyone here familiar with webpack?

#

wait I'll try something I'll get back if it doesn't work

opaque eagle
#

Ofc all JavaScript devs know what webpack is, it's just that not everyone has enough practice using it

carmine echo
#

I'm having trouble using it with createjs

#

holy shit I am an idiot

#

I forgot to add new and I was wondering why it said it wasn't a function. It was a constructor I've spent so much time trying to fix it

#

aaa

grave pilot
#

What is the HEX code for the invis color on embeds?

west spoke
#

You just use the color of the embed

lapis meteor
#

@warm sail No because prefix = message guild's prefix

#

@opaque eagle your first proposition didn't work

warm sail
#

Are you still having issues?

lapis meteor
#

@opaque eagle your second propostion didn't work

#

daheck i cant fix it

warm sail
#
if (!message.content.startsWith(prefix) || message.content.startsWith("<@" + bot.user.id + "> ")) return;

@lapis meteor what exactly do you expect this part of the code to do?

As it is, it will call return if message.content.startsWith(prefix) is false. It will also call return if message.content.startsWith("<@" + bot.user.id + "> ") is true.

jolly sentinel
#

pretty sure he already got that fixed

#

Otherwise akkoShrug

lapis meteor
#

brb tomorrow

#

cant code rn

#

and cant talk

warm sail
#

kk. g'night

lapis meteor
#

thx but i'm not going to sleep

warm sail
#

🤦 time zones

earnest phoenix
#

How do i make my web page for the bot say how many servers it in?

opaque eagle
#

Use the API

#

Or you can check out some of the official client libraries

#

It’s on the website

earnest phoenix
#

oh okay

opaque eagle
#

Click the “API” option in the navigation bar up top

earnest phoenix
cursive dagger
#

Hmm

earnest phoenix
#

hmM

#

🙏

restive light
#

why uploading a bot is sucking like that x358634643643374 times?

#

Detailed description too short. Minimum 300 characters. Add your commands. Spaces or empty spaces are not counted.

#

I must write something to detailed description?

buoyant wagon
#

write what the commands are and how to use them

knotty steeple
#

thats why it says its required

#

also pls dont

#

it shouldnt be hard to describe a bot that you made

#

just say some of its features and shit

restive light
#

Well nothing much for describing a chat bot

#

it doenst have any commands

buoyant wagon
#

not even help?

cunning oxide
#

@restive light what does it do then lol

restive light
#

I told man

#

just chatting for now

#

I will add commands soon

cunning oxide
#

300 words is pretty ez

restive light
#

well that site is annoying

#

Ill wont upload my bot

knotty steeple
#

there is multiple ways to describe a cleverbot

#

not really unique but

amber fractal
#

It's not even 300 words

#

it's 300 characters

tidal oar
#

Uhh hi, i was just working on voting system and i couldnt make my bot to dm the person whoever voted

#

the codeline is this: ```
dbl.webhook.on('vote', vote => {
bot.users.get(vote).send('Thanks for voting! You can vote again in 12 hours.');
console.log(User with id ${vote.user} just voted.);
});

#

it isnt working somehow

earnest phoenix
sacred minnow
#
if (message.content.startsWith(`${prefix}baga`)) {
  if (message.member.voiceChannel) {
    if(!servers[message.guild.id]){
      servers[message.guild.id] = {queue: []}
    }
    search(args.join(' '), function(err, res) {
      if(err){
        message.channel.send('ceva namers bn sefu')
      }
      let videos = res.videos.slice(0, 10);
    
    
      let resp = ''
      for(var i in videos) {
        resp += `**[${parseInt(i)+1}]:** \`${videos[i].title}\`\n`;
      }
        resp +=`\n\`alege un nr de la 1 la ${videos.length}\``; 
    
        message.channel.send(resp)
    
        const filter = m => !isNaN(m.content) && m.content < videos.length+1 && m.content > 0
        const collector = message.channel.createMessageCollector(filter);
        collector.videos = videos
        collector.once('collect', function(m) {
    
        
        
    message.member.voiceChannel.join()
      .then(connection => {
        var server = servers[message.guild.id];
        message.channel.send('casa ma scoti zi ``/iesi``');
        server.queue.push(args);
        Play(connection, message);
      })
      
    
      
    });
      })
    } else {
      message.channel.send("intra pe un canal retardatule")
    }
    console.log("████████████ "+"-"+message.guild.name+"- " + message.author.tag+": |baga| "+ args2[0] +" ████████████")
  }


  if (message.content.startsWith(`${prefix}iesi`)) {
    if (message.member.voiceChannel) {
      message.member.voiceChannel.leave()
      
        .then(connection => {
          message.reply('gata pa');
        })
      } else message.channel.send("foaie verde stam la mal intran pula mea peun canal")
    }```
#

can someone help me with this?

#

it works when i search for a video

#

it sends all the options

#

but when i select one

#

i get this error

hollow beacon
#

help me

#

TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received type object

#

const streamOptions = { seek: 0, volume: 1 };

idle basalt
#

youre passing an object where you should be passing a string

indigo geyser
#

How can I take my bot online after close repl?

grim aspen
#

there's no real way to do that

#

except using an express

#

but use a vps

indigo geyser
#

Ok

#

Thanks

#

Do you know a free Vps?

#

I think no

grim aspen
#

actually use keep_alive

indigo geyser
#

I use it

#

And flask

grim aspen
#

and no that's not possible for a vps that's free

indigo geyser
#

But It doesn't work very good

#

I'v just find this

diff --git a/discord/gateway.py b/discord/gateway.py index 7ba78b0..36b01f3 100644 --- a/discord/gateway.py +++ b/discord/gateway.py @@ -65,7 +65,12 @@ class KeepAliveHandler(threading.Thread): self.msg = 'Keeping websocket alive with sequence {0[d]}' self._stop_ev = threading.Event() + count = 0 def run(self): + try: + count = KeepAliveHandler.count + KeepAliveHandler.count += 1 + print("Keep alive", count, "started") while not self._stop_ev.wait(self.interval): data = self.get_payload() log.debug(self.msg.format(data)) @@ -76,6 +81,8 @@ class KeepAliveHandler(threading.Thread): f.result() except Exception: self.stop() + finally: + print("Keep alive", count, "stopped") def get_payload(self): return {

#

In gateway.py

hollow beacon
#

@idle basalt how to fix it?

indigo geyser
hollow beacon
#

Long knew about him

grim aspen
#

just

#

use

#

a

#

vps

indigo geyser
#

l

#

e

#

l

#

I'm poor

cunning oxide
#

LOL

sinful lotus
#

we cant do anything bout that then

#

¯_(ツ)_/¯

cunning oxide
#

dude said

#

this site is annoying

earnest phoenix
#

fun fact; people work to get money. you should get a job if you want to buy stuff you can't afford

lost acorn
#

Anyone able to assist me I’m having some difficulties with discord.py

cunning oxide
#

oof

#

@lost acorn whats happening

knotty steeple
#

you cant post links to other bot lists

cunning oxide
#

made a mistake pog

#

forgot the link

lost acorn
#

I’m getting an error when I try to install

cunning oxide
#

send console + code if possible

lost acorn
#

One sec just got home after taking a break to go eat

#

I don’t know if it’s a discord.py error pip error or just a user error

#

Reinstalling discord sorry just a min

knotty steeple
#

??

#

what reason do you need to install discord

#

it shouldnt be that hard just to post a screenshot

lost acorn
#

Right but I sent first message on my phone and the issue is on rpi

#

Command "/usr/local/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-install-mbo7z90c/multidict/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-record-ev0krf1d/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-mbo7z90c/multidict/
You are using pip version 19.0.3, however version 19.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

#

The error

high lava
#

@indigo geyser Both GCP and AWS provide Free VPS options with certain limitations. AWS' Free Option is only for a year though. Both aren't anything great, but they're fine for small-scale projects. Give them a try

#

If you're planning on doing anything big though, you may want to look elsewhere

indigo geyser
#

Ok thanks

high lava
#

np

shy rose
#

adding to that both aws and gcp have free inbound data which is great as around 98% of all data you use on a bot is inbound

high lava
#

Unless it's a music bot

#

So yeah, you should be fine

empty owl
#
const user = message.mentions.users.first();
// Parse Amount
const amount = !!parseInt(message.content.split(' ')[1]) ? parseInt(message.content.split(' ')[1]) : parseInt(message.content.split(' ')[2])
if (!amount) return message.reply('Must specify an amount to delete!');
if (!amount && !user) return message.reply('Must specify a user and amount, or just an amount, of messages to purge!');
// Fetch 100 messages (will be filtered and lowered up to max amount requested)
message.channel.fetchMessages({
 limit: 100,
}).then((messages) => {
 if (user) {
 const filterBy = user ? user.id : client.user.id;
 messages = messages.filter(m => m.author.id === filterBy).array().slice(0, amount);
 }
 message.channel.bulkDelete(messages).catch(error => console.log(error.stack));
});
#

it says it cant delete messages under 14 days

#

but im nort

buoyant wagon
#

over 14 days

empty owl
#

ye

fiery stream
#

A!eval message.author.send(client.guilds.size)

empty owl
#

??

fiery stream
#

ayyy is it good to run dashboard with bot of seprately

#

??

empty owl
#

is there a way to get a message's content using its ID

fiery stream
#

dont think so

buoyant wagon
#

i think so

empty owl
#

how

buoyant wagon
#

you would read the channel messages then get the message with that id then get its content

empty owl
#

but

#

yoiu cant get that

buoyant wagon
#

?

empty owl
#

you cant get a list

buoyant wagon
#

well maybe not in your language

empty owl
#

im using the stable version of discord.js

#

.-.

#

nearly 100% coverage of the Discord API

buoyant wagon
#

yes you can in discord.js

empty owl
#

how

buoyant wagon
fiery stream
#

Ayy im looking for devs for something big proj to do

#

Should know jquery and js html and css

fiery stream
#

please dm me if u interested?

earnest phoenix
#

Not the right place for asking that

real helm
#

Hello

earnest phoenix
#
fs.writeFile("./blacklist.json", JSON.stringify(bc)).catch(err){
    if(err) {
         console.log(err)
       }
}```

Unexpected   { at `fs.writeFile("./blacklist.json", JSON.stringify(bc)).catch(err){`
#

lol

#

I think you put , instead of .catch in that idk

mossy vine
#

the code snippet seems right, you most likely have an unclosed statement somewhere else in the code

#

@earnest phoenix no that makes no sense

earnest phoenix
#

kay

#

okay

#

@mossy vine well for me it works like , (err) => {} or somethin but yeah catch should work too I agree Thonk

mossy vine
#

its because you are doing a callback

earnest phoenix
#

Yis

mossy vine
#

but this is a promise

earnest phoenix
#

Okae

mossy vine
#

so a .catch is what you need

earnest phoenix
#

ok

#

I forgot nothing to close

if (bc[iduser]) {
delete bc[iduser];
message.channel.send(`**✅ L'identifiant ${iduser} à été retiré de la liste noire avec succès.**`);
fs.writeFile("./blacklist.json", JSON.stringify(bc)).catch(err){
    if(err) {
         console.log(err)
       }
}
}else{
message.channel.send(`**❌ L\'identifiant ${iduser} n'est pas dans la liste noire.**`);

}```
mossy vine
#

if only you indented the code properly it would be easier to read and find errors

earnest phoenix
#

You see the missing?

mossy vine
#

i cant read that code at all, please use a linter or something to have proper indentation

#

and no, i dont see it

#

likely outside of the scope

#

it can be anywhere tbf

quartz kindle
#

thats not how .catch works

#

.catch(err => { code here }) not .catch(err){ code here }

#

the way you wrote it is the correct way for try {} catch(err) {}

#

but not for .catch()

real helm
#

Hello

#

In need help

#

message.member.send( embed1 ).catch(err => {message.channel.send("No te he podido enviar los comandos")})

#

why the bot send the 2 messges?

earnest phoenix
#

Someone knows about the blacklist system, I encounter many worries

real helm
#

lol no

earnest phoenix
#

ok

quartz kindle
#

what blacklist system?

#

@real helm nothing wrong there, the problem is somewhere else in your code

real helm
#

fuck

#

but the code are okay

#

but i don't know how to use .catch

mossy vine
earnest phoenix
#

@bitter sundial can i invite bot

#

hey

#

im bot developer

slender thistle
#

Once your bot is submitted and approved, you get your bot invited to this server

earnest phoenix
#

oh

real helm
#

` js
if(command === "help"){
const embed= new Discord.RichEmbed()
.setAuthor(message.author.username, message.author.avatarURL)
.setColor(color.verde_lima)
.setDescription(":emoji_10: Mensaje enviado correctamente\n\nRevisa tus mensajes privados para ver los comandos")
.setFooter("Programado por @real helm")
message.react("581159019633180756")

message.channel.send({ embed })

const embed1 = new Discord.RichEmbed()
  .setTitle("__Comandos disponibles:__")
  .setColor("21ea12")
  .setThumbnail(client.user.avatarURL)
  .setDescription("Sintaxis de comando:`<>` = Requerido, `( )` = Opcional\nMi prefijo es `/`\nPara más información de un comando `/help-<comando>` ")
  .addField("General:", "`ping`, `serverinfo`, `report`, `avatar`, `userinfo`, `8ball`, `id`, `invite` , `uptime` ")
  .addField("Admin Commands:", " `kick`, `ban`, `say`, `purge`, `encuesta` ")
  .setFooter("Programado por @real helm")
  message.react("581159019633180756") 
 message.member.send( embed1 ).catch(err => {message.channel.send("No te he podido enviar los comandos")})

} `

mossy vine
#

thats not how you do that

#

surround it with 3 backticks

real helm
mossy vine
real helm
#

i don't know how i do the symbols xd

#

sorry

#

send me 1 symbol

#

sorry

earnest phoenix
#

testbot

#

bad name

warm sail
#

` `` (remove the space)

earnest phoenix
#

hmm

#

how i can call it

mossy vine
#

@earnest phoenix what are you talking about lol

real helm
#
if(command === "help"){
    const embed= new Discord.RichEmbed()
    .setAuthor(message.author.username, message.author.avatarURL) 
    .setColor(color.verde_lima)
    .setDescription(":emoji_10: __Mensaje enviado correctamente__\n\nRevisa tus mensajes privados para ver los comandos")
    .setFooter("Programado por @! Wᥱᥱd_Boყ#1031")
    message.react("581159019633180756") 
 
   message.channel.send({ embed })
     
 
  
    const embed1 = new Discord.RichEmbed()
      .setTitle("__Comandos disponibles:__")
      .setColor("21ea12")
      .setThumbnail(client.user.avatarURL)
      .setDescription("Sintaxis de comando:`<>` = Requerido, `( )` = Opcional\nMi prefijo es `/`\nPara más información de un comando `/help-<comando>` ")
      .addField("General:", "`ping`, `serverinfo`, `report`, `avatar`, `userinfo`, `8ball`, `id`, `invite` , `uptime` ")
      .addField("Admin Commands:", " `kick`, `ban`, `say`, `purge`, `encuesta` ")
      .setFooter("Programado por @! Wᥱᥱd_Boყ#1031")
      message.react("581159019633180756") 
     message.member.send( embed1 ).catch(err => {message.channel.send("No te he podido enviar los comandos")})
}  
earnest phoenix
#

my bot

mossy vine
#

noone really cares what a bot is called

earnest phoenix
#

test

#

okay

real helm
#

how I add a delete message in the .catch

mossy vine
#

@real helm it sends it because it cant send to message.member

real helm
#

yes, but the message that I need delete is the first

#

that it send in the channel

warm sail
#

Why not use .then() ?

real helm
#

where

#

after or before the catch

mossy vine
#

after the message is sent

warm sail
mossy vine
#

^ likely

earnest phoenix
#

can i say something

#

oh

#

i made this command already XD

#

require('discord.js').Util.fetchRecommendedShards(process.env.TOKEN) does not work

#

I use const result = async () => { await require('discord.js').Util.fetchRecommendedShards(process.env.TOKEN);

quartz kindle
#

why not use the already required discord.js?

earnest phoenix
#

how i can make command that can use only developer

#

but i return result() { return _ref.apply(this, arguments); }

#

P.S. i made it already

quartz kindle
#

i dont understand your code, but i did it like this js const Discord = require("discord.js"); const shards = Discord.fetchRecommendedShards(token)

earnest phoenix
#

ah

#

somebodyyyy

quartz kindle
#

@earnest phoenix i was replying to FellGill

earnest phoenix
#

I KNOW

quartz kindle
#

if you want to lock commands, you can lock them to your ID for example

earnest phoenix
#

wha

#

not lock

quartz kindle
#
if(message.author.id === "youridhere") {
    //command here that only you can use
}```
earnest phoenix
#

@quartz kindle now:

require('dotenv').config();
const Discord = require('discord.js');
const result = Discord.Util.fetchRecommendedShards(process.env.TOKEN);
console.log("Cordio sera spawné avec " + result + " shard(s)");
const manager = new Discord.ShardingManager('./src/index.js');
manager.spawn(result);
manager.on('launch', shard => console.log(`Launched shard ${shard.id}`))

Return:

Cordio sera spawné avec [object Promise] shard(s)
(node:3304) UnhandledPromiseRejectionWarning: TypeError [CLIENT_INVALID_OPTION]: The Amount of shards option must be a number.
#

already

#

@quartz kindle i made that command already

#

i forget

quartz kindle
#

ah yeah, its a promise

#

await it or use .then()

#

but cant you use "auto" instead?

earnest phoenix
#

const result = async () => {await Discord.Util.fetchRecommendedShards(process.env.TOKEN)}; ?

quartz kindle
#

im pretty sure the shard manager accepts auto as a value

earnest phoenix
#

Nop

#

"The Amount of shards option must be a number."

quartz kindle
#

idk then put everything together inside an async function

#

or put it in a .then()

earnest phoenix
#

Ok, but I put it or?

quartz kindle
#

hmm?

earnest phoenix
#

yay

#

i set rich presence for my bot

#

Give me a complete example because there I do not understand or put this .then

silent vale
#

@earnest phoenix it will be popular bot

earnest phoenix
#

ouh

quartz kindle
#

@earnest phoenix js Discord.Util.fetchRecommendedShards(process.env.TOKEN).then(result => { manager.spawn(result) })

earnest phoenix
#

"in" is missed

silent vale
#

kk

#

bye

#

i feel bad

#

fk my life

earnest phoenix
#

Playing in v0.0.1

#

hmm

#

i fix this

#

fixed!