#development

1 messages · Page 497 of 1

earnest phoenix
#

they use thier own invite link when they invite the bots here

late hill
#

yes

#

then as i said

#

there is no way to change its permissions

earnest phoenix
#

but like

#

what

#

also @lucid iris try to see if your bot is muted

uneven depot
#

yeah, if I get a Missing Permissions error that usually means the bot was muted.

rugged pond
#

Some one have a idea how to get the invitation used by a user when he join ?

#

A way to make that, because discord api don't permit to do that

#

🤷

inner jewel
#

@lucid iris @late hill permissions in the invite aren't guaranteed to be granted

late hill
#

Yeh

inner jewel
#

they're just selected by default

late hill
#

Which means

inner jewel
#

users can remove them

late hill
#

In the end its up to server administrators

uneven depot
#

yeah as far as i know there's no "invite accepted" event

inner jewel
#

never rely on having permissions

late hill
#

You can't change anything about it

lucid iris
#

I don't even know what needs what permission.
Which is why I'm trying first to find what's going on so I can then fix it.

inner jewel
#

probably missing permissions to send message in a channel

lucid iris
#

How would I check if my bot's been muted with discord.js?
I find no results on it and the typedef only shows a boolean muted on guilds, channels and user settings.

earnest phoenix
#

@sage river

#

+anuncio teste

#

+anuncio oie

west raptor
strong peak
#

Anyone here want to join the development team for @languid granite with a moderate expirence in Java?

lusty dew
#

How can I change an array of ID's to usernames?

night imp
#

You can loop through each item and retrieve the user

lusty dew
#
    let devs = await Promise.all(client.settings.bot_dev.map(async (id) => {
        dev = await client.fetchUser(id);
        return dev.name; })
    );
#

I just did this

#

with the help from someone in the official Discord.js server

earnest phoenix
#

why does discord fetch my meta tags only sometimes

uneven depot
#

Is it me or do the votes get reset back to 1?

earnest phoenix
#

every month

#

total count is not effected

lusty dew
#
 let role = msg.guild.roles.find(r => r.name === "NSFW")
    if(!role) return msg.reply(`${role} does not exist, let me make it for you.`);{
        msg.guild.createRole({
            name: 'NSFW',
            color: 'RED'
        }).then(role => msg.reply(`I created the role ${role.name} for you. Enjoy!`))
    }

    if(message.author.roles.has(role.id)) return message.reply(`${message.author.tag} Has the role I am letting them continue.`)
    await (message.author.addRole(role.id))

Why isn't this making the role?

#

I get 0 errors

#

and I am confused

uneven depot
#

@earnest phoenix hmm, is there a way to make it show total count instead? The API seems to show the resetted count and it also seems to affect search results

earnest phoenix
#

search results are based on taht months votes

#

thats for every bot

#

regardless

lusty dew
#

Whenever someone can help it would be lovely :3

earnest phoenix
#

no changing how the site displays it

west raptor
#

r u on master or stable neko

lusty dew
#

Stable

west raptor
#

🤔

lusty dew
#

?

#

What

gusty inlet
#

Hi

uneven depot
#

@earnest phoenix oh ok, thanks for the info

earnest phoenix
#

npnp

#

its primarily to promote the more favored / active bots

#

and let bots that arent used be put in the back

#

thats what i think at least

#

@lusty dew handle your errors

#

And maybe learn JS too...

lusty dew
#

Fixed

#

@earnest phoenix I fixed it dickhead

#

I know JS

earnest phoenix
#

whoa

lusty dew
#

I just made a slight mistake

earnest phoenix
#

Easy

lusty dew
#

Well

earnest phoenix
#
if(!role) return msg.reply(`${role} does not exist, let me make it for you.`);{
        msg.guild.createRole({
            name: 'NSFW',
            color: 'RED'
        }).then(role => msg.reply(`I created the role ${role.name} for you. Enjoy!`))
    }```
lusty dew
#

It is not nice hearing people to tell you to learn something when you are trying

earnest phoenix
#

That code right there tells me otherwise

lusty dew
#

I fixed it

#
    if(!role){
        msg.reply(`${role} does not exist, let me make it for you.`)
        await msg.guild.createRole({
            name: 'NSFW',
            color: 'RED'
        }).then(role => msg.reply(`I created the role ${role.name} for you. Enjoy!`))
    }
earnest phoenix
#

It's better...

#

still could use work

hidden ginkgo
#

Maybe they're an erlang programmer.

earnest phoenix
#
await promise(...).then(...)``` Please don't do that
#

And just because you fix an error doesn't mean you know a language

lusty dew
#

I understand that

#

Never said I knew js because I fixed the error

#

Anyway

#

Bye

#

No need for an argument

#

or a mute

earnest phoenix
#

I don't understand why people get so standoffish when someone tries to point out their code issues...

lusty dew
#

It isn't that...

#

I just hate when people tell me to learn js when I am trying

earnest phoenix
#

that's exactly what it is
I tell you what I suggest, and you call me a dickhead

#

10/10 man

west raptor
#

:/

hidden ginkgo
#

Hmm

lusty dew
#

You suggest for me to learn js

#

I don't like when people tell me to learn js

earnest phoenix
#

Yes, because your code tells me that you do

lusty dew
#

Simple as that

earnest phoenix
#

Okay, I won't tell you what you need to learn then

#

I'll let you struggle

lusty dew
#

Now stop the conversation on it

earnest phoenix
#

If you think of it that way...

lusty dew
#

Before you get us both muted

west raptor
#

i mean iTexlo wasnt being a dickhead really

#

but ok

earnest phoenix
#

Just hear me out please...
When someone says you need to learn something, they aren't insulting you...

#

they're pointing you in the right direction

hidden ginkgo
#

Hmm, you need to work on tone a bit.

earnest phoenix
#

They don't want to you make the same mistake over and over

hidden ginkgo
#

I can see where you're both coming from.

quartz kindle
#

well, telling someone "go learn js" while they're trying to learn is something like telling someone "go learn how to drive" when they are driving

#

it can be seen as insulting

earnest phoenix
#

Making a Discord bot is a terrible way to learn.

#

Aka learning the library before the language

lusty dew
#

It is my way of learning

quartz kindle
#

hey, if someone wants to learn how to drive by drifting let them be

hidden ginkgo
#

I like you Tim

quartz kindle
#

xD

earnest phoenix
#

Yes, but when they expect help Tim, they drive us crazy

quartz kindle
#

but eventually they'll become a drift king, and you wont

#

even if it takes 20 years

earnest phoenix
#

You want to help them, but at the same time you want them to be independent

west raptor
#

i learned a lot of js from making bots tbh

#

I think

quartz kindle
#

i did too

west raptor
#

texlo was uh a bit insulting depending on how you take it

hidden ginkgo
#

Regardless of it it's from a bot or not, there will be some core concepts involved.

west raptor
#

brb

quartz kindle
#

but there is indeed a huge difference between someone with 0 js experience and someone with a bit of web development experience like i had

hidden ginkgo
#

And the use of ellipses would suggest an insult in most cases where you can't actually hear tone in their voice.

quartz kindle
#

if the issue is strictly learning js, i believe the best way to learn it would be through web development and standard use in browsers

earnest phoenix
#

@hidden ginkgo You can't be too "truth-bending". I don't sugarcoat things
If you don't know it, I will tell you stratightforward

#

I'm not going to lie to you

hidden ginkgo
#

Yeah, that's fair and personally I'd appreciate that.

west raptor
#

^

hidden ginkgo
#

We aren't all brewed from the same teapot though.

earnest phoenix
#

In neko's case, he presented code that categorically proved he did not learn the fundamentals of JS

lusty dew
#

¯_(ツ)_/¯

#

I made a damn mistake

earnest phoenix
#

He said he was learning. basic if blocks are one of the first things you learn

lusty dew
#

drop it please

#

Please drop it

#

I made a damn mistake

#

I am human, humans make mistakes

hidden ginkgo
#

Your mistake isn't the focus of the conversation now

earnest phoenix
#

Okay...
I tend to give people the benefit of the doubt when they say that...

lusty dew
#

It seems like it

earnest phoenix
#

But then I get proven wrong the next day

#

¯_(ツ)_/¯

hidden ginkgo
#

It's more about how we approach these situations

#

Programmers are a misunderstood breed of people

#

They mean well, but everyone thinks they're assholes

lusty dew
#

¯_(ツ)_/¯

hidden ginkgo
#

😄

earnest phoenix
#

You need this.

#

ESLint lints your code and finds errors

west raptor
#

finding a good config is a pain though

earnest phoenix
#

I'll share mine if you want it.,

west raptor
#

and i dont have time to make a config

#

if you could, yes please

earnest phoenix
quartz kindle
#

there are several linting plugins for sublime text, if you use it

earnest phoenix
#

That's my baby

hidden ginkgo
#

A question I asked earlier but I think got lost; when you make a bot in js, can you hot swap files like you could with something on the web?

quartz kindle
#

what do you mean hot swap files?

hidden ginkgo
#

For example, with Java I have to recompile, and reinitialise every time I change something.

quartz kindle
#

with js you just need to restart node

earnest phoenix
#

Well, JS isn't compiled, it's interpreted

quartz kindle
#

^

earnest phoenix
#

so you can actually restart the application in a few seconds once you change a file

#

Tools like PM2 and nodeman can do this easily for you

hidden ginkgo
#

So you do have to restart the application is what I was getting at.

earnest phoenix
#

Yes you do

quartz kindle
#

its possible to modify files without restarting the application

#

if you code it that way

#

for example, require files, and have functions/commands to re-require the files

earnest phoenix
#

Oh I think I understand better.

hidden ginkgo
#

That makes sense, seems like dev can be pretty fast then

earnest phoenix
#

I have a "reload" command, but I barely use it

west raptor
earnest phoenix
#

I just restart with PM2

quartz kindle
#

pm2 has a "watch" option, where it watches a file for changes, and restarts automatically if it detects changes

earnest phoenix
#

@hidden ginkgo are you good with require.cache?

hidden ginkgo
#

I'd be lying if I said I had any idea what you're referring to.

#

I know basic web js, that's about it lol

earnest phoenix
#

Okay.
well in layman's terms, when you require modules, they are cached in the require.cache object

#

If you want to acheive the "hot reloading" feature you so desire, you can:

  1. Cache your modules (.js files) in memory
  2. Create a function that deletes the module from require.cache
  3. Re-require the file
  4. Re submit it to the cache.
hidden ginkgo
#

Right

#

Simple enough to achieve that

earnest phoenix
#

yep, simple enough

#

I do it in less than 20 lines

#

Could be even less for you, depending on the scope of your bot

hidden ginkgo
#

I don't think I'll be programming anything in Js any time soon, we've got another guy at work that handles that EleGiggle

#

It'd be interesting to learn about how it works compared to how the Java counterpart does though.

earnest phoenix
#

mind if I show how I implement it?

hidden ginkgo
#

Sure thing

earnest phoenix
#
reload() {
        return new Promise((resolve, reject) => {
            try {
                delete require.cache[require.resolve(`../../commands/${this.category.toLowerCase()}/${this.name}.js`)];
                const cmd = require(`../../commands/${this.category.toLowerCase()}/${this.name}.js`);
                const clas = new cmd(this.client);
                this.client.commands.delete(this.name);
                clas.category = this.category;
                this.client.commands.set(clas);
                resolve(this);
            } catch (e) {
                reject(e);
            }
        });
    }```
#

Don't expect you to understand everything, but I'll take it step by step

hidden ginkgo
#

Not familiar with the key words, but I pretty much understand what that's doing.

#

Unsure about the promise bit mostly.

inner jewel
#

you don't even need a promise there

earnest phoenix
#

It's a promise constructor, I'm creating the promise

#

basically the promise resolves if nothing fails, and the command is reloaded

hidden ginkgo
#

Is using exceptions for flow control good practice in js? blobbit

earnest phoenix
#

If module cannot be reloaded, I reject the promise, and the parent function receives the rejections

grizzled sequoia
#

@earnest phoenix Promise is useless

#

no async calls are made within the promise

#

You might as well just return something if it was successful

earnest phoenix
#

@hidden ginkgo when working with promises, it's basically mandatory
You have to handle your promises, especially in Node.js. Otheriwse, you'll be granted with errors such as unhandledRejection

grizzled sequoia
#

or throw otherwise

#

wrapping your code in a promise doesn't automatically make it asynchronous eyeskang

inner jewel
#
function requireAgain(x) {
    delete require.cache[require.resolve(x)];
    return require(x);
}

function reloadCommand(name) {
    commands[name] = requireAgain(`./commands/${name}`)
}```
grizzled sequoia
#

^better way

#

Handle exceptions yourself or return "null" and perform a check

lusty dew
#

How do I check if a user has a role?

earnest phoenix
#

@grizzled sequoia In this case, I have a parent function that is calling this method. I want to await the promise's eventual resolution, which I created by using the promise constructor.
Sure, the promise is optional, but I personally believe that it sets a good structure flow for when I'm writing my code.
To each their own.

grizzled sequoia
#

Which lang @lusty dew

lusty dew
#

D.js

quartz kindle
#

why 2 separate functions? are you ever going to re-require something without reloading a command?

grizzled sequoia
#

@earnest phoenix I agree with the last statement but because the code is blocking there's simply no need for a promise, might be using the wrong term here but it adds overhead when it's all blocking anyway

earnest phoenix
#

Natan's method has a few flaws

#

He's won't be able to ensure in any way that requireAgain() witll be executed before reloadCommand

#

If he does it in two functions

grizzled sequoia
#
reload() {
    try {
        delete require.cache[require.resolve(`../../commands/${this.category.toLowerCase()}/${this.name}.js`)];
        const cmd = require(`../../commands/${this.category.toLowerCase()}/${this.name}.js`);
        const clas = new cmd(this.client);
        this.client.commands.delete(this.name);
        clas.category = this.category;
        this.client.commands.set(clas);
        return this;
    } catch (e) {
        return e; // Check if typeof is error
    }
}
#

Promise just adds overhead/unnecessary complication

hidden ginkgo
#

Don't get issues like this in our clunky compiled languages, just recompile and reupload Krappa

quartz kindle
#

well thats what i do in js too

lusty dew
#

I will ask elsewhere then

quartz kindle
#

just save and restart node

#

lmao

earnest phoenix
#

@lusty dew there's always the discord.js docs

#
lusty dew
#

I have read them

earnest phoenix
#

Everything you'll every need is there

lusty dew
#

but I get an error

inner jewel
#

won't be able to ensure in any way that requireAgain() witll be executed before reloadCommand what

#

it's executed inside reloadCommand

lusty dew
#
Cannot read property 'has' of undefined
inner jewel
#

obviously it's not ran before

#

and even if it is

#

no issues

lusty dew
#
if(hMember.roles.has(role.id)) return msg.reply(`${message.author.tag} Has the role I am letting them continue.`)
    await hMember.addRole(role.id)
earnest phoenix
#

@inner jewel but is it? I don't see it there
and God forbid I assume 😃

hidden ginkgo
#

I prefer js version of inserting variables into strings

inner jewel
#

just because it's in two functions doesn't mean it won't work

hidden ginkgo
#

In Java you either concatenate or parameterize which is slow as hell

grizzled sequoia
#

@lusty dew msg.member.roles.has("id") i believe

#

name should work too iirc, although prone to ambiguity

inner jewel
#

js template strings are concatenation

#

just not explicit

hidden ginkgo
#

yeah, but in a neat way

earnest phoenix
#

I don't understand why you'd do it that way, but okay

quartz kindle
#

i prefer using concatenation than templating lmao

hidden ginkgo
#

instead like "this" + something + "this"

earnest phoenix
#

You don't handle errors at all

inner jewel
#

you don't either

#

you reject the promise

#

leaving callers to handle

#

mine will just throw

#

leaving callers to handle

earnest phoenix
#

I handle that in my reload command

#

simple .catch(onRejected)

inner jewel
#

just use a try catch instead of a .catch

hidden ginkgo
#

is templating as fast as manual concatenation?

inner jewel
#

using a promise has zero benefits

hidden ginkgo
#

in terms of cpu time

inner jewel
#

templating just becomes concatenation after parsing

#

so should be same speed to execute

earnest phoenix
#

Natan, you don't make any sense bloblul

hidden ginkgo
#

Yeah, so does parameterizing in Java

#

but it's like 100x slower

inner jewel
#

"parameterizing"?

#

you mean String.format?

hidden ginkgo
#

yeah

inner jewel
#

string.format is a different thing entirely

#

it's way more powerful than template strings/concatenation

#

but comes with overhead

#

either way the overhead is negligible

#

unless you're doing millions and millions of strings per second

hidden ginkgo
#

In most cases it is

#

yeah

grizzled sequoia
#

@hidden ginkgo templating times doesn't really make much of a difference in nodejs i believe

#

if it's performance you're after nodejs is the last place i'd look

inner jewel
#

if it does that'd be stupid

#

because it'd be either a poor template implementation or two different impls when one would be enough

quartz kindle
#

well... this is what i got regarding templating vs concatenation

inner jewel
#

microbenchmarks aren't really reliable

hidden ginkgo
#

That's what I was asking, if doing it in Js is slow too

#

relatively

inner jewel
#

also if that's just doing eval(benchmarkcode) it's flawed

#

because then it's considering parse times

#

a JIT-less node would be the best environment for that type of test

#

isolating each test to one process each

#

and running one at a time

#

and using a good old loop and timestamps before and after

earnest phoenix
#

@hidden ginkgo Tough to say. You'll never notice the difference in regular day to day use
But if you're really keen on knowing, you can run benchmarks to see

inner jewel
#

any lang with GC/JIT is hell to benchmark

#

way too unpredictable

quartz kindle
#

idk how they do it, but jsperf is pretty much the most used js benchmarking website

inner jewel
#

i guess with a deterministic environment you could probably get reliable stuff but those are rare

quartz kindle
#

so i assume its safe to somewhat trust their results

#

but of course the results highly depend on context

#

for example, another test which outputs to console.log instead of just declaring a variable, results in a speed difference of only 5% instead of 99%

#

another different test i did just now, that pushes the result to an array, resulted in a speed difference of 50%

#

but generally concatenation is always faster

hidden ginkgo
#

I'm guessing that's just because of overhead though, at least it is in Java.

#

Concatenation is converted into the equivalent StringBuilder, while String.format is that but precursed by a Formatter

earnest phoenix
#

Hey there, the bots can no longer interact with @twilit willow!

earnest phoenix
#

@queen sentinel

earnest phoenix
#

is there a way to simulate a vote to test functions regarding votes?

zealous veldt
#

you could vote yourself

#

and with an alt or something

earnest phoenix
#

you can test vote webhook thru the website

#

oh

#

TIL

zealous veldt
#

o that kind of voting

earnest phoenix
#

i need help

#

I have a file with an option of Owner as some roles
I mean Owner = Some roles
i want to make a code with staff list and i need this code
let staff_num = message.member.roles.find("name", "owner").members
but instead of searching a role it will search the option Owner

summer ocean
#

should it be something like

message.guild.members.filter(m => m.roles.some(r => r.name === "Owner"))
earnest phoenix
#

no need to filter every member and check for role name.

#

guild has roles prpoerty which is collection of roles

#

and roles have members collection

earnest phoenix
#

Anyone know a way you can jump like 5 seconds ahead in a voice channel playing music thing? ¯_(ツ)_/¯

#

discord.js

lament meteor
#

@earnest phoenix lavalink or ytdl-core/ffempeg ?

earnest phoenix
#

second one ^

lament meteor
#

ah...

#

there is a begin option

earnest phoenix
#

waw

#

lool

lament meteor
#

so u get the current time playing then u play again from there

#

idk if u can go ahead

earnest phoenix
#

ok

summer ocean
#

🤔 I didnt know that role has a collection of users lol @earnest phoenix

earnest phoenix
earnest phoenix
#

guys how can i get the servercount ruuning and working ,can someone give some details

ruby dust
#

you have to post your server count to dbl API

earnest phoenix
#

but there is no docs for dbl api

#

i cant find anything useful

ruby dust
#

I hope you know how APIs work, cause I aint helpin that far

earnest phoenix
#

and how shall count the guilds?

#

is that up to me

#

or there is any useful function

ruby dust
#

your discord client object suppose to have all guilds cached, so just get it's size and post that to API

earnest phoenix
#

nice i can make a loop and check for every 5 hrs or so thnx for help

earnest phoenix
#

-bot

slate kayak
earnest phoenix
#

error says cannot read property filter of undefined

#

and since u never learned basic concepts that doesnt make sense to you Omegaroll

#

but files is undefined

topaz fjord
#

I see the dancing gopher emoji

#

who 👀

slate kayak
#

if you say so tom but oh well i forgot that your a pro in everything that you do

#

oh and nextime keep your salt to yourself i have come here for help not your SALT

#

@earnest phoenix

earnest phoenix
#

👍 newsflash: u gotta be a pro to know what "undefined" is Omegaroll

#

🔫

topaz fjord
#

I believe it

west raptor
#

Well first of all you should read the first error @slate kayak

#

it can't find a folder

#

Therefore leading you the property error

earnest phoenix
#

error saying cant folder doesnt exist tickYes cannot read property x of undefined tickYes salty when pointed out tickYes

#

classic DBL

topaz fjord
#

but honestly it's not that hard to understand the error

#

salt is what makes a good helper

earnest phoenix
languid dragon
#

css

#

.shapes-background

earnest phoenix
#

Anyone know how to make a blacklist command, that when a user is added it blocks them from using commands ?

lament meteor
#

@earnest phoenix u know how to use dbs?

earnest phoenix
#

Somewhat.

lament meteor
#

well u make a db that has users with blacklist off

#

well yea..

earnest phoenix
#

guys

#

does the bot test also test it for being hack proof?

ruby dust
#

bot test?

earnest phoenix
#

yes

#

verification

quartz kindle
#

there is no such thing as hack proof, everything can be hacked. but regarding discord bots, the most common vulnerability is if you leak your token, so as long as you make sure to never accidentally make your token public, you're good to go

#

other possible vulnerabilities are leaked VPS ssh keys or auth information, or an open eval command

earnest phoenix
#

oh god finnaly now i can make sure i dont have any vulns

#

like command injection

#

i doubt it is also possible

quartz kindle
#

its only possible if you have an eval command, or similar

earnest phoenix
#

if i program the bot in the wrong style

#

yes

quartz kindle
#

or if you make your bot with php and open sql queries

earnest phoenix
#

and where i woul dleak my token i wonder

quartz kindle
#

lmfao

earnest phoenix
#

did someone hack my accoun tlol

inner jewel
#

no

quartz kindle
#

most people put their bot on github or similar, and forget to exclude their token files

#

thats how "hacking" happens

inner jewel
#

how to not get your bot hacked on discord:

  • properly secure your commands (just an id check is enough)
  • learn how to use gitignore/whatever ignore file your VCS uses
earnest phoenix
#

i dont use git

#

XD

quartz kindle
#

or just dont have an eval command and dont use git

#

lmao

#

i dont use it either

earnest phoenix
#

im hosting on my laptop

#

its H o t af

quartz kindle
#

i host on vps, but i push directly via ssh

earnest phoenix
#

if i get backdoored im fked

inner jewel
#

i just use git so i can roll back changes easily

earnest phoenix
#

how do I get a bot info by the client id

inner jewel
#

GET /users/:ID

earnest phoenix
#

with the discord api

#

right

inner jewel
#

will work for all bots except the old ones

#

where botid != clientid

earnest phoenix
#

I'm talking about the discord api

inner jewel
#

and i am too

earnest phoenix
#

oh ok

earnest phoenix
#

lol i wonder what if a pass a wrong int to dbl api updatestats function

ripe crown
#

when i try to use lavalink 3.0

#

i get this error

#

(intermediate value) is not iterable

quartz kindle
#

you mean a fake server count? @earnest phoenix

#

there is nothing stopping you from doing it, but if you get caught you'll probably get banned xd

earnest phoenix
#

yes

#

LOL

#

So cruel

quartz kindle
#

there was some dude who was apparently accidentally posting double the server count because he had 2 shards

earnest phoenix
#

oh 😂 😂

#

poor him

quartz kindle
#

and im pretty sure many people posted something like 99999 just for fun

#

xD

earnest phoenix
#

😂 😂 😂 😂

bronze wagon
#

hi \o

earnest phoenix
#

oh i though @rocky spire was @quartz kindle

#

daaaaaaam homie

#

because you are the best

#

@south finch how are you bro. i love ya lad

quartz kindle
#

wat

earnest phoenix
#

yeah

quartz kindle
#

yeah

earnest phoenix
#

which lead to bad stuff

#

because you know

south finch
#

um im good but this isnt a chitchat channel

earnest phoenix
#

we share our stuff together

#

so i didnt know so i shared our stuff with the other dude

#

sorry tim

quartz kindle
#

wtf

frigid juniper
#

Is there any thing to know if a bot is down ? Like on the website, there's a logo (online or offline) and I was wondering how the status was checked.

Or just, a loop checking something every 30sec to know if the bot is getting down ?

topaz fjord
#

The way the website knows the status is if the bot is in this server

quartz kindle
#

im pretty sure the website checks the discord api for the bot's online status on page load

frigid juniper
#

Yep but its not instantly refreshed and that's normal

#

I need something to know directly when something goes wrong and the bot is getting down

quartz kindle
#

if its your own bot, the best way is to do that server side

#

using some process manager

#

that alerts on process change

frigid juniper
#

Yup its mine

#

But like what ?

#

I'm using a raspberry

quartz kindle
#

well, first decide how do you want to be notified

#

by discord? by email? by text message?

frigid juniper
#

I don't want to be notified, I want to restart the raspberry when my bot is down

quartz kindle
#

oh thats way easier

topaz fjord
#

Use pm2

frigid juniper
#

Yup

#

pm2 ?

topaz fjord
#

pm2 autorestarts when a program crashes

#

Advanced process manager for production Node.js applications. Load balancer, logs facility, startup script, micro service management, at a glance.

frigid juniper
#

But ... I'm using screen package

quartz kindle
#

is your bot in node.js?

frigid juniper
#

No python : the script is running in a screen

quartz kindle
#

well, im sure there are many ways to auto-restart a python script on crash

topaz fjord
#

pm2 can run python btw

bronze wagon
#

hey bois

quartz kindle
#

example

frigid juniper
#

Its more difficult cauz the screen is getting closed when a script has finished running

quartz kindle
#

oh pm2 can run python, didnt know that

topaz fjord
#

They have interpreters

quartz kindle
#

if you run pm2, you dont need a screen

rustic axle
#

iirc if you are able to catch the process id from another process on a unix machine you should be able to check if it crashes

topaz fjord
quartz kindle
#

if your PI is running linux, and you access it via ssh, you can install pm2, and run pm2 start script.py

topaz fjord
#

ye

quartz kindle
#

pm2 will automatically create a process and manage it for you

#

no need for screens or tmux

frigid juniper
#

Oh OK, I'll check that

quartz kindle
#

and you can check status, amount of crashes, last error, ram/cpu usage, etc

topaz fjord
#

I suggest also specifiing interpreter as well when running it

#

just so it runs the right lang

#

who knows if it could fail so

quartz kindle
#

i was using tmux with while loops directly in terminal before i switched to pm2 xD

frigid juniper
#

I don't really know this app but I'll learn how its working

topaz fjord
#

o shit pm2 has an enterprise version

frigid juniper
#

Thanks a lot guys for your advices and have a good evening / day (10PM for me XD)

zenith moss
#

Anyone know why when I do my eval command it sends like five of the same messages.

earnest phoenix
#

you probably have the multiple instances of the bot running

#

if it is just for the eval message then not

zenith moss
rustic axle
#

no he probably has multiple instances

zenith moss
#

How..

rustic axle
#

Does anyone know of a npm package that can generate images of source code based on the code I send it

#

like a source code image generator api

earnest phoenix
#

so uh

#

you mean a computer

earnest phoenix
spring ember
#

No mentions probably

earnest phoenix
#

also isn't avatarURL()

smoky spire
#

Members don't have usernames or avatars, users do

earnest phoenix
#

@smoky spire
msg.mentions.users.first()????

smoky spire
#

Yes

earnest phoenix
#

Ty @smoky spire

#

.first() is discord's collection method for the first value

#

mentions.users extends discord collection which extends map

smoky spire
#

What are you trying to get at

bright spear
#

@earnest phoenix its avatarURL in 11 and avatarURL() in 12

#

btw @smoky spire that won't work for people without avatars, to make it work for them use displayAvatarURL instead of avatarURL

smoky spire
#

Yes I know

simple bramble
#

how do i connect my bots program to my remote desktop control

#

i need a vps lul

opaque eagle
#

How would I go about localizing my bot, as in supporting multiple languages? I'm using Discord.js

earnest phoenix
#

you learn different languages

#

or have translators do it for you

#

google translate Thonk

quartz kindle
#

make a database of strings/texts by language instead of hardcoding your dialogues

hidden ginkgo
#

^

wheat marten
frail terrace
#

welcome to the bang gang squad

wheat marten
#

oh god

west raptor
#

l o l

wheat marten
#

I am the bot developer for a roblox server -_-

west raptor
#

Even better

#

I mean

#

yes

hybrid shadow
#

oof

#

for discord.py, anyone know what this error means?

#
Task exception was never retrieved
future: <Task finished coro=<ConnectionState._delay_ready() done, defined at /home/runner/.site-packages/discord/state.py:166> exception=ConnectionClosed('WebSocket connection is closed: code = 1000, no reason.',)>
Traceback (most recent call last):
  File "/home/runner/.site-packages/discord/gateway.py", line 447, in send_as_json
    yield from super().send(utils.to_json(data))
  File "/home/runner/.site-packages/websockets/protocol.py", line 330, in send
    yield from self.ensure_open()
  File "/home/runner/.site-packages/websockets/protocol.py", line 422, in ensure_open
    raise ConnectionClosed(self.close_code, self.close_reason)
websockets.exceptions.ConnectionClosed: WebSocket connection is closed: code = 1000, no reason.

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

Traceback (most recent call last):
  File "/home/runner/.site-packages/discord/state.py", line 185, in _delay_ready
    yield from self.chunker(split)
  File "/home/runner/.site-packages/discord/client.py", line 1680, in request_offline_members
    yield from self.ws.send_as_json(payload)
  File "/home/runner/.site-packages/discord/gateway.py", line 450, in send_as_json
    raise ConnectionClosed(e) from e
discord.errors.ConnectionClosed: WebSocket connection is closed: code = 1000, no reason.
bronze wagon
#

@hybrid shadow tried switching eq to experimental?

hybrid shadow
#

wdym?

bronze wagon
#

what os are u using

hybrid shadow
#

im actually using an online hosting site known as repl.it but I think its linux

bronze wagon
#

i dont have full control on that site

hybrid shadow
#

oof

bronze wagon
#

U*

hybrid shadow
#

what abt this error:

Exception in thread Thread-7:
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/home/runner/keep_alive.py", line 20, in run
    app.run(host='0.0.0.0',port=8080)
  File "/home/runner/.site-packages/flask/app.py", line 943, in run
    run_simple(host, port, self, **options)
  File "/home/runner/.site-packages/werkzeug/serving.py", line 814, in run_simple
    inner()
  File "/home/runner/.site-packages/werkzeug/serving.py", line 774, in inner
    fd=fd)
  File "/home/runner/.site-packages/werkzeug/serving.py", line 660, in make_server
    passthrough_errors, ssl_context, fd=fd)
  File "/home/runner/.site-packages/werkzeug/serving.py", line 577, in __init__
    self.address_family), handler)
  File "/usr/local/lib/python3.6/socketserver.py", line 453, in __init__
    self.server_bind()
  File "/usr/local/lib/python3.6/http/server.py", line 136, in server_bind
    socketserver.TCPServer.server_bind(self)
  File "/usr/local/lib/python3.6/socketserver.py", line 467, in server_bind
    self.socket.bind(self.server_address)
OSError: [Errno 98] Address already in use
odd shell
#

Hey anyone run into problems with voiceRecieve.on('opus' not receiving events?

earnest phoenix
#

who do humans ping mee

bronze wagon
#

which python version node opus requires to install?

#

nodejs

earnest phoenix
#

Just install build tools GWchadThink

#

Well, 2.7

candid oak
#

does anyone know mySQL very well and fancy looking at two queries and telling me why one works and the other doesnt?

earnest phoenix
#

show maybe i can help

candid oak
#

@earnest phoenix
this doesn't work:

SELECT *
FROM ocelotbot_spooks AS spooks1
JOIN ocelotbot_spooks ON ocelotbot_spooks.id = (SELECT min(id) AS next FROM ocelotbot_spooks AS spooks2 WHERE spooks2.id > ocelotbot_spooks.id AND spooks2.server = ocelotbot_spooks.server)

but this one does

SELECT *,
(SELECT min(id) AS next FROM ocelotbot_spooks AS spooks2 WHERE spooks2.id > ocelotbot_spooks.id AND spooks2.server = ocelotbot_spooks.server) AS next
FROM ocelotbot_spooks
restive silo
#

@bitter sundial now for real why would you need an api token for like quering top bots sorted by server count as example

hidden ginkgo
#

What output are you getting?

restive silo
#

its kinda pointless imo

bitter sundial
#

@restive silo to control api abuse, like scraping

restive silo
#

ah did it go that bad?

#

well i mean i understand that then for like security reasons its fine i guess,

earnest phoenix
#

well currently the api/bots* requires no auth and has a limit of 500 so people can "scrape" the whole site in like 10 requests

heady zinc
#

that will just make people actually scrape the website and do more requests by doing so ThinkRaging

earnest phoenix
#

okay now it's maybe offtopic development question

#

The Scenario: A hosting company calls you and explains that they developed their own in-house control panel. However, they wish to move away from it to a more feature-complete commercial control panel that contains all of the standard features that website owners are looking for. They wish to eliminate development costs associated with maintaining their own control panel so they can get back to providing shared hosting more efficiently.

Is cPanel & WHM “The Hosting Platform of Choice” for this user?

#

is it?

earnest phoenix
#

uuh its a choice

#

now whether its the choice would depend to actual specifications of their in-house control panel and whether a combination of WHM and cPanel would be sufficient enough

wide ruin
#

discord.js, is it possible to get the user's role colour?

inner jewel
#

no

wide ruin
#

Ok

inner jewel
#

users don't have roles

#

members do

wide ruin
#

Is there a way to get a members role colour?

bitter sundial
#

find their highest role and check the color of that role

wide ruin
#

Where in docs can I find it?

#

Member.role

#

Or similar

bitter sundial
#

member.roles for list of roles

#

are you on master?

inner jewel
ruby dust
#

doesn't member have a color parameter in d.js or something

wide ruin
#

Thanks

bitter sundial
#

oh they do? lol I didn't notice that when I looked at that before 😄

#

should've known tho

ruby dust
#

well idk, I just know that in d.py it's a thing 👀

wide ruin
#

So member.roles.displayHexColor

inner jewel
#

no

wide ruin
#

Would that be right?

inner jewel
#

read the docs

wide ruin
#

I did

inner jewel
#

displayColor is a property of GuildMember

wide ruin
#

Oh

#

Well it's going off a ping, defined as mUser

#

So mUser.GuildMember.roles.displayHexColor?

ruby dust
inner jewel
#

i'd recommend learning the language/library properly before making a bot

ruby dust
#

it's a second, or a third week he's been asking these kind of questions

wide ruin
#

Oh, so remove roles

inner jewel
#

still wrong

#

GuildMember is a class

#

not a property

earnest phoenix
#

botum hala test edilmedimi

wide ruin
#

highestRole.displayHexColor

#

?

smoky spire
#

No, displayHexColor is a property of a member, not a role

wide ruin
#

Right, looked at roles and is it just hexColor

#

That's what it said on guildMember.highestRole

#

@smoky spire right?

smoky spire
#

You said you just wanted the color that the member shows right?

wide ruin
#

Yes

#

Like the embed would be green as my role is green

smoky spire
#

just use member.displayHexColor GWqlabsFacepalm

inner jewel
#

again, learn the library

wide ruin
#

mUser.displayHexColor

inner jewel
#

you could find the answer to your question with a simple ctrl + f on the docs

ruby dust
#

not ust the library, they will keep asking these stupid questions cause they've been doing it for 3 weeks I think

earnest phoenix
#

Will you test my Discord botum?

inner jewel
#

it will be tested eventually

#

you just need to wait

hushed berry
topaz fjord
#

What does it do

hushed berry
#

well i mean

#

the explaination for what auto reset is

#

is on that second hyper link

#

but do you think the premium bit is confusing

topaz fjord
#

I was thinking you could do [Premium] or smth like that

hushed berry
#

thats the syntax i use for parameters though

#

hmm

topaz fjord
#

uh

hushed berry
#

😳

topaz fjord
#

()?

#

{}

hushed berry
#

hmm

west raptor
#

maybe directly below it?

visual surge
#

Hi niko.
I'd say either that, directly above in a smaller font, in a red [P] before it, or possibly even as another line after Required Permissions

abstract crystal
#

how about making it a tag (might misled users into believing that it's not a link)

west raptor
#

That could work also

hushed berry
#

@abstract crystal I dont believe I have that much control

abstract crystal
#

is this a website, if i may ask

unborn estuary
#

hello to all, can one help me with a very simple bot? He should only choose a random user with a specific role. (Python)

west raptor
#

python*

hushed berry
#

@abstract crystal kinda

unborn estuary
#

you right xD

abstract crystal
#

so you want to get the role (you can get it with the discord.util.get) then use role.members to get the list of members and use random.choice to select a random member

unborn estuary
#

first Thank you
i try it but i must say, im a noob in coding, i think i need more help 😅

abstract crystal
#

@hushed berry is there any wiggle room with css? (i'm guessing probably not) only thing required would be background color and border radius

hushed berry
#

yeah, actually, there is 😊

unborn estuary
#

maybe but my english isn´t so good
but i try it
thx

hushed berry
#

i just have absolutely no clue how to use it

unborn crow
#

Are you german?

unborn estuary
#

yes

unborn crow
#

Das ist ja schön c:

unborn estuary
#

hehe hi ^^

west raptor
unborn estuary
#

soory

#

sorry

west raptor
#

its ok

unborn crow
abstract crystal
#
.tag {
    align-items: center;
    background-color: #f5f5f5;
    border-radius: 290486px;
    color: #4a4a4a;
    display: inline-flex;
    font-size: .75rem;
    height: 2em;
    justify-content: center;
    line-height: 1.5;
    padding-left: .75em;
    padding-right: .75em;
    white-space: nowrap;
}

and the html would be

<p>-auto reset <span class="tag">premium</span></p>
#

@hushed berry

earnest phoenix
#

so uh

#

how would i make my bot have multiple prefixes through an array

#

like

#

i know how to do

abstract crystal
#

{guild_id: "prefix"}

hushed berry
#

check if first matches, if so run command

earnest phoenix
#
*/eval
let a = ["*/", "this is so sad */", "*/*/"]
let strong = "this is so sad */ping"

a.forEach(prefix => {
  message.channel.send(strong.startsWith(prefix))
})
hushed berry
#

if not, repeat with prefix 2

west raptor
#

anidiotsgiude has a section on it i think

#

want me to link

earnest phoenix
#

actually

#

ill check that

west raptor
#

do you want me to link?

#

cause like

#

i can if you want

earnest phoenix
#

nah

#

i'm ok

west raptor
#

alright

earnest phoenix
#

i'll try the if statement thing

#

and if that doesn't work i'll use an idiots guide

hushed berry
#

@abstract crystal i kinda got it working!! 😊

abstract crystal
#

OwO

hushed berry
#

i really appreciate the help

abstract crystal
#

nice

#

np

hushed berry
#

its not perfect

#

i couldnt figure out how to define a new element

#

so i kept the superscript and just applied the css to that instead

#

which works, i guess

#

right?

abstract crystal
#

well it works xd

hushed berry
#

maybe ill have to submit a ticket or something to ask how to do that thing

#

but ty anyways pepeblush

#

it looks much nicer

#

also eww

#

i hate that pepe blush

west raptor
#

lol

abstract crystal
topaz fjord
#

@abstract crystal isn't that the Bulma tag

abstract crystal
#

yes

#

now stolen

topaz fjord
#

bad

abstract crystal
#

and a bit modified

earnest phoenix
#

uwu

abstract crystal
hushed berry
#

wait actually css modification might be above my plan lmao

#

hold on

#

gvd

abstract crystal
#

who the hell charges for css modif?

#

xd

hushed berry
#

um a lot of sites

topaz fjord
#

then host it on your own

hushed berry
#

well that would defeat the purpose of this then!

topaz fjord
#

wut

abstract crystal
#

is external stylesheet too much to ask?

topaz fjord
#

What are you even making ur weebsite with

languid vault
#

how do i get the 300 characters

<div style="display: none">
this broke
yeaaaaaaaaaaaaaaaa

yeeet
</div>

but it didnt work

west raptor
#

lol

hushed berry
#

....

topaz fjord
#

To get 300 characters you type more

abstract crystal
#

Actually make a meaningful description mmLol

hushed berry
#

be very verbose

topaz fjord
#

Just add a shitload of css

hushed berry
#

ACHOO

#

sorry

topaz fjord
#

nou

abstract crystal
#

copy and paste entire bootstrap

languid vault
#

i dont know for a description

topaz fjord
#

If dbl was made with react I bet it would be 100 times 👌

abstract crystal
#

react™

topaz fjord
#

yes

languid vault
#

uhhh

topaz fjord
#

Just type more to get more characters

#

That's the easiest way

languid vault
#

random words then

topaz fjord
#

No

abstract crystal
#

lorem ipsum

topaz fjord
#

Spam to fill long desc gets you declined

inner jewel
#

how about a huge comment

languid vault
#

it works

#

thanks

west raptor
#

oh so thats how people gets no description

#

lol

languid vault
#

lorem ipsum

abstract crystal
#

inb4 bot declined

west raptor
#

hahayes

abstract crystal
west raptor
hushed berry
#

dot dot dot

earnest phoenix
#

ol

hushed berry
#

@languid vault yeah, you actually need to have something there for it to pass verification lol

wicked dust
#

?help

rustic axle
#

no !help is better

bronze wagon
#

is there any alternative to npm forever?

#

it works nicely but i cant see console and error

#

s

topaz fjord
#

pm2

inner jewel
#

systemd

bronze wagon
#

im figuring out pm2

#

seems better

#

this ubuntu

#

driver support absolutely terrible

inner jewel
#

systemd is the built in method

#

¯_(ツ)_/¯

bronze wagon
#

but pm2 gives me remote access to keep an eye on bot ;d

frail terrace
#

what's the best way to store commands (their names): a db or in json

quartz kindle
#

i just have them in an array somewhere in the main file lul

frail terrace
#

but i'd like it to be dynamic

quartz kindle
#

like enabled/disabled?

#

or per server configuration?

#

then you need a db yes, to keep track of server ids

#

json also works, but db is safer

frail terrace
#

like i add a command

#

and it automatically adds

quartz kindle
#

with or without restarting the bot?

frail terrace
#

restarts

quartz kindle
#

then you can have each command in a file in a folder, and on bot startup read the folder

#

that way you can just create a new file and your bot will see it automatically

ivory pebble
#

Does anyone know if sharding will improve my bot's ping?

inner jewel
#

no

#

sharding just splits the connection

topaz fjord
#

improve your internet to get better ping

shrewd lark
#

hola una pregunta

earnest phoenix
#

creo q solo dejan hablar ingles..

#

aunq no estoy seguro

ivory pebble
#

My internet is good..

#

I just don't know why the ping gets bad after a while

shrewd lark
#

alguien me recomienda un bot parecido al @runic bridge

earnest phoenix
#

habia uno bueno pero se me olvido como se llamaba

#

lol

west raptor
earnest phoenix
#

ty mini mod

topaz fjord
earnest phoenix
#

I was telling him that

topaz fjord
#

no

ivory pebble
#

Okay

#

Well is there any way to improve the ping?

earnest phoenix
#

for your bot?

ivory pebble
#

Ya

earnest phoenix
#

is it hosted on ur pc

ivory pebble
#

No

#

VPS

earnest phoenix
#

ah

#

I don't think there is

bronze wagon
#

thats 2 bad

inner jewel
#

move it to a server close to discord

topaz fjord
#

like i said improve internet

inner jewel
#

aka us east coast

ivory pebble
#

Ya the server is in CHicago

bronze wagon
#

do u have full access to server

#

or host is not urs

ivory pebble
#

Yes I have full access

topaz fjord
#

I host mine in N.Y. and i get ~ 22-28ms

ivory pebble
#

Well my bot is weird

#

Sometimes it has really good ping

#

And sometimes it has really really bad ping

#

And its affecting the bot's server count and stuff

topaz fjord
#

rip

bronze wagon
#

ur using same internet?

quartz kindle
#

whats the ping you're getting?

#

until 200ms on average its considered normal

#

optimally, you would have 60-100ms

ivory pebble
#

Im getting more than 10 seconds ._.

topaz fjord
#

what the fuck

bronze wagon
#

whoah

ivory pebble
#

Sometimes it can go up to a minute

quartz kindle
#

are you sure thats the bots ping and not some code problem?

#

maybe try changing servers?

ivory pebble
#

That would cost money

topaz fjord
#

hosting in N.Y seems to do well for some bots

#

@ivory pebble how much do you pay for your vps rn

bronze wagon
#

why dont u use ur own host

quartz kindle
#

there are many VPS with free/trial options

ivory pebble
#

Im using galaxy gate, 10$

topaz fjord
#

how do you have that bad ping

ivory pebble
#

I dont know..

topaz fjord
#

im using Galaxy Gate same plan and i get 20ms

quartz kindle
#

galaxygate has very good reviews here, it shouldnt be that bad lol

bronze wagon
#

isnt it just better to host by yourself?

ivory pebble
#

No

topaz fjord
#

no

quartz kindle
#

no

bronze wagon
#

why lol

tough tinsel
#

LOL

#

HAY

ivory pebble
#

It might be my music system thats causing this

quartz kindle
#

consumer internet vs dedicated server internet

#

consumer internet sucks

#

its unstable

#

slow

#

etc

topaz fjord
#

GG has unlim bandwith so idk if its music

ivory pebble
#

Ya its really weird

topaz fjord
#

you can try asking in their support server

quartz kindle
#

if your music is using a lot of bandwidth then it could be the issue

#

similar to how torrent makes your ping go to 2k+

#

try disabling the music temporarily?

topaz fjord
#

or use lavalink

ivory pebble
#

Music is the only feature of the bot crylaugheyes

#

That would be a problem if I disabled that, since its a music bobt

quartz kindle
#

still, its worth a try

#

try a simple ping command

#

with and without music

#

if ping is normal without the music system running, then you have your answer

#

and the problem is the code, not the server

ivory pebble
#

Okay

quartz kindle
#

try making a new bot with only a ping command, and shut down your main bot for 10 seconds to test the ping

ivory pebble
#

See

#

The bots ping isnt always bad

#

It becomes bad after I run node index.js by like 3 hours

#

or sometime like that

quartz kindle
#

then its possible you have a memory leak or something

ivory pebble
#

when i restart it, it's ping is fresh

#

hmm

inner jewel
#

definitely broken code

#

you might be doing something that blocks the eventloop

ivory pebble
#

Okay, well thanks for all the help

glacial kestrel
#

message delete event on d.js isnt working for me 👀

#

nvm im autistic

wicked summit
#

Hey

bright spear
#

@wicked summit are you using express?

wicked summit
#

Umm already know it

topaz fjord
#

are you using apache or nginx of smth

#

bc in nginx I believe u need to reverse proxy

earnest phoenix
#

ok

#

so if my bot doesn't have the permission to do something in a guild

#

should it be

#
if(client.user.hasPermissions !== "some-value-lol-foobar") || if(message.guild.me.hasPermissions !== "some-value-lol-foobar")
#

i feel like client.user.hasPermissions isn't a function

#

so

bright spear
#
if(!message.guild.me.hasPermission('EMBED_LINKS')){
          // do stuff
}
earnest phoenix
#

k

#

i thought it was the second one

earnest phoenix
#

Can somebody tell me how can I mentions specific server in js

#

I need to disable level up and coins messages from this server

#

anyone here maybe can help me ^w^
i got confused 3 hours
So i want make an JSON to save a image using a link in GLITCH
this https://sharif.glitch.me
but i'm confused why the images can't randomly sended there.
my code:```js
var express = require('express');
var http = require('http');
var app = express();

// pinging
app.use(express.static('public'));
// http://expressjs.com/en/starter/basic-routing.html

let img = require('./image.json')
let rstatus = img[Math.floor(Math.random() * img.length)]
app.get('/', function(request, response) {
response.send(( {image: rstatus} ))
})
// listen for requests :)
var listener = app.listen(process.env.PORT, function() {
console.log('Your app is listening on port ' + listener.address().port);
});
setInterval(() => {
http.get(http://${process.env.PROJECT_DOMAIN}.glitch.me/);
}, 280000);

verbal jolt
earnest phoenix
#

no its json

#

i put a link image there

#

and want get it randomly

#

but

#

can't random

#

Ooh

bright spear
#

@earnest phoenix yes but you need to use normal quotes: "

earnest phoenix
#

TIL about uikits mobile optimization

#

its godsent

amber gorge
#

Hey everyone
is anyone familiar with digital ocean ?
How much time can i host my bot with 50$ ?

earnest phoenix
#

i use ovh

#

uwu

#

depends on ram usage of your bot

#

how lightweight is your bot

bright spear
#

I've heard ovh sucks

amber gorge
#

Actually i'm using Heroku
it's totally free

earnest phoenix
#

i have never had a problem with ovh

amber gorge
#

but i sometimes get memory leaks

earnest phoenix
#

i have a 12 gig ram 2 core server with them

#

never had a single problem

amber gorge
#

is it pricy ?

earnest phoenix
#

cheapest host i can think of

#

much moreso then digital ocean

#

but if you need the support structure

#

i would go with Digital ocean

#

if you have a good grasp on how server management and maintnance works

#

ovh

amber gorge
#

i just got the student pack from github

#

i have 50$ free

earnest phoenix
amber gorge
#

on digital ocean

earnest phoenix
#

they start at 3.30 a montht for 2 gigs ram

paper zinc
#

Can someone give me a code line for my bot.js? It keeps crashing after 24 hours (thats not the problem) but the problem is that it wont start up automatically again!

earnest phoenix
#

pretty affordable

#

@paper zinc are you running it with PM2 or nodemon?

#

or just 'node blah.js'

paper zinc
#

Wtf is both of that

amber gorge
#

thanks uber

paper zinc
#

i use node blah bleh oh my mac pro in the corner of my room

earnest phoenix
#

what kind of server are you hosting it on

#

ok

#

soe if your running it off your pc

paper zinc
#

Yee

#

I call it my server because i got no use for it

earnest phoenix
#

get this

paper zinc
#

Wat?

#

I aint good at coding, wot should i do

earnest phoenix
#

pm2 will run it and if it crashes etc it will instantly restart

#

0 downtime

#

just install it

#

and run 'pm2 start blah.js'

#

here

#
npm install pm2 -g
pm2 start 'blah.js'
pm2 list
paper zinc
#

OKAY

#

Lets see

earnest phoenix
#

i use it on my server

#

works wounderfully

#

and it stores files to cache i believe so when you change files it wont effect till a restart meaning 0 downtime

amber gorge
#

@earnest phoenix you can write text directly
use markdown like in discord
or use html

earnest phoenix
#

pm2 is lovely

amber gorge
#

there's a button to preview so you can test what you want

earnest phoenix
#

but read its docs

#

or else youll be lost

#

I put the code of my bot

#

if you want a easier solution but less stable and more thrown together i guess you could run it on nodemon

#

he put the code of his bot

#

ded

#

It is mandatory

#

no

#

it is not

amber gorge
#

no

earnest phoenix
#

Yes

#

tu es connard, es no obligetoires HYPER_ANGER

amber gorge
#

haha ! XD

earnest phoenix
#

i have a french friend irl, only thing he taught me was swearing

#

and slang

#

wesh

amber gorge
#

wesh is not french

earnest phoenix
#

its french ghetto slang

#

it didnt originate

#

but its used

#

commonly

paper zinc
#

`npm install pm2 -g
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! { Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! stack: 'Error: EACCES: permission denied, access '/usr/local/lib/node_modules'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/admin/.npm/_logs/2018-10-06T08_40_55_276Z-debug.log`

amber gorge
#

from north africa people

earnest phoenix
#

run sudo npm install pm2 -g

#

idk if sudo works on mac