#development

1 messages · Page 523 of 1

earnest phoenix
#

But google doesn’t have everything

bright spear
#

being a noob is no excuse for you to make ur bot try to mention everyone in every server (and probably break tos) lol

earnest phoenix
#

?

keen drift
#

lmao

earnest phoenix
#

try this:

C:\Python36\python.exe C:\Users\Username\Desktop\your_bot.py
#

using cmd or powershell (cli = cmd) (same shit)

sick cloud
#

how do you find permissions for your bot in a channel in eris

#

i've tried this

!ctx.channel.permissionOverwrites.find(p => p.id == ctx.me.id).has('createInvite')``` but it just says
```TypeError: Cannot read property 'has' of undefined```
earnest phoenix
#

@bright spear it’s not against T.O.S. and what’s wrong with that

keen drift
#

@sick cloud depends, not all channel have that property

#

you'll have to check the instance type

sick cloud
#

i had a look and it doesnt have permission overrides for my bot, so thats where thats wrong

#

so uh

#

how would i add a fallback?

#

since the bot needs to create invites, and i dunno how to do perms right tbh

keen drift
#

in the find fn, I'd include a check for .type as well

sick cloud
#

hm ok

#

lol

#

had to do that

keen drift
sick cloud
#

well, it means you have to specifically set it

#

even if the bot has admin lol

keen drift
#

hm try creating an invite

#

without that on

#

c u ri o us

sick cloud
keen drift
#

brokecord

#

kek

#

it happens in my bot

#

Here's the best way to check

#

then just do a bit flag & to check

sick cloud
#

oh

keen drift
#

usually that does it

#

but I'd do the channel check and then check for roles as well

#

if channel flag doesn't exist, check role permissions

#

if either pass, you can try to create invite, if neither pass, it's prob safe to say that it can't

#

discord permission in a nut shell

#

@sick cloud You can always do try catch, that always works

topaz fjord
#

@keen drift hello yes what is |=

keen drift
#

bitwise or

#

holy shit my discord is lagging hard

sick cloud
#

true

#

also, is there a netflix api?

keen drift
#

netflix api Thonkang let's see

topaz fjord
#

no

#

there isnt

#

the only one is deprecated

keen drift
#

@sick cloud what do you need from netflix api

sick cloud
#

whatever exists

#

preferably just searching

keen drift
#

yeah there's but it's some painful authentication

#

unofficial ofc

sick cloud
#

oh

vernal rivet
#

Plus the only thing you can do with that for discord is looking the title up, you can't play that, unless you figure out how to make it share screens in a dm, it's not much things you can do with it

sick cloud
#

okay

keen drift
#

not worth it imo, needs authentication cookie

zealous veldt
#

wew

#

that's a lot of things

#

without a lot of formatting

vernal rivet
#

Yes, this will take you a long time to create, or simply destroy your bot(what I mean is going to have a ton and a ton of errors)

sick cloud
#

i found an api

#

but its confusing af

keen drift
#

I may create an api that aggregates them

#

but I'm lazy

vernal rivet
#

Lol

sick cloud
#

it needs loads of params

keen drift
#

those better be optional

#

that's a lot of filters

sick cloud
#

*

keen drift
#

k e k

vernal rivet
#

Which API is it for?

sick cloud
#

very unoptional

#

uhh

vernal rivet
#

That might be decrepited, it was create in December 2015 about 3 years ago, so I wouldn't be surprised if it doesn't work

sick cloud
#

could be

vernal rivet
#

Its best to say that it will take you ages to create a command like what your asking, not that you can't do it, I know you can do it, but it's your resources that will stop you.

sick cloud
#

i've seen others doing it

vernal rivet
#

Have you check when they were last updated?

sick cloud
#

nope

vernal rivet
#

You might want to see if you can

keen drift
#

The request only needs NetflixId cookie

#

i need to look into the query structure, but this seems doable

vernal rivet
#

So it's not decrepit?

keen drift
#

it's not hard to use, yes

vernal rivet
#

Ok

keen drift
#

I can prob automatically obtain the session, I'll just have to look at the login endpoint now

vernal rivet
#

What kind of ide is that fishy?

earnest phoenix
#

tf

slim heart
#

What would be an easy way to make like a kind of soft restart thing so it starts up another bot process and waits for it to log in and then shuts down the first one so there's no realizable downtime

earnest phoenix
#

LOL

gilded plankBOT
#

User not found

sullen path
keen drift
vernal rivet
#

are you asking about like in hosting terms or in the bot code @slim heart

keen drift
#

Much the structure can be compacted

slim heart
#

I mean I'd like to integrate it with the bot code so I can run a command to do it

#

But yeah I guess in terms of actually running the bot yes

vernal rivet
#

what lang are you doing?

slim heart
#

js

vernal rivet
#

ok, give me a second

#

so, do you want it to be a full one restart the bot, or reload/restart the commands?

slim heart
#

just a full restart the bot

#

But I dont want it to just stop and run again

#

I want it to run a whole other process of the bot, wait till the bot connects and then shut down the first one

#

so it's seamless

vernal rivet
#

ummm

slim heart
#

cuz like i can obviously do it manually

vernal rivet
#

yes

slim heart
#

but i wanna add it as like a command

vernal rivet
#

i know i am not supposed to promote servers, but if you want a server that is mainly based on discord.js, i can give an invite link, i know there are a few guys there that would be more help than me

slim heart
#

the actual official djs server lol?

empty owl
#

halp halp halp galp galp I need help

vernal rivet
#

no

empty owl
#
        if (command === 'suggest') {
        let title = args[0]
        let suggestion = args.slice(1).join(" ")
        let r = new Discord.RichEmbed()
          .addField(`${title}`, `${suggestion}`)
          .addField('From:', `${message.author.username}`)
          .addBlankField(true)
      Client.guilds.get('459515118254817281').channels.get('514234126493286420').send({r});

``` doesnt seem to work
vernal rivet
#

its like a youtuber server

slim heart
#

@empty owl args is an array

knotty steeple
#

@slim heart you can use child_process to start the main file

empty owl
#

?

knotty steeple
#

and exit the current process

vernal rivet
#

change args[0] to args[1]

empty owl
#
  const args = message.content.slice(prefix.length).trim().split(/ +/g);
  const command = args.shift().toLowerCase();```
slim heart
#

nvrm by b

empty owl
#

o ok

topaz fjord
#

I should use intellijs built in http thing

earnest phoenix
#

that should be args[0]

topaz fjord
#

*golanda

knotty steeple
#

what exactly isnt working

topaz fjord
#

*golands

slim heart
#

btw

knotty steeple
#

doesnt seem to work doesnt help

empty owl
#

hes right

#

oh ok

#

it says cannot send empty message

knotty steeple
#

also shouldnt it be args[1]

slim heart
#

@empty owl you don't have to do Client.guilds.get('459515118254817281').channels.get('514234126493286420').send({r});

knotty steeple
#

oh ok

empty owl
#

?

slim heart
#

you can just do client.channels.get("514234126493286420")

vernal rivet
#

is there any errors in the console?

earnest phoenix
#

do

empty owl
#

really?

slim heart
#

yea

earnest phoenix
#

args.join(" ").slice(1)

knotty steeple
#

embed: r

#

try this instead of r

empty owl
#

ok

earnest phoenix
#
      Client.guilds.get('459515118254817281').channels.get('514234126493286420').send({r});

bot has access to channels.

slim heart
#

@knotty steeple yeah that's kind of what I want but the problem is I want to wait until the new process logs into discord

#

then stop proc1

empty owl
#

Cooper samurai and jpb soved it

knotty steeple
#

you start a new one

#

then end the current

earnest phoenix
#

oh

#

xD

slim heart
#

Yeah but I want to wait for the new one to log into discord, THEN stop the first

knotty steeple
#

oh

#

idk how you would do that

zealous veldt
#

well

#

you could have a process that spawns them

vernal rivet
#

or do let suggestEmbed = new Discord.RichEmbed(){ ....... Client.guilds.get('459515118254817281`).channel.get(`514234126493286420').send(suggestEmbed);

slim heart
#

you think I could make a data file that just tells it when i restart that the bot is off and then when it readies it sets it on and then when it's on the first process stops

knotty steeple
#

maybe when it starts you can make it send a message to a channel and if it gets a message from that channel then stop the process but mmLol

#

you can check for last message right?

zealous veldt
#

so like .. bot process ............... / ⬇️soft-restart ordered master_ <-------- ................\ new process (newly spawned) ..........................⬆️emits ws event on ready

#

when the ws event is recieved by the master one it kills og process

#

also my ghetto diagram is amazing fight me

slim heart
#

it is quite amazing but still kind of confused how I'd actually do that

zealous veldt
#

lmao

keen drift
#

On the new process, via IPC emit to the controller, then controller will kill the old

knotty steeple
#

whats a ipc

slim heart
#

i could like post the PID as something somewhere idk and then it'd read it on ready and kill that process

keen drift
#

Inter-process communication

zealous veldt
#

yeah

slim heart
#

i just got my clip stuck inside another clip

#

a n y w a y s

#

wait but what do if the bot actually crashes then it wont write any pid file sks

zealous veldt
#

o

#

well

#

You could have a slave-master heartbeat interval

#

and start a new slave if that interval is interupted

slim heart
#

i mean if u start two different instances of the bot it just runs them

sick cloud
#

hm

earnest phoenix
#
[discord.js]
"DiscordAPIError: Missing Permissions"
Trying to kick & ban members, checking if user has permission before attempting, still doesn't work```
west raptor
#

bot doesnt have those perms

slim heart
#

It means your bot doesn't have perms

#

Check if it has perms and then reply to their message if the bot doesn't have the permission to do so

earnest phoenix
#

It does have perms.

#

It has administrator role.

slim heart
#

Does the adminisrator role have the administrator permission lol

earnest phoenix
#

yeah

slim heart
#

Ok, so who are you trying to ban/kick?

#

Another user with admin?

earnest phoenix
#

some random kid as a test. no admin.

slim heart
#

let me see the code?

earnest phoenix
#

one sec

earnest phoenix
#

@slim heart sorry for ping I need help

#

With something on @runic flower

slim heart
#

Ummm, ok what's up?

earnest phoenix
#

Okay so I need to show you go to testing 1

#

And can you vc

#

I explain better

slim heart
#

sure

earnest phoenix
#

K meet me in vc

#

Or testing 1

empty owl
#

OMIIIWAII EDOTESSTI I need help with the voting thing

#

Anyone willing to help me?

#

aNYONE?

wanton walrus
#

Hm

#

Hi

#

What's up

empty owl
#

um

#

do u have a glitch acc?

#

so I can show u alll my code

wanton walrus
#

no because glitch isn't a host

#

So what exactly is the issue

#

?

empty owl
#

ik

#

ok

#

so

#

im trying to make a cooldown

wanton walrus
#

okay and

empty owl
#
        if (cooldown.has(message.author.id)){
            message.delete();
            let d = new Discord.RichEmbed()
              .setTitle('You cannot use this command for another 5 seconds.')
              .setDescription('To bypass, please vote here', 'https://discordbots.org/bot/510276597987934210/vote')
            return message.channel.send({embed: d})
        }
        if (!message.author.hasVoted === true) {
            cooldown.add(message.author.id);
        }```
#

but its not working

wanton walrus
#

What specifically isn't working

empty owl
#

the whole cooldown part

wanton walrus
#

Is cooldown a set?

empty owl
#

yes

wanton walrus
#

Is it persistent

empty owl
#

const cooldown = new Set();
const cdsec = 5;

wanton walrus
#

okay

#

Hm lemme see here

#

It's just going to endlessly leave the user in the set

empty owl
#

heres all of the code if u want

#

what?

wanton walrus
#

Is it actually removing the userid after a point

#

Nvm lemme see the code lol

empty owl
#

ok

west raptor
#

u should like

#

delete that invite

empty owl
#

ok

west raptor
#

people can see ur .env files iirc

wanton walrus
#

oh my god you have so many message events

#

Jesus christ

empty owl
#

lol

wanton walrus
#

Why

#

Oh my god

sick cloud
#

thats horrible

empty owl
#

im highlighting the reg thing

empty owl
#

so

mighty sky
#

im not finished

carmine berry
#

bob i think i have an idea for you

empty owl
#

its line 78

#

?

#

@wanton walrus its line 78

sick cloud
#

that code is just horrendous

empty owl
#

ik

#

ur on it?

wanton walrus
#

I

#

I honest to god

#

Can't

mighty sky
wanton walrus
#

Follow the code

#

Like

empty owl
#

o

wanton walrus
#

I don't even

empty owl
#

go to line 78 @wanton walrus

sick cloud
#

i'm not able to even understand half of that

wanton walrus
#

Do you know what you are doing

#

Like do you know JavaScript

empty owl
#

yeah mostly

mighty sky
#

no

wanton walrus
#

I

#

I don't

#

Think you do

empty owl
#

dude its my second bot

#

what do u expect

west raptor
#

to learn

sick cloud
#

clearly you've learnt nothing

loud salmon
#

@mighty sky ez on the code images oliypls

empty owl
#

ok

mighty sky
#

that what i typed

empty owl
#

so are you going to help me or no? @wanton walrus

#

3 people are on my thing wow

mighty sky
#

i was doing the whole thing bc i have no clue what the hell, im doing

loud salmon
#

@mighty sky

west raptor
#

py

#

no

empty owl
#

um @wanton walrus @west raptor the problem is on 78

west raptor
#

js

empty owl
#

of index.js

loud salmon
#

shut

sick cloud
#

@empty owl stop pinging kirb

empty owl
#

ok

west raptor
#

why did u ping me

empty owl
#

r u on my code?

west raptor
#

no

empty owl
#

ok

mighty sky
#

@earnest phoenix

loud salmon
#

why the ping

empty owl
#

so noones going to help me eh?

sick cloud
#

your code is so horrible and impossible to read

#

so no

loud salmon
#

r00d

empty owl
#

;-;

#

o

#

ill look at the comments

sick cloud
#

love how you all use guides

loud salmon
#

@carmine berry spoonfeed 🤦

wanton walrus
#

I just store the users last interaction time and run a cached db query to check

sick cloud
#

same

wanton walrus
#

Pretty speedy and makes selfbot detection a breeze

zenith moss
#

I sniped the delete message in here yeet go to #commands

loud salmon
#

ok

sick cloud
#

so uh, how do i parse a buffer into json

#

i tried using my modules parser but it errors

loud salmon
#

ask it nicely

sick cloud
#

._.

weak coral
#

'-'

#

he said ask nicely

keen drift
#

@sick cloud hhhhhhhhhhhhhuuhhhhhhhhh

topaz fjord
#

@sick cloud you can use buffer.toString('utf8')

#

then use JSON.parse on the string

keen drift
#

wow this looks retarded

#

but it works HappyThonk

topaz fjord
#

retarded

#

no

#

works

#

yes

keen drift
earnest phoenix
#

hey so i'm making my bot in d.js and i was wondering how i'd do an eval command

slim heart
#

@earnest phoenix ```js
bot.on("message", message => {
const args = message.content.split(" ").slice(1);

    function clean(text) {
        if (typeof(text) === "string")
            return text.replace(/`/g, "`" + String.fromCharCode(8203)).replace(/@/g, "@" + String.fromCharCode(8203));
        else
            return text;
    }



    if (message.content.startsWith(stuff.prefix + "eval")) {
        const botowner = bot.users.get("142408079177285632")
        if (message.author != botowner) {
            message.reply("You do not have permission to run this command!")
            return;
        }
        try {
            const code = args.join(" ");
            let evaled = eval(code);

            if (typeof evaled !== "string")
                evaled = require("util").inspect(evaled);

            message.channel.send(clean(evaled), {
                code: "xl"
            });
        } catch (err) {
            message.channel.send(`\`ERROR\` \`\`\`xl\n${clean(err)}\n\`\`\``);
        }
    }
});```
#

change settings accordingly

#

such as stuff.prefix and botowner's id

#

and bot

sullen path
earnest phoenix
#

me on all my web apps

keen drift
#

lmao

earnest phoenix
#

how i draft up website layouts is also pretty meme worthy

#

i draft up applications and websites in ms paint

#

like heres one where this guy wanted an iframed web app with some additional functions to run as an application on their pc

#

release vs draft

#

lol

#

i draft everything in ms paint

#

its wounderful

cinder gate
#

Qq - I got a stupid Nginx thing that's supposed to lose the .php extensions. Problem is, it's not showing index.php. Anyone help? ;;

earnest phoenix
#

node sockets express > nginx php

cinder gate
#

Thanks, that really helps. Now, for an actual answer?

earnest phoenix
#

are they standard .php or with diffrent extentions

#

ive known people to do that

#

@keen drift I need help

#

With one part

cinder gate
#

They're standard php

earnest phoenix
#

Sorry for ping

#

try using this in your websites nginx settings

#
location / {
    try_files $uri $uri.html $uri/ @extensionless-php;
    index index.html index.htm index.php;
}

location ~ \.php$ {
    try_files $uri =404;
}

location @extensionless-php {
    rewrite ^(.*)$ $1.php last;
}
cinder gate
#

..i did..

earnest phoenix
#

and you restarted the nginx service?

cinder gate
#

No, I haven't been restarting my Nginx service every time I left nano while also running nginx -t.

earnest phoenix
#

try restarting nginx service manually

cinder gate
#

That's what I've been doing. -.-

keen drift
#

@earnest phoenix why me

#

wth

earnest phoenix
#

oh i thought you said you hadnt

cinder gate
#

Sarcasm.

earnest phoenix
#

Idk

#

Your good

#

OK good

keen drift
#

the fuck

earnest phoenix
#

thought you were meming me

keen drift
#

there's like 10k other people

earnest phoenix
#

Reaction role

#

Boi

#

ya im not amazing with php so im out of solutions

#

XD

#

whenever i had hid the extention

#

i had just used that stack

#

but if it isnt working for you dunno

keen drift
#

what you need help for in php

cinder gate
#

It's more an nginx problem

#

index.php is not showing up after using a try_files

keen drift
#

mind showing that file

cinder gate
keen drift
#

nginx log?

earnest phoenix
#

can someone help me pls

#

actually one sec

cinder gate
#
108.162.241.211 - - [20/Nov/2018:04:35:19 +0000] "GET /game/ HTTP/1.1" 404 143 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0"
108.162.241.211 - - [20/Nov/2018:04:35:20 +0000] "GET /game/ HTTP/1.1" 404 143 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0"
108.162.241.199 - - [20/Nov/2018:04:44:04 +0000] "GET /game/ HTTP/1.1" 404 143 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0"
108.162.241.157 - - [20/Nov/2018:04:44:04 +0000] "GET /favicon.ico HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0"```
#

(Cloudflare IPs)

buoyant vapor
#

woah u just leaked my ip man

#

😡

cinder gate
#

Yes, because you live in Cloudflare.

keen drift
#

Can you describe what you are trying to do

earnest phoenix
#

me?

keen drift
#

no

earnest phoenix
#

or them

#

LOL

cinder gate
#

Told you, it's cloudflare

Drop the .php extensions, @keen drift

earnest phoenix
#

LOL

keen drift
#

Do you want it to base back to an index?

cinder gate
#

If there are no returns, mhm

earnest phoenix
#

XD

#

LOL

#

When i can give 2 fucks

keen drift
#
location / {
    try_files $uri $uri.html $uri/ @extensionless-php;
    index index.html index.htm index.php;
}
#

perhaps

buoyant vapor
#

woah u just d doxed urself

earnest phoenix
#

who me

buoyant vapor
#

ya

earnest phoenix
#

dw

buoyant vapor
#

😨

#

i saw that

earnest phoenix
buoyant vapor
#

woah

#

u don’t have ad. blocker

#

weirdo

earnest phoenix
#

cause thats my vps

#

XD

#

idc

#

to

cinder gate
#

Can't do that, @keen drift. It has to be /game

keen drift
#

then use /game

earnest phoenix
#

there we go

buoyant vapor
#

omg ur ddoxing urself

#

ur brave

earnest phoenix
#

ofc i am

cinder gate
#

tickNo Wrong.

earnest phoenix
#

@buoyant vapor

#

watch this

#

where i really live

buoyant vapor
#

lol u don’t live in usa

#

that sucks

earnest phoenix
#

no

#

that was my vm

buoyant vapor
#

wow big if true

cinder gate
#

If I don't include the try_files, then it'll direct correctly.

earnest phoenix
#

bare doxing

buoyant vapor
#

kio

#

have u googled ur issue

cinder gate
#

...

cinder gate
#

You're telling me to turn on and off my computer again when I already did that 17 times

buoyant vapor
#

wow toxic

cinder gate
#

No, it's a perfect response to something that's been suggested over and over again.

buoyant vapor
#

t Gasp x i c

cinder gate
#

I don't have time for this

keen drift
#

my friend would know more

#

I use apache

#

he uses nginx

buoyant vapor
#

i mean

#

i use nginx

#

i google when i run into walls and solve issues through that

#

🤷

cinder gate
#

Really

buoyant vapor
#

ya

cinder gate
#

Because I think I recall googling my issues before talking to anyone.

buoyant vapor
#

that sucks that ur running into the problem ur facing

cinder gate
#

Fixed it.

#

It was the order of operations.

buoyant vapor
#

nice what was issue

#

wats ur website

#

😮

keen drift
#

it's in the nginx config

buoyant vapor
#

i’m on phone

#

is difficult to type

#

:feels astyman~1:

#

wow

sick cloud
#

nice

buoyant vapor
#

i’m not ur stalker buddy

#

i’m laying in bed staring at this discord

cinder gate
#

Suuure

#

I see those photos of me

#

on your ceiling

#

I know what you up to

buoyant vapor
#

please keep this channel to development only discussion!!!!!

cinder gate
#

You did start it.

earnest phoenix
#

woot finished the frontpage of the new app! :D

sick cloud
#
m.reactions.find(r => r.emoji.name == '⬅' && r.users.find(u => u.id == msg.author.id)).delete()
``` is this like incorrect or something
#

my bot doesnt work when i try to use it

keen drift
#

define doesn't work

sick cloud
#

it just fails silently

#

no errors

keen drift
#

is this eris

#

or d.js

#

eris doc is giving me a headache

earnest phoenix
#

S

sick cloud
#

djs

#

@keen drift

keen drift
#

why u keep switching

#

wth

coral trellis
#

@hollow fulcrum Please refrain from the shitposty comments that are unnecessary here

keen drift
#

@sick cloud also I'm not sure if you can check .find result like that

#

it doesn't return a bool

#

perhaps use .some?

sick cloud
#

uhh

#

so .some ok

keen drift
#

that's my first notice

sick cloud
#

okay

#

nope some breaks too

keen drift
#

breaks?

sick cloud
#

like it doesnt work with some

keen drift
#

what's different

sick cloud
#

oh

#
    at m.awaitReactions.then (C:\Users\ThatTonybo\Desktop\reaction-help\bot.js:20:106)
    at process._tickCallback (internal/process/next_tick.js:68:7)```
#

delete isnt a function

#

hm

keen drift
#

you trying to remove one's reaction?

#

are you on master?

sick cloud
#

yeah, v12

keen drift
#

.remove in .users

#

you'll need the person's resolvable id

sick cloud
#

so

keen drift
#

also .users isn't cached

sick cloud
#

add .users ... .remove

#

?

keen drift
#

so you'll need additional step

sick cloud
#
m.reactions.find(r => r.emoji.name == '⬅' && r.users.some(u => u.id == msg.author.id)).users.get(msg.author.id).remove()
#

i cache already

#

so thats fine

keen drift
#

you cached already?

sick cloud
#

yep

keen drift
#

you ran .users.fetch()?

sick cloud
#

yeah

#

also TypeError: m.reactions.find(...).users.get(...).remove is not a function remove doesnt work

keen drift
#

remove(user)

sick cloud
#

oh

keen drift
sick cloud
#

remove user id?

#

so like .users.remove(msg.author.id);

#

would that work

keen drift
#

yeah

sick cloud
#

ok

#

uhh ok so it doesn't delete it

keen drift
#

no errors tho?

sick cloud
#

oh wait

#

lol missing perms

#

one thing tho, i dunno why but it listens to message react remove too

#

i just want it to listen to add

keen drift
#

you can block that in the client options

#

to ignore that event

#

if you don't use it

#

but that may cause reactions cache to be unsynced

#

so i'd leave it on

sick cloud
#

yeah, i don't wanna do that

#

also that wouldn't work i dont think

#

its awaitReactions @keen drift

#

👀

keen drift
#

O I never done awaitreaction

#

I'm guessing it's a wrapper

#

But yeah my bot doesn't use that

sinful lotus
#

async with .then

#

I dont think thats a good idea

#

unless you have the reason to do so

earnest phoenix
#

@sinful lotus I did not understand yet, are u a female or a male? or just an hentai girl.

sinful lotus
#

idk myself

earnest phoenix
#

wow.

slender thistle
#

Girls don't exist on the Internet
poofs away

lofty hamlet
#

Hi !

#

People can help me ?

#

@sinful lotus

sick cloud
#

@lofty hamlet ask your question

sinful lotus
#

dont ping random people

sick cloud
#

and that

#

@sinful lotus qt

sinful lotus
#

uwu

lofty hamlet
#

Exue me

#
            fonction.channellogs(message)
            let xoargs = message.content.split(" ").slice(1);
            let xo03 = xoargs.join(" ")
            if (!xo03) return message.reply(':Croix: **Tu as oublié(e) le Pokémon après la commande** :Croix:')
            if (Dresseur.SacH.content(xo03`)) {
            var embedGlobal = new Discord.RichEmbed()
                .setColor(embedcolor)
                .setTitle("Companion définis avec succès")
                .setThumbnail(message.author.displayAvatarURL)
                .addField("Companion : ", xo03)
                .setFooter(bot.user.username + " - by Nebulus")
                .setTimestamp()
                message.channel.send(embedGlobal)
            }
            else {
                message.channel.send(`Tu n'as pas ce Pokémon dans ton PC trouve le et ensuite refait la commande !`)
            }
        }```
#

This code not work

#

Can you help me ?

#

Dresseur.SacH is a jo

sick cloud
#

what's the error

lofty hamlet
#

Json

#

TypeError: Dresseur.SacH.content is not a function

sick cloud
#

it's not a function

#

obviously

lofty hamlet
#

....

#

So ?

sinful lotus
#

fix it so it becomes a function

mossy vine
#

Its a property

lofty hamlet
#

No way to do what I did?

mossy vine
#

Not a function

#

Just remove the () after it

#

A property is a value

#

So to compare you do value == "this"

lofty hamlet
#

No but if i remove () waves apparate

#

if Dresseur.SacH.content(${xo03}) {

#

...

sinful lotus
#

what are you even trying to achieve?

mossy vine
#

Dl Dresseur.SacH.content == xo03

#

Do*

sinful lotus
#

discord.js docs says .content is not a function but a property

lofty hamlet
#

Basically I want that when it happens in the folder.json the trainer there's this pokemon bah it's the rest

mossy vine
#

Well i gtg

sinful lotus
#

what?

#

this pokemon Bah is the rest?

#

could you word it more better

lofty hamlet
#

Exuse me i fench ...

sinful lotus
#

yes that doesnt matter if you are french but we could not help you properly if we cannot understand what you are trying to say

lofty hamlet
#

Ok so :

#

I want that when I make the order if the bag of the Trainer therefore: Trainer.StyleH / Contains the xo03
Said: Yes you have this pokemon or you have not

#

You understand ?

knotty steeple
#

i dont

quartz kindle
#

is dresseur.sach an array?

lofty hamlet
#

What do you not understand?

quartz kindle
#

if yes, then if(dresseur.sach.includes(value))

knotty steeple
#

i was about to say since when was contains a thing

lofty hamlet
#

Dresseur.sach is ex :

#

"Sac":["Carapuce","Bétochef","Deoxys"]

quartz kindle
#

if dresseur.sach is an object, then if(dresseur.sach[value])

lofty hamlet
#

Dresseur.sach is ex :
"Sac":["Carapuce","Bétochef","Deoxys"]

#

Sac*

quartz kindle
#

so its dresseur.sac?

#

or dresseur.sach.sac?

lofty hamlet
#

Dresseur.Sac

quartz kindle
#

so dresseur.sac.includes(value)

knotty steeple
#

but its an object isnt it

quartz kindle
#

also, you need to normalize capitals

lofty hamlet
#
            fonction.channellogs(message)
            let xoargs = message.content.split(" ").slice(1);
            let xo03 = xoargs.join(" ")
            if (!xo03) return message.reply(':Croix: **Tu as oublié(e) le Pokémon après la commande** :Croix:')
            if (Dresseur.SacH.content == xo03) {
            var embedGlobal = new Discord.RichEmbed()
                .setColor(embedcolor)
                .setTitle("Companion définis avec succès")
                .setThumbnail(message.author.displayAvatarURL)
                .addField("Companion : ", xo03)
                .setFooter(bot.user.username + " - by Nebulus")
                .setTimestamp()
                message.channel.send(embedGlobal)
            }
            else {
                message.channel.send(`Tu n'as pas ce Pokémon dans ton PC trouve le et ensuite refait la commande !`)
            }
        }```
#

You can edit my code and then explain to me because I do not understand anything: '( Plz ?

quartz kindle
#

for example "deoxys" is not equal to "Deoxys"

#

different capitals

lofty hamlet
#

Ok but look my code you understand what I want ?

quartz kindle
#

i told you, Dresseur.SacH.includes(xo03)

lofty hamlet
#

Hu ?

#

You can edit my code and then explain to me because I do not understand anything: '( Plz ?

quartz kindle
#

no

lofty hamlet
#

😢 but ....

#

I don't understand

knotty steeple
#

that is what you call

quartz kindle
knotty steeple
#

spoonfeed

earnest phoenix
#

Can you guys help me how to make an array of guilds?

knotty steeple
#

wym

sinful lotus
#

you should stay away from making advanced bots yet, if you cannot understand a simple property and function

lofty hamlet
#

....

#

Fail screenshot

knotty steeple
#

who downloads screenshots

sinful lotus
#

no one

knotty steeple
#

exactly

lofty hamlet
sinful lotus
#

nvm that my head meme

earnest phoenix
#

Intresting...

quartz kindle
#
Dresseur.SacH // ["pokemon1","pokemon2","etc..."]
Dresseur.SacH.content // undefined
Dresseur.SacH.content == xo03 // always false
Dresseur.SacH.includes("pokemon1") // true
Dresseur.SacH.includes(xo03) // true if xo03 is a pokemon that exists in Dresseur.SacH

understand?

lofty hamlet
#

What are you asking me?

#

Yes

#

I set you line

#

Look screenshot

#

But waves appared i don't understand

knotty steeple
#

ur missing () around it

lofty hamlet
#

😂

#

Bruh exuse me

#

I test this code

#

I have the pokemon Chlorobule in my sac but isn't work

sinful lotus
#

we are trying to help you here

knotty steeple
earnest phoenix
#

Does myClient.channels.array().sort() gives me the about of channel?

sinful lotus
#

if you said you tested it, why dont you do it your own. I mean they are already trying to help you

lofty hamlet
#

I go eat i come back

knotty steeple
#

why do you need an array of channels

earnest phoenix
#

I’m just asking, since i’m trying to make an array of guild names, channels, and members

#

Ah, thanks

quartz kindle
lofty hamlet
#

I'm back

#

So :

#

It does'nt work

#

Why ?

quartz kindle
#

do console.log(Dresseur.Sac,xo03)

lofty hamlet
#

Where ?

quartz kindle
#

right before the if(Dresseur...)

lofty hamlet
#

@quartz kindle wtf ... it should work

quartz kindle
#

yeah it should @_@

lofty hamlet
#

:'/

#

Mmmmhhh you don't have solution ?

quartz kindle
#

do console.log(Dresseur.Sac.includes(xo03))

lofty hamlet
#

oK

#

wHere ?

earnest phoenix
#

What does “dresseur” mean

quartz kindle
#

same place

lofty hamlet
#

Ok

topaz fjord
#

Are you checking if Dresseur has a certain item

earnest phoenix
#

message?

#

Did you define “Dresseur”

topaz fjord
#

he did

#

also Dresseur is french

quartz kindle
#

Dresseur.Sac is an array that contains the pokemons he owns

lofty hamlet
#

He say : True:') @quartz kindle

earnest phoenix
#

Ah

topaz fjord
#

Yes Tim ik

#

but he was using .content to check if it was in it

earnest phoenix
#

Got it

quartz kindle
#

explaining to fiq lol

lofty hamlet
#

Just the console say true

earnest phoenix
#

Not really advanced at cs

lofty hamlet
#

When i run the command

#

With Chlorobule

quartz kindle
#

Nebulus show your code again

#

you're using SETC2 right?

lofty hamlet
quartz kindle
#

the code for SETC2

lofty hamlet
#

I try both

quartz kindle
#

yeah but SETC2 is cut

lofty hamlet
#

It's code is equal

earnest phoenix
#

The same?

lofty hamlet
earnest phoenix
#

is that JS?

quartz kindle
#

yes

earnest phoenix
#

mk

#

i barely know it

#

i am learning it

#

What is embedcolor

quartz kindle
#

ok so this makes no sense, the console.log returns true, but the if doesnt?

lofty hamlet
#

Yes 😦

earnest phoenix
#

Is he supposed to write a hexcolor or just “RANDOM”

lofty hamlet
#

He make no sense

earnest phoenix
#

did you define Embedcolor?

lofty hamlet
#

It's nothing

earnest phoenix
#

Well... that’s the problem

#

”embedcolor” is not even a color

lofty hamlet
#

No ...

#

It's not the probleme

earnest phoenix
#

Then what is the problem

quartz kindle
#

if his bot is sending the message in the else part, then the if is not working

lofty hamlet
#

So ?

#

No sense thonkku

earnest phoenix
#

There’s a problem in the if part

slim heart
#

Is it supposed to be fonction

quartz kindle
#

just delete everything and do js if(Dresseur.Sac.includes(xo03)) { console.log(true) } else { console.log(false) }

lofty hamlet
#

Ok

slim heart
quartz kindle
#

lmao

earnest phoenix
#

Lol

slim heart
quartz kindle
#

maybe its function in french

slim heart
#

Oh nvrm

#

It’s there again

#

It’s right but why fonction lol

#

Why not just use client as a function store kthnx

earnest phoenix
#

Show me where did you define embedcolor

slim heart
#

It is somewhere

#

Might not be right but is defined

lofty hamlet
earnest phoenix
#

Also, do you need to use message.author.displayAvatarURL or message.author.avatarURL

#

...or both

lofty hamlet
#

It's not the problem ....

#

...

slim heart
#

Just avatarURL

lofty hamlet
#

But it's not the probleme here

earnest phoenix
#

/version

slim heart
earnest phoenix
#

I usually used .avatarURL, not sure about .displayAvatarURL

lofty hamlet
#

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

slim heart
#

Yup

earnest phoenix
#

Thats the error

slim heart
#

No it works

lofty hamlet
#

But is not the problem !

earnest phoenix
#

Huh

lofty hamlet
slim heart
#

.displayAvatarURL is a thing a p p a r e n t l y

quartz kindle
#

lmao

lofty hamlet
#

I say is not the problem

earnest phoenix
#

It is

lofty hamlet
#

Ohohohoh

quartz kindle
#

he already deleted everything anyway

slim heart
#

Lol

lofty hamlet
earnest phoenix
#

But im not sure if it can be used in author

#

Wth

slim heart
#

I literally just sent a screenshot of me using it in eval

#

Fiqstro please

earnest phoenix
#

Oops

slim heart
#

Lol

quartz kindle
#

i have no idea why xo03 is undefined

slim heart
#

^

lofty hamlet
#

😂

earnest phoenix
#

Where did he define xo03

lofty hamlet
#

fuck

quartz kindle
#

you guys are blind

#

lmao

slim heart
#

Sksksksks

lofty hamlet
#

I must go back to class to resume this code tonight: ')

earnest phoenix
#

facepalm me

lofty hamlet
#

Goodbye See you tonight

quartz kindle
#

bye

lofty hamlet
#

Thanks tim

#

For you help

slim heart
#

Thanks for giving us the apparent knowledge of displayAvatarURL

#

😂

lofty hamlet
#

😂

#

bye

earnest phoenix
#

i think i need glasses

slim heart
#

S a m e

bright spear
#

@earnest phoenix @slim heart avatarURL will only work if the user set an avatar but displayAvatarURL will show the default avatar the user has if they haven't set one

earnest phoenix
#

Oh thanks :)

slim heart
#

Oh I can actually use that lol

#

Thanks hue

bright spear
#

Yw

tight heath
#

Amazing

#

Simply

earnest phoenix
#

Anyone see this before

#

Remote Desktop within Remote Desktop

#

Those are both my vps

#

VMs

#

XD

#

First one you see on phone is

#

Intel Xeon 2vcpu 8gb of ddr3-4 memory Disk: 120gb of SSD storage Network: 1 Gigabits Upload and download

#

Second Intel Xeon 4vcpus 16gb ram Storage 1tb of SSD storage Network: 2 gigabits upload and download speed

#

To run my discord bot of off

#

And I get it for free

#

LOL

#

my upgrade

#

xD

#

im using discord.js and im having this error happen and i dont know what to do ```if (!msg.member.roles.includes(role18P)) {
^

TypeError: msg.member.roles.includes is not a function```

slim heart
#

Is msg defined as ur message?

earnest phoenix
#

its defined with the client.on

#
  if (msg.content.toLowerCase().startsWith(config.prefix+'role')) {
    const role18S = msg.guild.roles.find(role => role.name === "Bosses");
    const role18P = msg.guild.roles.find(role => role.name === "18+ Bosses");
    var cmd = config.prefix+'role ';
    const args = msg.content.slice(config.prefix.length).trim().split(/ +/g);
    const command = args.shift().toLowerCase();
    if (["add","remove","list"].includes(args[0])) {
      if (args[0] === "add") {
        if (msg.content === '<>role add') {
          return msg.channel.send('Please specify what role you want added. For more information say `<>role list`');
        }
        if (args[1] === '18+') {
          if (role18P === null) {
            return msg.channel.send(':thinking: thats weird. Please Notify Serabus About this issue.');
          }
          if (!msg.member.roles.includes(role18P)) {```
slim heart
#

Don’t use .includes()

#

Use .has()

earnest phoenix
#

ill try

#

jpb

#

look up

slim heart
#

Nice lol

earnest phoenix
#

it works now thanks.

slim heart
#

Np

west raptor
#

rtfd

slim heart
#

^

#

I can see how people’s use include tho

west raptor
#

i guess

slim heart
#

I think they think member.roles is an array

mossy vine
#

okay so im looking into the Eris lib and i dont really understand what a "Bucket" is can someone explain

#

or rather, how it works and what its used for

slim heart
#

I think it’s for handling rate limit right?

#

I may be wrong

#

Idk eris too wel

mossy vine
#

yes but like, what would it be used for?

slim heart
mossy vine
#

oHHH

#

i didnt even read the docs properly

#

smfh

slim heart
#

O o f

mossy vine
#

in js if an object property is null i can check for it with if(!object.property) console.log("tis not exist") right?

shadow dust
#

sounds more like lua to me

mossy vine
#

just because i didnt put the {}

#

but i can check for it like that right?

shadow dust
mossy vine
#

oh so its just

#

in

#

thanks

steel heath
#

Can you store the whole message object in MongoDB with mongoose, so like: new Schema({ msgObj: Object });

earnest phoenix
#

You cannot store circular references.

#

Just store the content, to be honest

night imp
#

You could get out circular refs by filtering by type

steel heath
#

It'd be really good if it's possible but ok

earnest phoenix
#

techically, you could turn the object to JSON, then parse it back to a javascript object\

steel heath
#

well i guess storing only message content, date and user id is just fine for a snipe command

knotty steeple
#

@earnest phoenix 1. dont use windows for a vps

#
  1. thanks for your ip
earnest phoenix
#

1st its better

knotty steeple
#

how

#

linux servers are cheaper and better

earnest phoenix
#

DID YOU NOT READ

#

I GET IT FOR FREE

#

🤦

knotty steeple
#

no i did not read

earnest phoenix
#

Microsoft Azure

knotty steeple
#

still gonna have to pay for it eventually

#

so im not dumb

earnest phoenix
#

eventually but its better

#

for me

#

Really not

knotty steeple
#

GWvictoriaNotLikeBlob ^

earnest phoenix
#

how

#

Azure hardware for the price isn't the best.

#

eh

#

depends

#

Microsoft is a big name company: they can charge pretty much whatever they want, and people will still buy them

#

So they don't stree about the hardware they give people

#

The hardware's amazing for the price for the vm i have

#

im sharing my vps vm with another dev

#

This is how azure goes toe-to-to with a more affordable Vultr

#

They trade blows sure, but the margins aren't impressive enough

#

wait dude what plan do you think i have

#

XD

#

2gb

#

you think i have 1 core and 2gb of ram

#

XD

knotty steeple
#

you dont need 16gb for a 12 guild bot

earnest phoenix
#

Dude i use it for not just hosting my bot

knotty steeple
#

oh what else your 60 websites?

earnest phoenix
#

oml

#

XD

#

no

#
  1. I plan for the future 2nd. I use it for other stuff other than Discord bots like my backup for all my shit and for hosting other applications that i do @knotty steeple
knotty steeple
#

future

#

you upgrade if you need it in the future lmao

earnest phoenix
#

and i share it with my friend also another developer

knotty steeple
#

you can store backups somewhere else like a usb

earnest phoenix
#

well i prefer to have an online backup and a backup on my external hdd i have

knotty steeple
#

and thats not an excuse since backups dont use ram

earnest phoenix
#

I said i use other applications other than backups and vsc

#

that use ram

knotty steeple
#

oh my

earnest phoenix
#

and your very welcome for the ip

knotty steeple
#

can you not literally run vsc on your pc and transfer the code GWvictoriaNotLikeBlob

earnest phoenix
#

omg ffs. No i cannot i do not have my laptop and desktop on all the time neither do i have internet i am on the go alot so i have data LTE Hotspot

#
<style>
  .votebutton btn btn-orange btn-2x {
      background-color: red
  }
</style>```
#

i want to change vote button color\

#

So i went with microsoft azure

#

Now lets drop this

knotty steeple
#

ignorance is bliss

earnest phoenix
#

I’m. Not ignoring

#

Just don’t get what your problem is

knotty steeple
#

do you even know what ignorant means

earnest phoenix
#

Yes but your being annoying cause you don’t get why I have 16gb of ram and Intel Xeon v4

knotty steeple
#

doesnt look like you know what it means

earnest phoenix
#

Just tell me what’s your problem with me

knotty steeple
#

none?

#

also this is offtopic af

earnest phoenix
#

Eh

#

Then what’s your problem with me having 16gb of ram

#

And Microsoft azure

knotty steeple
#

wat

#

you dont need it

#

if you still think you do then i dont care

still slate
#

I don't mean to be a backseat mod™ but is this really needed-

earnest phoenix
#

Just gonna say I use it for more than just bot coding

#

And the other things I do on it needed more ram and cpu cores so I upgraded

earnest phoenix
#

What are the main things I need to know before sharding?

#

Apart from the code to run and the 2k guilds recommendation

west raptor
#

lib?

earnest phoenix
#

JS

#

Discord.JS

west raptor
earnest phoenix
#

Thanks a lot 😄 ❤

west raptor
#

np

earnest phoenix
#

Any bad things you can list if one shards to early?

#

Not much right?

west raptor
#

increased cpu/memory usage, etc

earnest phoenix
#

So nothing too bad can happen if you shard to early? Nothing major??

knotty steeple
#

@west raptor u sure

west raptor
#

@knotty steeple yes, if you make more shards than necessary

knotty steeple
#

true

#

but what if you make a necessary amount of shards mmLol

earnest phoenix
#

Whats the best amount to start off at?

west raptor
#

then i dont see any downsides

earnest phoenix
#

2 shards? 1 shard?

west raptor
#

@earnest phoenix discord.js can determine that for u iirc

earnest phoenix
#

Indeed it can but I would rather do it manually tbf

knotty steeple
#

if you have 500 guilds

#

you can do 5 shards

earnest phoenix
#

100 per shard?

knotty steeple
#

ye

earnest phoenix
#

So what about 150 ish guilds?