#development

1 messages · Page 357 of 1

crude mantle
#

ok

#

i havnt used emoticons before in bots so idk

late siren
#

okey

languid dragon
#

is there a way i can access both "D" and "E" to send it through the function?

crude mantle
#

what does d function do

languid dragon
#

it doesn't matter what the function does

crude mantle
#

idk what ur trying to do :/

languid dragon
#

i just explained what im doing

crude mantle
#

i dont understand lol

languid dragon
#

I want {D:{}, E:{}} aka the "module.exports" to go through the function

#

i was wondering if i was able to achieve it like above, or if there is an alternate way without me taking the entire module from my map

tawny lava
#

@languid dragon I think you can do this.D or this.E

languid dragon
#

ty lizar ❤

craggy thistle
glossy sand
#

for the record i'm pretty sure the proper way to accomplish it is to define d and e in the module then export them later

#
let D = ...;
let E = () => D;
module.exports = {D, E};
languid dragon
#

ah

#

well it worked

#

with just module.exports

quiet bobcat
#

How can I make so if there is an error it doesn't continue with the code?

#

Like if a command is missing permissions

#

Using discord.js

indigo notch
#

return;

quiet bobcat
#

Still sends?

#
                .catch(error => {
                    return message.channel.send(`**Error: ${error}**`); 
                });
            message.channel.send({embed: {
            description: `**Sucessfully delted ${args[1]} messages.**`,
            color: 0xb93a32
            }})``` That's the code for it
glossy sand
#

@quiet bobcat when js throws an error, it immediately stops execution up to the outermost try...catch block

quiet bobcat
#

Isn't that a catch block?

glossy sand
#

@quiet bobcat oh i see

#

you can't really do that with the callback pattern

#

either stick your "messages successfully deleted" code into a success handler for the promise or use the async/await pattern

quiet bobcat
#

How do I do the async/await pattern?

glossy sand
#

google it

#

i'm gonna be busy for a bit sorry

quiet bobcat
#

Ok

worn ridge
#

I dont have a website, can my bot get certified nonetheless? (because of this requirement: The use of at least one of our widgets on your website/github page.)

mighty barn
#

There's nowhere where you can put the widget?

#

@worn ridge

worn ridge
mighty barn
#

Hmmm, might count. But you can put it in the reame.md if you have your bot on github

worn ridge
#

I dont, but I can put it on github .. 🙃

quiet bobcat
#

How can I add to a value without making it stack. I want it to be eg 100 and I get 100 so it's 200 but instead it's I have 100 and get 100 and I get 100100 for some reason? Any way to just add it like addition instead of adding it after the current value?

#

Using discord.js

languid dragon
#

if its a string

#

parseInt(string) to make it an integer (i think i spelt it right)

quiet bobcat
#

It is a string but I still can't add to it

#

It does nothing

topaz fjord
#

@quiet bobcat show code

quiet bobcat
#

I looked up parseInt and it showed me to do this

#

parseInt(currency[message.author.id + message.guild.id].money) + args[2]

#

@topaz fjord

topaz fjord
#

you have to parseint args[2]

#

since thats a string

quiet bobcat
#

?

topaz fjord
#
currency[message.author.id + message.guild.id].money + parseInt(args[2])
quiet bobcat
#

So parseInt(currency[message.author.id + message.guild.id].money) + parseInt(args[2])

#

ok

#

Still doesn't work

topaz fjord
quiet bobcat
#

Tried that aswell

#

oh

#

ok

#

Still didn't work

topaz fjord
#

well fuck

quiet bobcat
#

Got any other ideas?

long forge
#

Yo @surreal peak the video search command I have only allows for YouTube videos to be searched. None of which are “nsfw” (by which I’m assuming you mean pornographic), so I’m not sure how I could change that...

heady bough
#

How can I get guildMember from message.author?

surreal peak
#

Uhh some of them are @long forge

#

that's why you dont see bots with that command 99% of the time

long forge
#

Wait really? There’s porn on YouTube? Jesus. Ok well then I guess I’ll remove that command then.

#

Never intended bot to have that

surreal peak
#

oki

#

for the better i guess

#

some stuff such as "naked art"

#

even seen some sex guides with real people -_-

#

so yea bad idea

heady bough
#

Could it be better to add a tag blacklist to the search, so it will fail on non-NSFW channels if an NSFW tag is used?

long forge
#

There’s an idea.

heady bough
#

That's what I use for my booru commands anyway, and it seems to work well

shell grotto
#

I can't believe I've gone almost an entire month without realizing that discord.js pretty much requires the error event to be handled.

#

🤦

unique star
#

lol wat

#

I mean unhandled rejections basically does the same lol

#

but that's not d.js

#

that's node for you

shrewd field
#

How can I make like this and then set a modlog channel to something and it updates?

topaz fjord
#

use a db

shrewd field
#

no

languid dragon
#

well goodluck lul

#

its either user a Database or

#

Dadadadont

shrewd field
#

here I will post image

#

here is example

mighty barn
#

Still wating

heady bough
#

I added a prefix table to my discord.js bot, but now I need to count the number of characters up to and including the !

#

How would I do this?

shell grotto
#

Pretty sure there's a string position function in JavaScript. Just look that up.

#

Though keep in mind people might use ! for punctuation

#

Or maybe I'm not understanding

slow elk
#

@shrewd field What library do you use?

languid dragon
#

d.js

indigo notch
#

Eris is better

slow elk
#

He could either use the SQLite module thing. I use SQLite too, for now.

indigo notch
#

@heady bough use A regex

#

I use mongo, eris & regex for my prefix

#

custom

inner jewel
#

i just use string manipulation

#

check if it starts with prefixes

crude mantle
#

whats needed for a randomizer?
ive defined result as

"rock", 
"paper", 
"scissors"
];``` but idk how to send 1 of those in a message
rose hazel
#

Math.random()

long forge
#

Is that the right format?

crude mantle
#

i guess

#

what language is ur bot written in (py, java, js etc)

long forge
#

js

#

js

#

that the right format for js?

languid dragon
#

mmmmmmm

crude mantle
#

how to use Math.random()?

languid dragon
#

array[Math.floor(Math.random() * array.length)]

crude mantle
#

what is array defined as

languid dragon
#

its an array?

crude mantle
#

oh

#

but how does it know to get it from result variable

languid dragon
#

that

#

is how

#

you do it

#

(╯°□°)╯︵ ┻━┻

rose hazel
#

what?

crude mantle
#

ok

rose hazel
#

you're using result as your array, are you not?

crude mantle
#

idk

#

wait don't i need var result because im using js

rose hazel
#

you're just taking its length and multiplying it by Math.random() which returns a variable between 1 and 0.00(god knows how many zeros) and flooring it

languid dragon
#
let options = [
"rock", 
"paper", 
"scissors"
]
let result = options[Math.floor(Math.random() * options.length)]

crude mantle
#

oo ok

#

do i need any type of things?
like require stuff

rose hazel
#

no

#

math is a part of js

crude mantle
#

ok

languid dragon
crude mantle
#

kk

#

ty for help

#

how do u do like an and in js

inner jewel
#

&&

rose hazel
#

&&

crude mantle
#

ok

#

@inner jewel

#

thanks for approving my bot

earnest phoenix
#

How to make a bot in visual studio code?

languid dragon
crude mantle
#

lol

#
"rock",
"paper",
"scissors"
];

module.exports = {
    run: function(bot, config, msg, args, suffix) {
        let result = options[Math.floor(Math.random * options.length)];
        msg.channel.send(result);
        if(suffix == "rock" && result = "paper") {
            msg.channel.send('Aww, you won');
        }
    },
    help: {
        name: 'rps',
        description: 'Play RPS With The Bot',
        usage: 'p!rps <rps>'
    }
}```
```potatoebot@server:~$ node .
/home/potatoebot/commands/rps.js:11
        if(suffix == "rock" && result = "paper") {
           ^^^^^^^^^^^^^^^^^^^^^^^^^^

ReferenceError: Invalid left-hand side in assignment```
#

help?

languid dragon
#

===

#

you're trying to set "result" to "paper" in an if statement
( this is what you're doing right now )
THIS IS WHAT
IS CAUSING ERRORS
THIS IS THE THING, YOURE DOING
THE THING UR NOT SUPPOSED TO BE DOING
variable = "test" is an assignment of a variable
variable == or === "test" is testing to see if the variable equals "test"

crude mantle
#

oo ok

#

no im checking if result is paper

#

?

#

ohh

#

i see

#

lol whoops

#

ik i saw when i went to edit

#

uhm

#

i have ```msg.channel.send('Aww, you won');

narrow flare
crude mantle
#

no

narrow flare
#

how do I know if an user is a bot or not?? anyone xd?

crude mantle
#

in js its if(msg.author.bot)

narrow flare
#

hmm will try

languid dragon
#

hes clearly not asking for js

narrow flare
#

@languid dragon it looks similar xD

#

lol, it looks like that it worked..

#

I wanted to use that for adding EXP if an user writes something (Bots were leveling up xD) . So for now, it does work....

#

@crude mantle thanks..

crude mantle
#

lol

tawny lava
#

It's pretty much the same in both libs

#

msg.author.bot

crude mantle
#

so u let bots use ur bots commands?

tawny lava
#

It's to ignore other bots

narrow flare
#

I only want the users gaining xp, so I need to ignore bots

crude mantle
#

ik

#

i have```
msg.channel.send('Aww, you won');

its saying cannot send an empty message
#

help?

#

@tawny lava

languid dragon
#

show error

crude mantle
#

I did

mighty barn
#

no no like the error

languid dragon
#

thats not the error

#

thats a small snippet of the code you think doesn't work

crude mantle
#

UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): DiscordAPIError: Cannot send an empty message

languid dragon
#

is that the entire error?

tawny lava
#

Don't think it's from that

languid dragon
crude mantle
#

yes

languid dragon
#

take screenshot

crude mantle
#

oh wait

tawny lava
#

Yeah those errors are usually that big only

crude mantle
#

i think ik

#

is it because I have
msg.channel.send(result);

#

would that be it?

languid dragon
#

probs

crude mantle
#

ok

#

ill just add a space at the enf

#

end*

tawny lava
#

Heccing discord api errors don't even give a file line

#

Trash

crude mantle
#

hm i do p-rps
my bot says undefined

#

code:```let options = [
"rock",
"paper",
"scissors"
];

module.exports = {
run: function(bot, config, msg, args, suffix) {
let result = options[Math.floor(Math.random * options.length)];
msg.channel.send(result + ' ');
},
help: {
name: 'rps',
description: 'Play RPS With The Bot',
usage: 'p!rps <rps>'
}
}```

earnest phoenix
#

Too much coding

crude mantle
#

what?

earnest phoenix
#

Coding

crude mantle
#

well u are in a development channel rn

#

with developers

earnest phoenix
#

True

#

Well i have to be here

crude mantle
#

waiting for ur bot to be approved i guess

earnest phoenix
#

Yes

crude mantle
#

lol

#

mine was approved in a few hours

earnest phoenix
#

Damn it

#

!killme

#

lel

crude mantle
gentle rock
#

how to set code to connect the bot code file to a specific folder so the bot satrts with the folder?

crude mantle
#

?

gentle rock
#

read the question

earnest phoenix
#

which lang, which lib

like do you expect people to read minds lol

gentle rock
#

js eris

earnest phoenix
gentle rock
#

how to set code to connect the bot code file to a specific folder so the bot satrts with the folder in eris?

quiet bobcat
#

How do I update to v12 discord.js?

wooden shoal
#

npm update discord.js

#

I think

quiet bobcat
#

Nope

wooden shoal
#

um

#

npm install discord.js#12

#

?

quiet bobcat
#

I think you need to get it from git or smth

wooden shoal
#

ok... then

#

npm install hydrabolt:discord.js#12.0

#

or no

#

npm install hydrabolt:discord.js#12.3.0

#

try that

#

w8 shit.

quiet bobcat
#

lol

wooden shoal
#

nevermind I have no clue what I'm talking about

quiet bobcat
#

haha

wooden shoal
#

lol

#

try 12.11

#

idk

quiet bobcat
#

Won't work

gentle rock
#

eris vs d.js which is better

quiet bobcat
#

Depends

#

In my opinion d.js

gentle rock
#

d.js starts breaking at 15k guilds

quiet bobcat
#

Ok

wooden shoal
#

isn't that what shards are for?

quiet bobcat
#

^^

wooden shoal
#

and you should start sharding at 2k guilds, so that isnt an issue that should be encountered

gentle rock
#

how do you shard?

quiet bobcat
#

And you should continue sharding every 2k guilds

#

Check the docs

gentle rock
#

d.js is easier for me to cod in

#

code

quiet bobcat
#

Go for discord.js then

#

If it's easier to code in

wooden shoal
#

^

quiet bobcat
#

It just comes down to personal preferance

#

Btw it was npm i hydrabolt/discord.js

#

@wooden shoal

gentle rock
#

i think d.js has more customisation

wooden shoal
#

o ok

#

so no need to specify the version alrighty then

quiet bobcat
#

Because that's the latest

#

which is v12

wooden shoal
#

well, master is. but that's on another branch I guess

quiet bobcat
#

That is the master

wooden shoal
#

ya

#

oh

#

._.

quiet bobcat
gentle rock
#

i found the code for sharding

#
const Manager = new Discord.ShardingManager('./YOUR_BOT_FILE_NAME.js');
Manager.spawn(2); // This example will spawn 2 shards (5,000 guilds);```
quiet bobcat
#

Yeah but you won't need it untill like 2k guilds

#

which is very hard to get

tawny lava
#

Just make a weeb bot ez 500k guilds

quiet bobcat
wooden shoal
#

lol sad but true

#

the the site says around 2.5k guilds is when you HAVE to shard

#

2.4 is when you should start

#

idk where this guy is getting 15k from lol

scenic crest
#

I recommend

#

1k/shard

narrow flare
#

What does shards do?

tawny lava
#

Discord recommends that as well iirc

elder rapids
#

Around? You mean at 2.5k

quasi marsh
#

Sharding is chipping up your bot into multiple pieces

#

It means you split up your bot over multiple processes, so that only a small number of guilds are connected to 1 process

#

You MUST shard if your bot is in more than 2500 guilds, but it is recommend to start earlier, at like 1000 guilds

#

(if your bot is more than 100k guilds, you have to make sure your shard count is in multiples of 16, but you probably won't hit that limit and things might change if you hit it one day)

narrow flare
#

@quasi marsh so, mi bot got 10 svs xDDDDDDDDDDDDDDD... so SHARD MUST BE DONE

quasi marsh
#

Certainly

#

(no, most people recommend sharding at 1000 guilds)

#

But if your bot is good, you will probably get there some day

narrow flare
#

@quasi marsh I was just joking jdsjsd, but thanks.. I think my bot could reach that number some day.. 😛

crude mantle
#

wait why do u have to shard? i dont understand

earnest phoenix
#

@earnest phoenix what discord.js ver do you use

crude mantle
#

@earnest phoenix can u help me with my code

earnest phoenix
#

ya

#

dm me

crude mantle
#

kk

quasi marsh
#

Quote from Discord4J docs
When a bot becomes part of a lot of servers it becomes too clunky to handle all the events on only a handful of threads, this is why sharding it introduced, to allow multi threaded delegation of events posted from discord to the API more efficiently.

#

Basicly, if you have a bowl of soup, you can help people get more soup if you add another spoon.

#

You can only get so much soup out of the bowl to a person with 1 spoon

#

(But in reality, the spoon is shared with 2500 other people, but when you have 5000 or 10000 people, it'll take longer, so you add more spoons)

crude mantle
#

oh

#

ok

#

so shard at every 2k?

#

just to be safe

quasi marsh
#

Yeah that's fine

crude mantle
#

how do u shard?

storm storm
#

^ xd

quasi marsh
#

What lib?

#

discord.js?

storm storm
#

mhmm

crude mantle
#

ya

quasi marsh
#

I don't use js myself, so read up on the docs

crude mantle
#

ok

quasi marsh
#

You can probably find examples on github as well

storm storm
#

or be lazy like me and wait for the dbm update xddd

inner jewel
#

the discord devs need to manually move you to the new system

quasi marsh
#

Oh

#

Like when a guild has a lot of members they need to ask for more space otherwise it'll just go down all the time?

earnest phoenix
#

@earnest phoenix idk

#

o rip

earnest phoenix
#

@crude mantle you need some help?

crude mantle
#

with?

earnest phoenix
#

i saw something about js

crude mantle
#

oh

#

im fine thanks

earnest phoenix
#

👍

wooden shoal
#

wow nvm

earnest phoenix
#

I've invited Haru to my chat trying to figure why commands dont work. Any help would be appreciated

bright spear
#

anyone know how to get the server's vanity url through d.js?

abstract mango
#

how should I display a sort of carousel thing without using js or anything?

shrewd field
#

hey

#

guys

#

who knows what is this error because of?

#

d.js

#

lib

#
client.commands = new Discord.Collection();
client.aliases = new Discord.Collection();
fs.readdir('./commands/', (err, files) => {
  if (err) console.error(err);
  log(`Loading a total of ${files.length} commands.`);
  files.forEach(f => {
    let props = require(`./commands/${f}`);
    log(`Loading Command: ${props.help.name}. 👌`);
    client.commands.set(props.help.name, props);
    props.conf.aliases.forEach(alias => {
      client.aliases.set( alias, props.help.name);
    });
  });
});```
#

code

half ridge
#

Are there there any pokemongo bots??

fathom pebble
#

@shrewd field what is props.help for?

shrewd field
#

umm

#

the name of the command in exports.help

shrewd field
#

how to get an invite for a server a bot is in. discord.js example a bot is in a server that I don't own and I am not in. how do I get an invite for that server

shrewd field
#

ok

#

creating a new invite

languid dragon
#

its not in the docs so i dont think ya can ¯_(ツ)_/¯

earnest phoenix
#

xd

languid dragon
#

Why don't you go to the actual D.JS server

#

instead of constantly asking for help here

#

You never read the documentation and constantly ask for help for the most rediculous errors

#

also my mistake, you can create invites

shrewd field
#

ok

#

i can't go to the actual D.JS server

languid dragon
#

lemme guess

#

you were banned?

shrewd field
#

yep

languid dragon
#

i wonder why Thinkeng

shrewd field
#

are you banned?

languid dragon
#

no im not banned

shrewd field
#

Ok.

languid dragon
#

i dont ask stupid questions constantly

shrewd field
#

Idk why they banned me and I don't ask stupid questions constantly.

languid dragon
#

you do

#

you're asking them here all the time

#

you never read the docs

shrewd field
#

what

languid dragon
#

we need to literally send you to the documentation every time

earnest phoenix
#

Read the docs @shrewd field

languid dragon
#

and walk you through step by step

shrewd field
#

I did read the docs when they said to read it.

languid dragon
#

you read the section we send you to

#

and come back for help every second

#

like

#

you never go to the documentation first?

shrewd field
#

No

languid dragon
#

if you did you wouldn't ask half the questions you do

shrewd field
#

Ok then how can I get unbanned?

#

and I will next time see the docs before doing that.

#

Also at that time I didn't know what was the docs for?

reef dirge
#

How to count voice chat with discord py?

bright spear
#

@languid dragon your "retarded men" link crashes discord every time I click it

languid dragon
crude mantle
#

xD

bright spear
#

That one crashed discord too

#

Could you just upload it to discord?

languid dragon
#

its nothing important lul

mighty barn
#

there

bright spear
#

Oh

#

I thought it was a screenshot of stupid questions

mighty barn
#

lol

languid dragon
#

all you need to do is search Deni in #development and you'll find a lot

shrewd field
#

OK

#

guys

#

I know what to do know.

languid dragon
shrewd field
#

ken

#

Stop.

mighty barn
#

@gilded plank demote Ken

languid dragon
#

@gilded plank demote @gilded plank

mighty barn
#

@gilded plank demote Oliy

gusty topaz
#

@gilded plank take over the server and give me admin while you're at it

quiet bobcat
#

@gilded plank demote all of the ppl that are higher ranks than me and then give me website administrator and ownership of the website plx k thx

shrewd field
#

Hey to set a modlog channel and then update it in a server settings command I need to use a database yes?

#

Like this I mean

languid dragon
#

yes

shrewd field
#

this is waht i mean

#

When I change server log to a channel it will upadte using a database

#

right?

languid dragon
#

ya

shrewd field
#

Ok

#

thx

shrewd field
#

Hey, the permssions on the oath url of a bot are they reqiured to be fullfilled all of them to do a regular command in the discord server even if the bot doesn't have the same permssions on the invite link given.

#

Because when I do a regular info command it gives meDiscord API Error Missing Permissions.

languid dragon
#

wat

scenic crest
#

just do a perm check for each command

shrewd field
#

ok

#

How do you get the name of an unbanned person from their ID.

#
fathom pebble
gusty topaz
#

User.tag

wraith burrow
#

Hello, is anyone online?

quasi sandal
#

@wraith burrow I am

wraith burrow
#

In my bot, I can't mention myself

quasi sandal
#

Use the mention format

wraith burrow
#

await client.send_message(message.channel, "@wraith burrow")

#

I use this

quasi sandal
#

<@userid>

wraith burrow
#

but it doesn't work

quasi sandal
#

Use that

wraith burrow
#

oh <>

#

i didn't use that

#

ty

quasi sandal
#

@wraith burrow

#

That is for your mention

#

(that one is escaped so it shows up like that)

wraith burrow
#

Thanks, it worked.

#

Will it also mention me in the servers which I'm not a member of?

fathom pebble
#

no

worn ridge
elder rapids
#

Your client has the user cached

#

So it can resolve the mention properly

#

Or at the very least you may share a server with that user and it caches/can resolve it

#

User/bot point is across

worn ridge
#

I dont share a server with the @gilded plank

elder rapids
#

You do, it's called here

worn ridge
#

Sorry I meant Srapy is not sharing a server with @gilded plank

elder rapids
#

To mention someone in code you can do <@123455...>

#

That's how Luca does it

worn ridge
#

But not when the user is not on the server

elder rapids
#

Yes you can

#

The mention will still go through but only resolve to a name and profile if the end user has the person cached

worn ridge
#

ah ok

night imp
#

Proof - @ember axle

#

not in this server

crude mantle
#

in my bot i put:dbl = require('discordbots');
dbl.postStats(bot.guilds.size);i got this error: ```/home/potatoebot/index.js:13
dbl.postStats(bot.guilds.size);
^

TypeError: dbl.postStats is not a function``` anyone help?

bitter sundial
#

I can't help you with that unofficial module

vital lark
#

who ever made it

#

they didn't make postStats() a function

crude mantle
#

isn't it?

bitter sundial
#

that wasn't made by me or oliy

#

so it's not part of the site

crude mantle
#

or is it discordbots-api

vital lark
#

here is an example: ```js
const snek = require('snekfetch');

snek.post(https://discordbots.org/api/bots/${<Client>.user.id}/stats)
.set("Authorization", "key")
.send("server_count", <Client>.guilds.size)
.then(() => console.log("Done"))

#

Replace <Client> with your Discord.Client()

crude mantle
#

o

#

how do i install snekfetch ? npm install snekfetch --save?

vital lark
#

npm i snekfetch

crude mantle
#

ok

#

is it 1 package?

vital lark
#

yes

crude mantle
#

ok

#

where do i put my token

vital lark
#

in the Authorization header

crude mantle
#

and what function do i put it in

vital lark
#

any

crude mantle
#

ok

vital lark
#

but I recommend the following events

#

guildCreate guildDelete ready

crude mantle
#

ok

elder rapids
#

I run it in a loop ;)

vital lark
#

Novus

#

gtfo

#

you weeb

elder rapids
#

.. ok :(

crude mantle
#

do i replace key with my token?

vital lark
#

yes

crude mantle
#

kk

vital lark
crude mantle
#

why are they so long xD

vital lark
#

because

#

that's how the devs made it

crude mantle
#

ok

elder rapids
#

Long == secure

vital lark
#
if ((long) token == "secure") return;
``` ![mmLol](https://cdn.discordapp.com/emojis/356831697385422848.webp?size=128 "mmLol")
crude mantle
#

do i need to log done?

vital lark
#

no

#

log is optional

topaz fjord
#

Long == secure

#

So my dick is secure @elder rapids

crude mantle
#

so my **** is secure?

#

omg

#

xD

vital lark
#

lul

#

@topaz fjord my dick is secure too mmLol

topaz fjord
#

Same

crude mantle
#

xD

topaz fjord
#

Long dick buddies

crude mantle
#

same

vital lark
#

lol

elder rapids
#

Oh

#

Yours isn't secure at all in that case

crude mantle
#

it didn't do anything? @vital lark

vital lark
#

it didn't?

crude mantle
#

no

#

wait it crashed

#
      throw er; // Unhandled 'error' event
      ^

Error: socket hang up
    at createHangUpError (_http_client.js:331:15)
    at TLSSocket.socketOnEnd (_http_client.js:423:23)
    at emitNone (events.js:111:20)
    at TLSSocket.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1056:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)```
topaz fjord
#

thats discords problem

crude mantle
#

how to fix

topaz fjord
#

try again

crude mantle
#

ok

#

@vital lark

#

help?

vital lark
#

it's probs Discord

crude mantle
#

how to fix

vital lark
#

nothing

#

probs reset your token

#

or let Discord handle it

crude mantle
#

ok

#

@ohlookitsAugust#1793

#

@ohlookitsAugust#7360

#

@vital lark

vital lark
#

yes

crude mantle
#

ok

vital lark
topaz fjord
#

@crude mantle show code pls kthx

crude mantle
#

what code

topaz fjord
#

the code your using to send

crude mantle
#

k

#
            .set('Authorization', 'my token')
            .send('server_count', bot.guilds.size);```
neon pasture
#

You sure .bot is right?

#

Isn't it .client

topaz fjord
#

you are putting the token as your dbots token right?

crude mantle
#

mines set to bot

topaz fjord
#

amd mot bot token

crude mantle
#

yes

#

@topaz fjord

#

helpp0

quiet bobcat
#

Can someone help me? I'm using discord.js and I'm trying to figure out a way to add a value to my json file. I want to add to the number using addition but right now I'm using js currency[message.author.id + message.guild.id].money += '100'; and instead of making the two values eg 200 is makes them 100100

livid mango
#

@quiet bobcat why tho

#

anyways

#

you want 1+1=2

quiet bobcat
#

What do you mean?

livid mango
#

not 1+1=11 right

#

or the reverse

quiet bobcat
#

Yes

#

I want 1+1=2

livid mango
#
parseInt(first_object) + parseInt(second_object)
#

two objects must be strings containing a number

quiet bobcat
#

it didn't do anything

#

Should I do like math.round(parseInt(firstobject) + parseInt(second_object)?

#

or math.floor

#

or whatever

unique surge
topaz fjord
#

kek u cant add a string to a number

quiet bobcat
#

both are strings though?

topaz fjord
quiet bobcat
#

hm

topaz fjord
#

can u also do

#
console.log(typeof currency[message.author.id + message.guild.id].money)
quiet bobcat
#

It worked for me aswell

#

hm

#

brb

#

in eval that is

#

but didnt work else

topaz fjord
#

did u console.log the thing i told u to

quiet bobcat
#

Yup

topaz fjord
#

what did it say

quiet bobcat
#

string

topaz fjord
#

so

#

can u do

quiet bobcat
#

wait

#

brb

topaz fjord
#
console.log(typeof parseInt(currency[message.author.id + message.guild.id].money))
quiet bobcat
#

It says number @topaz fjord

topaz fjord
#

so then

#
console.log(parseInt(currency[message.author.id + message.guild.id].money) + parseInt('100'))
#

what does that return

#

@quiet bobcat

quiet bobcat
#

200

topaz fjord
#

so then thats what you have to use :/

#

without the console.log

quiet bobcat
#

yeah

#

That's what I have

topaz fjord
#

then it should work Thonk

quiet bobcat
#

ik

#

It stopped adding completeley

#

it's still the same after I added 100 to my balance

#

The balance is still 100

#

when I tried to add 100

#

@topaz fjord

topaz fjord
#

Hmm

#

Idk then

quiet bobcat
#

😦

#

should I try to do parseint on one

#

and then just a number as the other?

#

@topaz fjord zoomeyes

devout laurel
#

f*help

quiet bobcat
ripe ocean
#

@earnest phoenix

narrow flare
#

How many times my bot can change its Playing status?? I mean, how often should I set the period to not get banned?

crude mantle
#

@topaz fjord my bot is still broken :/

#

stupid discord

inner jewel
#

@narrow flare 1/15s

umbral pelican
#

my bot's playing status updates whenever it joins/leaves a server drakeLUL

narrow flare
#

@inner jewel thanks..

umbral pelican
#

also, isn't it 5/60s

elder rapids
#

ya

#

1/15s

#

Good enough not to ratelimit

#

If you ratelimit your bot game status you get d/c from the gateway

split adder
#

Dunno ho I'm supposed to tell, but I fixed the reason why my bot was muted.

earnest phoenix
#
parseInt(currency[message.author.id + message.guild.id].money) + 100)

or just this @topaz fjord @quiet bobcat Thonk

heck why not just save the money property as a number to begin with and you wouldnt need to parse anything?

quiet bobcat
#

I don't know actually

#

Might need to change that

#

🤔

earnest phoenix
#

@quiet bobcat
if it's stored in JSON then you could even make it be stored like so. Then if you load the json (lets say it is in a let called jsondata) then you could do jsondata[msg.guild.id][msg.author.id].money

{
    "guildID": {
        "memberID": {
            "someProp1": "someVal1",
            "money": 100
        }
    }
}

I use sort of a similar structure in my own bot's warning system so it should work
I personally use jsonfile: https://www.npmjs.com/package/jsonfile

mental willow
#

can someone help me with getting this bot running as i am trying to code python.

old bridge
#

Have tou tried getting an eclipse platform for python?

#

Try eclipse pydev

frail kestrel
#

use rewrite

#

it’s cooler

earnest phoenix
#

@floral stump

#

A friend made me my script with python for the command "kick" but I know almost nothing xD. Watch the script ↓

            if message.author.id in botadmins:
                utilisateur = userSearch(parametres[0], guild=message.guild)
                await message.guild.kick(utilisateur)
floral stump
#

idk pytrhon

earnest phoenix
#

:d

floral stump
#

there is an E after command tho

#

might be it

#

also show error

earnest phoenix
#
Ignoring exception in on_message
Traceback (most recent call last):
  File "C:\Users\BANIEN\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\client.py", line 223, in _run_event
    yield from coro(*args, **kwargs)
  File "C:\Users\BANIEN\Desktop\Dossier Emmanuel\#1\#2\Bot.py", line 128, in on_message
    elif command == "kick":
NameError: name 'command' is not defined 

XDD

lethal sun
#

define command

#

command = something

#

ezpz

chilly dawn
#

Hey guys, I need a bot that can convert time zone in chat.. do you know something?

#

I have another problem too.. I can’t find my server from the list.. why?

north fog
#

if it is truely your server that you madem then you should be able to find it, if you didn't made the server then you need to have administration perms

neat falcon
#

actually

#

you just need manage server perms

north fog
#

is that not the same as administrator ¿¿¿

neat falcon
#

no

#

manage server just gives perms to add bots, and edit name etc

north fog
chilly dawn
#

I already had some servers, but I created a new one too for test, called TEST, but still can’t find it..

earnest phoenix
#

I have a superagent post request & the reply of the API is an Image in the body but superagent get it like a Buffer, how I can transform that buffer to an image?

#

The console.log of the request

bitter sundial
#

it is an image

#

just the raw binary data

earnest phoenix
#

Yeah so how I transform that

#

like that Discord be happy

#

and can embed that

bitter sundial
#

you can just fs.writeFile it and it'll be an image file

#

oh

#

you should be able to just send that buffer

earnest phoenix
#

lol no

bitter sundial
#

what lib?

earnest phoenix
#

eris

bitter sundial
#

lol

earnest phoenix
#

lol im idiot

bitter sundial
#

embeds dont take files

#

it needs an url

earnest phoenix
#

I did image.url

#

im retarded

#

I added it

#

yay worked without embed

inland salmon
#

!stats

#

.stats

#

t@stats

frigid juniper
#

@inland salmon Not here

inland salmon
#

@frigid juniper idk

frigid juniper
#

Yeah bots are not allowed here

crude mantle
#

how to calculate total users? is it bot.guilds.users.size

#

js ^

glossy sand
#

uh not quite

#

guilds is a collection of guilds, so it almost certainly has no property called users

#

more likely there's some field called bot.users that stores cached users

crude mantle
#

p

#

o*

#

so bot.users.size?

glossy sand
#

or if you want to only include users in the bot's guilds, you can map each guild to its member count and fold the resulting list with a summing combiner

#

er i guess so

crude mantle
#

ok ty

topaz fjord
#

No

#

bot.users.size only accounts for online users

crude mantle
#

o

#

what then

#

@topaz fjord

topaz fjord
#

Make a forEach statement to get the size of each guild then add them together

crude mantle
#

ok

glossy sand
#

there are... more idiomatic ways

crude mantle
#

how do u get guilds? bot.guilds

glossy sand
#

you could use monadic operations

#

yes

crude mantle
#

ok

#

so

#

forEach(bot.guilds as guilds) {
}
then what?

glossy sand
#

ehhhh

#

that's not javascript syntax lol

crude mantle
#

ugh

#

im used to php lol

#

not js

zealous veldt
#
bot.on('message', msg => {
    r.db('moosebot').table('guilds').get(msg.guild.id).run().then(data => {
        if (data) {
            var prefix = data.prefix;
            console.log(`Guild: ${msg.guild.name} - prefix: ${prefix}`)
            if (msg.content.startsWith(prefix)) {
              if (!msg.channel.permissionsFor(msg.guild.me).has('SEND_MESSAGES')) return;
              let args = msg.content.slice(config.prefix.length).trim().split(/ +/g);
              let command = args.shift().toLowerCase();
              let commands = require('./modules/cmds.js')
              console.log('pre try');
              try {
                console.log('post try');
                if (commands[command]) {
                  console.log('pre perms');
                  let perms = {
                    embed: msg.channel.permissionsFor(msg.guild.me).has('EMBED_LINKS'),
                    manage_server: msg.channel.permissionsFor(msg.guild.me).has('MANAGE_GUILD')
                  }
                  console.log(`passed perms`);
                  commands[command].func(msg, args, {embed: true}, bot, prefix);
                }
              } catch (e) {
                console.log(e);
              }
            }
        }
    })
});```
This makes it to the if statement, then nothing happens
topaz fjord
#

@zealous veldt which if Thonk

zealous veldt
#

if(commands[command])

topaz fjord
#

Wth is that CMD handler...

crude mantle
#

xD

zealous veldt
#

a custom one

glossy sand
#

not using async/await in 2018

crude mantle
#
      if(msg.author.bot || msg.channel.type === 'dm' || !msg.content.startsWith(prefix)) return;
      var command = msg.content.split(' ')[0].slice(prefix.length).toLowerCase();
      var args = msg.content.split(' ').slice(1);
      let suffix = args.join(' ');
      var cmd = commands.get(command);
      if(cmd) {
          try {
              cmd.run(bot, config, msg, args, suffix);
          } catch(err) {
              console.error(err);
              msg.channel.send('Oops, Something Wen\'t Wrong! Please Contact PotatoeTheDev#6123');
          }
      }
  });
``` thats mine
#

oo i need to remove that if statement lol

topaz fjord
#

I used a async await one

#

And event handler

crude mantle
#

how to do forEach in js?

inner jewel
#

x.forEach(y=>doStuffWithY(y))

glossy sand
#
for (const thing of collection) {
  // do something
}
tawny lava
#

Google tbh

crude mantle
#

x is defined as?

#

google Isn't helping

inner jewel
#

if mayo was still here he'd say "use map because it's faster than foreach"

glossy sand
#

there are a great many ways to iterate in js lol

crude mantle
#

ok

tawny lava
#

Lul yes

glossy sand
#

but are you familiar with monads?

crude mantle
#

no

glossy sand
#

ok then yeah use a for...of loop i guess

crude mantle
#

how do u define something as something in for loop?
for(bot.guilds as servers)?

topaz fjord
#
crude mantle
#

k

#

what would i need?

earnest phoenix
#

This channel is nothing but js feelssadman

topaz fjord
#

Just read the articles they will help you out

crude mantle
#

kk

#
const guilds = bot.guilds;

guilds.forEach(function(guilds) {
    //add users
});```
this?
topaz fjord
#

your getting there

crude mantle
#

what did i do wrong?

topaz fjord
#

nothing

crude mantle
#

ok

#

now how would i add them?

#

guilds + guilds.users?

glossy sand
#

no it's like

#

suppose you have an array of numbers and you're trying to find the sum

#

that's essentially the problem you're trying to solve here

abstract mango
#

@earnest phoenix you should use ext.commands

#

will work WAY BETTER

radiant citrus
#

sure

#

i took classes

#

i wasnt listening]

#

lol

reef dirge
#

How to set bot music play speed with discord.py? (youtube_dl)

elder rapids
#

Uhhh can you even

#

I know one way and that's lowering the frequency of audio you send to Discord lul

#

44,100 doubles playback speed on Discord

#

I messed with audio on Discord a lot

reef dirge
#

oh thanks
Let me try.

elder rapids
#

In all honesty though I don't know the easy way

#

I use custom libraries and I found that as a funny thing

#

but it does work

#

not recommended changing frequency though

quiet bobcat
#

Is there still a way to fetch messages in discord.js v12?

bitter sundial
#

yes

quiet bobcat
#

oh, thanks didn't see that

quiet bobcat
#

Uhm, can someone help me? I'm using discord.js v12 and have a music bot, but when I wan't to play music on it. I make it join the server and start playing a song. It sends the message that it's added to the queue but then it leaves. I tried console logging it aswell and everything worked out fine. But still no music. There's no errors in the console at all so I don't even understand where to start looking.

bitter sundial
#

send your code

quiet bobcat
#

This is what I use to start playing the music ```js
if (!message.guild.voiceConnection)
message.member.voiceChannel.join().then(function (connection) {
if (!server.dispatcher)
play(connection, message);

})
else {
if (!server.dispatcher)
play(message.guild.voiceConnection, message);

}```

#

It worked fine two days ago, haven't changed the code since. I don't understand what's wrong

quiet bobcat
#

Here's the play function (forgot it) ```js
function play(connection, message) {
var server = servers[message.guild.id];

nowplaying[message.guild.id] = server.queue.shift();
var video = nowplaying[message.guild.id];

if (!server.dispatcher) {
    message.channel.send({embed: {
        color: 0x82eefd,
        description: `[**Added to the queue:**](${video.url})  \n${video.title}`,
        thumbnail: {
        url: video.thumbnail
        }
        }})
}
log("I have started playing \"" + video.title + `" in ${message.guild.name}!`)

server.dispatcher = connection.playStream(YTDL(video.url, { filter: "audioonly" })); 
if (volume[message.guild.id]) 
    server.dispatcher.setVolume(volume[message.guild.id]); 

server.dispatcher.on("end", function () {
    nowplaying[message.guild.id] = null;
    if (server.queue.length > 0)
        play(connection, message);
    else {
        connection.disconnect();
        server.dispatcher = null;
    }
});

}```

jagged birch
#

if(server.dispatcher = null) {
connection.disconnect();
}

(add instead of else at the end of your code)

I have no clue, but give it a shot. Now it should only disconnect when there is no song playing right? I have no experience with anything to do with music bots though so I could be wrong.

quiet bobcat
#

It's worth a shot

#

Well it doesn't disconnect anymore

#

But there still isn't any music

jagged birch
#

hm ok, idk then. 😢

quiet bobcat
#

Thanks for the try

jagged birch
#

wait add in a line that says if the queue = null then disconnect, i dont have time to write the code

quiet bobcat
#

No, still doesn't work

#

or

#

wait

#

Didn't read it all LUL

#

Still doesn't play :/

jagged birch
#

Ah I dunno then, ask someone else. Sorry man

quiet bobcat
#

Yeah, it's ok.

#

nvm fixed it, just had to update ytdl-core LUL

jagged birch
#

Oh haha, nice.

jagged birch
#

Can someone help me with a command, im using discord.js btw. I'm trying to make a command so if the bot joins a server it sends a message automatically. It works, but it seems if there is no #general channel the bot crashes. This is my code:

client.on('guildCreate', guild => {
guild.systemChannel.send(Hello, I'm LMAOBOT. Thanks for inviting me, here are a list of all my commands! :alien:, {embed:{
title: '❌ Prefix',
color: 0x2471a3,
description: "The prefix for all my commands is 'lmao', e.g: 'lmao help'.",
fields:[
{
name: '🎉 Fun',
value: 'agree, dankrate, gayrate, 8ball, meme, pun, roll, coinflip, doge, kappa, lenny, lol, megusta, pepe, sanic, spiderman, spooderman, troll, wat, dolan, notsure, alone, pupper, kitty'
},

            {
                name: '🛠 Utilities',
                value: 'help, ping, invite, servers'
            },

            {
                name: '🔊 Sound Board - WARNING (EARRAPE)',
                value: 'reee, airhorn, momgetthecamera, 20thcenturyfox, dedotatedwam, friendzoned, gofuckyourself, gottagofast, illuminati, ohmygod, pussy, sadviolin, smokeweed, ohbabyatriple, wombocombo, wow'
            }
        
            ],
        
        footer: {
            text: 'LMAOBot created and developed by Pete#4164.'
        }
}});

});

Would anyone be able to help me fix this, I had a look on the discord.js library and I couldn't change guild.systemChannel.send to guild.defaultChannel.send because they removed that. Is there another command that sends the message to the first channel the bot has perms to?

quasi sandal
#

loop over all the channels and check if the bot has read + write perms

jagged birch
#

I made a whole new server with no roles or anything added and removed #general and made a new text channel with no perms, it wouldn't send.

#

said "TypeError: Cannot read property 'send' of undefined"

quasi sandal
#

that's why you need to loop over every text channel

jagged birch
#

the bot has read and write perms

quasi sandal
#

did you not read what i said?

jagged birch
#

ohhhhh gotcha

shrewd field
#

Hey guys I have this error that says cant find commands/general module but I dont have any general modules.

#

I see it only loads two commmands and when it reaches the help command it gives the error

#

the error is ```css
Error: Cannot find module './commands/general'
2:27 PM

at Function.Module._resolveFilename (module.js:489:15)

2:27 PM

at Function.Module._load (module.js:439:25)

2:27 PM

at Module.require (module.js:517:17)

2:27 PM

at require (internal/module.js:11:18)

2:27 PM

Jump to
at files.forEach.f (/app/app.js:38:17)
2:27 PM

at Array.forEach (<anonymous>)

2:27 PM

Jump to
at fs.readdir (/app/app.js:37:9)
2:27 PM

at FSReqWrap.oncomplete (fs.js:135:15)```
jagged birch
#

you've probably mentioned ./commands/general somewhere in your code. Press Ctrl+F on your code editor and search for ./commands/general and edit/delete it.

#

Does anyone know how I can restrict commands to upvoters only? I know the api but how will I get my bot to read it?

north fog
#

@earnest phoenix do you let JDA call a build function ¿¿

#

well, no reaction, can't help you then

earnest phoenix
#

i did

north fog
#

can you show (copy paste in a codeblock) how ? (remove the token if it is in there)

earnest phoenix
#

is on tfpatches

#

im trying to use seth code

north fog
#

¿¿

earnest phoenix
#

@north fog

north fog
#

wierd, it should work

earnest phoenix
#

yeah

jagged plume
#

lmao

north fog
#

try adding a onready listener

earnest phoenix
#

is resulting offline

north fog
#

look if onready gets fired

#

got some kotlin code by hand```kotlin
class OnReadyReport : EventListener{
override fun onEvent(event: Event?) {
if(event is ReadyEvent){
println("Logged in as ${event.jda.selfUser.name}")
}
}
}

earnest phoenix
#

alright

stone kiln
#

override fun

#

nice

ebon apex
#

Alright whatcha need @earnest phoenix

earnest phoenix
#
const dbl = require("dblposter");
const DBLPoster = new dbl(`API KEY`);

// Then, depending on what you called your client
DBLPoster.bind(client);

sooo i just put this in guild add and remove?
the code

ebon apex
#

If you wanna use the module yes that would work

earnest phoenix
#

and ofc install dblposter

ebon apex
#

Make sure you require the module out of the event

earnest phoenix
#

out.. so like at line 4 of bot.js not where guildadd etc..

ebon apex
#

Actually

#

That does all that for you

#

just put that anywhere in your code

earnest phoenix
#

oh k

ebon apex
#

That explains it

earnest phoenix
#
const dbl = require("dblposter");
const DBLPoster = new dbl(`the api key i need`);

// Then, depending on what you called your client
DBLPoster.bind(bot);``` should match my bot then
ebon apex
#

Yes that should work

earnest phoenix
#

okay thx

ebon apex
#

np

earnest phoenix
#
0|jb       | Error: 400 Bad Request
0|jb       |     at _response.transport.finalizeRequest.call.then (/home/pi/Desktop/jb/node_modules/snekfetch/src/index.js:198:23)
0|jb       |     at <anonymous>
0|jb       |     at process._tickDomainCallback (internal/process/next_tick.js:228:7)

#

@ebon apex help

ebon apex
#

Have you gotten the api key and put it in the spot

earnest phoenix
#

yes

ebon apex
#

Let me see how you have your code, jsut replace the key with something else before posting here

earnest phoenix
#
0|jb       | Error: 401 Unauthorized
0|jb       |     at _response.transport.finalizeRequest.call.then (/home/pi/Desktop/jb/node_modules/snekfetch/src/index.js:198:23)
0|jb       |     at <anonymous>
0|jb       |     at process._tickDomainCallback (internal/process/next_tick.js:228:7)

``` i used \` now and got this error
ebon apex
#

That would mean it's not getting the key

earnest phoenix
#

wuttt

#

;-;

ebon apex
#

400 bad request is odd

#

That means something was provided incorrectly

#

401 means the key was not gotten by the api

topaz fjord
#

Why not just use snekfetch

ebon apex
#

It might be eaiser to just post it manually without using the pre-built module

#

sec

#
// bot is your Discord client.
const snekfetch = require('snekfetch');
const key = 'YOUR DBL KEY';

snekfetch.post(`https://discordbots.org/api/bots/${bot.user.id}/stats`)
    .set('Authorization', key)
    .send({ server_count: bot.guilds.size })
    .then(() => console.log(`Posted to dbl.`))
    .catch((e) => console.error(e));
topaz fjord
#

^

ebon apex
#

I edited it to be without shards that should work fine

earnest phoenix
#

oki

#
0|jb       |     at Object.<anonymous> (/home/pi/Desktop/jb/bot.js:17:61)
0|jb       |     at Module._compile (module.js:635:30)
0|jb       |     at Object.Module._extensions..js (module.js:646:10)
0|jb       |     at Module.load (module.js:554:32)
0|jb       |     at tryModuleLoad (module.js:497:12)
0|jb       |     at Function.Module._load (module.js:489:3)
0|jb       |     at Object.<anonymous> (/usr/local/lib/node_modules/pm2/lib/ProcessContainerFork.js:73:21)
0|jb       |     at Module._compile (module.js:635:30)
0|jb       |     at Object.Module._extensions..js (module.js:646:10)
0|jb       |     at Module.load (module.js:554:32)

#

@ebon apex

ebon apex
#

what is line 17

earnest phoenix
#

uhh

#

this

#
snekfetch.post(`https://discordbots.org/api/bots/${bot.user.id}/stats`)```
ebon apex
#

Is your client defined as bot

earnest phoenix
#

yes

ebon apex
#

Alright I think I know what the problem is

earnest phoenix
#

y

ebon apex
#

Make sure the top two variables (The require and the key variables) are at the top of your file then the snekfetch.post part is in your ready event and your guild create and delete event

earnest phoenix
#

is IN?

#

ohh

#

lol

ebon apex
#

It's because the bot.user is not defined until the client is logged in

#

and it's trying to call it before that

earnest phoenix
#

okay

#

a ton of errors

ebon apex
#

For the errors

#

and I can see if I can help you out

earnest phoenix
#

finally it works..

ebon apex
#

Alright

#

hell yeah

#

nice

earnest phoenix
#

"posted to dbl"

#

yey

ebon apex
#

I can see that

#

Nice

#

Good luck with your bot 😃

earnest phoenix
#

lel

#

thx

#

btw u should check it out

#

xD

lime sluice
#

o

tacit sleet
#

m!help

quiet bobcat
solid ruin
#

im using this code for a google command (command handler heh) but for example when i search whatever things it outputs anything related to google (example: i search youtube and it gives me out the yt channel of google)

const snekfetch = require('snekfetch');
const querystring = require('querystring');
exports.run = async (bot, message, args) => {
  let searchMessage = await message.reply('Searching... Sec.');
  let searchUrl = `https://www.google.com/search?q=${encodeURIComponent(message.content)}`;
  return snekfetch.get(searchUrl).then((result) => {
    let $ = cheerio.load(result.text);
    let googleData = $('.r').first().find('a').first().attr('href');
    googleData = querystring.parse(googleData.replace('/url?', ''));
    searchMessage.edit(`Result found!\n${googleData.q}`);
  }).catch((err) => {
    searchMessage.edit('No results found!');
  });
}```
earnest phoenix
#

Byte

#

how do i get my dbl key?

abstract mango
#

oof

crude mantle
#

how to use api to post server count?

#

@inner jewel

inner jewel
crude mantle
#

doesn't work

#

says the function doesn't exist

#

@inner jewel

earnest phoenix
#

maybe... you should try doing it yourself first beforehand copypasting code?

topaz fjord
#

what are you using

crude mantle
#

js

#

i think ik why tho

#

lemme try again brb

zealous veldt
analog breach
#

rethonk

shut heron
#

Ok I give up on finding a good youtube video to help me code my bot somebody tell me the program or just what to use and where

carmine berry
#

what lang do you plan to/are using

shut heron
#

I had no fucking clue

#

I just started

carmine berry
#

there is step one choose a lang

shut heron
#

shit man I need life advice now

#

ok

#

javascript

#

why not

carmine berry
#

now look at the many libs for discord in js

#

most if not all libs have docs for you to look at

#

@shut heron

shut heron
#

thanks

shut heron
#

@carmine berry Whats the program I put the code in? I can't find it _('-')_/

carmine berry
shut heron
#

thanks

carmine berry
#

wait you means to run it right?

shut heron
#

yeah

carmine berry
#

then yes the link up there

jagged birch
#

how do I restrict commands so you have to upvote to access them?

glossy sand
#

you can query the dbl api

jagged birch
#

How would i do that, is this correct?

var voteapi = "https://discordbots.org/api/bots/398413630149885952/votes";
client.on('message', message => {
if(message.content.startsWith(prefix + " test")) {
snekfetch.get(voteapi).then(r => console.log(r.onlyids));
}
});

I have no experience with json or api's so its a tad hard trying to figure this out

bitter sundial
#

without onlyids you get other stuff like username too

jagged birch
#

ahhh righto, thats what I was looking for, thanks.

mental willow
#

is this the right code to join a voice channel in python

#

@dusk verge.command(pass_context=True
async def play
bot.join_voice_channel()

frail kestrel
#

read docs

low rivet
#

i don't think so

inner coral
#

anyone know how to use discordblocks?

ebon apex
#

It's a drag and drop bot builder, it's not that hard.

inner coral
#

i did not figure it out

raven hawk
#

When I try to get bot stats from the api, it gives 301, why?