#development

1 messages ยท Page 374 of 1

earnest phoenix
#

it didnt

quiet bobcat
#

Any errors?

carmine berry
#

send the code ill try on me bot

earnest phoenix
#

'test': (msg) => {
msg.channel.send({embed: {
color: 3447003,
description: "A very simple Embed!"
}});

carmine berry
quiet bobcat
#

same

earnest phoenix
#

how do you get eval?

quiet bobcat
#

also in the guide

#

That guide almost has everything

#

I know your error btw

earnest phoenix
#

i cant open chrome and discord at the same time

quiet bobcat
#

Don't think you can be doing 'test': (msg) => { }

earnest phoenix
#

one of them crashes

quiet bobcat
#

which is why you get the syntax error

earnest phoenix
#

well '': (msg) => { works on all of my bots

quiet bobcat
#

You sure you did the command handler correctly?

carmine berry
#

doesnt it say what line that unexcpected token is on

quiet bobcat
#

^

earnest phoenix
#

im just not gonna

#

can someone fix my music

#

it wont connect to the vc and it says there was a error gettings the song everytime

south finch
#

do you ever like

#

read the rules in the server?

earnest phoenix
#

no

south finch
#

stop asking to be spoonfed ๐Ÿ‘€

#

well you should

earnest phoenix
#

lol

feral nova
#

Hey, how do I make an Mute/Unmute Command?
(I start with if(command === ${prefix}command) {

heady zinc
#

read the docs

#

google some stuff if ur unsure

#

and profit

feral nova
#

i googled but didnt find a good thing

haughty onyx
#

i feel like a total noob and i feel very discouraged of being here.. and I should know how to code.. I didnt know who to turn to..

quiet bobcat
#

Sorry but we have to follow the rules... 7. a. Donโ€™t spoon-feed or attack beginners.

haughty onyx
#

wow.

quiet bobcat
#

What do you need help with either way? What lib and what lang?

earnest phoenix
#

-eval message.channel.send({embed: {
color: 3447003,
description: "A very simple Embed!"
}});

#

@real ibex

quiet bobcat
earnest phoenix
#

oh

haughty onyx
#

well i need a bot for my group that stores info. Like someones arrival date and their role.

quiet bobcat
#

Have you started coding anything yet?

haughty onyx
#

No I have not.

#

I wanted to see if there was a bot already made and i could just modify it

quiet bobcat
#

Hm

#

I can look and try to find some

haughty onyx
#

like i know theres bots that can store info. I was on a Animal crossing discord.. it was very organized :x

quiet bobcat
#

wdym?

haughty onyx
#

like on the bot you can put your Friendcode, the town name, the town fruit

quiet bobcat
#

Friendcode?

#

and what town?

south finch
#

Animal crossing is a game Jonas ๐Ÿคฆ๐Ÿฝโ€โ™€๏ธ

quiet bobcat
#

welp, I'm dumb

#

Oh... I get it

haughty onyx
#

Thanks @south finch ๐Ÿ˜ƒ

south finch
quiet bobcat
#

I can't find any bot with those functionalities :/

haughty onyx
#

hmm ๐Ÿค”

#

so if i were to make a bot, how complicated will it be?๐Ÿ˜ณ

quiet bobcat
#

That completely depends on what language you pick, if you know that language, if there's an api for what you want to do.

haughty onyx
#

yeah ๐Ÿ˜ž

bright bone
#

Can someone give me an example of UpdateMessages in js?

trim plinth
#

I heard Animal Crossing zoomeyes

#

anyways what lib are you using @bright bone

bright bone
#

Discord.js

trim plinth
#

k

bright bone
#

I do not understand something what you say xD

topaz fjord
#

@haughty onyx as complicated as you want it to be lol

haughty onyx
#

LOL

weary niche
#

Does any one have good resources for just starting out on making a discord bot; the language I am learning to use right now is java. Thanks!

trim plinth
#

what library do you plan on learning

weary niche
#

I don't know, any suggestions?

trim plinth
#

you can try JDA, it

#

is popular

weary niche
#

ok thank you.

trim plinth
#

(sorry for weird parting, pressed enter too soon bloblul )

#

yw

haughty onyx
#

So i found the bot that i need but how do i get the coding???

trim plinth
#
  1. If you are planning to submit this bot, don't take other bot code, 2. If you are looking for the same thing that you got from the animal crossing bot, you most likely need a database 3. You don't get the coding. If it's not open source, it's not.
#

(you may not need a database but storing info like that usually requires it)

hushed oyster
#

@haughty onyx I would recommend that you learn a language, then make a bot from scratch

abstract mango
#

i agree ^

#

I went head-in with python, making a bot first

#

it was pretty bumpy

still cave
#

It's pretty good because ti doesn't assume you know anything and guides you through. I really like that it even encoursages typing out everything instead of just copy/pasting because it helps you make your own connections and you actually learn faster.

#

The "Free Sample" for learn Python 2 the hard way is actually the entire book just without pdfs or videos, and you can read it as it's just webpages with the information lined up with excersizes.

abstract mango
#

dapi was my friend early on

#

:p

dim cipher
#

You have to want to make a bot. Personally, I really wanted to make a music bot, so I dived head first into docs, and googled everything I needed to know and use it this day GWnanamiAquaThumbsUp
Granted, my bots were like spaghetti, but I succeeded.

still cave
#

Once you start looking at everything as a problem and find generalized ways to solve them, your bot will be and look sexy

jagged birch
#

need a little help with something. I just added shards and I am trying to add my server count in my bots status.. this code is in my ready event:

client.shard.broadcastEval('this.guilds.size').then(results => {
  client.user.setActivity(`lmao help | ${results.reduce((prev, val) => prev + val, 0)} servers`);
})```
It just shows the guilds in 1 shard instead of the total, but I use the same code to update my discordbots.org server count, and that works.. am I doing something wrong?
still cave
#

I was curious what reduce does

jagged birch
tame rivet
#

anyone know how to suppress this

#
protocol: <asyncio.sslproto.SSLProtocol object at 0x7f3181a294a8>
transport: <_SelectorSocketTransport fd=8>
Traceback (most recent call last):
  File "/usr/lib/python3.6/asyncio/selector_events.py", line 761, in write
    n = self._sock.send(data)
OSError: [Errno 9] Bad file descriptor
Fatal error on SSL transport
protocol: <asyncio.sslproto.SSLProtocol object at 0x7f3181a294a8>
transport: <_SelectorSocketTransport closing fd=8>
Traceback (most recent call last):
  File "/usr/lib/python3.6/asyncio/selector_events.py", line 761, in write
    n = self._sock.send(data)
OSError: [Errno 9] Bad file descriptor
still cave
#

@tame rivet seems to be that Pyyhon 3.4.3 and python 3.5.0 both have that issue.

#

asyncio is supposed to be telling you the connection was lost so that you dont get that error

#

@tame rivet websockets right?

try calling

yield from asyncio.sleep(0)

after the send call

or

    return```

before the send call
tame rivet
#

im awaiting it ๐Ÿค”

#
    async def update_stats(self):
        """This function runs every 30 minutes to automatically update your server count"""

        while True:
            logger.info('attempting to post server count')
            try:
                # replace shard_id with your current shard for the bot
                await self.dblpy.post_server_count()
                logger.info('posted server count ({})'.format(len(self.bot.guilds)))
            except Exception as e:
                logger.exception(
                    'Failed to post server count\n{}: {}'.format(type(e).__name__, e))
            await asyncio.sleep(1800)
#

i run this as a client loop

#

but every time i close it gives the error

still cave
#

You can probably put

if websocket.writer.transport._conn_lost:
    return

in post_server_count

#

just before the send call

tame rivet
#

good idea

still cave
#

Let me know if it works ๐Ÿ˜ฎ

tame rivet
#

no it doesnt

still cave
#

fk

tame rivet
#

AttributeError: module 'websocket' has no attribute 'writer'

#

the error happens when loop is shut

#

idk why

#

as in ctrl c

still cave
#

hmmmm can I see yourt post_server_count mayber? or would you rather pm?

tame rivet
still cave
#

oh do you use Select?

tame rivet
#

no?

still cave
#

I am experiementing a bit now

#

I was making assumptions but now I can see haha, bare with me

#

it might take some time

lethal sun
#

This doesen't seem to work...
Code:

        db.get(`SELECT * FROM all WHERE ID = '${message.guild.id}'`, function(err, row) {

            if (!row) {
                db.run(`INSERT INTO all(ID) VALUES(?)`, [message.guild.id], function(err) {
                    console.log(`A row has been inserted with rowid ${this.lastID}`)
                    message.channel.send('lul')
                });
            }

            message.channel.send(row.laungage)
        });```

Console Output:
```TypeError: Cannot read property 'laungage' of undefined```

SQLite Studio Columns:
https://my-bot.dabs-on.me/DDDuycQfb.png
#

halp

tame rivet
#

@still cave seems like an asyncio bug?

still cave
#

Yeah, i was thinking you were working directly with it but you arent

tame rivet
#

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

leaden bane
#

Anyone knows how to directly manage and update PostgresSQL databases in Access? Currently the contents displayed are read-only.

tame rivet
#

i'll try and suppress it

still cave
#

Yeah, basically when asyncio loses a connection, its never telling you, so next message is sending because it thinks its still connected, and fails because it isnt

tame rivet
#

not failing tho

#

its cause the loop is closing on keyboardinterrupt

#

but ye

#

same thing

still cave
#

Hmmmm

#

Ah there is a way to force it to clear the remaining asynchronous operations.... there just has to be ๐Ÿ˜ฆ

tame rivet
#

wait_until_complete() ?

austere meadow
#

@lethal sun you may be doing if (!row) and creating a new entry on that, but row's value hasn't changed
you need to reassign a new value to row because it's still undefined from when you first did db.get

still cave
#

But yeah when you keyboard exit, the operation is still running asynchronously and the socket closed before the operation either started or completed.
It might work I have never actually intercept exiting that way before though

#

But at the time the asynchronous operation was started the connection was open and it just assumes it will be once it starts operating.... one sec

wise shell
#

how to code eval command

frail kestrel
#

wjhat lib

#

what lib

wise shell
#

discord.js

earnest phoenix
#

(color)

low rivet
#

CSS

leaden bane
#

@earnest phoenix

<!--           ^ Replace this by your color     -->
<p>Your description.</p>
</body>
#

Use it in the bot's description.

earnest phoenix
#

OK thanks ^^ @leaden bane

leaden bane
#

You're welcome.

stray citrus
#

Hello, can someone help me with my JDA bot?

inner jewel
#

just ask the question, don't ask to ask

stray citrus
#

Okay

inner jewel
#

what's your code?

stray citrus
#

JDA

inner jewel
#

your code

#

not the lib

stray citrus
#

oh Sorry

inner jewel
#

you're probably missing a superclass declaration/have a wrong method signature

stray citrus
inner jewel
#

Received vs Recived

#

wrong method name

stray citrus
inner jewel
#

onMessageReceived

#

yours is onMessageRecived

stray citrus
#

ohhhhhhh

lapis crystal
#

XD spelling is annoying, it always gets me

stray citrus
#

I'm very Stupid ๐Ÿ˜‚

#

Thanks M8 xD

plush frost
#

Does apache or ngnix better

#

?

gilded wing
#

=help

#

woah

solemn obsidian
#

In Eris, is there any other way to get user other than through getRESTUser/looping through all guilds + their members?

heady zinc
#

iterate through the Client.users collection

solemn obsidian
#

ok im blind

heady zinc
#

its the same as for guild members tho, some users won't be cached and therefore won't be in the collection

solemn obsidian
#

Then I guess I'll have touse getRESTUser?

heady zinc
#

yeah as far as i know, if the user is not cached and don't share a server with your bot, you're gonna need to enable REST requests and use getRESTUser

stray citrus
#

Hello I have a Another Question. How Can I set the Game of the bot?

heady zinc
#

if they do share a server tho, you would just need to fetch all the members

solemn obsidian
#

Alright, thanks

vernal yoke
#

guys, i got a quick question. How do i prevent message reactions to dissapear using discord.js ? I am using reaction.remove() to cancel the reaction but if i click once more on the reaction it dissapears completely

#

download discord module

#

is missing

#

no module named discord

#

instead of import discord

tame rivet
#

@sweet portal import discord should import discord.py

#

what is that discord package you have installed?

#

ye

#

uninstall discord

#

pip3 uninstall discord

#

nonono

#

yes

#

read this

still cave
#

omg why in the hell is phpstorms ftp so slooooooow

topaz fjord
#

Don't use phone

#

Php

#

Fixed

vernal yoke
#

well happy to help @sweet portal and the other ones who actually said the same thing but you did not understand

tame rivet
#

@vernal yoke import discord.py doesnt work

shy rose
#

is it possible in any way to render an emoji inside these as using discord type emoji shows it as string from but sedning it as raw emoji shows it as its unrendered form

#
:flag_au:
๐Ÿ‡ฆ๐Ÿ‡บ

but if you send eithr of those you render a flag

earnest phoenix
#

Can someone help me activate my bot?

quiet bobcat
#

What lib?

earnest phoenix
#

?

quiet bobcat
#

library

earnest phoenix
#

Other

quiet bobcat
pale light
quiet bobcat
#

That's not very helpful

pale light
#

thats good

earnest phoenix
#

Jon

quiet bobcat
#

What language

pale light
#

@earnest phoenix what language are you using

#

coding language

quiet bobcat
#

๐Ÿ‘€

earnest phoenix
#

what?

pale light
#

hm

#

let me reset

#

are you coding a bot rn

quiet bobcat
#

that

earnest phoenix
#

Not yet...

quiet bobcat
#

which one

pale light
#

so you're asking how to start coding basically

earnest phoenix
#

;-;

#

yes

pale light
#

have you decided on a coding language?

trim plinth
#

good beginner languages are python and js

quasi marsh
#

^

earnest phoenix
#

Python

whole totem
#

what's the best way to host a javascript bot

idle torrent
quiet bobcat
#

a vps imo

idle torrent
#

what do i dooo

quiet bobcat
#

npm run build.js?

#

idk how npm run works

whole totem
#

@idle torrent do you have node.js

quiet bobcat
#

well he has discord.js so I'd assume so

uncut slate
#

that's not the issue

#

why are you trying to use npm run build

quiet bobcat
#

^

uncut slate
#

what do you think it'll do

whole totem
#

he can do

#

node run {name of bot}.js

#

or not node run

#

just node

#

so

uncut slate
#

no

#

just node

whole totem
#

node {name of bot}.js

uncut slate
#

and not name of bot either lol

#

just whatever his main file is called

whole totem
#

thats what i meant

idle torrent
#

yes i have node.js

whole totem
#

but

idle torrent
#

what do i do

whole totem
#

okay so go to the where you keep your bot

idle torrent
#

what do you mean

quiet bobcat
#

Again, not the issue

whole totem
#

what''s the issue then

idle torrent
#

Cmon please guys. Im getting pretty stressed

quiet bobcat
#

We just told you

#

Scroll up

idle torrent
#

instructions told me to

#

Download or clone this repo's files.
cd into the Referobot directory.
Run npm install to install dependencies.
Run npm run build to build.
Add your bot token to your_auth.json.
Rename your_auth.json to auth.json.
Run node lib/referobot.js.

#

ehhhhhhhh

quiet bobcat
#

node build

idle torrent
#

what

quiet bobcat
#

I litterally gave you the answer

idle torrent
#

Im not trying to figure out a riddle here guys

#

its not a game

quiet bobcat
#

But there's no riddle...

idle torrent
#

i dont do npm build then?

quiet bobcat
#

No

idle torrent
#

then what do i do

quiet bobcat
#

Do what I told you instead

whole totem
#

he said do node build correct?

idle torrent
#

youre tearing me apart man

#

This is aweful

whole totem
#

programming will tear you apart

quiet bobcat
#

^

idle torrent
#

Guys what do i do

#

tell one last time up front

whole totem
#

try node build I believe he's saying

uncut slate
#

no ๐Ÿคฆ

idle torrent
#

lol finally someone who knows what theyre doing

quiet bobcat
#

๐Ÿค”

idle torrent
#

@uncut slate

#

what do i do

quiet bobcat
uncut slate
#

@idle torrent node file.js

quiet bobcat
#

In this case file = build

uncut slate
#

how do you know that

idle torrent
#

error cannot find module

whole totem
#

I don't think he's trying to run his project

quiet bobcat
#

He told me before

uncut slate
#

@idle torrent run npm i

#

when @quiet bobcat

#

don't see it here

quiet bobcat
#

Scroll up a bit

uncut slate
#

where, I don't see it ๐Ÿค”

quiet bobcat
#

11:38

idle torrent
#

then what

uncut slate
#

then retry running the file

idle torrent
#

error cannot find module

whole totem
#

do you have all the modules you need to run the bot

idle torrent
#

Download or clone this repo's files.
cd into the Referobot directory.
Run npm install to install dependencies.
Run npm run build to build.
Add your bot token to your_auth.json.
Rename your_auth.json to auth.json.
Run node lib/referobot.js.

#

these are what im trying to do!!!!!!

#

what are modules

#

i have downloaded all the files, yes

#

@uncut slate

uncut slate
#

sure

#

follow the guide

earnest phoenix
#

where do I put the programming for the bots

idle torrent
#

I dont know howww

#

I foollow it and get errors

quiet bobcat
#

what errors?

earnest phoenix
#

?

idle torrent
#

I just posted pics twice

earnest phoenix
#

i'm trying to figure out I put coding.

quiet bobcat
#

well those werent really helpful

idle torrent
#

What do i do for step 1?

quiet bobcat
#

@earnest phoenix you make a file. Call it something like app.py

idle torrent
#

okay then what

quiet bobcat
#

Have you followed those steps?

#

@idle torrent

idle torrent
#

Yes i get errors. What do i do for step 2 for these instrustionc

#

cd into the Referobot directory.

#

what does this mean

earnest phoenix
quiet bobcat
#

dms

#

You can't do py.txt @earnest phoenix

earnest phoenix
#

fuck.

quiet bobcat
#

go to save as and then click other and remove .txt and add .py instead

idle torrent
#

dms?

quiet bobcat
#

direct messages

earnest phoenix
#

I didn't add the .txt part.

whole totem
#

then delete it

#

it's the normal thing when you create a txt file

#

@earnest phoenix I would delete the message with the file too because they may find your token

#

by the way I downloaded it and you didnt put your token in anyways

quiet bobcat
#

Also that's .js

#

not .py

whole totem
#

yup

still cave
#

If my bot has a eeb portal, does the soruce code to the web portal have to be open sourced also? Does the bitnhave to be open sourced at all?

uncut slate
#

you don't need to make anything open sourced

still cave
#

Yay

idle torrent
#

what error is this

#

how do i correct this

glossy sand
#

presumably there's no file called "build.js"

uncut slate
#

I still can't find anything about you saying your index file is build.js

idle torrent
#

i never said that

uncut slate
#

@quiet bobcat ???

idle torrent
#

can i dm you

topaz fjord
#

@idle torrent you didnt have too lmao

uncut slate
#

@idle torrent not really

topaz fjord
#

thats what your error says lol

quiet bobcat
#

Well went on it's github, and it doesn't even have a js file

topaz fjord
#

either he you dont have the files or its in the wrong directory

quiet bobcat
#

or hm

idle torrent
#

Nobody knows!

topaz fjord
#

then why are u asking lol

idle torrent
#

Bro

#

How does nobody know. My life has bugs that cant be fixed

#

Story of my life

topaz fjord
#

ok

#

i would help if you showed code

idle torrent
#

exactly what im doing

topaz fjord
#

are u trying to submit a clone Thonk

uncut slate
#

calls PEBCAK

idle torrent
#

Im trying to make a freaking bot

pine relic
#

no need to curse

topaz fjord
#

how is that making aa bot

#

you basically just cloning

idle torrent
#

OKay yeah

#

cloning

#

downling the code

#

step by tep what do i do

pine relic
#

pay somebody to make a bot for you

topaz fjord
#

idk

#

@pine relic no

pine relic
#

?

topaz fjord
#

code it yourself kek mmLol

idle torrent
#

guyssssss i thought you would be able to atleast help a little

topaz fjord
#

also idk i dont clone @idle torrent

pine relic
#

@idle torrent are you even familiar with javascript

idle torrent
#

i dont know the library but yes

pine relic
#

maybe you should learn discord.js first by making your own bot, this website has plenty of examples.
https://discord.js.org/#/

topaz fjord
#

javascript isnt a library

#

javascript is a language

pine relic
#

i think he was talking about the library that the repo was using

idle torrent
#

I neec an invite somebody

#

need

pine relic
#

lol

#

ok bye now

idle torrent
#

What

#

Why has no one released an invite bot on bot.discord

#

Theres so many out there

topaz fjord
#

because bots cant invite bots

idle torrent
#

what

#

no i need a bot that keeps track of how many invites people have

hushed oyster
#

someone made that

#

i think

topaz fjord
#

o shit its kaniel

#

a cert kaniel

idle torrent
#

Which one

topaz fjord
#

since when

hushed oyster
#

today

#

and

#

@idle torrent

#

let me find it

idle torrent
#

Thank you Agust! Life saver!

#

August

hushed oyster
#

lmao

#

you're welcome

trim plinth
#

๐Ÿ‘€

hushed oyster
#

i guess

topaz fjord
#

thats not august thats kaniel Thonk

patent reef
#

Anyone know how to send a DM to a user ID in Eris?

idle torrent
#

Sorry I havent been here long i dont know their names

#

Does it have top 10 inviters @hushed oyster

hushed oyster
#

I believe it has a leaderboard of inviters

idle torrent
#

Perfect!

#

Find anything?

hushed oyster
#

not yet

#

still searching

uncut slate
#

@patent reef client.getDMChannel(id) gets you the channel to send it to

patent reef
#

thx

#
const direct = bot.getDMChannel(persons id);

bot.createMessage(direct, "my msg here");```
#

???

uncut slate
#

await

heady zinc
#

right eris's dms integration is so painful

patent reef
#

omg tell me about it

#

ive been at this since this morning

heady zinc
#

but yeah basically

#
User.getDMChannel().then(channel => {
   channel.createMessage("baguette tbh");
});```
#

or await it

#

and follow whatever code style you like

#

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

patent reef
#

isnt await only for python?

heady zinc
#

await has been implemented in node.js since node 8.x.x

patent reef
#

lol this is my first day using JS

heady zinc
#

idk how it works in python

#

but in js you need to be in a async function to use await

hushed oyster
#

same with py

heady zinc
#

then it shouldn't be much of an issue to understand it zoomeyes

patent reef
#

where does the ID go?

heady zinc
#

the ID?

patent reef
#

the ID of the person i want to DM

hushed oyster
#

probably right here:

heady zinc
#

you don't need it if you have the user

hushed oyster
#

const direct = bot.getDMChannel({id});

heady zinc
#

wait ok i think you're a bit lost cuz the docs are misleading

#

there is multiple ways to do that

patent reef
#

Heres what I had

heady zinc
#

basically cuz abal is a scrub, you can use pretty much all methods from the client class because he implemented them all in

patent reef
#
const devdm = bot.getDMChannel("162780049869635584");

bot.createMessage(devdm, "Hi");```
#

i put my ID in just for testing

heady zinc
#

sooo

patent reef
#

never worked

heady zinc
#

if you want to use it from the client class

#

it would be like that outside an async function: ```js
bot.getDMChannel("162780049869635584")
.then(channel => {
channel.createMessage("Hi");
});

#

or bot.createMessage(channel.id, "Hi"); but that's longer isn't it

#

smh im probably confusing you with all that shit

#

i'll just shut up

patent reef
#

XD

#

ill test it out

#

Thanks a lot

trim steppe
#

world's best admin is world's worst pythoner

topaz fjord
#

anyone know how to fix this problem with npm

#

whenever trying to install modules from github it just hangs and does nothing

austere meadow
#

how long did you wait for?

#

usually takes some time for me, about 140s to install d.js

#

its pretty bad

topaz fjord
#

like 10 minutes

austere meadow
#

damn

#

did you try bombing your node_modules?

#

npm is pretty buggy

topaz fjord
#

i might just switch to yarn

#

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

austere meadow
#

yeah i use yarn wherever possible

topaz fjord
#

@austere meadow yarn is fucking amazing

austere meadow
#

yeah it is

#

a lot better than npm

topaz fjord
#

fuck npm

austere meadow
#

although i have issues installing github stuff from yarn myself

#

so thats weird

topaz fjord
#

it installing that git module in like 2 mins

shy rose
#

Is there an API limit for getMembers or is it just global (or does the global even apply? )

earnest phoenix
#

would you guys have any idea on how to play a local file using lavalinik?

ornate shadow
#

I just changed my Raspberry Pi's IP to be static and now my bot is down. Any idea why/how to fix this?

#

pm2 says "errored"

#

the logs inform me that the bot loaded all of its commands, connected to the MySQL database but then suddently no more logs are to be seen

#

it was supposed to say "Posted to dbl." then continue to run

#

nevermind. I just deleted the pm2 entry of my bot and added it back

languid dragon
#

anyone know mongoose schema's?

if yes, is it
whitelist: [Array]
or
whitelist: Array

ornate shadow
#

it works now. strange

maiden rampart
#

hAI

bitter sundial
#

@languid dragon Array

#

but you can do like [OtherSchema] to make an array of objects with that schema

#

or

#

[String] for an array of strings and shit

#

[Array] would be an Array of Arrays

languid dragon
#

oooooo, thank u

#

[String] is what i'm after then SpinningLUL

bitter sundial
#

with just Array you could put anything in them but yes

bitter pagoda
#

Does anyone know a good anti-spam bot?

frail kestrel
#

wrong channel

frigid juniper
#

@bitter pagoda just set a cooldown

quiet bobcat
#

For what?

#

Messages?

worldly cliff
#

How do u even make a bot?

languid dragon
worldly cliff
#

What

quiet bobcat
#

Google it

worldly cliff
#

Ok

#

Thanks

worldly cliff
#

Which website do I go to?

hushed oyster
#

just search "how to make a bot"

quiet bobcat
hushed oyster
#

and choose something random

worldly cliff
#

ok

quiet bobcat
#

Is there a way to use the guildBanAdd event for user and async events?

#

Using d.js

shy rose
#

@worldly cliff there's a bit builder I made have a look at https://cheweybot.gq you can use it without the need to know code as well

patent reef
#

Anyone know how to send a message to a specific channel ID in eris?

#
bot.createMessage("channel id", "content");```
#

that didnt work ^

uncut slate
#

then you're doing something wrong, that's the proper way to do it

patent reef
#

hm

#
TypeError: bot.createMessage is not a function```
tame rivet
#

when you think you've added ratelimit implementation but then you just haven't cause it doesnt save over restart

worldly cliff
#

Hi

inner jewel
#

a lib shouldn't really save data

#

unless specifically configured to do so

#

or at least give the user a way to configure how to save data

worldly cliff
#

@shy rose thanks

tame rivet
#

@inner jewel what i meant was cache the ratelimit quota remaining over restart

inner jewel
#

again, don't do that automatically

tame rivet
#

e.g. bot makes 60 requests in 10 seconds

#

bot then restarts

inner jewel
#

let the users decide

#

if the lib should save that

tame rivet
#

bot has no quota left but doesnt realise so hits 429 and is blocked for an hour

worldly cliff
#

Hi guys

#

how do u code a bot

#

i know my name is thecoder but i donโ€™t know everything

trim plinth
#

do you know how to code

worldly cliff
#

Some

trim plinth
#

what coding language

worldly cliff
#

Swift, Python, and HTML

uncut slate
worldly cliff
#

Why do people cuss

trim plinth
worldly cliff
#

Ok

#

How

#

I am kinda new here

patent reef
#

hmmm

#

idk tbh ill keep testing shit

quiet bobcat
#

Is there a way to use the guildBanAdd event with user and async message? Using discord.js

worldly cliff
#

@trim plinth thanks for everything though

trim plinth
#

yw

topaz fjord
#

@worldly cliff because why not

vernal girder
#

what

craggy token
#

can you help me whenever I try to run my bot I get this:

#

app@goomba:~ 20:29 
$ node mybot.js
\`\`\`Error: EIO: i/o error, read
    at Object.fs.readSync (fs.js:675:18)
    at tryReadSync (fs.js:540:20)
    at Object.fs.readFileSync (fs.js:575:19)
    at Object.Module._extensions..js (module.js:653:20)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)
    at Module.require (module.js:587:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/app/node_modules/jsdom/lib/jsdom.js:8:19)\`\`\`
limpid basalt
#

What do you code in? Like, what enviornment?

craggy token
limpid basalt
#

That's where you code?

craggy token
#

yes

limpid basalt
#

Does it tell you the errors and what it requires to fix them?

craggy token
#

it only tell me that ^

limpid basalt
#

oof

#

Have you heard of Visual Studio Code?

trim plinth
#

@limpid basalt Probably has, but glitch.com can run your bot 24/7 and allows you to code in it

craggy token
#

I don't have a VPS so I can't use it

limpid basalt
#

Oh okay

#

I use VSCode

#

And then pm2 to run my bots 24/7

#

But pm2 is being stupid

#

SO I'm using nodemon for a temporary online status for the bot

craggy token
#

wait, does pm2 run if the pc is off?

trim plinth
#

no

limpid basalt
#

no sadly

craggy token
#

oh, so I can't use it^

#

oh nvm, I fixed

limpid basalt
#

It won't run if the terminal is closed either

#

That's why I always keep my PC charged and awake while the lid is closed

craggy token
#

oh ok

limpid basalt
#

oh crap

#

I closed the terminal

#

oh there we go

light palm
#

!play sia

#

.h play

trim plinth
shy rose
#

So question like i know this wouldn't be official or any guarantee but would anyone be able to take a look @bitter comet and see if its worth going for certification cause last time i did it was really new and only out for a week but since then huge changes been done

earnest phoenix
#

I'll look at it for you @shy rose

earnest phoenix
#

how do I pipe sudo find / | grep gitlab to rm -rf

dense bone
#

I've been grinding this all day. I'm working with komada and trying to make an upvote inhibitor. using the api in code i can't get true/false, yet in eval i can.

uncut slate
#

@earnest phoenix xargs

earnest phoenix
#

k

uncut slate
#

also be careful

#

you're playing with fire

earnest phoenix
#

lol

inner jewel
#

find / | sudo xargs rm -rf

uncut slate
#

old nick

#

smh

inner jewel
#

it's your current nick

#

in terminal

uncut slate
#

oh

#

right

trim plinth
#

A way to catch a rejected promise for setActivity in discord.js? I tried using catch(e) but that ended up returning an error Thonk

inner jewel
#

thing().catch(console.log)

#

afaik

trim plinth
#

mk

#

ty

earnest phoenix
#

try except is better

#

but that's py so eh

trim plinth
#

gives python advice to javascript dev

vital lark
#

Code: ```js
const { version } = require('../../../node_modules/eris/package.json');
const Command = require('../../structures/Command');

module.exports = class About extends Command {
constructor(client) {
super(client, {
name: 'about',
desc: 'About me? Duh!',
usage: 'about',
aliases: ['info'],
category: 'Core'
});
}

async run(msg, args) {
    const { client } = this;
    const config = client.config;

    return msg.channel.createMessage({ embed: {
        title: 'About Yui Hirasawa',
        description: `:wave: - I am Yui Hirasawa, you discord bot for weebs!\nI am made by @vital lark`,
        color: config.settings.colour,
        footer: {
            text: config.settings.footer
        }
    }});
}

}```
error:

[2018-02-18 17:53:43] [ERROR]: An error has occured while processing about.js: ReferenceError: aliaes is not defined````
trim plinth
#

aliaes?

vital lark
#

yes

trim plinth
vital lark
#

it's telling me that even tho it's not even in the context

inner jewel
#

save the file and run again

earnest phoenix
#

blame the eris devs

inner jewel
vital lark
#

while(true) { banNatan(); }

earnest phoenix
#

maybe they spelled aliases wrong

vital lark
#

nope

earnest phoenix
#

also smh js doesn't tell you the line

#

where it errored on

hushed oyster
#

py >>>>>> js

earnest phoenix
#

^^^

vital lark
trim plinth
#

ok no need to start a war in #development , we just need to see why augusts code is throwing an error

inner jewel
#

scala > java > py > js

#

inb4 lang war

vital lark
#

:q all of you!!!!!

inner jewel
#

:x!

trim plinth
#

hmmm

inner jewel
trim plinth
#

did you spell something wrong in the Command class?

#

(unlikely but could happen)

vital lark
#

no

trim plinth
#

hmm

#

I have no idea wth is happening then

vital lark
#

I added .stack to see what's wrong

trim plinth
#

mk

inner jewel
#

do a global search for aliaes

vital lark
#

SMH not even loading

trim plinth
#

just wait for it to load and hope that you find an instance of "aliaes" to fix

vital lark
#

I'm stupid as fuck

#

this.conf = {aliaes}

trim plinth
#

welp theres your error to fix

#

:^)

vital lark
#

yes no errors

trim plinth
#

๐ŸŽ‰

earnest phoenix
#

I need lib/app ideas for py

#

@vital lark no u

topaz fjord
#

@earnest phoenix task manager mmLol

earnest phoenix
#

no u

#

taskmgr for windows is enough
htop for linux is enough

#

@topaz fjord

topaz fjord
#

I just dual booted and whenever I leave my PC alone booted on windows it switches to ubuntu

#

Idk why

#

Any help

earnest phoenix
#

what do you mean

#

change boot order?

topaz fjord
#

Like im booted into windows

#

Using Windows all fine

#

Leave for a while, then see my PC in u until login screen

#

*Ubuntu

earnest phoenix
#

blue screen?

topaz fjord
#

No

earnest phoenix
#

view system log?

real bear
#

Question.

#

Since i'm new to this bot thing.

trim plinth
#

what could your question possibly be

glossy sand
#

no need to be snarky

real bear
#

How do you log into your bot?

trim plinth
#

you don't

#

you login your bot, you do not log into your bot

real bear
#

Gg.

#

Just tell me how.

topaz fjord
#

You code you bot

trim plinth
#

logging into your bot is API abuse

topaz fjord
#

Then it becomes online

#

But you don't login as your bot

real bear
#

Oh.

topaz fjord
#

Unless you want to get banned

trim plinth
#

:^)

glossy sand
#

ok so like the way your bot works is

#

you run a fancy program on a computer somewhere

#

and that program interacts with discord like a sort of "fake user" that does stuff automatically based on the state of discord

#

you have to write that program, of course

trim plinth
#

^ this is an analogy, do not take it literally

#

@real bear if you are asking how to login your bot (NOT login as your bot), you run your code then your bot should become online

real bear
#

Ah.

#

Thank you.

trim plinth
#

yw

shy rose
#

@earnest phoenix Thanks for feedback really helps (and taking the time to do so) ๐Ÿ‘

earnest phoenix
#

Np

bright karma
#

how would I get how many guilds are in each shard? Like what is the easiest way of doing this? btw I have Internal Sharding enabled for my bot, discord.js.

prime cliff
#

Some libraries have a shard manager variable that you can use to get guild count or you can loop through each shard and add the guild total

bright karma
#

i have a shard manager but I can only get the shard that the message was sent from

languid dragon
muted oxide
#

So i think, in discord.py editing, mentioning can be done as @test#1234 right?

low rivet
#

what editing?

muted oxide
#

IDLE.

low rivet
#

what... :/

#

don't use idle anyway

#

use an actual program

muted oxide
#

lets take Visual Studio Code

low rivet
#

*visual

muted oxide
#

if i remember correctly, a mention in discord.py can be done with @apollo11#1969
right?

low rivet
#

no

#

<@ID>

muted oxide
#

not that, a command mention for the bot.

#

like in cleverbot

low rivet
#

huh what command mention GWcfcThonk

muted oxide
#

they use @wicked brook [message]

low rivet
#

<@ID>...?

muted oxide
#

got it

abstract mango
#

@muted oxide so you want to have a mention as a prefix? or am I wrong

#

oh ic what you're getting at

#

you could use a on_message event

muted oxide
#

yes

gritty ice
#

are there need for permissions to send embeds, or that comes under "Send Messages"?

#

bot was working fine, and stopped working in this one perticular server out of a sudden

heady zinc
#

if disabled, users will see a blank message

#

or well no, server-side it will just not allow you to send it iirc

gritty ice
#

but until now it was working fine with "Send Message" permission

heady zinc
#

yeah but if you want to send embeds

#

you need the embed links permission

gritty ice
#

even in this server it just has send message persmission, but it's working fine, let me show you in #265156322012561408

#

I am getting these in the logs

discord.errors.Forbidden: FORBIDDEN (status code: 403): Missing Permissions

The above exception was the direct cause of the following exception:

discord.ext.commands.errors.CommandInvokeError: Command raised an exception: Forbidden: FORBIDDEN (status code: 403): Missing Permissions

What to make of it?

heady zinc
#

now yeah well, you need to check if your bot has all the needed permissions, and is not restriced channel-wide or smth

gritty ice
#

okay, I checked, my bot has permissions to send text, but not embeds in that server

#

it was able to send normal text messages

#

this gives me an idea, I should write try catch, and in case bot doesn't have permission to send embeds, it should say so, how's that idea?

gritty ice
#

[FIXED] you were right, it was a channel wide issue

heady zinc
#

permissions issues mmLol

earnest phoenix
#

Hello, I am asking for some help. So I just got a execute command, but ping google.com isn't working, for example I did the ls command and it worked. here is the code. (I have defined ownerid)

#
var exec = ["execute"]
if(exec.every(key => {return msg.content.includes(key)})) {
if(msg.author.id === ownerid) {
const { exec } = require('child_process');
exec(args.slice(1).join(" "), (error, stdout, stderr) => {
  if (error) {
    msg.channel.send(
      new Discord.RichEmbed()
      .setTitle("Execute Error")
      .setColor('RANDOM')
      .setDescription(`Error: \`\`\`${error}\`\`\``)
      )
    return;
  }
      msg.channel.send(
  
    new Discord.RichEmbed()
                        .setTitle("Execute")
                        .setColor('RANDOM')
                        .setDescription(`**Input**:\n${args.slice(1).join(" ")}\n\n**Output**:\n\`\`\`${stdout}\`\`\`\n${stderr}`)
        )
});
} else {
  msg.channel.send("I'm afraid I cannot do so, I do not have permissions to create an invite.") 
}
}```
low owl
#

@gritty ice don't do try catch

#

Check for potential issues beforehand

gritty ice
#

hmm ๐Ÿค” how do you suggest to do that?

earnest phoenix
#

So nothing on my problem

#

okedokie

gritty ice
#

lol

earnest phoenix
#

Mention me if you have a fix, thanks

low owl
#

@gritty ice either by implying your bot gets permissions on some way (automatic roles or such alike) or by literally looking up what Perms you have. Try catch does work of course but I find it makes your code more difficult to read and the intention of the try catch is not really clear without digging into it. It also means that you expect an exception that you could avoid altogether. Which is always better.

earnest phoenix
#

brian help me out too pls

gritty ice
#

makes sense, and your profile pic ๐Ÿ‘€ @low owl

low owl
#

@gritty ice ikrbloblul

quiet bobcat
#

How can I see if a member is kicked with discord.js?

austere meadow
#

you can just see if the member exists in the guild
message.guild.members.has('id)

#

oh wait do you mean the actual event

quiet bobcat
#

yeah

austere meadow
#

tbh ive been wanting to know that myself

quiet bobcat
#

:/

austere meadow
#

one sec

quiet bobcat
#

kk

formal bramble
#

hello

austere meadow
#

guildMemberRemove

#

actually

#

no

#

hmmm

#

that checks if they've left and/or been kicked

deep parrot
#

guildMemberRemove is a guild event

austere meadow
#

yeah thats fine

trim plinth
#

I don't think there is an exact event for discord.js that emits when a member is kicked. I guess your only option is guildMemberRemove

austere meadow
#

but jonas just wants to see if someone is kicked

#

surely there must be some way

#

else how would @gilded plank work

trim plinth
#

dunno

#

true

austere meadow
#

maybe luca uses raw?

trim plinth
formal bramble
#

I don't think so...

gusty topaz
#

Check on guildMemberremove

#

Then consult audit logs

#

I may write an extension to do it

#

(for d.js)

austere meadow
deep parrot
#

^

quiet bobcat
#

ah

austere meadow
#

dont think theres another way to do it otherwise

quiet bobcat
#

wait, how do I check audit log?

gusty topaz
#

Oof

trim plinth
#

o0o0f

gusty topaz
#

Use them docs

quiet bobcat
#

Never had to do it before

deep parrot
#

:readDocs:

austere meadow
#

guild#fetchAuditLogs()

gusty topaz
#

RTFM

trim plinth
#

^

quiet bobcat
#

kk

#

thanks

formal bramble
#

โค

heady zinc
#

indeed, you have to check the audit logs, discord doesn't emit any specific event for kicks

#

and audit logs aren't even accurate tbh so its just shitty

quiet bobcat
#

I have another question... I need to have async (to be able to use await), user and the guild properties in that event

#

is that possible?

heady zinc
#

i mean

#

how wouldn't it?

quiet bobcat
#

idk

#

But I can't figure it out

heady zinc
#

to use async you just put the async keyword before the function

restive silo
#

mark the event function as async and then use await in it eyesThink

heady zinc
#

^

quiet bobcat
#

I can try

#

But how do I do the other two?

#

Because guild is still not defined.

heady zinc
#

which event tho

quiet bobcat
#

guildMemberRemove

heady zinc
#

wat

quiet bobcat
#

or can you even have guild in there

#

hm

heady zinc
#

psure guildMemberRemove gives you the guild as well

austere meadow
#

it does

#

member and guild

quiet bobcat
#

๐Ÿค”

#

I can't use guild

#

says that it's not defined

heady zinc
#

you know how to use a function jonasjac?

#

i mean it may be something to learn

quiet bobcat
#

oh

#

I'm an idiot

restive silo
#

@austere meadow it doesn't it gives you only a member since that has a .guild property

austere meadow
#

oh does it

#

zoomeyes checks stuff

restive silo
#

i know ma shit lol

#

mostly atleast

heady zinc
#

oh ye yuki is right

austere meadow
#

you're right

heady zinc
#

d.js is shit*

austere meadow
#

what

restive silo
#

more like js*

heady zinc
#

true*

quiet bobcat
#

Thanks

frail kestrel
#

py better

trim plinth
#

A way to define args without it making ascii look like this with commas and to keep it spaced out? I've tried multiple ways of defining args and none of them have fixed this issue

#

I'm using js with the current args defined as message.content.split(" ")

heady zinc
trim plinth
#

oof ty

worldly cliff
#

Hi guys

#

How do u add code to your bot

#

And do @worldly cliff when u do so

#

So I can see

#

And know

#

Bue

south finch
#

@worldly cliff you use google.

heady zinc
#

^

tropic ridge
#

What are the differences between JS, Java and Python libraries? Besides the language, obviously

austere meadow
#

the syntax can differ with other libraries as well as the API coverage

#

not all libs cover all ends of the API

#

like some don't have voice implementation

tropic ridge
#

Ah, which one would you recommend me to cover most of the stuff?

austere meadow
#

well it depends really, do you know javascript, and are you a beginner?

#

if so, i'd recommend discord.js

#

if you are more experienced with javascript, i'd say go with Eris

#

those are the only two libs i have experience with

#

there are plenty more though

tropic ridge
#

Ah, thanks, I'll look into discord.js then

austere meadow
worldly cliff
#

?

restive silo
#

well it always depends on the language as example js is really bad with music so if you want make a "full" music bot js would be a bad choice

worldly cliff
#

I figured out already

restive silo
#

๐Ÿ‘

austere meadow
#

also true what yukine said, it really depends on your skill level and what exactly you want to make

worldly cliff
#

Do u have a name in Chinese @restive silo

austere meadow
#

but most people use discord.js

restive silo
#

thats Japanese angeryCry and ^

worldly cliff
#

^

austere meadow
#

i use discord.js myself and i like it

tropic ridge
#

I pretty much wanna do a bot with a basic levelling system and fights inbetween members

worldly cliff
restive silo
#

then js with d.js is a pretty good choice

#

python with d.py is also fine for that

#

there are also plenty frameworks for d.js what mostly take a lot of work from you to make like reaction menu's or a command loader, command classes and database integration

#

so if you aren't wanna do that yourself i would recommend using a framework

tropic ridge
#

Aight! Thanks, gonna start working on it right now

restive silo
toxic hearth
#

How to send image using curl in php?

worldly cliff
#

php?

#

I have no idea

#

Google it though

earnest phoenix
#

@toxic hearth your bot got aproved?

toxic hearth
#

yep

earnest phoenix
#

how long u needed to wait?

worldly cliff
#

How long did u wait?

earnest phoenix
#

@toxic hearth

toxic hearth
#

Few days

earnest phoenix
#

k

worldly cliff
#

K

earnest phoenix
#

go dm

worldly cliff
#

What does that meen

#

Mean

austere meadow
worldly cliff
#

Ok

pastel lynx
#

Can someone help me I can't install discord.py on my vps it comes up with egginfo error

low rivet
#

what's the full error

pastel lynx
#

Wait let me just get it up

#

Python setup. Py egg_info failed with error code 1

low rivet
#

screenshot?

pastel lynx
#

wait thats the wrong one

#

here

#

wait let me use pip3

#

its install pynacl

#

is it supposed to take a lot of time

low rivet
#

you need python 3.4 or above

#

read it @pastel lynx

pastel lynx
#

ok thanks im a noob

#

sorry

languid dragon
#

help

#

@wispy schooner EYES

inner jewel
#

one process per shard

languid dragon
#

wut

#

im new to sharding ples ;-;

weak parrot
languid dragon
#

omg kill me

#

-purge 20

sudden rivet
wispy schooner
#

@languid dragon dude, my bot isn't anywhere near sharding yet, and you're asking me for advice? LOL ask @ornate onyx

languid dragon
#

SMH

#

UR THE TUTORIAL GUY

wispy schooner
#

I KNOW

languid dragon
#

(โ•ฏยฐโ–กยฐ๏ผ‰โ•ฏ๏ธต โ”ปโ”โ”ป

wispy schooner
#

But how can I write a tutorial on something I've not had a need to do yet?

normal pagoda
#

I want to learn to code a bot but don't know what an easy code is to use for the bot.

languid dragon
#

smhhhhhh

cinder gate
#

@normal pagoda It depends on your comfort zone.

#

If you like tabbing, go with Python.

#

If you're okay with a bit of Mess, C should do the trick.

#

Otherwise, ABANDON ALL HOPE FOR NEWBIES

weak parrot
#

C# is pretty good

ornate onyx
#

JS. blobshrug

normal pagoda
#

I'm new to coding wanting to learn somewhere I have slight knowledge in python, and Java but can learn others if needed

sudden rivet
#

hi

weak parrot
cinder gate
#

Your best bet would be either Discord.js or Discord.py(Rewrite) - These two libraries are amazing

#

Ken, I'm sad

#

;-;

normal pagoda
#

Thanks guys

cinder gate
#

Not an isue.

languid dragon
#

EYES oh

cinder gate
#

I thought My bot was the most adorable. But apparently not.

languid dragon
#

which one is urs

cinder gate
#

Guess. =w=

languid dragon
#

FUK

#

im changing

#

(โ•ฏยฐโ–กยฐ๏ผ‰โ•ฏ๏ธต โ”ปโ”โ”ป

cinder gate
#

Hah!

languid dragon
#

ssorrrrryyy

cinder gate
#

It's fine! It's fine.

#

Don't worry about it.

#

The real one you should be worried about is my friend.

languid dragon
#

;~;

uncut slate
#

@languid dragon use eris

languid dragon
#

ban yourself.

inner jewel
#

eris > d.js

uncut slate
#

d.js sharding is pretty trash

#

aren't you at like barely 100 servers tho

languid dragon
#

im not even past 10

#

i just wanted to try things ok

uncut slate
#

mk

#

ya I wouldn't

cinder gate
#

Neither am I! High-five, Ken!

#

We might aswell be running the same bots. :3

languid dragon
#

aeth ples

#

ill probably ignore it cos doubt ill get past 2.4k SpinningLUL

cinder gate
#

Hm. Actual question, though.

should I rewire this script to do my dirty work to try and make a deep-learning AI?

earnest phoenix
#

const qdb = require("child_process").exec("npm install quick-db")