#development

1 messages · Page 403 of 1

austere meadow
#

@hidden veldt try copy and pasting this character in place of the unicode codes 1️⃣

hidden veldt
#

..

austere meadow
#

it looks really strange but it is the 1 character

hidden veldt
#

hmm?

#

if python crashes...

#

oh

#

it didnt

#

wow...

#

nope

#

it doesnt work

#

its not crashing

#

its doesnt show an error

#

it just doesnt to anything

uncut slate
#

you have to log the emoji value

#

to know what it is

#

at least, that's the easiest way

hidden veldt
#

whats emoji value

#

...

uncut slate
#

print(reaction.emoji)

hidden veldt
#

hmm

#

o

#

k

mental solstice
#

== "1⃣"

#

atleast thats what i use in c#.. idk if py lib is the same persay

hidden veldt
#

yep

#

the function works

#

i checked

#

but for some reason

#

it wont say anything:(

wooden shoal
#

Hey does anyone know how to fix this error?
FATAL ERROR: v8::ToLocalChecked Empty MaybeLocal. Aborted
It happens when I run my bot. It was caused by downloading better-sqlite3, and it only happens on my raspberry pi.
Any help would be great

hidden veldt
#

...

#

what are u using

mental solstice
#

tristan

#

who made the message

wooden shoal
#

d.js

mental solstice
#

that u are adding the reaction to

wooden shoal
#

it's not the lib tho

hidden veldt
#

a bot

mental solstice
#

if reaction.message.author.bot:
return

hidden veldt
#

@mental solstice

#

yeah

#

i got that

mental solstice
#

if the author of your message is a bot

#

return

hidden veldt
#

@client.event
async def on_reaction_add(reaction, user):
if reaction.message.author.bot:
return
if reaction.emoji == "\u0031\u20E3":
print("\u0031\u20E3")
await client.send_message(reaction.message.channel, "yay this works!")

#

no

mental solstice
#

youre adding the reaction to the message a bot created?

hidden veldt
#

thats not the problem anymore

#

yes

#

the problem is the bot knows im reacting

#

but it isn't saying anything

mental solstice
#

so u get past that line of code then?

hidden veldt
#

line 4... I think?

mental solstice
#

line 4 is return.. no?

hidden veldt
#

yeah

#

oh

#

no

#

line 7

#

i think

#

if not

#

then idk what ur sayin

mental solstice
#

im saying.. message.author == bot

hidden veldt
#

oh

#

line 3

mental solstice
#

so your code will return

hidden veldt
#

yeah

#

line 3

#

it checks if the user is a bot

#

then returns if yes

knotty steeple
mental solstice
#

maybe im mistaken.. youre not checking if the reaction user is a bot

#

youre checking if the person who created the message you reacted to is a bot

hidden veldt
#

oh

#

but it doesnt do anything at all...

#

so like...

#

It's asking if the person who created the message is a bot

#

and I'm clearly not a obt

#

so it won't return

mental solstice
#

but the bot created the message

hidden veldt
#

oh..

#

so what do I ask

mental solstice
#

reaction.user.isbot

#

im not sure of the lib

#

do u have the docs?

hidden veldt
#

yep

#

but I cant find it

knotty steeple
#

uh guys

#

something weird is happening

hidden veldt
#

what

#

is

#

happening

#

wiat

#

u tryin to embed pics

#

right

#

@mental solstice docs doesnt say anything about that

knotty steeple
#

if i have to use this link for an image https://ep01.epimg.net/tecnologia/imagenes/2013/12/10/actualidad/1386677703_010784_1386679831_noticia_normal.jpg in an embed it shows up but if i use this link http://media.technicles.com/2013/06/win7.jpg it doesnt show up. why is this

mental solstice
#

try doing reaction.User.IsBot

#

or reaction.member.bot

#

idk the correct methods for it

#

could be glitched.. did u try more than once?

#

@knotty steeple

knotty steeple
#

yes

earnest phoenix
#

Are non bot related questions allowed here?

knotty steeple
#

no

mental solstice
#

😂

#

sam.. i imagine discord would scale it.. but the other picture is quite a bit bigger.. could be an issue?

knotty steeple
#

maybe

mental solstice
#

@hidden veldt any luck?

#

i dont see a limit on discord for picture size. maybe its just taking a long time for it to convert

#

Enis.. whats the issue?

#

in notice you have Let link =.. then print(Link)

#

idk if case matter in the language

#

console.log(Link)

#

sorry

#

can Let be uppercase?

knotty steeple
#

no

low owl
#

Dude

#

You gotta read your stuff. Casing matters 😅

knotty steeple
#

let has to be lowercase

#

no problem 😄

#

@mental solstice talking about the image, it is 1600x1000 so its probably too big

#

the windows image

mental solstice
#

yeh, i noticed that, i didnt see limits on the discord website. but who knows

#

tristan went quiet.. fingers cross that solved it for him

knotty steeple
#

what link?

#

no sorry

low rivet
#

is that your bot?

#

that you can't add

#

go to your discord developers page and untick code grant and all those

knotty steeple
#

uh ok

#

just use the example on the discord.js website then work on from there

low rivet
#

anyone used google analytics on dbots page? how would i do it 😳
i tried a couple ways and they didn't work

topaz fjord
#

@earnest phoenix it does work lmao I've used it

#

Also why is ur message.content.split(" ") like message.content.split (" ")

elder rapids
#

Follow your own style :(

topaz fjord
#

It's not

elder rapids
#

Don't just copy the video

topaz fjord
#

Look at the video carefully

ashen quail
knotty steeple
#

is it home-hosted?

ashen quail
#

yee

#

meaning I host it from console xD

#

for now

night imp
#

@ashen quail Go to index.js:25:29)

#

and post that code

ashen quail
#

meaning lne 25?

#

ok

night imp
#

line 25 yeah

#

and the code around it

ashen quail
#

line 25 is empty xD

knotty steeple
#

weird

night imp
#

in index.js?

ashen quail
#

so should I give you line 25 to 29?

#

Yeah

night imp
#

give me line 15-30

ashen quail
#

Ah wait!

#

I remember changing my code after this error

#

lemme restart it again and when it has that error I will tell ya

night imp
#

k

#

cuz I think the problem is that you have this

#

Client.bot.on

#

instead of

#

Client.on

ashen quail
#

ok lemme see that

#

well I have this:

const bot = new Discord.Client({disableEveryone: true});
night imp
#

oh

#

then use

#

Bot.on

ashen quail
#

yeah i did that

#

look:

#
bot.on("message", async message => {
night imp
#

is that what is giving errors?

ashen quail
#

idk you said that im not using bot.on

#

so then i showed you

night imp
#

I thought that would be the error

ashen quail
#

wait 5 min im bleeding a lot xD

night imp
#

but could you post the code where the error occured?

ashen quail
#

well line 25 is empty

#

omg this hurts so much xD

night imp
#

does it still give the error?

#

you can go

ashen quail
#

idk

#

oh it is fine

#

lemme wait until the error is back

night imp
#

ok well if you sent the original code I could fix it but if you don't need it then

#

¯_(ツ)_/¯

ashen quail
#

ok sending code through dm

#

hastebin or just typing it?

knotty steeple
#

type it

#

```js
code here
```

topaz fjord
#

^

earnest phoenix
#

This isnt changing the embed and idk why

#
.fetchMessage(id).then(msg => {
            
            embed = msg.embeds[0]

            embed.fields.splice(-1,1)



        msg.edit(embed)

        })```
#

the fetchmessage is on a channel

#

and the id, is an actual message id

#

_+

#

it just puts "edited"

#

and doesnt remove the reason feild

#

i tried to change the field.value, but that didn't work either

#
[ MessageEmbedField {
    embed:
     MessageEmbed {
       message: [Object],
       type: 'rich',
       title: 'Kick | Case #3',
       description: undefined,
       url: undefined,
       color: 16773632,
       fields: [Circular],
       timestamp: '2018-04-28T15:56:12.946000+00:00',
       thumbnail: null,
       image: null,
       video: null,
       author: null,
       provider: null,
       footer: null },
    name: 'User',
    value: 'LoseJoe#6437 (@hearty rampart)',
    inline: true },
  MessageEmbedField {
    embed:
     MessageEmbed {
       message: [Object],
       type: 'rich',
       title: 'Kick | Case #3',
       description: undefined,
       url: undefined,
       color: 16773632,
       fields: [Circular],
       timestamp: '2018-04-28T15:56:12.946000+00:00',
       thumbnail: null,
       image: null,
       video: null,
       author: null,
       provider: null,
       footer: null },
    name: 'Moderator',
    value: 'LoseJoe#6437',
    inline: false } ]``` this is when i log "embed"
#

TLDR; Im trying to edit an embed, from a message object. (fetched message)

hidden veldt
#

hi

#

whatup

#

sorry

#

i had to go

#

no

#

i had no luck

#

@mental solstice

#

ok

#

tf...

#

hheh

#

WHOAH

#

THERE ARE LIKE A THOUSAND OF U

mental solstice
#

Tristan. Instead of returning.. send a message under that condition.. if message.author.bot... make it send a message to the channel

frail harness
#

wtf why

hidden veldt
#

ok

#

cool

#

@client.event
async def on_reaction_add(reaction, user):
if reaction.emoji == "\u0031\u20E3":
print("\u0031\u20E3")
if reaction.message.author.bot:
await client.send_message(message, "we have returned to the start of the function!")
await client.send_message(reaction.message.channel, "yay this works!")

#

that?

#

wait

#

it says this

#

1⃣
Ignoring exception in on_reaction_add
Traceback (most recent call last):
File "C:\Python\lib\site-packages\discord\client.py", line 307, in _run_event
yield from getattr(self, event)(*args, **kwargs)
File "C:\Users\edwar\Desktop\Bot-Lib\TB\v1.py", line 32, in on_reaction_add
await client.send_message(message.channel, "we have returned to the start of the function!")
NameError: name 'message' is not defined
1⃣
Ignoring exception in on_reaction_add
Traceback (most recent call last):
File "C:\Python\lib\site-packages\discord\client.py", line 307, in _run_event
yield from getattr(self, event)(*args, **kwargs)
File "C:\Users\edwar\Desktop\Bot-Lib\TB\v1.py", line 32, in on_reaction_add
await client.send_message(message.channel, "we have returned to the start of the function!")
NameError: name 'message' is not defined

#

.. 😦

#

lemme try makng it pring something

frail harness
#

because message is not defined in this scope

hidden veldt
#

yep

#

it prints it twice

frail harness
#

it even shows you the line you made the error

hidden veldt
#

yeah

#

ik

#

but I dont know how to make it... understand message...

#

how...

mental solstice
#

U dont need message

frail harness
#

tell me what args are being passed to on reaction add

hidden veldt
#

hmm

#

reaction

#

user

#

thats all

#

wait those are parameters

frail harness
#

reaction.message

#

yes

mental solstice
#

Reaction.member or user

hidden veldt
#

ok

#

cool

#

async def on_reaction_add(reaction.message, user):?

frail harness
#

no

#

use reaction.message within the function to get the message that the reaction is added to

hidden veldt
#

ooh

mental solstice
#

No.. u dont need anything about the message

hidden veldt
#

o

#

wait

#

wat

mental solstice
#

U just need to change your first condition to reaction.user.bot instead of reaction.message.author.bot

hidden veldt
#

wat

#

ok

frail harness
#

that's not where the error is happening lol @mental solstice

mental solstice
#

Or if user is already the user who added the reaction

hidden veldt
#

ok

#

wait lemme explain my logic

#

the bot says something

#

then it adds reactions

#

then u react

#

and it says something

#

wa

#

uh..

#

it says user is not defined 😦

#

screeeee

frail harness
#

tf lol

#

are you using async or rewrite

hidden veldt
#

async

#

😐

frail harness
#

you need to read the docs

hidden veldt
#

i....did...

#

it said something like

#

esiy

#

wait

#

im on it rn

frail harness
#

wait_for_reaction is a function that exists

hidden veldt
#

discord.on_reaction_add(reaction, user)
Called when a message has a reaction added to it. Similar to on_message_edit, if the message is not found in the Client.messages cache, then this event will not be called.

Note

To get the message being reacted, access it via Reaction.message.

Parameters:
reaction – A Reaction showing the current state of the reaction.
user – A User or Member of the user who added the reaction.

#

somethin like that

#

thats wat it says

frail harness
#

next time

#

please read the docs

hidden veldt
#

ooh

#

wait

#

this part...

#

New Features
Client.wait_for_reaction() now returns a namedtuple with reaction and user attributes.
This is for better support in the case that None is returned since tuple unpacking can lead to issues.

#

wait...

#

wat.

#

lemme try dat

#

uh...

#

I got another issue...

#

what if i wanted the bot to react in two different ways depending on the reaction?

#

ok...

#

wait

#

i cant ping everyone>

#

aww..

#

noone?

#

Aw,,,

floral stone
#

@frail harness I think that's rewrite

frail harness
#

rewrite the functiion changes, but its still available in async

hidden veldt
#

wait...

#

uh...

#

remember me...

#

aw

#

u dont

#

ok

umbral summit
#

code cant find something

topaz fjord
#

just bot node <bot file>

umbral summit
#

can you explain it better i am just noob

earnest phoenix
#

could someone here help me with POST requests not working on express behing nginx?

umbral summit
stray cedar
knotty steeple
#

what is zeit

knotty steeple
#

Im making a help command, and im using fs for it, and i was wondering how to remove the .js here http://i65.tinypic.com/2a7srbo.png Me and someone was struggling for a way to remove it

#
require('fs').readdirSync("../Artemis/cmds").join("\n")
uncut slate
#

more than 1 way

#

.slice(0, -3) works if your ext is always going to be .js

knotty steeple
#

the end will always be .js

foggy delta
#

Anyone here use Discord.JS master branch? Need help with clearing reactions from a message. Can't figure out how to do it!

msg.channel.send(`XD`).then((m) => {
      m.react(`😂`).then((reaction) => {
        // Clear 😂 here or something
      });
    });
  }
abstract crystal
earnest phoenix
#

lmao

foggy delta
#

That's the stable version saddly :(

#

Not Master version

#

That's master

#

:ccc

abstract crystal
#

oooooh i see sorry

foggy delta
#

Yeah

#

Sad life

abstract crystal
#

maybe await reaction?

foggy delta
#

That's a reaction collector. I just want to delete a reaction placed by a user or the bot on a message

abstract crystal
#

interesting, why it's not allowed

low owl
#

Allowed?

foggy delta
#

@knotty steeple try this to remove the .js from a filename using the 'path' module built into Node.JS

const path = require(`path`);

path.basename(__filename, '.js');

This'll return the filename without the .js :d

knotty steeple
#

ok

#

thanks

foggy delta
#

👌

abstract crystal
#

well implemented, i mean the stable has it, but master doesn't

foggy delta
#

Yeah, strange

#

Oh fuck me... I think I just deleted my files by accident! Ffffffff

#

:(

#

:CCCCCCCCCCCC

abstract crystal
#

Recycle bin?

foggy delta
#

I haven't enabled it :(((((((((((

#

@unique birch ping

abstract crystal
#

rip maybe try Photorec

foggy delta
#

Photorec?

#

My Bot is hosted on a VPS

abstract crystal
foggy delta
#

Oh fuck yeah

abstract crystal
#

Linux

foggy delta
#

If this works

#

I'll kiss you

abstract crystal
#

xd

earnest phoenix
#

how do you manage that

foggy delta
#

Atom being a twat

#

And accidently delted all my files

#

Fucking tits

earnest phoenix
#

sick

knotty steeple
#

Atom? I use VSC

earnest phoenix
#

you deleted everything but the modules as well

#

at least you dont have to install modules

#

oh wait nvm those are gone as well

foggy delta
#

Come on work ;-;

#

Getting there

tepid laurel
#

Anyone here uses node-ipc?

foggy delta
#

But I don't know what I'm doing, never used this before

#

Nope, sorry

spring ember
#

@earnest phoenix for the question you asked on #topgg-api use lavalink

abstract crystal
#

it will just come up with lots of files and you'll have to sift through them + they don't have original names

#

@spring ember not sure if he/she/it wanted that

knotty steeple
#
const path = require(`path`);

path.basename(__filename, '.js')
``` just returns the help.js file
foggy delta
#

Really?

knotty steeple
#

yes

foggy delta
#

Why does it work for me? xd

knotty steeple
foggy delta
#

Should return the filename without .js

#

Yeah is that not what you wanted?

knotty steeple
#

yes but i want it for all the files in my cmds folder

foggy delta
#

Ah

knotty steeple
#

which are all .js

foggy delta
#

Do this:

const path = require('path');
const fs = require('fs');

let commandArr = [];
let commands = fs.readdirSync(`/path/to/command/dir/`);

for (let i = 0; i < commands.length; i++) {
    commandArr.push(path.basename(`/path/to/command/dir/${commands[i]}`, `js`);
}

console.log(commandArr); // Should have all command names
knotty steeple
#

ok

#

Things are going good

spring ember
#

Lol the copyright

knotty steeple
#

now i want it to add the prefix to each filename

foggy delta
#

Ez

#

But first

#

I got my files fixed

#

I forgot that I had backups

knotty steeple
#

good

foggy delta
#

Litterally right in front of me

knotty steeple
#

lol

foggy delta
#

.-.

earnest phoenix
#

toEmp

foggy delta
#

Sush

#

Why are you here, get back to our server loser

earnest phoenix
#

nie kurwa

knotty steeple
#

how do i do the thing that u say is ez

earnest phoenix
#

@foggy delta help out your customer

tulip kraken
#
    msg.guild.createChannel(`Ticket-${msg.author.username}`, 'text' [{
    id: msg.author.id,
    deny: ['MANAGE_MESSAGES'],
    allow: ['SEND_MESSAGES'],
    },
    {
    id: '@everyone',
    deny: ['READ_MESSAGES','SEND_MESSAGES','READ_MESSAGE_HISTORY']
#

I need some help

#

This creates a channel

#

but doesnt do the permissions

#

while i clearly tell it to do permissions

foggy delta
#

Oh sorry

#

I'm bacl

#

What

#

Ok so @knotty steeple

#

You know your commandArr?

knotty steeple
#

yes

night imp
#

@tulip kraken Try adding a callback and then setting it

foggy delta
#

Just like:

let commandList = [];

for (let command of commandArr) {
commandList.push(`${prefix}${commandArr[command]}`);
}

msg.channel.send(`
${commandList.join('\n')}
`);
night imp
#

it may not of been created yet

uncut slate
#

that'd be wrong

#

you're sending a string

foggy delta
#

Sh

uncut slate
#

for..of would return the values

#

not the indexes

#

so that's still wrong

earnest phoenix
#

Anyone know how Ascii Art works?

#

i need a command for it

#

when moist calls himself elite programmer yet he deletes his own bot files like 3 times

#

XD

foggy delta
#

You know what @uncut slate

#
for (let i = 0; i < arr.length; i++) {
// ..
}
#

Happy?

inner jewel
#

var i

foggy delta
#

let > var

uncut slate
#

just msg.channel.send(commandList.map(command => prefix + command).join('\n'))

foggy delta
#

SAME THING

inner jewel
#

command + prefix

foggy delta
#

PSH

inner jewel
#

or even better

#

msg.channel.send(commandList.map(command => prefix + command).join("\n"))

foggy delta
#

Yeah you know what, why didn't I just

#

.map

#

I'm stupid xd

#

I forgot that even existed

uncut slate
#

natan

#

r u ok

uncut slate
#

I edited it before you sent yours tho 😤

tulip kraken
#
chan.overwritePermissions('@everyone', { SEND_MESSAGES: false, READ_MESSAGE_HISTORY: false, READ_MESSAGES: false })```
#

how would i define @ everyone in this case

#

i failed miserably

#

i also tried

#

without the '' and the @

grizzled isle
#

You need to get the role id to set permissions for roles.

tulip kraken
#

@ everyone isnt a role

#

and doesnt have a id

grizzled isle
#

But it is

#

and it does

inner jewel
#

the everyone role has an id

#

it's the guild id

tulip kraken
#

rly

#

hmm

#

ill try that

#

ty

#

Ya learn something new everyday

knotty steeple
tulip kraken
#

YUP

#

Works like a charm

#

Thanks

knotty steeple
#

i need fix

#

if i use the commandArr without the prefix it works but with commandList, with the prefix this happens

knotty steeple
#

hello

#
const path = require('path');
const fs = require('fs');
const prefix = "a]"

let commandArr = [];
let commands = fs.readdirSync(`hmm`);

for (let i = 0; i < commands.length; i++) {
    commandArr.push(path.basename(`directory/to/cmds/${commands[i]}`, `.js`));
}

let commandList = [];

for (let command of commandArr) {
commandList.push(`${prefix}${commandArr[command]}`);
}


exports.run = function(bot, msg) {
    msg.channel.send("📨 Help coming in your DMs!")
    const embed = {
        "title": "Hey! Im Artemis!",
        "description": "Here you can learn about my commands and how to use them!",
        "color": 5315286,
        "footer": {
            "icon_url": "https://cdn.discordapp.com/embed/avatars/0.png",
            "text": `© 2018 SamuraiStacks | v${package.version}`
        },
        "author": {
            "name": "Artemis by SamuraiStacks.  | Click here to join support server!",
            "url": "cant"
        },
        "fields": [
            {
                "name": "The commands",
                "value": `${commandList.join('\n')}`
            }
        ]
    };
    msg.author.send({ embed });
}
knotty steeple
#

nvm i fixed it

hidden veldt
#

heyyo

#

i

#

have

#

another

#

issue

#

hehe

#

I'm doing python async how would u make a bot recieve exactly what reaction u do?

#

heres my code...

#

msg = await client.send_message(message.channel, "YAY")
await client.add_reaction(msg, "\u0031\u20E3")
await client.add_reaction(msg, "\u0032\u20E3")
await client.add_reaction(msg, "\u0033\u20E3")
await client.add_reaction(msg, "\u0034\u20E3")
cow = await client.wait_for_reaction(["\u0031\u20E3"], message = msg)
await client.send_message(message.channel, "yay...")

#

so how could I make it respond depending on my reaction?

#

kk

static lynx
#

whos good with APIs?

knotty steeple
#

me

#

well APIs for js

static lynx
#

rip

#

I need help with Python AIOHTTPs

hidden veldt
#

hmm...

#

well there's we api docs

#

hey are any bot devs on

#

i sorta need help

grizzled isle
#

if I knew python I would help.

toxic oracle
#

795 to be exact

static lynx
#

i have checked so many docs lol

hidden veldt
#

hi

#

anyone know python

#

i still need help

#

srry for continually asking

#

but nobodyes on when I am

lament meteor
#

how do you only get stuff from an array like
var a = ["a", "b", "c", "d", "e", "f", "g", "h"]
and i only want to get the first until thrid

grizzled isle
#

a.slice(0,3)

hidden veldt
#

heh

grizzled isle
#

Tristan you may want to go to the coding den if you need help with python

static lynx
hidden veldt
#

ok

#

thx

#

@static lynx

static lynx
#

theres a coding channel?

hidden veldt
#

heres my prob

#

nu

static lynx
#

ok

hidden veldt
#

there aint

static lynx
#

go on

#

whats your prob

hidden veldt
#

@client.event
async def on_message(message):
if message.content == "yay":
x = random.randrange(1, 2)
if x == 1:
msg = await client.send_message(message.channel, "yay")
await client.add_reaction(msg, "\u0031\u20E3")
await client.add_reaction(msg, "\u0032\u20E3")
await client.add_reaction(msg, "\u0033\u20E3")
await client.add_reaction(msg, "\u0034\u20E3")
def check(reaction, user):
e = str(reaction.emoji)
return e.startswith(("\u0031\u20E3"))
def check2(reaction, user):
e2 = str(reaction.emoji)
return e2.startswith(("\u0032\u20E3", "\u0032\u20E3", "\u0032\u20E3"))

res = await client.wait_for_reaction(message=msg, check=check)
await client.send_message(message.channel, "yay!")    
res = await client.wait_for_reaction(message=msg, check=check2)
await client.send_message(message.channel, "also yay!")
#

kabam

#

thats my code

#

uh...

static lynx
#

oye

topaz fjord
#

code block pls

#

do

hidden veldt
#

how u do that

static lynx
#

can you ```py it

hidden veldt
#

idk how to embed

topaz fjord
#

py code

static lynx
#

py <text>

topaz fjord
#

^

static lynx
#

oops

topaz fjord
#

3 `

#

then py

#

then code

hidden veldt
#

hi

topaz fjord
#

then

hidden veldt
#

oh

#

it works

#

ok

#

`@client.event
async def on_message(message):
if message.content == "yay":
x = random.randrange(1, 2)
if x == 1:
msg = await client.send_message(message.channel, "yay")
await client.add_reaction(msg, "\u0031\u20E3")
await client.add_reaction(msg, "\u0032\u20E3")
await client.add_reaction(msg, "\u0033\u20E3")
await client.add_reaction(msg, "\u0034\u20E3")
def check(reaction, user):
e = str(reaction.emoji)
return e.startswith(("\u0031\u20E3"))
def check2(reaction, user):
e2 = str(reaction.emoji)
return e2.startswith(("\u0032\u20E3", "\u0032\u20E3", "\u0032\u20E3"))

res = await client.wait_for_reaction(message=msg, check=check)
await client.send_message(message.channel, "yay!")    
res = await client.wait_for_reaction(message=msg, check=check2)
await client.send_message(message.channel, "also yay!") `
topaz fjord
#

3 `

hidden veldt
#

heh

static lynx
#

.```
hidden veldt
#

thats it

static lynx
#

no

topaz fjord
#

no

static lynx
#

no

#

wait

hidden veldt
#

wat...

low owl
#

Almost

topaz fjord
hidden veldt
#

oh i got it

#
async def on_message(message):
    if message.content == "yay":
        x = random.randrange(1, 2)
        if x == 1:
            msg = await client.send_message(message.channel, "yay")
            await client.add_reaction(msg, "\u0031\u20E3")
            await client.add_reaction(msg, "\u0032\u20E3")
            await client.add_reaction(msg, "\u0033\u20E3")
            await client.add_reaction(msg, "\u0034\u20E3")
    def check(reaction, user):
        e = str(reaction.emoji)
        return e.startswith(("\u0031\u20E3"))
    def check2(reaction, user):
        e2 = str(reaction.emoji)
        return e2.startswith(("\u0032\u20E3", "\u0032\u20E3", "\u0032\u20E3"))

    res = await client.wait_for_reaction(message=msg, check=check)
    await client.send_message(message.channel, "yay!")    
    res = await client.wait_for_reaction(message=msg, check=check2)
    await client.send_message(message.channel, "also yay!")```
#

YAY

#

FINALLY

topaz fjord
#

yes but also put lang after the first 3

hidden veldt
#

that

#

the last four lines

static lynx
low owl
#

And if you add a py it will also colour highlight

topaz fjord
#

^

hidden veldt
#

im tryin to run 1-2 and 3-4 the same time (for the last four lines)

static lynx
#

backwards `

#

lol

lament meteor
#

ty Zoth

hidden veldt
#

'hi'

#

no

#

ok

static lynx
#
@client.event
async def on_message(message):
    if message.content == "yay":
        x = random.randrange(1, 2)
        if x == 1:
            msg = await client.send_message(message.channel, "yay")
            await client.add_reaction(msg, "\u0031\u20E3")
            await client.add_reaction(msg, "\u0032\u20E3")
            await client.add_reaction(msg, "\u0033\u20E3")
            await client.add_reaction(msg, "\u0034\u20E3")
    def check(reaction, user):
        e = str(reaction.emoji)
        return e.startswith(("\u0031\u20E3"))
    def check2(reaction, user):
        e2 = str(reaction.emoji)
        return e2.startswith(("\u0032\u20E3", "\u0032\u20E3", "\u0032\u20E3"))

    res = await client.wait_for_reaction(message=msg, check=check)
    await client.send_message(message.channel, "yay!")    
    res = await client.wait_for_reaction(message=msg, check=check2)
    await client.send_message(message.channel, "also yay!")```
#

there

hidden veldt
#

hmm

#

yeah

topaz fjord
#

as far as i know await waits till its done to continue

hidden veldt
#

yep

#

yea

static lynx
#

wait

hidden veldt
#

thats my problem

static lynx
#

tristan can you gist or pastebin it?

hidden veldt
#

wat...

static lynx
hidden veldt
#

hmm

low owl
#

Hold on, await "makes" the code async and not sync 🤔

static lynx
#

and why 2

#

oh

#

i meant why is there two "="'s

#

are*

low owl
#

@topaz fjord It's a state machine. If there is an await it will make the call, continue with the code and then resumes when the await finished.

topaz fjord
#

o

minor elm
#
if(message.guild.id = "id here")

Always returns true

hidden veldt
#

wat

#

sorry

#

the wifi just crashed

#

yep

#

wat

minor elm
hidden veldt
#

no

#

im doing a problem

#

asking about one

minor elm
#

Then ask

hidden veldt
#

yeah

#

i did

#

already

#

@static lynx hey im back

#

sorry

static lynx
#

oh

#

its fine

hidden veldt
#

yeah

#

uh to answer ur question

static lynx
#

Again Im not great at coding but

hidden veldt
#

i got 2 = b/c it needs it for an if statement and a variable

#

heh

minor elm
#

Can someone tell me why

if(message.guild.id = "id here")
``` always returns true?
hidden veldt
#

well...

static lynx
#

uhh

hidden veldt
#

what u using

minor elm
#

d.js

static lynx
#

i suck at this, do you want to be in this large server that can help tristam

hidden veldt
#

idk js

#

srry

#

i tried it

#

and this stupid @override thing wouldnt work

static lynx
#

do you want the server link that can help

hidden veldt
#

wait

#

me?

#

sure

#

😃

#

ima gist that though

static lynx
#

check dms

hidden veldt
#

ok

#

waah nobodys on

#

sob

#

😄

topaz fjord
#

like Aly said, were not entitled to help u

minor elm
#

Nevermind i used assignment not comparasion

hidden veldt
#

ik

#

that was a joke

#

wait whos aly

frail harness
#

community manager

abstract mango
#

@minor elm still need help with that true problem?

#

oh i just saw your most recent message

#

lol

minor elm
#

No, figured it out myself

abstract mango
#

👍

hidden veldt
#

oh

#

k

ivory pebble
#

I'm getting this error from the dblapi.js npm package

#
  async postStats(serverCount, shardId, shardCount) {
        ^^^^^^^^^

SyntaxError: Unexpected identifier
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:549:28)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.require (module.js:504:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/root/ium/node_modules/dblapi.js/index.js:1:80)
#

Anyone know why?

inner jewel
#

what node version?

ivory pebble
#

6.14.1

#

Hmm

inner jewel
#

update

ivory pebble
#

Should be the latest

#

how do i install the lattest?

lament meteor
#

@ivory pebble

ivory pebble
#

@lament meteor THe bot is being hosting on Ubuntu server

young cradle
#

In the website they teach how to install in Ubuntu tho GabrielThink

ivory pebble
#

o, ok

#

Where does it say that?

topaz fjord
ivory pebble
#

I tried that, but didnt install latest version

#

Got it to work by doing this

#
wget -qO- https://deb.nodesource.com/setup_8.x | sudo bash -
sudo apt-get install -y nodejs```
#

Thanks!

topaz fjord
#

its not related to development

elfin stream
#

ok

#

im on my laptop and have discord opened up

#

what do i need to get started making a simple bot

#

i see a nice fancy program people always use, it's like in a 4 split or 2 split screen

#

kind of like that website where you can test coding lol

#

im on windows

low rivet
#

learn programming

elfin stream
#

i got that down, enough lol

low rivet
#

what lang do u know

elfin stream
#

what interface would you recommend?

#

nodeJS, Java, JavaScript, C++

low rivet
#

then get started on making a d.js bot or eris bot 😳

#

read their docs first though

elfin stream
#

installing node.js for windows

#

do i need just the api info from discords website for bot logins, or do i need to run a discord instance with an account?

low rivet
#

have u done anything in node before..?

elfin stream
#

yeah, used to run litecoin mining pool for an altcoin called GarliCoin

#

and the website interface

low rivet
#

then why don't u have node on your pc... thonkku

elfin stream
#

installing python

#

i didn't manage the server on this computer, i ran that on a friends VPS running ubuntu

#

would i want visual studio? which year is most common?

trim plinth
#

2017 is gud

toxic oracle
#

ur good

trim plinth
#

and if you're using js, you want visual studio code

toxic oracle
#

roasted

earnest phoenix
#

I am getting this error and I don’t get it let me get the picture of the error.

#

What should I do?

#

Anyone?

#

@earnest phoenix

#

Idk why I tagged myself.

quiet bobcat
#

It says Error: Cannot find module '/root/Savitar50/bot.js' so it's something with that

earnest phoenix
#

Ik

#

But how could I fix it?

wise bridge
#

Use the correct path maybe?

quiet bobcat
#

^

#

/root/Savitar50/bot.js doesn't exist

earnest phoenix
#

Ok.

#

Oh wait I get it.

wise bridge
#

try cat /root/Savitar50/bot.js

#

And see what it gives

earnest phoenix
#

Cat?

wise bridge
#

That's a command

#

In your console

earnest phoenix
#

Oh ok.

#

I thought it was because I skipped one of them.

wise bridge
#

And? What does cat yield?

earnest phoenix
#

Well I didn’t add it yet since I don’t have my PC rn.

wise bridge
#

Ah

#

It should just say the file doesn't exist

earnest phoenix
#

Ok.

#

I think I am supposed to say:

#

/root/Savitar50/.../bot.js

wise bridge
#

?

#

Go to the directory where the file is and do pwd

tulip kraken
#

How would i measure my own ping in discord.js? editing a message gives me discords ping
and client.ping is the API's ping

#

-bot @low rivet

#

-botinfo @low rivet

gilded plankBOT
#

That bot wasn't found

tulip kraken
#

bruh

low rivet
tulip kraken
#

jup

#

found out too late

#

😂

earnest phoenix
#

Hello.

#

I need help let me get a pic of my issue one sec.

#

Can anyone help me?

#

I typed bot.js

low owl
#

Oh boi, you didn't hide the IP 😛

prime cliff
#

Oof

earnest phoenix
#

Shit.

prime cliff
#

Time to hack it

low owl
#

Well, he should use a key anyways. RSA or something.

earnest phoenix
#

@prime cliff How would you hack it without the password?

solemn obsidian
#

bruteforcing

knotty steeple
#

@earnest phoenix are u trying to start ur bot

earnest phoenix
#

Yes.

#

Also you tagged the wrong person.

#

There.

prime cliff
#

@earnest phoenix do cd

knotty steeple
#

^

earnest phoenix
#

Cd?

#

That’s all?

prime cliff
#

I mean ls

#

That lists your files

knotty steeple
#

then you cd

earnest phoenix
knotty steeple
#

well then idk

spring ember
#

uninstall and reinstall putty

earnest phoenix
#

Cd worked.

#

What do put after cd?

knotty steeple
#

did u cd to the folder bot.js is in

prime cliff
#

ls not found GWmythicalThonkCool

knotty steeple
earnest phoenix
#

?

#

So cd node bot.js

#

??

knotty steeple
#

no

earnest phoenix
#

Then what?

knotty steeple
#

cd is to go to a folder

earnest phoenix
#

Oh.

knotty steeple
#

then learn a language

earnest phoenix
#

So I do cd bot.js

#

?

knotty steeple
#

thats not a folder is it?

#

no

#

ls

earnest phoenix
#

Then what???

#

Ok.

#

So cd 1s

#

?

knotty steeple
#

just ls

earnest phoenix
#

That isn’t found.

prime cliff
#

What os do you have savitar

knotty steeple
#

i do

earnest phoenix
#

Os?

prime cliff
#

@wispy swan use google

#

@earnest phoenix what linux are you using

knotty steeple
#

codecadamy 😉

earnest phoenix
#

Umm

#

32 bit?

knotty steeple
#

how to make a discord bot 2018

earnest phoenix
#

Can anyone help me?

halcyon abyss
#

Does /bin/ls work ?

#

I guess you messed up your PATH variablle

dapper olive
#

spaghett

subtle steeple
#

🤦

earnest phoenix
#

One more question.

#

How do you get putty on your mobile?

uncut slate
#

use an SSH client that's available on your device

earnest phoenix
#

Like?

#

I got termius but that is bs.

#

It won’t work.

#

Is Shelly good?

uncut slate
#

which OS do you use

earnest phoenix
#

IPad Air 2 if that is what you are talking about. If it isn’t sorry I am not good with this kind of stuff.

uncut slate
#

so iOS

knotty steeple
#

yup

earnest phoenix
#

Yes.

uncut slate
#

I don't know of any good iOS SSH clients, but someone else might

pulsar cairn
#

i dont

earnest phoenix
#

Ok.

uncut slate
#

anyone who does would answer, sit tight or do some research 😄

earnest phoenix
#

Ok,

#

Ok!

#

Do you agree with Google?

knotty steeple
#

yes

earnest phoenix
#

Which one?

knotty steeple
#

Prompt 2

#

that one looks good

earnest phoenix
#

Ok.

knotty steeple
#

o wait

earnest phoenix
#

?

knotty steeple
#

if u have money u can get it

earnest phoenix
#

Oh shit I can’t.

knotty steeple
#

its $14.99

earnest phoenix
#

I got 7 dollars left.

knotty steeple
#

well

#

Shelly

earnest phoenix
#

Ok.

#

Termius is shit,

uncut slate
#

Their desktop client is nice, what issues are you running into with their mobile one?

earnest phoenix
#

Getting into the coding part.

uncut slate
#

you don't write code over SSH

earnest phoenix
#

I mean like this part:

uncut slate
#

that's not an issue with your SSH client

earnest phoenix
#

Oh.

#

I am soo dumb.

#

What do I do now?

uncut slate
#

Put in your server's IP address

earnest phoenix
#

Oh ok.

low owl
#

Hold on

#

You tried to use the shell without ssh'ing into something?

earnest phoenix
#

?

#

It works for me now.

low owl
#

I don't do JS but I would guess startsWith returns a boolean

hidden veldt
#

hmm...

#

yeah

knotty steeple
#

what is the trigger message gonna be

low owl
#

It does. You essentially try to compare a boolean to a string

earnest phoenix
#

This error is pissing me.

knotty steeple
#

prefix+test?

hidden veldt
#

i had the same problem with python when I first started. It kept saying that there was no module named discord.

#

but i just ignored it and it worked fine.

knotty steeple
#

if(msg.content.startsWith(botsettings.prefix + "TEST")) {}

hidden veldt
#

yep

knotty steeple
#

yes

low owl
#

Great, now you spoonfed

hidden veldt
#

that looks right

low owl
#

😐

hidden veldt
#

😐

#

😐 😐 😐

#

ok

#

now I got a friggin problem

#

im sad 😦

uncut slate
#

What is it?

low owl
#

Then try to find out why it doesn't work

hidden veldt
#
async def on_message(message):
    if message.content == "test":
        x = random.randrange(1, 2)
        if x == 1:
            msg = await client.send_message(message.channel, "hi")
            await client.add_reaction(msg, "\u0031\u20E3")
            await client.add_reaction(msg, "\u0032\u20E3")
            await client.add_reaction(msg, "\u0033\u20E3")
            await client.add_reaction(msg, "\u0034\u20E3")
    def check(reaction, user):
        e = str(reaction.emoji)
        return e.startswith(("\u0031\u20E3"))
    def check2(reaction, user):
        e2 = str(reaction.emoji)
        return e2.startswith(("\u0032\u20E3", "\u0032\u20E3", "\u0032\u20E3"))
    for p in range(0, 500):
        res = client.wait_for_reaction(message=msg, check=check)
        client.send_message(message.channel, "yay!")    
        res = client.wait_for_reaction(message=msg, check=check2)
        client.send_message(message.channel, "also yay!")
        time.sleep(0.01)
    return```
#

that

#

when I run it

#

it says this

earnest phoenix
#

I got a problem with ssh

hidden veldt
#
Traceback (most recent call last):
  File "C:\Python\lib\site-packages\discord\client.py", line 307, in _run_event
    yield from getattr(self, event)(*args, **kwargs)
  File "C:\Users\edwar\Desktop\Bot-Lib\TB\v1.py", line 38, in on_message
    res = client.wait_for_reaction(message=msg, check=check)
UnboundLocalError: local variable 'msg' referenced before assignment```
#

wat

knotty steeple
#

yeah that should work

hidden veldt
#

i tried changing msg to something else

#

but it wouldnt work

#

the code wont run with this issue

low owl
#

@earnest phoenix Be more explicit. What are your use cases? What did you try and what was the result?

earnest phoenix
hidden veldt
#

whoah

#

that looks snazzy

low owl
#

I figured that out already.

earnest phoenix
#

Can someone help me out?

hidden veldt
#

so... the problem is the variables are not defined?

knotty steeple
#

@earnest phoenix your in node

earnest phoenix
#

Yes.

hidden veldt
#

ok

low owl
#

But I want to know what message you tried exactly.

earnest phoenix
#

What does that mean?

knotty steeple
#

why

hidden veldt
#

uh Im also asking the same question

#

so yeah soz idk

knotty steeple
#

your in the node command prompt essentially

earnest phoenix
#

Oh.

#

How do I get out?

knotty steeple
#

idk, i use windows

earnest phoenix
#

Ok.

knotty steeple
#

if i were to exit i do ctrl+c

earnest phoenix
#

Ok.

knotty steeple
#

or .exit

earnest phoenix
#

Ok got out.

#

Yeah I did ctrl c

#

Now what!

#

?

knotty steeple
#

screenshot

earnest phoenix
knotty steeple
#

so does cd not work

#

or ls

earnest phoenix
#

Let me try.

#

It says 1s is not found.

hidden veldt
#

...

knotty steeple
#

try dir

earnest phoenix
#

And cd just makes another line.

#

Ok.

hidden veldt
#

Ok

#

Heh

earnest phoenix
#

App

hidden veldt
#

'''cow'''

knotty steeple
#

its windows :P

hidden veldt
#

Wait

#

I can't embed on iPod

#

Nooooooooo

earnest phoenix
#

I typed dir and it made another line saying app then made another line.

hidden veldt
#

I'm sad

knotty steeple
#

what does it look like

earnest phoenix
knotty steeple
#

try dir app

earnest phoenix
#

Ok.

knotty steeple
#

there u go

earnest phoenix
#

But I am trying to make the bot online.

knotty steeple
#

node app/bot.js

earnest phoenix
#

Oh ok.

knotty steeple
#

express is a node module

#

you need to install it

earnest phoenix
#

Where?

hidden veldt
#

Command prompt?

knotty steeple
#

just install it like you installed discord.js or whatever you use

hidden veldt
#

Idk

#

Ok

#

Cya

earnest phoenix
#

On ipad?

knotty steeple
#

on a pc

#

npm i express

earnest phoenix
#

How would I do it on Ipad?

knotty steeple
#

same way

earnest phoenix
#

But there isn’t a cmd prompt on iPad l

#

.

knotty steeple
#

no u dont need cmd

earnest phoenix
#

Oh.

knotty steeple
#

do it on the server

earnest phoenix
#

Ok.

knotty steeple
#

where your bot is

earnest phoenix
knotty steeple
#

now try to run your bot again

earnest phoenix
#

How?

knotty steeple
#

like how i said to

#

node app/bot.js

earnest phoenix
#

Can not find module discord,js

#

npm i discord.js

knotty steeple
#

yes

#

just keep on doing that until your done

earnest phoenix
knotty steeple
#

thats in your code

#

are u sure u uploaded all your files?

earnest phoenix
#

Yes.

knotty steeple
#

well

#

in that err you have an invalid token

earnest phoenix
#

Invalid token?

#

The token is the bot token.

#

It is right,

knotty steeple
#

yes

floral stone
#

First, why root? Send, remove the period from the link and try making it direct.

earnest phoenix
#

Ok.

#

What?

floral stone
#

/root/name/cmds besides ./cmds/

earnest phoenix
#

Ok.

#

But,

#

I don’t do that.

#

Not found.

floral stone
#

error?