#development

1 messages · Page 318 of 1

earnest phoenix
#

Most likely

#

Crystal is getting into Node.js so yes

#

Use npm install -g pm2

#

The apt version is probably outdated or a ripoff version

opaque bison
#

o.0 we're talking about PM2 here

rugged tiger
#

Moin

umbral pelican
tawny lava
sinful jolt
#

will storing a large amount of data in a PersistentCollection adversely affect performance?

umbral pelican
#

PersistentCollection Thonkeng

sinful jolt
#

Part of d.js

earnest phoenix
#

@sinful jolt not part of D.js

#

its a package for D.JS tho

sinful jolt
#

ya that

earnest phoenix
#

The more data u store the more storage will get used idk about Performance tho

#

i dont think so

vital lark
#

How do I post server count with NUMBER Servers | SHARD_COUNT Shards? thonk

umbral pelican
silver juniper
#

.

vital lark
#

....

earnest phoenix
#

.........

earnest phoenix
#

..................

vital lark
#

..........................................

earnest phoenix
#

....................................................................................

vital lark
#

....................................................................................................................

surreal peak
#

...................................................................................................................................

tawny lava
#
Exec
**Input**
git gud```
**Output**
You are now so gud!
#

@earnest phoenix yes it is

earnest phoenix
tawny lava
#

rekt

umbral pelican
#

How to cluster with pm2 and d.js sharding manager?
Whenever I've tried it just makes multiple instances on each shard, instead of splitting between them.

keen anvil
#

what?

#

you don't need to do anything, d,js sharding takes advantage of mutiple cores

umbral pelican
#

oh

#

k

earnest phoenix
supple shale
#

(╯°□°)╯︵ ┻━┻

woven drum
#

(╯°□°)╯︵ ┻━┻

eager zinc
#

rebel

woven drum
#

Tonkku will mute this too

eager zinc
#

TONKY CANNOT SILENCE US

supple shale
#

dont make me

woven drum
#

me too

earnest phoenix
#

i would but im banned

tawny lava
#

hi @weary shoal

supple shale
#

._.

woven drum
#

why @earnest phoenix

earnest phoenix
#

@woven drum "posting memes"

supple shale
#

Look lol

earnest phoenix
#

im appealing now

supple shale
vital lark
#

#RIPAllChannels

eager zinc
#

dont make me do it

earnest phoenix
#

HAHA

eager zinc
#

jks

supple shale
woven drum
#

c.ping

fiery goblet
#

only shitpost

floral stone
#

s@userz

vital lark
#

nice prefix

opaque bison
#

I have no idea why but it restarts my app outta no-where

vital lark
#

Never used PM2 before uwu

#

but i need to get started

karmic parcel
#

uh, did your boat exit with code 0?

#

that's what it looks like

opaque bison
#

No, it didnt throw any errors

#

that's the most weird part

uncut slate
#

that looks like a normal exit to me

#

caused intentionally

#

signal SIGKILL

karmic parcel
#

Ya

uncut slate
#

that's what my process.exit()s look like, anyway

winged vapor
opaque bison
#

Only I can access the VPS and I'm only monitoring the app rn

winged vapor
opaque bison
#

It happened like 4 times

karmic parcel
#

what lib?

opaque bison
#

Commando

#

I have put codes everywhere to throw errors or unhandledExceptions whenever they occour but currently there are no errors in the logs but the bot is still exiting out

karmic parcel
#

are you sharded?

opaque bison
#

No, my bot is only on 190 guilds

karmic parcel
#

hmm, but like Aethyr is saying, exit with code 0 is a clean exit

opaque bison
#

But my code doesn't contain anything which tells the process to exit.

sinful jolt
#

Are you by any chance happening to copy something with ctrl-c with the terminal open

opaque bison
#

I cross checked every file to see any funny business

weary shoal
#

Inb4 evaled process.exit()

opaque bison
#

I'm not evaling or copying anything

#

I know the basic things, come on guys lol I'm not that dumb

sinful jolt
#

is your eval locked 🤔

opaque bison
#

Only I can use it you mean?

karmic parcel
#

yes

opaque bison
#

of course 😛

karmic parcel
#

any logs generated?

#

did you try to do pm2 logs <whatever your app name is>

opaque bison
#

yes, there's nothing that is causing this

karmic parcel
#

how long has it happened?

opaque bison
#

For a while I think

sinful jolt
#

Shit vps?

opaque bison
#

bruhhhhhhh

#

My bot uses like 15MB ram

#

xD

#

my VPS only has that single bot, nothing else

earnest phoenix
#

i did everything but my node moduals are not installing right?? wtf welp

tawny lava
#

what is it saying

#

send a screenshot

fiery goblet
#

npm i?

fiery goblet
#

install npm?

earnest phoenix
#

yes

#

Hello?

tawny lava
#

how did you install node?

earnest phoenix
#

sudo apt-get install nodejs

tawny lava
#

what happens when you run node -v?

earnest phoenix
#

wtf node not installed

#

i did install it tho

earnest phoenix
#

ok now what

tawny lava
#

do node -v

#

does it output the version

#

?

earnest phoenix
#

sudo apt install nodejs-legacy

tawny lava
#

no

#

did you follow the steps?

earnest phoenix
#

yes that is what it said

tawny lava
#

it should output the version

earnest phoenix
#

no not istalled it says

tawny lava
#

then you didn't follow it correctly

#

run this curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -

#

then this sudo apt-get install -y nodejs

earnest phoenix
#

its gay

tawny lava
#

gay WaitWhat

umbral pelican
earnest phoenix
#

it did not work

tawny lava
#

then you're doing it wrong lul

earnest phoenix
#

but how

#

Please help

tawny lava
#

I gave you what you have to do

#

did you run those commands?

earnest phoenix
#

AND I FIF IT

#

DID*

tawny lava
#

if it's not working then you didn't

#

¯_(ツ)_/¯

#

check for typos

earnest phoenix
#

ok

karmic parcel
#

I still use 6.x

#

but that works p well for arm

#

that same source is what I use on new pis and stuff

tawny lava
#

I use 8 cuz I need async

karmic parcel
#

I don't "need" async

#

cuz I'm not a nub

earnest phoenix
#

it dose not install at all

karmic parcel
#

jk jk

#

but I don't need bleeding dege

#

edge*

tawny lava
#

@earnest phoenix can you try npm -v

earnest phoenix
#

that works

tawny lava
#

and node -v doesn't?

earnest phoenix
#

nope

tawny lava
#

¯_(ツ)_/¯

earnest phoenix
#

ik

karmic parcel
#

which node

#

Try that

#

And what version of npm was it?

weary shoal
#

/./exec which node

#
/usr/bin/node

earnest phoenix
#

no such file

tawny lava
#

then not installed gg

#
Exec
**Input**
which node```
**Output**
/usr/bin/node
earnest phoenix
#

it is gay

#

not working

tawny lava
#

it's not "gay"

#

you're doing something very wrong

umbral pelican
#

it might be

#

who knows

tawny lava
#

ya sry for assuming it's sexuality

opaque bison
#

Are MySQL and MariaDB's database same?

#

I'm trying to import a dump into Maria which was in MySQL before but it isn't working correctly...

#

It only loads like half the data

earnest phoenix
#

yes i installed node now how do i install pm2 the right! way

tawny lava
#

npm install pm2 -g

earnest phoenix
#

ya that unistalls node its so weird

#

yes it did it now it said error shit

tawny lava
#

wut

#

how does that

#

uninstall node

karmic parcel
#

Lol

earnest phoenix
#

no it works now

#

but pm2 did not install ugh

umbral pelican
#

do you even

earnest phoenix
#

please help @tawny lava

tawny lava
#

wtf do you want me to do

earnest phoenix
#

wow

#

pm2 is not installed

#

error

tawny lava
#

what's the error

earnest phoenix
#

it did not install right wtf

tawny lava
#

sudo npm install pm2 -g

bitter sundial
#

give us the error or we cant help

tawny lava
#

try that

#

I think the error's that he doesn't have sudo perms

#

cuz -g

bitter sundial
#

yeah that could be very possible

earnest phoenix
#

worked but it is not runing it at alllllllllllll

tawny lava
#
Exec
**Input**
whose pm2```
**Output**
/bin/sh: 1: whose: not found
earnest phoenix
tawny lava
#

o wait

earnest phoenix
#

its not found!

#

ahhhhhh

tawny lava
#

that's the wrong file

earnest phoenix
#

see im like so mad

tawny lava
#

did you open it in the project folder?

bitter sundial
#

is it in another folder

earnest phoenix
#

yes

#

DiscordBot i named it

tawny lava
#

the main file is called discordbot.js?

earnest phoenix
#

no

#

index.js

tawny lava
#

what's the folder called

earnest phoenix
#

its in a file called discordbot

#

my main file is called bot.js

tawny lava
#

then cd to that folder

bitter sundial
#

is it in discordbot folder

earnest phoenix
#

yes

tawny lava
#

cd DiscordBot

#

then run pm2 start index.js

earnest phoenix
#

cd DiscordBot that is it?

tawny lava
#

cd to the folder

earnest phoenix
#

yes

#

i love you thanks

#

gay ik

#

but im not

tawny lava
#

if you have to say "I'm not gay" then 90% of the time you're gay

earnest phoenix
#

what ever Just thanks man

tawny lava
#

np

earnest phoenix
#

in cmd i think md is "make document" and cd is "check document", if i'm not wrong

tawny lava
#

cd is change directory

earnest phoenix
#

oh, yeah ok

tawny lava
#

and md is make directory

earnest phoenix
#

makes sense

harsh zenith
#

Does anybody know if it's possible to get the discord id of a patreon supporter?

#

By API or similar?

keen anvil
#

not that I'm aware of. They'd have to have their discord linked, and even IF it was, I don't think they release that info

umbral pelican
tawny lava
#

hmm

umbral pelican
#

doesn't have dicksword though

bitter sundial
#

where's the docs tho

umbral pelican
sinful jolt
#

Just use the there bot to add them to a role

#

Then get the ids from the role

#

Lol there API has Facebook Id no Discord

tawny lava
#

cuz bad api™

bitter sundial
#

could be old docs someone should check

weary shoal
umbral pelican
#

oWo

tawny lava
#

nice

weary shoal
#

Funny because that is @tawny lava's id lol

#

231085410988589056

tawny lava
#

hmm

#

ye

keen anvil
#

their bot is shit @sinful jolt

umbral pelican
#

it's always offline

sinful jolt
#

ikr

#

It never comes online

#

lol it's hiding Always

#

It does add the roles tho

#

🤷

umbral pelican
#

@paper perch BlobOwOevil

tawny lava
#

if someone could make a lizard pics api that would be great

#

k ty

umbral pelican
#

Thonk make it yourself

keen anvil
#

eh debatable

#

it's never added any for me, and yes I have it set up

tawny lava
#

I would if I knew how to

sinful jolt
#

send a zip of pics I'll make one 🤷

tawny lava
#

uploading

#

if you need more just let me know

umbral pelican
tawny lava
#

lemme pet him

winged vapor
#

Pong! Latency is 278ms.

tawny lava
#

hmm

#
Lizard™#7292
Pong!
💓 Heartbeat ping:

108ms

📨 Message ping:

221ms

winged vapor
#

!ping

umbral pelican
tawny lava
#

ponged™

winged vapor
#

Pong! Latency is 133ms.

tawny lava
#
**Input**
client.ping```
**Output**
108.66666666666667```
winged vapor
#

Pong! Latency is 582ms.

tawny lava
#

LUL

winged vapor
#

wat

#

Eval:

INPUTclient.ping
OUTPUT

68.66666666666667```
#

oh dere it is

tawny lava
#

hmm

#
**Input**
Math.floor(client.ping)```
**Output**
108```
#

ez

winged vapor
#

Eval:

INPUTMath.floor(client.ping)
OUTPUT

70```
#

get rekt

#

got a better ping latency

tawny lava
#

gg

winged vapor
#

/coinflip

#
Coinflip

You've got tails

tawny lava
#

self.rate my ping

#

I'd give my ping a 10/10

#

ez

winged vapor
#

I'd give my ping a 11/10

#

ign rating

tawny lava
#

gg

#

self.rate me

#

I'd give me a 7/10

#

good enough

winged vapor
#

Error:

INPUTclient.setGame("Lizard has a worser ping then me")
OUTPUT

TypeError: client.setGame is not a function```
tawny lava
#

gg

winged vapor
#

fuck XD

tawny lava
#

client.setGame

winged vapor
#

/eval client.user.setGame("Lizard has a worser ping then me")

#

/eval client.user.setGame("Lizard has a worser ping then me")

tawny lava
#

yes

#

we see it

winged vapor
#

somehow

#

XD

#

how

#

/coinflip

#
Coinflip

You've got tails

#

/eval client

tawny lava
#

LUL

#
**Input**
client.token```
**Output**
'-- My Token -- '```
winged vapor
#

Somehow my eval crashed

#

XD

tawny lava
winged vapor
#

:kappa:

#

kappa

#

Eval:

INPUTclient.user.setGame
OUTPUT

[Function: setGame]```
#

/eval client.user.setGame("Lizard has a worser ping then me")

#

@tawny lava U win this time

#

kappa

tawny lava
#

yes

#

I just have it as acommand instead of evaling it everytime

#

¯_(ツ)_/¯

winged vapor
#

Eval:

INPUT2+2
OUTPUT

4```
#

Eval:

INPUTvar lizard = "your mom"
OUTPUT

undefined```
tawny lava
#
**Input**
"2" + "2"```
**Output**
'22'```
#

eww

#

var

winged vapor
#

XD

#

Error:

INPUTboi
OUTPUT

ReferenceError: boi is not defined```
#

/purge 1

#

/purge

tawny lava
#

hmm

weary shoal
tawny lava
#

@weary shoal unban me right this instant

weary shoal
#

You're not banned

tawny lava
#

hmm

#

@weary shoal I better get my roles back gg

weary shoal
#

no

tawny lava
#

u wot

keen anvil
#

@tawny lava @winged vapor keep selfbot testing in #commands

tawny lava
#

oke sry

winged vapor
#

kkk

vital lark
#

-botinfo @meager jetty

gilded plankBOT
#
Bot info
ID

317145148901556234

Username

YumiBot

Discriminator

8217

Short Description

A bot who has various features, some might be unstable but why?!

Library

discord.js

Prefix

y/

Upvotes

6

Server Count

204 Servers

Owner(s)

@median isle
@vital lark

Links
vital lark
#

😏

drifting shoal
#

-botinfo @stable jolt

gilded plankBOT
#
Bot info
ID

223511211054989313

Username

alterEgo

Discriminator

2366

Short Description

A bot for shits & giggles

Library
Prefix

~

Upvotes

2

Server Count

434 Servers

Owner(s)

@drifting shoal

Links
opaque bison
#

-botinfo @hushed snow

gilded plankBOT
#
Bot info
ID

303181184718995457

Username

PenguBot

Discriminator

9722

Short Description

A Cute Multi-Purpose Discord Bot with Custom Commands, Fun, Music, Moderation & More Commands!

Library

discord.js

Prefix

p! {configure-per-server}

Upvotes

2

Server Count

207 Servers

Owner(s)

@opaque bison

Links
lavish mango
#

-botinfo @onyx kelp

gilded plankBOT
#
Bot info
ID

330044809651814412

Username

Robot Hamster

Discriminator

2058

Short Description

Robot Hamster is a multipurpose bot that has moderation commands, fun commands, and useful commands! Overall it is the bot to choose!

Library

discord.js

Prefix

h!

Upvotes

3

Server Count

268 Servers

Owner(s)

@karmic radish
@lavish mango

Links
winged vapor
#

-botinfo

gilded plankBOT
#

Please include a bot mention

winged vapor
#

-botinfo @fair grail

gilded plankBOT
#
Bot info <:certifiedbot:308880575379275776>
ID

270904126974590976

Username

Dank Memer

Discriminator

6539

Short Description

It's just a meme

Library

discord.js

Prefix

pls

Upvotes

1045

Server Count

16781 Servers

Owner(s)

@keen anvil dblBanne
@uncut slate certifieddev

Links
sinful jolt
#

Pretty sure botinfo should be done in testing channels unless it relates to the conversation

umbral pelican
#

nah, this is the bot info checking channel ULTRALUL

tawny lava
cosmic plover
#

this is the official botinfo checking channel

earnest phoenix
#

Hey gusy

#

Hey guys, who wanna auto delete invite links ?

#

Script ?

keen anvil
#

already done @earnest phoenix

hallow harness
#

copy and pasting

#

hey guys im trying to make it so that each server has a separate word list saved
i tried saving in json under guild.id but guild.id gave undefined 😦
this is discord.js btw

jagged plume
#

you using the message event?

hallow harness
#

i wasnt grabbing it before that

#

i was**

jagged plume
#

What event are you using to get the guild

hallow harness
#

nothing 😦

jagged plume
#

dunno how you are getting guild then

hallow harness
#

lol i did new discord guild

#

it felt wrong

#

but i did it

jagged plume
#

You'd need to use an event like message after they run a command, then <Message>.guild.id it

hallow harness
#

ah okay

#

thanks a lot!

jagged plume
#

np.

earnest phoenix
#

can anyone help? i use discord js and check if bot has permission to "send messages" but it's not working:

if(!msg.guild.member(client.user).hasPermission("SEND_MESSAGES"))
  {
    msg.author.createDM().then(dm=>{
      dm.send("It appears that I don't have permission to talk in the server/channel you tried to talk to me, please change it or notify an admin.");
    });
    return;
  }
tawny lava
#
if(!msg.guild.me.permissions.has('SEND_MESSAGES') {
 // DO STUFFZ HERE
}```
earnest phoenix
#

didn't work...

#

so anyone can help?

tawny lava
#
if(!msg.channel.permissionsFor(client.user).has('SEND_MESSAGES') {
// now do stuffz here
}
#

try that

earnest phoenix
#

ok

#

that one worked, thanks

indigo notch
#

also @earnest phoenix msgauthorcreateDM is totally wrong

#

just msg.author.send

#

one liune needed

earnest phoenix
#

oh really? ok

#

thanks

indigo notch
#
    return <message>.author.send('STUFF');
earnest phoenix
#

both ways work, ill use the shorter one

sinful jolt
#

So in djs I can get ws events with raw how can I send on the ws connection?

#

Trying to make a client lib for lavalink

earnest phoenix
#

-botinfo @molten wren

gilded plankBOT
#
Bot info <:certifiedbot:308880575379275776>
ID

213466096718708737

Username

Mantaro

Discriminator

4454

Short Description

Stable and fun multipurpose bot with moderation, images, actions and music!

Library

JDA

Prefix

~>

Upvotes

96

Server Count

48429 Servers | 49 Shards

Owner(s)

@cosmic plover certifieddev
@cyan flax certifieddev
@inner jewel

Links
cobalt marten
#

bot for rules and permision ?

cobalt marten
#

Bot for welcome ?

earnest phoenix
tawny lava
#

bot for command

keen anvil
#

bot for ping

weary shoal
#

bot for president

earnest phoenix
#

bot for bot

tawny lava
#

client for bot

earnest phoenix
#

bot for client

umbral pelican
#

bot for pizza

earnest phoenix
#

bot for robbie rotten

hallow harness
#

but it gives me an auth error? :c

tawny lava
#

that means you gave it the wrong token

#

also instead of doing bot.guilds.array().length just do bot.guilds.size

earnest phoenix
#

did you give them the bot token? it's not the right one

tawny lava
#

not the bots token

umbral pelican
#

And use snekfetch Daving

tawny lava
hallow harness
#

but its right :\

earnest phoenix
#

use snekfetch :/

#

at the bottom

hallow harness
#

oh

#

😮

earnest phoenix
#

Is that comic sans?

#

xD

#

yeah, i got confused at first

hallow harness
#

LOL

earnest phoenix
#

they need to mention it's on the bottom lol

hallow harness
#

Monofur actually

umbral pelican
earnest phoenix
hallow harness
#

@tawny lava thank you!

tawny lava
#

np

#

all me

zenith ocean
vital lark
#

nice admin cmd

#

and Idk

#

@zenith ocean which lib & lang

zenith ocean
#

Discord.js and JavaScript

sinful jolt
#

You should catch unhandled Errors so they don't crash your bot

vital lark
#

copies HEHHEHEH

#

-botinfo @kind dagger

gilded plankBOT
#
Bot info
ID

334186716770598912

Username

neko

Discriminator

5531

Short Description

A bot to post random nekos from https://nekos.life

Library

discord.js

Prefix

~

Upvotes

7

Server Count

564 Servers

Owner(s)

@sinful jolt

Links
zenith ocean
#

With .catch ?

sinful jolt
#
process.on('uncaughtException', err => {

    let errorMsg = err.stack.replace(new RegExp(`${__dirname}\/`, 'g'), './');

    console.error("Uncaught Exception: ", errorMsg);

});

process.on("unhandledRejection", err => {

    console.error("Uncaught Promise Error: ", err);

});

vital lark
#

I'm gonna add that

zenith ocean
#

But i not created !role, why the bot send me this error ?

sinful jolt
#

The addrole command

#

Wasn't used with a actual role

#

It looks like

zenith ocean
#

Mmmm.... Ok

#

Tomorrow i try

#

Ty

sinful jolt
earnest phoenix
#

@zenith ocean Why are you under the locked Administrator role?

#

net user Administrator /active:yes

#

:p

zenith ocean
#

That is a Windows server

#

I don't know

earnest phoenix
#

o

#

ew

#

Command Prompt color is aids

zenith ocean
#

Hahahaha

sinful jolt
#

Anyone gud with js wanta work on a new bot I'm planning to integrate with Alexa voice service hit me up

supple shale
zenith ocean
#

-botinfo @shut pumice

gilded plankBOT
#
Bot info
ID

339593314653306891

Username

AlphaBot

Discriminator

7140

Short Description

Music and Moderation Bot

Library

discord.js

Prefix
Upvotes

2

Server Count

No server count

Owner(s)

@zenith ocean

Links
zenith ocean
#

how to do to authorize my bot for the server counting ?

#

the output of console is all time: unothorized.

#

Should I be certified?

tawny lava
zenith ocean
#

ok ty

misty anvil
#

-botinfo @humble echo

gilded plankBOT
#
Bot info
ID

339254240012664832

Username

AmariBot

Discriminator

5150

Short Description

A simple and fair level system

Library

discord.js

Prefix

:?

Upvotes

1

Server Count

No server count

Owner(s)

@misty anvil

Links
umbral pelican
winged vapor
#

@coral crown

misty anvil
#

What's the best way to advertise your bot?

#

Phone makes me excited loool

umbral pelican
#

mass dm?

tawny lava
#

lul

misty anvil
#

😐

#

Brb Kappa

tawny lava
#

client.users.forEach(user => user.send('add my bot k ty'));

misty anvil
#

👀👀

umbral pelican
#

cough .map

misty anvil
#

XD

tawny lava
#

no

umbral pelican
#

yes

tawny lava
#

forEach > map

umbral pelican
#

banned :/

tawny lava
#

no u

misty anvil
#

Looool

sinful jolt
#

var > let

tawny lava
umbral pelican
sinful jolt
misty anvil
#

You guys kill me 😂😂

#

It's awesome

zenith ocean
sinful jolt
#

Do you have some kinda autorole?

#

Or addrole Command

zenith ocean
#

I do not understand sorry 😦

sinful jolt
#

Ok

#

So your bot is attempting to add a role

#

The parameter being passed to it

#

Isn't a role or a id

#

Hence the Error

zenith ocean
#

becouse my bot is attempting to add role ? where start this ? Then it only happens after a while that the bot is active because?

#

maybe server overload ?

tawny lava
#

your bot doesn't have permission to give roles

zenith ocean
#

but not should crash in this metod

opaque bison
#

<voicecon>.player.dispatcher.end(); is throwing error saying end is not a function

#

that's DJs btw

#

what should I do

sinful jolt
#

@zenith ocean you need to add a .catch to the addrole

opaque bison
#

nvm I think I fixed my shit

#

xD

sinful jolt
#

So it doesn't die on error

#

or just catch all unhandled Errors

zenith ocean
#

ok, so with .catch my bot should not crahs ?

sinful jolt
#

Yes

#
process.on('uncaughtException', err => {

    let errorMsg = err.stack.replace(new RegExp(`${__dirname}\/`, 'g'), './');

    console.error("Uncaught Exception: ", errorMsg);

});

process.on("unhandledRejection", err => {

    console.error("Uncaught Promise Error: ", err);

});``` add this somewhere too
zenith ocean
#

i have added this at my main file (app.js) is correct ?

sinful jolt
#

Should be fine

zenith ocean
#

Or should I add this to any file commands ?

tawny lava
#

do you have sparate files for the events?

zenith ocean
#

yes

tawny lava
#

put it in the events folder then

zenith ocean
#

ok

earnest phoenix
#

can you help me, after some commands an error shows up saying it does not recognize 'msg' on this line:

if(!msg.channel.permissionsFor(client.user).has('SEND_MESSAGES'))
#

i use discord.js btw

umbral pelican
#

msg isn't defined then

earnest phoenix
#

how come?

client.on('message', msg => {

this line says otherwise

umbral pelican
#

is if(!msg.channel.permissionsFor(client.user).has('SEND_MESSAGES')) inside that scope

earnest phoenix
#

yes

keen anvil
#

what is the exact error

earnest phoenix
#

msg is not defined

#

it points ^ at the !msg

keen anvil
#

do you have an await around that area?

earnest phoenix
#

no

keen anvil
#

then it has to be a syntax error

earnest phoenix
#

how can i fix it?

keen anvil
#

go over every line of code and check for the correct syntax. Semicolons, commas, etc

earnest phoenix
#

ok

tawny lava
#

you could also get a linter

regal patio
#

lol

keen anvil
#

assuming linters catch all errors angrythink

tawny lava
#

still catches alot of errors

earnest phoenix
#

linter?

keen anvil
#

google eslint

#

use that

earnest phoenix
#

ok

zenith ocean
#

@sinful jolt the same problem

sinful jolt
earnest phoenix
#

strange, up till now this error didn't show up, i'll tell you if it comes up again

zenith ocean
sinful jolt
#

And that crashs it?

#

Uncaught Exception: TypeError: Supplied parameter was neither a Role nor a Snowflake. at GuildMember.addRole (C:\Users\Administrator\Desktop\AlphaBot\node_modules\discord.js\src\structures\GuildMember.j s:397:22) your Error is this

#

But it shouldn't crash it

zenith ocean
#

yes my bot crash for this

#

😦

sick remnant
#

message: 'Missing Permissions',

#

at the bottom of the stacktrace?

earnest phoenix
#

here, now i have noticed the error returned, this is the error

tawny lava
#

what did you pass it as in your message event?

earnest phoenix
#

nothing, i think someone else did maybe

#

but i remember doing the same thing again and it showd up after few times

#

idk how to fix this...

#

wait, it's ok, finally figured it out and was just dumb not noticing

tawny lava
#

you can't pass it as nothing wtf

#

<client>.on('message', THINGY HERE

earnest phoenix
#

that wasn't the problem this THINGY is called msg for me, the problem was i had the same code in guildMemberAdd and guildMemberRemove, noticed it after seeing the line

#

@earnest phoenix Is that what I think it is...?

#

AAAAAAAAAAAAAa AN EASY PROGRAMMING LANGUAGE!! BATCH!!!

#

😅

zenith ocean
#

@sinful jolt ok i understand the problem, the problem is the welcome message. my bot have the user add role when the user join on the server, in this server the bot not have the permissions for add the role, for this my bot crash all time. Solution: go out my bot from this server

earnest phoenix
#

@earnest phoenix Do you even js?

#

google it

#

yes

sinful jolt
#

@zenith ocean you need to catch that function because that's not the only time that's going to happen you don't want your bot to die Everytime it doesn't have permissions

zenith ocean
#

@sinful jolt But the bot fails to add permission here only, because it does not have the admin role

sinful jolt
#

I know

#

But

#

The end user not so smart

tawny lava
#

make it check perms before adding the role

#

¯_(ツ)_/¯

sinful jolt
#

So do you really want your bot to crash every time someone doesn't give it admin

#

Like a bot farm

tawny lava
#
  • it doesn't need admin to add roles
zenith ocean
#

@sinful jolt You're right, I'm confused.

#

@sinful jolt I do not know what to do

earnest phoenix
#

why did you mention twice

#

(╯°□°)╯︵ ┻━┻

sinful jolt
#

I don't mind lol

zenith ocean
#

sorry

sinful jolt
#

put a catch on the function

#

Or check perms and return

zenith ocean
sinful jolt
#

member.addRole(member.guild.roles.find("name", (role))).catch(console.log(e));

#

I think

tawny lava
#

@zenith ocean what's (role) in your settings file?

zenith ocean
#

the role That the bot adds to the user who enters

#

@sinful jolt ok, the error is the same, but the bot not crash

#

ty

sinful jolt
#

np~

zenith ocean
#

i used .catch(console.error)

fiery goblet
#

try, catch((err) => {})

tawny lava
#

wot

#

or

#

just catch(console.error)

#

or catch(err => console.error(err))

fiery goblet
#

u could

#

but i mean try {} then catch

#

not try, catch

zenith ocean
#

@fiery goblet what changes ?

#

is the same ?

keen anvil
#

catch(console.error) is depreciated iirc

fiery goblet
#

it is

zenith ocean
#

What do you mean? I do not understand

earnest phoenix
#

@keen anvil How so?

#

I use it all the time

#

no warnings about depreciated

keen anvil
#

Because it doesn't properly catch errors anymore. It's supposed to be an arrow function.

zenith ocean
#

0@fiery goblet ty nothing error with catch((err) => {})

fiery goblet
#

how to do locales? thought that i would store it in a database as en, fr and so

#

and that i need to replace stuff

#

oh wait, i got an idea

earnest phoenix
#

mmmm

supple shale
#

rip

keen anvil
#
const D = require('discord.js')
const token = require('./config.json').token

const shard = new D.ShardingManager('./memedaddy.js', {
    token: token,
    totalShards: 'auto',
    respawn: false
})


shard.on('launch', shard => {
    console.log(`Launching shard ${shard.id + 1}/${shard.manager.totalShards}`)
})

shard.spawn()

This is my sharding manager, and I keep getting dead shards and some shards duplicate themselves and double send messages. Why? I'm on debian, use the latest node version, d.js, and run it on pm2
Could it be an issue with d.js, or discord its-self?
I don't get errors when shards die or dup

#

Or does every lib/lanuages have this many sharding issues?

sinful jolt
#

I have had 0 issues with py shards other the normal Discord ws unstableness

#

Why does Discord even let you connect with the same shard_id twice blobwaitwhat

keen anvil
#

Idk, but I'm sick of double posting shards. I lose a ton of servers each time it happens.

sinful jolt
#

can't help haven't got to Shards yet 🤷‍♀️

keen anvil
#

Starting to think its a d.js issue tbh

sinful jolt
#

Add logs on disconnected, reconnecting, resume events might help pin point it

keen anvil
#

yeah

earnest phoenix
#

hey guys, can you please tell me what's wrong with these two lines?

if(!member.guild.channels.find("name","trolluminati").permissionsFor(client.user).has('SEND_MESSAGES')) return;
if(!member.guild.defaultChannel.permissionsFor(client.user).has('SEND_MESSAGES')) return;
#

it keeps telling me it does not recognize .has

vital lark
weary shoal
#

Becuse permissionsFor takes a member object not a user object

earnest phoenix
#

oh

vital lark
#
if (!msg.guild.channels.find(client.user.id).permissionHas('SEND_MESSAGES')) return;```
earnest phoenix
#

i see

vital lark
#

or some shit

weary shoal
#

@vital lark that doesnt do what he wanted

earnest phoenix
#

no, it's not on msg, it's on member add and member leave

vital lark
#

@weary shoal ohh

#

shit

weary shoal
#
if(!member.guild.channels.find("name","trolluminati").permissionsFor(msg.guild.members.get(bot.user.id)).has('SEND_MESSAGES')) return;
``` Something like this
#

Input:

msg.guild.members.me

Output:

undefined
#

oops

#

Input:

msg.guild.me

Output:

undefined
#

I cant remember it

tawny lava
earnest phoenix
#

ok, thanks

tawny lava
#

try checking for a perm

#

No selfbot right now

earnest phoenix
#

ok, so far so good, let's see now if it works

#

no... it does not work 😭

umbral pelican
#

rip

vital lark
#

noo.... @umbral pelican doesn't work

earnest phoenix
#

what should i do then 😭

earnest phoenix
#

With?

#

I don't get it.

#

Can you explain what it is you need help with?

jagged plume
#

pm2 and sharding ??

#

i thought you werent supposed to use pm2 with the sharding manager thingo

earnest phoenix
#

@jagged plume No

#

A sharding managers already handles shards

#

pm2 just handles the process

jagged plume
#

i thought it broke some stuff tho

#

some people were having issues with it

earnest phoenix
#
if(!member.guild.channels.find("name","trolluminati").permissionsFor(member.guild.me).has('SEND_MESSAGES')) return;
if(!member.guild.defaultChannel.permissionsFor(member.guild.me).has('SEND_MESSAGES')) return;

please help, something is wrong with this code, it does not recognize the 'has'

umbral pelican
#

probably does that when it can't find a channel called trolluminati

earnest phoenix
#

no, it does, this is the full code:

if(member.guild.channels.find("name","trolluminati"))
  {
    if(!member.guild.channels.find("name","trolluminati").permissionsFor(member.guild.me).has('SEND_MESSAGES')) return;
    member.guild.channels.find("name","trolluminati").send("Hello " + member.user + ", welcome to " + member.guild.name + "!");
  }
  else
  {
    if(!member.guild.defaultChannel.permissionsFor(member.guild.me).has('SEND_MESSAGES')) return;
    member.guild.defaultChannel.send("Hello " + member.user + ", welcome to " + member.guild.name + "!");
  }
earnest phoenix
#

no one can help? 😦

umbral pelican
#

because there's seems nothing wrong with that code

tawny lava
#

what's the error

earnest phoenix
#

What? ("name","trolluminati") What is this?

tawny lava
#

yes

earnest phoenix
#

Oh, crap. That's how you people do it.

tawny lava
#

that's how find works

earnest phoenix
#

it searches for a channel with the name "trolluminati"

#

but it does not recognize "has"

tawny lava
#

show the error

#

in the console

earnest phoenix
#

Make sure the channel is a text channel.

#

it does not show up now, i'll show when i encounter it

#

That's weird.

#

ok

spare spruce
#

yo guys is this correct make my commands only be in right discord but no other places

#
if (message.guild.id = config.mgnDiscordId) {
//stuff
return
} else {
message.channel.send("SORRY! you not allowed to do this commands");
}```
#

im making 2 bots rn i got 1 almost finished thats TalentRecordz 1 but still got no place run it yet. and MGN discord bot

#

im still waiting for my friend get his $10 get me VPS for my talentRecordz

tawny lava
#

It’s === not just =

spare spruce
#

kk

#

is bottom correct too

#

if did it tells them cant do it

sinful jolt
#

Looks ok

spare spruce
#

kk

sinful jolt
#

try it and find out

#

Is there a js equivalent to py for guild in bot.guilds: print(guild.name)

spare spruce
#

will do

#
var guild = bot.guilds.name;
message.channel.send(guild)```
sinful jolt
#

Basically I need to loop through all Guilds and add a field to my database

spare spruce
#

thats what mine is

sinful jolt
#

Because I Fucked up

#

And forgot one

spare spruce
#

all depends if using msg. or message. as message thign and end bit default sendMessage but mine is send

#

mine bult in as module

tawny lava
#

For one that’s not how you get a list of guilds

#

And 2 don’t use var use let

spare spruce
#

i use const

#

everything mine that some are var

tawny lava
#

That could work as wel

sinful jolt
#

unless your const needs to change then use let I believe

tawny lava
#

^

earnest phoenix
#
for(var guild in bot.guilds)
{
    message.channel.send(guild);//Note: it will give you the mentional version of the guild so i suggest you'll change it to send(guild.name);
}
sinful jolt
#

O ic ic Ty~

earnest phoenix
#

np

#

i have changed it up a bit, but it's still not working:

client.on('guildMemberRemove', member => {
  if(!member.guild.me.hasPermission('SEND_MESSAGES')) return;
  //something
});

Cannot read property 'hasPermission' of undefined

earnest phoenix
#

no one knows what to do or something? 😪

tawny lava
#

I don’t see what’s wrong with that code thanking

earnest phoenix
#

ikr, it's so weird

#

🤔

#

😫

sinful jolt
#

I guess I'll leave this here as im lost af wew so when ever i call this eveything stops working and all my api calls return a 405 tf did i break here waitwhat js client.awaitReply = async (msg, neko2send, limit = 60000) => { freeNeko = msg.channel.send(neko2send); const filter = m=>m.channel.id = msg.channel.id & m.content === ">catch" ; try { const collected = await msg.channel.awaitMessages(filter,{max: 1, time: limit, errors: ['time']}); if (collected.first().content === ">catch"){console.log("True");console.log(collected.first().author.id); freeNeko.delete(); msg.channel.fetchMessages({ limit: 50 }) .then(messages => { let msg_array = messages.array(); msg_array = msg_array.filter(m => m.content === ">catch"); msg_array.length = 50; msg_array.map(m => m.delete().catch(console.error)); });} } catch (e) { return false; }};

weary shoal
#

@sinful jolt I dont get why you are setting the length to 50 here? msg_array.length = 50;

sinful jolt
#

@weary shoal because I don't know wtf I'm doing

weary shoal
#

@sinful jolt Can you explain what you want it to do so I know what is happening?

sinful jolt
#

So at x amount of msg and time if a Neko Channel is set it calls that and that sends a neko I want to wait for the first person to do >catch then Delete the neko and anyones messages that had >catch

#

the code that calls that funcjs if (await client.nekoChannel(message.guild.id).catch() !== null && await client.nekoChannel(message.guild.id) === message.channel.id) { let guild = await client.getGuild(message.guild.id); guild.msgcnt++; console.log(guild.msgcnt); client.saveGuild(guild); if (guild.msgcnt===5){ client.awaitReply(message,"neko?"); guild.msgcnt = 0; client.saveGuild(guild);} }

#

it sends neko? then things go vary bad

#

I also need the ID of the first person that does >catch to update there balance

#

I am confused af :/

weary shoal
#

Hmm, I'll see what I can do

sinful jolt
#

I'm basically trying shit till it works :/ learning along the way

earnest phoenix
#

i changed the code a bit to this, hope it will work for me:

if(!member.guild.me||(member.guild.me&&!member.guild.me.hasPermission('SEND_MESSAGES'))) return;
inner jewel
#

it can be simplified to js if(!member.guild.me || !member.guild.me.hasPermission('SEND_MESSAGES'))

earnest phoenix
#

oh right XD

weary shoal
#

@sinful jolt try this ```js
client.awaitReply = async (msg, neko2send, limit = 60000) => {
const filter = m => m.channel.id === msg.channel.id & m.content === ">catch" ;

msg.channel.send(neko2send)
.then(freeNeko => {
freeNeko.channel.awaitMessages(filter, {max: 1, time: limit, errors: ['time']})
.then(messages => {
messages.first().channel.send('Neko Caught!')
messages.first().author.id // THIS IS THE ID TO ADD BALANCE
freeNeko.delete()
})
.catch(timeout => {
freeNeko.channel.send('Time up! The Neko escaped!')
})
})
}``` You'll have to add in all your catches and stuff but it should work

sinful jolt
#

@weary shoal oo Ty ❤️ I will try rn

weary shoal
#

@sinful jolt one small adjustment, if you want to delete the neko message when time runs out add freeNeko.delete() under the line freeNeko.channel.send('Time up! The Neko escaped!')

sinful jolt
#

oo Ic ic ❤️

weary shoal
#

lmao you're welcome ❤

fiery goblet
#

smh neko would get muted unless u make it so it doesnt work here or dbots

sinful jolt
#

Welp the Trump bot is muted 🤔

#

Also you have to set the channel

fiery goblet
#

ohhhh

#

it be gud then

tawny lava
#

Is here a tutorial on how to use rethinkdb?

#

I wanna try it later

keen anvil
#

for node?

tawny lava
#

But not sure how to

#

Ye

keen anvil
tawny lava
#

Ty

keen anvil
sinful jolt
#

@tawny lava look at my repo if you want a real sample

#

@keen anvil also I updated my repo everything uses rethink now 👌🏼

tawny lava
#

Ye I’ll look at all the examples when I get home

#

Everything I can get my hands on

sinful jolt
#

There docs are a bit meh

#

I stopped using them about 6 mins in

fiery goblet
#

after looking at neko, it looks ez pz

spare spruce
#

yo how can i error log to discord chat in console aka discordjs

#

when i done mgn/eval message.channel.send(console.log) doesnt do it says not fuction

sinful jolt
#

lol you can't send console.log

#

.catch(channel.send(e))

fiery goblet
#

how will i make something which displays such @edgy carbon (=mods)? discord.js

umbral pelican
#

WaitWhat just get members with ban perms

fiery goblet
#

ye ik but nub

umbral pelican
#

filter then map

fiery goblet
#

so msg.guild.members.filter(u => u.user.permissionHas()).map(m => m.user.username ?

umbral pelican
#

eh

#

users don't have permissions

fiery goblet
#

oh yeah

tawny lava
#

it's hasPermission

#

and yes

#

users don't have permissions

fiery goblet
#

msg.guild.members.filter(u => u.hasPermission('BAN_MEMBERS').map(m => m.user.username ?

#

like so?

tawny lava
#

yes

vital lark
#

what is a better db source? Rethonkdb, PostgreSQL, or SQLite

umbral pelican
#

I prefer just using member.permissions.has() tbh

fiery goblet
#

all, really

tawny lava
#

it's just preference

umbral pelican
#

try 'em all, pick your favourite ¯_(ツ)_/¯

#

or use JSON

tawny lava
#

yes

earnest phoenix
#

JSON != Good

umbral pelican
#

!= !== good

fiery goblet
#

how will I make message.guild.members.filter(u => u.hasPermission('BAN_MEMBERS') ).map(m => m.user.username + ' | ' + m.user.presence.status) look noicer and clean?

umbral pelican
#

really?

fiery goblet
#

hmmm

#

im thonking leave me alone

#

jk

sinful jolt
#

Re🤔👌🏼

keen anvil
#

rethonkingdb 💯

vital lark
#

@sinful jolt not Re🤔 it's Rethonkdb

fiery goblet
#

yep

karmic parcel
#

ReGearGasm db

keen anvil
#

ReGearGasmDB

#

seems legit

vital lark
#

yes

sinful jolt
#

I have json [{id:3728, Nekos:272,name:"bill"},{id:37247298, Nekos:72,name:"not bill"}] ect how can I sort it by the sum of Neko

earnest phoenix
#

wdym

earnest phoenix
#

Most to least? @sinful jolt

#

json.sort((a, b) => b.Nekos - a.Nekos)

#

sorry I'm on mobile atm

vital lark
#

I wonder why this is causing this problem with Yumi thonk js 1|YumiBot | Error: Cannot find module './src/Commands/u.js' 1|YumiBot | at Function.Module._resolveFilename (module.js:485:15) 1|YumiBot | at Function.Module._load (module.js:437:25) 1|YumiBot | at Module.require (module.js:513:17) 1|YumiBot | at require (internal/module.js:11:18) 1|YumiBot | at Client.client.on.msg (C:\Users\AugustxD - Official\Desktop\other b0tz\Yumi\YumiDev\YumiBot\Yumi.js:72:21) 1|YumiBot | at emitOne (events.js:115:13) 1|YumiBot | at Client.emit (events.js:210:7) 1|YumiBot | at MessageCreateHandler.handle (C:\Users\AugustxD - Official\node_modules\discord.js\src\client\websocket\packets\handlers\MessageCreate.js:9:34) 1|YumiBot | at WebSocketPacketManager.handle (C:\Users\AugustxD - Official\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:102:65) 1|YumiBot | at WebSocketConnection.onPacket (C:\Users\AugustxD - Official\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:325:35)

earnest phoenix
#

...

vital lark
#

spammers

#

yes

earnest phoenix
#

It can't find the file

vital lark
#

I know

#

it kept spamming it

earnest phoenix
#

ok

#

why do we need to know this

#

smh

harsh zenith
earnest phoenix
#

RIp

indigo notch
#

-bots @harsh zenith

gilded plankBOT
#
kony1337#7290
Bots <:certifieddev:308880841382297610>

@quartz gull certifiedbot

indigo notch
#

rip

earnest phoenix
#

-botinfo @quartz gull

gilded plankBOT
#
Bot info <:certifiedbot:308880575379275776>
ID

329331577467174919

Username

Audio recorder

Discriminator

3889

Short Description

Records audio in your voice channel

Library

discord.js

Prefix

!

Upvotes

24

Server Count

1276 Servers

Owner(s)

@harsh zenith certifieddev

Links
quaint saffron
#

-botinfo @gilded plank

gilded plankBOT
#

Please include a bot mention

sinful jolt
#

@earnest phoenix thanks what i needed 👌🏼

vital lark
sinful jolt
#

ugh so i have ```js
bot.getUsers = async () => await bot.r.db('neko').table('users').run(bot.connection, function(err, cursor) {
if (err) throw err;
cursor.toArray(function(err, result) {
if (err) throw err;

        users = result.sort((a, b) => b.nekos - a.nekos);
        console.log(users);
        return users
    });
});``` now it logs <http://b1nzy-banned.me/WUiuC.png> this is gud however when i call the func it returns https://feed-the-wump.us/ahigebemew i am confused af ![waitwhat](https://cdn.discordapp.com/emojis/320387072290455554.webp?size=128 "waitwhat")
vital lark
#

What are u trying to do?

sinful jolt
#

lb

#

it logs right

vital lark
#

is (err) defined?

sinful jolt
#

ye it dosent err tho

#

it console logs what it should

vital lark
#
if (err) return throw new Error(err);```
sinful jolt
#

but it returns that other shit

vital lark
#

lol

sinful jolt
#

return users should return the same thing it logs to console no?

vital lark
#

Yea.

inner jewel
#

@sinful jolt

#

return cursor.toArray

#

missing a return there

earnest phoenix
#

@vital lark Do you even js

#

you can't return a thrown error

#

and, don't purposely throw errors

#

handle them properly

sinful jolt
#

ooo

#

Ty~

earnest phoenix
#
if (error) {
    msg.channel.send("An error occured!");
    console.error(error);
}```
empty moat
#

Ey, so before I attempt anything, is it possible to get all users of a server (no bots) and list them into, online, dnd, away, invisible / offline and streaming?

bitter sundial
#

yes

indigo notch
#

yes

umbral pelican
#

yes

empty moat
#

oh ok thanks

empty moat
#
if (msg.content.startsWith(prefix + `announce`) && msg.author.id === "336396409110659083") {
        const args = msg.content.split(` `).slice(1).join(` `);
        for (const guild of bot.guilds) {
            guild.defaultChannel.send(args)
        }
    }

idk how i made that but would it work? (global announcer system)

earnest phoenix
#

don't ever make a global announcement system

#

your bot will lose so many servers

sinful jolt
#

but yes it looks like it will work

tawny lava
#

just prepare to lose atleast 5 guilds + per announcement

keen anvil
#

lmao

#

5

#

no

weary shoal
#

more than 5

keen anvil
#

try hundreds if you have it

weary shoal
#

1/5 maybe

tawny lava
#

¯_(ツ)_/¯

keen anvil
#

I've done two global announcements. First time lost 300, second time (a month later) lost 500

#

doesn't REALLY make sense as a single message in the default channel isn't annoying, but people hate it anyway

sinful jolt
#

alota ppl have it as welcome or announcement channel

#

so it pisses them off

ruby mesa
#

Who here uses N.JS?

fiery goblet
#

node?

ruby mesa
#

Mhm

tawny lava
#

like 90% of us use node

empty moat
#

me

#

^

ruby mesa
#

gg

fiery goblet
#

85% does

empty moat
#

im working on a party system ^w^

ruby mesa
#

Anyone here use the bot lists' API?

fiery goblet
#

90% does

empty moat
#
if (message.channel.id === relayChannelA) {
    client.channels.get(relayChannelB).send(`${message.author.username} said ${message.content}`);
} else if (message.channel.id === relayChannelB) {
    client.channels.get(relayChannelA).send(`${message.author.username} said ${message.content}`);
}

// some of the code lol
ruby mesa
#

I've been trying to POST bot guild data for a while...

#

All without success..

weary shoal
umbral pelican
#

the bot needs to be accepted before you can post

ruby mesa
#

WHY DOESN'T ALL BOT LIST SERVERS HAVE THAT CHANNEL?

umbral pelican
weary shoal
#

Because other bot lists are dumb

tawny lava
#

rekt

umbral pelican
#

Because other bot list users aren't dumb

sinful jolt
#

lol

ruby mesa
#

¯_(ツ)_/¯

empty moat
#

lol

empty moat
#

(yuh, its using discord.js)

sinful jolt
#
const snekfetch = require('snekfetch')
snekfetch.get(`https://discordbots.org/api/bots/${client.user.id}/votes`)
  .set('Authorization', 'UR DBOTS.ORG KEY')
  .then(r => console.log(r))
  .catch(e => console.warn('dbots.org down spam @oliy'));```
weary shoal
#

lol

empty moat
#

do i have to install snekfetch by npm? xd

umbral pelican
#

you already have it installed

weary shoal
#

snekfetch comes with discord.js

empty moat
#

oh ok

#

where can i find the key?

weary shoal
#

At the bottom

empty moat
#

thx

umbral pelican
#

or at the top if your screen is upside down

empty moat
#

lul

weary shoal
#

lol

empty moat
#

its soo long

weary shoal
#

lmao

empty moat
#

can i use the r thingy in other parts of the cmd

#

like in my embed

#

i tried but it crashed

#

and said r is not defined

umbral pelican
#

what is the r thingy? WaitWhat

#

oh

#

.then(r => console.log(r)) ?

sinful jolt
#

You have to do the stuff in the .then

empty moat
#

oh

#

can i do { xxx }

#

?

weary shoal
#

ya

empty moat
#

oke thx

#

it still says r is not defined 😐

#
if (msg.content.startsWith(prefix + `votes`)) { 
        snekfetch.get(`https://discordbots.org/api/bots/${bot.user.id}/votes`)
  .set('Authorization', 'is like blanked out')
  .then(r => {
            console.log(`[Quixl] Total discordbots.org votes: ${r}`)
            const embed = new Discord.RichEmbed()
            .setColor(0x2F69DF)
  .setFooter("qvotes | Quixl ")
  .addField("Votes", "Total votes: " + r, true)
   msg.channel.send({embed}); 
        })
  .catch(e => console.warn('[Quixl] discordbots.org is down, votes couldn\'t be fetched.'));
    }

thats my code im using

sinful jolt
#

r.body

#

o

empty moat
#

it says that r is not defined (uner the .addField)

#

under*

sinful jolt
#

Try

#

r.body.size

empty moat
#

oh ok

weary shoal
#

no

empty moat
#

instead of just r?

weary shoal
#

JSON.parse(r.text).length instead of r

empty moat
#

oh

#

.addField("Votes", "Total votes: " + JSON.parse(r.text).length, true) so that?

weary shoal
#

yah

empty moat
#

oke thanks

#

do i have to change the r in the console.log too?

weary shoal
#

no

empty moat
#

oh ok

weary shoal
#

ahh

#

Your bot isnt even on the site yet lmao

empty moat
#

oh thats why ;-;

#

it hasnt been approved yet

weary shoal
#

What's its name, I'll test and approve it

sinful jolt
weary shoal
empty moat
#

oh ok

weary shoal
#

@empty moat done™

empty moat
#

oh yay thanks 😄

#

@elfin iron is finally here xd