#development

1 messages ยท Page 332 of 1

inner jewel
#

bots can't speak here

#

also

#

@prime cliff @trim steppe @jagged plume discord fucks up presences for sharded bots if you can see more than one shard

prime cliff
#

Ah ok

prisma quarry
#

If you don't know already (I think you should):

#

One astrick (*) at the beginning and end of the word makes it in italics. EX: Bots are fun!

#

Also,

restive silo
#

that isn't even a question

prisma quarry
#

Just telling you.

restive silo
#

this is for developing stuff

prisma quarry
#

๐Ÿ‘Œ

earnest phoenix
#

do you mind

#

this is for development purposes

#

and from what i know you're not a bot developer, web developer or even a roblox developer

prime cliff
#

Roblox devs are lit asf

#

You nerds

#

โค

low niche
#

In regex, how would you replace _ or - with spaces?

lime falcon
#

What language?

low niche
#

JS regex

#

note the regex

inner jewel
#

"(_|\\-)" -> " "

#
(_|\-)```
lime falcon
#

String.replace(/[_-]/g, " ")

inner jewel
#

or that

low niche
#

I already got it ignoring the IDs and idk where to fit that

#

String.replace(<@!?[0-9]+>/g, ' ')

#

i still need help lol

#

@lime falcon

lime falcon
#

One sec...

#

Ah I see so that's replacing all mentions with a space

low niche
#

no

#

now you have to use _ or - for a space between words in captions of the picture

#

like this: it is now ppmemegen top_caption | bottom_caption instead of ppmemegen top caption | bottom caption

lime falcon
#

If you want it to do the same as the above, but also replace [_-], then you just need to tack on |[_-] to the existing RegExp

#
String.replace(/<@!?[0-9]+>/g, ' ') // Matches a mention, replaces with a space
String.replace(/<@!?[0-9]+>|[_-]/g, ' ') // Matches a mention OR an _ or - and will replace either with a space 
low niche
#

like this? <@!?[0-9]+|[_-]>,

#

oh i see

#

thanks

lime falcon
#

Welcome

low niche
lime falcon
#

Welp. I honestly am not a JS master and I'm not sure what kind of error that is. Aside from 'The Promise errored'

low niche
#

ok i see

inner jewel
#

internet is rip

low niche
#

it works fine

#

besides the slow speeds

buoyant ivy
#

I have a question xD : how do I get my bot's client ID?

earnest phoenix
buoyant ivy
#

Thank you

earnest phoenix
#

np

low niche
earnest phoenix
#

@low niche That isn't a problem with your ISP iirc

#

I ran into the same issue

low niche
#

node stuffed

#

git stuffed

#

npm stuffed

earnest phoenix
#

what

low niche
#

can't install eslint

earnest phoenix
#

npm i -g eslint

low niche
#

i know that

#

errors out

earnest phoenix
#

gib errors

tawny lava
#

errors are for nubs anyways

languid dragon
sinful meadow
#

need help

#

lmao

tawny lava
#

createInvite returns a promise

languid dragon
#

Yh im

#

Ik*

tawny lava
#

so you'll have to await it or use .then

sinful meadow
#

@languid dragon

#

var invite_code = client.guilds.get(users[1].details.server).channels.first().createInvite().then(e => console.log(e.url))

#

Should work

languid dragon
#

I dont wanna console log it

#

I wanna store it as a variable and use it somewhere else

sinful meadow
#

you dont have to

#

THat is just checking

#

to make it work

#

lmao

tawny lava
#

var invite_code = await client.guilds.get(users[1].details.server).channels.first().createInvite()

#

do that

languid dragon
#

Ok ill try after my shit

tawny lava
#

invite_code.url will give you the url

#

or whatever you want

sinful meadow
#

^^^^

languid dragon
#

Thank dad xox

tawny lava
#

yes

languid dragon
#

๐Ÿ˜™

#

@tawny lava i fucking love you, im so annoyed that all i was missing was await LMFAO

if only i could get those 2 hours of my life back

tawny lava
#

lul

sinful meadow
#

lmao

tawny lava
#

np xd

low niche
#

lmao

sinful meadow
#

You code in js @low niche

#

i forgot lmao

#

more like do you

low niche
#

@sinful meadow JS and Java

sinful meadow
#

Mind helping me real quick

low niche
#

ok

sinful meadow
#

Im trying to tag a role but in embeds

#

How do i do that

low niche
#

๐Ÿค”

sinful meadow
#

Do you tag by ids?

low niche
#

Explain why you want to do that

sinful meadow
#

Or just @NAME

#

Because

#

I have a roles in the server command

lime falcon
#

Aren't roles <@&[ID]>?

#

I think

sinful meadow
#

I dont know

low niche
#

yes

lime falcon
#

To create a tag, not sure how embeds interact with role tags, but that's how you'd do it

low niche
#

^^^^

#

now to update my bot

#

and fix @timid mantle's issue

sinful meadow
#

Got it

#

@lime falcon Thanks

timid mantle
#

kek

neon pasture
#

How do I fix this? Error: SQLITE_BUSY: database is locked. I have shards, discord.js

#

I know it means that your database is opened some where else, but I don't know how to fix it.

uncut slate
#

@neon pasture Discord.js creates a process per shard, and if you have a sqlite connection for your bot.js file, that means you're opening an SQLite connection per shard

neon pasture
#

How do I open just one connection for all my shards?

#

or isn't that possible?

surreal peak
#

Make a standalone class

#

in c# that would be a static class

#

dunno in other languages

uncut slate
#

Using Discord.js sharding, I believe you can't.
You might be able to work with multiple connections at the same time though, I think @earnest phoenix mentioned it being possible to have multiple connection as long as they're all SQLite

neon pasture
#

They are all SQLite connections

uncut slate
#

Yeah I'm not sure myself, but if you're getting that error I'm lead to believe it's not possible to have multiple connections

neon pasture
#

but SQLite locks the database for a short time when is something changed.

uncut slate
#

So you would have to do what Erlite is doing and add your own IPC framework to the Discord.js shard manager (which is going to be a massive pain in the dick)
or Find out how to have multiple connections somehow
or Pick a new database that doesn't use an in-process connections
or Use Eris

neon pasture
#

When I use Eris, I can still use SQLite?

uncut slate
#

Yes.

#

Eris doesn't create a new process per shard - it handles it internally.

neon pasture
#

fuck discord.js, hello Eris

uncut slate
#

Ay. I used to use Discord.js for all of my projects, honestly it's a pain in the dick for bigger bots.

neon pasture
#

Was trying to work with Eris, but it's hard to understand.

uncut slate
#

It is quite a bit more raw, yeah. Discord.js has lots of utility to make it easier for you.

surreal peak
#

Dont use js then

neon pasture
#

I made one command, just a simple embed. Took me 2 hours.

uncut slate
#

I just moved to Eris on my main project yesterday - the libs are quite a bit more similar than you'd think

surreal peak
#

in .net it would be as simple as adding the static keyword to a class lol

uncut slate
#

Most of it is changing msg.guild to msg.channel.guild and msg.channel.send and msg.channel.createMessage

neon pasture
#

But I like that you have a cooldown funtion

uncut slate
#

Ah, that'd be the commando thingy

#

I don't use that

neon pasture
#

What else?

uncut slate
#

Just Eris

#

with my own command handler

neon pasture
#

isn't commando fine?

uncut slate
#

The CommandClient thing is 100% optional

#

you can use it if you want to, I don't like it

neon pasture
#

It's pretty simple

#

You can add subcommands

uncut slate
#

Simplicity isn't my concern, it's just a thing I'd way rather do myself than have taken care of

neon pasture
#

yeah

#

But thank you for helping me

earnest phoenix
#

How do u purge msg from a user

neon pasture
#

ban the user

earnest phoenix
#

Ye thts wsy but im mking a purge cmd

#

python ftw

#

how do I send a message to a certain channel in Discord.Bat?

lethal sun
#

How to set that a command is only usable with a user that has a cerrtain role?

earnest phoenix
#

Anybody got a bot were on a command it set a role

lethal sun
#

Discord.js

earnest phoenix
#

Set a role? What you mean

#

Like ~>bb (task: set role to user)

#

Add someone to a role?

#

;(cmd)

#

Added user to role

#

But in a cutom command

#

Thats easy on discord.js

#

Like ;updates on

#

Or ;updates off

lethal sun
#

yes it is ez on js

#

hmm

earnest phoenix
#

I dont want that im looking for a bot that does it

#

Idk what you mean

#

๐Ÿคฆ

#

Ur explaining it like your talking with mouth closed

#

I want a bot where you can set a custom command like update on/off and it sets/removes a role from them

#

There i dumbed it down for you

#

Ok?

#

Still dont get it do you

#

What tou mean by update? On/off?

#

You have the AI of a fish

#

-_-

#

Omg why did it come a "?" i meant what do u mean by update on/off

#

That has nothing to do with ut

#

My keyboard sucks

#

Well there r many bots which can set a role

earnest phoenix
#

You mean like a self role?

supple ocean
#

hey guys if anyone is able to be a bot dev in my server (needed only one command else u want to do more) then DM me, thanks

earnest phoenix
#

@neon pasture It is possible to use SQLite on all shards

#

It worked great for me

#

I don't know why you are having an issue

#

When I did have SQLite at one point, I don't know if I had multiple shards or not... ๐Ÿค”

#

What I meant was my bot was sharded, but I don't know if my bot had more than one shard.

#

Eww autoshard

lethal sun
#
message.channel.fetchMessages({limit: 100})```
#

How can I make it so the bot can fetch more messages than 100?

prime cliff
#

You cant

lethal sun
#

Knew it

#

lol

prime cliff
#

The hardlimit on Discord is 100

lethal sun
#

smh

#

kk

neon pasture
#

@earnest phoenix did you use discord.js?

earnest phoenix
#

yes

#

@lethal sun It is possible.

#

hold on

lethal sun
#

alright

earnest phoenix
#
const amount = 250;
let lastID = msg.id;
let messages = [];
var nums = [];
while (amount > 0) {
    nums.push(Math.min(amount, 100));
    amount = amount - 100;
}


function next() {
    msg.channel.fetchMessages({
        limit: nums[i],
        before: lastID
    }).then((msgs) => {
        msgs.map(v => messages.push(v));
        nums.splice(0, 1);
        lastID = msgs[msgs.length - 1].id;
        if (nums.length > 0) return setTimeout(next, 0);
        messages.map(m => {
            m.delete();
            if (messages.indexOf(m) === messages.length - 1) {
                msg.channel.send({
                    embed: {
                        title: "Pruned!",
                        color: 3066993,
                        description: "Pruned `" + messages.length + "` messages."
                    }
                })
            }
        });
    }).catch((error) => {
        // error
    });
}

next();```
#

@lethal sun

#

I haven't tested this, but it should work

#

the amount variable should be changed to the amount of messages the user wants to prune, so an argument

median lintel
#

wot

earnest phoenix
#

go away

tawny lava
#

lul

lethal sun
#

lil

#

kthx

earnest phoenix
#

Is it possible in discord.js that it writes data to a .json file? Im using this for custom commands that are addable

median lintel
#

in discord.js

#

no

#

you'd have to use a module like fs

earnest phoenix
#

K

restive silo
#

if you want to write often to that, you should use a db instead

neon pasture
#

And JSON has memory leaks.

uncut slate
#

not if you do it right

#

but still, do yourself and all of us a favor and don't use json files as a replacement for a db

earnest phoenix
#

^

#

rethink is better

#

it supports JSON too

restive silo
#

well RethinkDB stores JS objects

clear kernel
#

so just a quick question, so Is it like possible to set up pm2 so I push my files with git into it, and then I can restart and it loads the changes? If so how do i set it up/links?. (Please mention me)

restive silo
#

you can just make an command what execute git pull and then exit the process so PM2 restart it @clear kernel

clear kernel
#

From inside the bot or like on webhook or something

restive silo
#

from inside Thonk but you must execute the command yourself

clear kernel
#

ok so just exec git pull and then wait and restart? ok

restive silo
#

exec git pull wait until its done if no err => process.exit so PM2 will restart it

uncut slate
#

or you can use --watch, but that's less than ideal

restive silo
#

yea

clear kernel
#

yeah i use nodemon earlier, but I don't want to edit files and then auto restart and fuck up someone using the bot (even tho no one uses it )

earnest phoenix
#

nodemon is shit

clear kernel
#

how

earnest phoenix
#

it's really unstable

#

and just terribly coded

clear kernel
#

hmm worked fine for me

earnest phoenix
#

It works sometimes

uncut slate
#

never tried nodemon, never had to, pm2 is pretty gud

earnest phoenix
#

^

clear kernel
#

ugh my whole setup is weird. I'm dev locally, with a local version of my files on my computer. Then I SFTP upload to my vps, and I also with vs code can git push to bitbucket.
Now uh how would I set it up so (vps) reads from bitbucket remote repo (using git pull/fetch)

rare mist
#

@trim steppe My bot has changeable prefix [prefix X you can change it to something not starting in [ to fix the issue
#mod-logs
Case:982

uncut slate
#

no.

rare mist
#

and how i can solve that?

uncut slate
#

fix your scuffed code

trim steppe
#

Not error in Discord

#

Error in your own guilds channel

rare mist
whole mural
#

vps reads from bitbucket?
@clear kernel you mean so it would auto sftp?

trim steppe
#

No

clear kernel
#

Kinda yeah, like I want it so once I type a command ;update or something it will automatically pull the changes and restart

trim steppe
#

Don't error to the user

rare mist
#

Ok

trim steppe
#

Error to you

whole mural
#

@clear kernel ohhhhhhh

#

i do something VERY similair actually

#

I use a docker container i made to run my bots

gilded plankBOT
#
TheDevFreak#2798
Bots

@void phoenix
@unique bronze

whole mural
#

those 2.

#

when those containers start they git pull then they python bot.py

fickle solstice
#

i need help with a eval command djs v.12

whole mural
#

so i can just do docker restart spacebot and wait like 10secs done updated.

rare mist
#

There fixed @trim steppe

clear kernel
#

hmm I tried reading how to make it a remote or shit but didnt want to cause master already defined

trim steppe
#

What does it do now

rare mist
#

nothing

karmic lake
#

O.o

whole mural
#

@clear kernel you can change git's remote.

#
git remote set-url origin https://url```
clear kernel
#

I think i was just doing it wroing or soemthing

#

yeah

#

I think I'm doing something that I really don't need to do (clone into a non-empty dir)

#

I really only know how to very basic git -_-

whole mural
#

i guess you could

#
git init
git remote set-url origin https://url```
clear kernel
#

Oh set-url not add?

#

ah

whole mural
#

mhm

clear kernel
#

shit i need to prob disable the sftp upload

#

well fuck, I also did git in the wrong directory

#
jackz@vps137730:/var/node/untitled$ git remote set-url origin https://Jackz@bitbucket.org/Jackz/insertbotnamehere-code.git
fatal: No such remote 'origin'
#

(i just did git init above)

#

should I do git add instead? Ok.. Let me try doing this. I think i got it down?

#

Ok. So I did:

git init
git remote add origin <the link>``` and tried doing ```git log```
but it says your current branch 'master' doesnt have commits
So I assumed that, somehow master !== origin, and did:
```[branch "master"]
    remote = origin
    merge = refs/heads/master``` and same error
#

I'm just simplying trying to make the main branch be a remote branch to bitbucket, which i can git pull.

earnest phoenix
clear kernel
#

thanks for the help

earnest phoenix
#

no prob

placid flax
#

i still cant make server_count work

#

my api page doesnt even have a server_count thing

#

wait do you have to be certified before you can start using server_count ?

median lintel
#

no

placid flax
#

then why doesnt mine work..

earnest phoenix
#

idk

#

bc you did it wrong

placid flax
#

i didnt though?

earnest phoenix
#

post code

placid flax
#
async def post_stats():
    await bot.wait_until_ready()
    while True:
        num_servers = len(bot.guilds)
        headers = {"Authorization" : config.statToken,'Content-Type': 'application/json'}
        data = {"server_count" : int(num_servers)}
        url ="http://discordbots.org/api/bots/340354052715970563/stats"
        r = requests.post(url, data=json.dumps(data), headers=headers)
        print(r.status_code)
        asyncio.sleep(3600) #1 hour
earnest phoenix
#

hmm

#

what error is it returning?

placid flax
#

it doesnt return any errors , it tells me it worked

earnest phoenix
#

what is the status code it's returning

placid flax
#

when its run, it returns HTTP200/OK

#

as in

#

it worked

earnest phoenix
#

yea

#

:/

placid flax
#

but as you can see from my bots api page

#

it aint there

#

๐Ÿ˜

earnest phoenix
#

weird

placid flax
#

yea..

#

i know

#

ill comment it back in and see what happens

earnest phoenix
#

@bitter sundial might wanna help this guy

#

trouble with API

placid flax
#

it simply does not work

bitter sundial
#

cough /stats cough

placid flax
#

no idea what you mean bty that

#

which is new

#

so ill try that

#

after adapting it because the py3 version isnt using extcommands...

earnest phoenix
#

It isn't "new"

#

it's been there for a couple months

placid flax
#

also like the reaction images say these are blocking calls so i have to write around that and i dont know how

clear kernel
#
Yukine

exec git pull wait until its done if no err => process.exit so PM2 will restart it

#

@restive silo The problem is, what if there is any local file changes? I don't want to overwrite them. I don't think its efficient/correct to commit locally and merge, (kinda a noob at git)

I don't think git pull --hard is correct either?

placid flax
#

i appreciate the total lack of help tho guys thankz

restive silo
#

@clear kernel just do git pull and its fine there is no efficient bonus at all from merging local

clear kernel
#

ok but local changes would be fine? like a new file or a temp json db ?

#

(when i do git pull --hard, as I need to)

restive silo
#

why do hard Thonk just do a git pull eyesFlipped

clear kernel
#

I can't

restive silo
#

why

clear kernel
#
Updating 6e64227..e1102a8
error: Your local changes to the following files would be overwritten by merge:
        package.json
Please, commit your changes or stash them before you can merge.
Aborting
#

i did edit package.json on my vps as I couldn't do it from local (issues with installing packages)

#

oh wait, wouldnt the .gitignore on .json file not affect that?

earnest phoenix
#

Do you guys know in js whats the code to remove all roles from a user?

restive silo
#

@clear kernel oh well then do -hard i guess

clear kernel
#

Ok. I got the whole git thing setup, and now down to the code update system. Getting fatal: Could not read from remote repository. 3|InsertBo | Please make sure you have the correct access rights 3|InsertBo | and the repository exists. . It works fine from putty: git pull origin master

do I need the ssh key somewhere else for nodejs?

neon pasture
#

Can you use MySQL with sharded Eris?

restive silo
#

ofc you can why shouldn't you?

neon pasture
#

Umm

#

I use SQLite, and when you have multiple connections, your database will be locked.

#

So was thinking it's the same with MySql

restive silo
#

MySQL has a server and uses querries so that shouldn't be a problem

#

SQLite dont have a server

inner jewel
#

SQLite isn't made for concurrent access

#

it's made to be embedded

#

for small applications to store their data

clear kernel
#

Ok, I tried everything to get git pull origin master to work. Works fine from putty/ssh, but from node exec it just says the error i sent above. I have added the private key to ~/.ssh/id_rsa

#

Somehow my permissions aren't setup for node exec, thats all i know -_-

delicate zephyr
#

Just curious with d.js does the autosharders do it at a certain number of guilds?

clear kernel
#

does pm2 not auto git fetch???

sinful meadow
#

They can if they want @delicate zephyr

delicate zephyr
#

Yea, Im just wondering if it has a default @sinful meadow

sinful meadow
#

No

delicate zephyr
#

oh

#

So I need to set it or smthn?

sinful meadow
#

I mean

#

you can if you want

#

But if you want you can creat a AUTO shard script

#

or function

delicate zephyr
#

im already sharding

sinful meadow
#

Thats the easy way

#

of sharding

low niche
#

@earnest phoenix are there any good imaging libs for Java?

#

i'm sorry to disturb you if I did

inner jewel
#

Graphics2D

#

:^)

low niche
#

ok

#

thank you

#

you just prevented me from switching to Python @inner jewel

#

(that's a good thing)

earnest phoenix
#

:(

#

But I love python

#

java.awt is already good enough

inner jewel
#

as long as it's not for UIs

#

:^)

earnest phoenix
#

true

#

but for image stuff it is good

low niche
#

i am making a blob emoji avatar cmd

lime falcon
#

Question, what is the purpose of the Embed 'provider' field?

prime cliff
#

Certain embeds like youtube videos have that

cosmic plover
#

@neon pasture use MySQL with a proper pool

#

will do just fine.

delicate zephyr
#

Can someone help me out

#

How would one check if the youtube video is a live broadcast on youtube through the link
JavaScript

inner jewel
#

either use the yt api or do some scrapping

cosmic plover
#

@delicate zephyr cannot through the link, but if you use the api/whatever, it returns a weird lenght

#

like 9 quantillion ms or smth lol

#

or -1, don't remember exactly what the api gives

delicate zephyr
#

@cosmic plover I got it

#

Im using youtube-node module

#

got it working after like 2 hours

cosmic plover
#

pat

delicate zephyr
#

Im sad because I was trying my best to avoid fixing this bug

#

then 60 people complained at once

#

notlikethis

cinder pecan
#

would anyone be able to help me possibly with doing self assignable roles?

#

i have the storage part set up already i just can't get the role assigning to actually work

#

i'm using discord.js/klasa

earnest phoenix
low niche
#

I need some help with this exec command. when I try to exec anything, no output comes out

#

here's code:

const { exec } = require('child_process')
const settings = require('../../settings.json')
exports.run = async (client, msg, args) => {
   if (msg.author !== settings.ownerid) return;
    exec(args.join(" "), function(error, stdout, stderr){
            try {
             msg.channel.send(`\`\`xl\n${clean(stdout)}\n\`\`\``)   
            } catch (error) {
                msg.channel.send(`\`\`xl\n${clean(error)}\n\`\`\``)
            }
    });

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

Ive never done that

#

Soz man

low niche
#

nah, it's fine

tawny lava
#
exec(args.join(" "), function(error, stdout, stderr){
   let result = (stdout || stderr);
   message.channel.send(clean(result), { code: 'xl' });
}```
#

try that

low niche
#

thanks, lizard

tawny lava
#

np

sinful meadow
#

Can someone answer to me why the fuck this doesnt work ```js
let a = parseInt(args[1])
if(a === NaN) return message.channel.send('test')

#

@low niche ?????

languid dragon
#

isNaN(a)

sinful meadow
#

I totally forgot about that

#

Thansk

#

Thanks*

languid dragon
#

np xox

sinful meadow
#

Ive used that before

#

lmfao

#

But i totally forgot

low niche
#

@tawny lava still not working

tawny lava
#

what error do you get? Thonk

languid dragon
#

wyd

low niche
#

@tawny lava same as before

#

no output and no error

languid dragon
#

do u need const { exec } =

#

y isn't it just const exec

low niche
#

it would do the same

tawny lava
#

that's weird

#

works for me lol

low niche
#

my whole exports.run:

const { exec } = require('child_process')
const settings = require('../../settings.json')
exports.run = async (client, msg, args) => {
    if(msg.author !== settings.ownerid) return;
    exec(args.join(" "), function(error, stdout, stderr) {
        let result = (stdout || stderr);
        msg.channel.send(clean(result), { code: 'xl' });
    });

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

try it without the clean function

#

not sure if it will make a differnece tho

#

probably not

#

but taht looks correct

low niche
#

still doesn't work

tawny lava
#

not sure tbh

#

I use that and it works

low niche
#

i fixed

#

just need to remove the [object Object] msg on outpt and error

languid dragon
#

json.stringify?

low niche
#

it ain't json tho

languid dragon
#

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

bitter sundial
#

if it's an object you can make it into viewable json with JSON.stringify

low niche
languid dragon
#

print it to the console and then get what you need from the console?

restive silo
#

just use util.inspect

#

to view the content of the object

low niche
#

same output

restive silo
#

i dont think so i use that for my eval so it shows objects

#

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

#

you didn't used it properly

low niche
#

I fixed anyway

sinful meadow
#

Anyone use Jimp?

earnest phoenix
#

Use canvas

sinful meadow
#

Id rather not go throught fucking 100 damn steps

#

just to install

#

-_-

#

smh

languid dragon
#

canvas is for web-based javascript not server based?

clear kernel
restive silo
#

@languid dragon there is an canvas npm package to use in node.js eyesFlipped

shy flicker
#

-bots @austere valley

gilded plankBOT
#
Morphoxeris#1111
Bots

@ember flare

shy flicker
#

ugh ๐Ÿ˜“

neon pasture
#

How can I make a custom emoji for Eris?

#

For bot account, not for the guild.

pine moon
#

what

heady zinc
#

eh?

#

wdym custom emoji?

inner jewel
#

there's no "bot account emoji"

#

bots can use all emotes from guilds they're in

pine moon
#

that's what i was thinking

supple ocean
#

Hey guys, in python commands.ext rewrite this command does not work (no error msg tho)

elif ctx.message.channel.id == 364841014239821825:
           await ctx.message.delete()```
lethal sun
#

Anyone knows how to create a leveling system in discord.js? Dm me.

restive silo
#

sure i do but there a tons of web sources which tells you how to do

#

look at anidiotguides

#

he did some tutorials

lethal sun
#

Also looking for someone that knows how to do the draw on pircture thing in discord.js

restive silo
#

thats canvas

#

you must install that yourself not an d.js thing more like an node.js package

#

or Jimp works also

clear kernel
#

Jimp seems to have more features

lethal sun
#

Yeah, Jimp is better than canvas

restive silo
#

canvas is fine for me tho

sinful meadow
#

An idiots guide SQLite database @lethal sun

#

Best one out id say

#

I use sqlite

pale light
#

Yes

#

An Idiots Guide is god

abstract mango
#

does a bot token work for the rest of the site?

lethal sun
#

dbl toke or discord token?

fickle solstice
#

can i get a eval command d.js v.12 ?

sweet fox
#

same as one for v11 Thonk

umbral pelican
#

wtf

#

lol

elder badge
#

someone help me:

i did public static Guild g;
then System.out.println("Command: !!help was used in " + g.getName()); and it errors

#

java is that btw

lime falcon
#

Did you actually instantiate g?

elder badge
#

sorry I'm new to discord jda wym?

lime falcon
#

did you assign a guild object to g

elder badge
#

o

low niche
#

i think it was <MessageReceivedEvent>.getMessage().getGuild(); idk

lime falcon
#

simply doing public static Guild g; does not make an object there, you need to set it to a Guild object.

elder badge
#

can you give me that what I need to add?

lime falcon
#

I don't know, I don't use that library

elder badge
#

fuck

lime falcon
#

Circuit mentioned something about the event, probably that

elder badge
#

k

winged monolith
#

how can you do a server count in discord.js

umbral pelican
winged monolith
#

also, how can i add a welcome message when my bot joins a server

umbral pelican
#

use the guildCreate event I suppose

earnest phoenix
#

nice idea 7coil

clear kernel
#

3.5coil*

earnest phoenix
#

ah

#

ok

#

3.5cOiL

pine moon
#

TRADUZ-ME SEMPAI

earnest phoenix
#

traduz-mos

#

@restive silo ur here too Thonk

#

๐Ÿ‘€

#

I need nytro

#

nitro*

#

@trim steppe should i translate "footer_copyright" or nah?

trim steppe
#

If you can find a word that means copyright, you can replace that

earnest phoenix
#

Don't translate and replace legal declarations like copyright, have it in multiple languages if needed

#

Just advice from not a lawyer

trim steppe
#

ok moose lawyer

earnest phoenix
#

@trim steppe will i get credit$ for the translation, or not at all..? xD

trim steppe
#
Feel free to add your name inside the help menu, and ask for extra translated aliases for commands to better suit the language's audience.
earnest phoenix
#

๐Ÿ˜„

trim steppe
#

might look like this

earnest phoenix
#

"consent-needed" en-us

trim steppe
#

oh no it's on both

earnest phoenix
#

that fucked up typo

#

LOL

trim steppe
#

I'll put it though a spell checker

earnest phoenix
#

@trim steppe i've done pt-pt.json, now what?

#

is there anything more to translate?

trim steppe
#

I like how you named it json

#

im really sorry

earnest phoenix
trim steppe
#

im sorry you have to edit using the online github editor

#

wait

#

wrong person

#

did you do that tho

earnest phoenix
#

i don't think so

trim steppe
#

when making that, you can add your name at the top or bottom

earnest phoenix
#

ok

#

@trim steppe pt-pt.json and pt-pt.md made

#

anything more?

trim steppe
#

wow thanks

#

there shouldn't be anuthing more

#

send a pull request, and i'll mark it as hacktober if you want a tshirt

inner jewel
#

iirc it doesn't need to be marked as hacktoberfest

ionic sparrow
earnest phoenix
#

@earnest phoenix to get certified, should your bot have a currency of some sort and levels?

languid dragon
earnest phoenix
#

like would it help?

languid dragon
#

if its original and not buggy, it might ยฏ_(ใƒ„)_/ยฏ

earnest phoenix
#

lol nothings original

#

impossible

languid dragon
#

not really but ok

#

y tho

#

well develop your bot privately?

earnest phoenix
#

๐Ÿค” i guess

languid dragon
#

if i have any tips, make something thats new and people can love, something people want in their server for a long period of time, something people would enjoy and something thats somewhat original compared to the thousands already in here.

OR be better than the original

It's not impossible, it's just gonna take a lotta planning and thinking

earnest phoenix
#

๐Ÿค” like a discord game?? ๐Ÿ˜ฎ

languid dragon
#

Also if you dont want people copying you, develop the entire bot and test on a private server, dont expose it to public discord bot lists until you've got a stable and complete version you're happy with, yano?

earnest phoenix
#

Oh yeah! thats good idea ;3

#

ill probs use that

#

WAIT

#

@languid dragon is it original to do that?

languid dragon
#

to do what?

earnest phoenix
#

the bot thing private

languid dragon
#

creating a bot in a private discord server has nothing to do with originality lmfao

earnest phoenix
#

Cya ๐Ÿ˜„

shrewd field
#

Hello can someone help me in making process.exit run by pm2
I am trying to make a restart bot command

#

My purpose is making the bot stay online 24/7 even when my pc is powered off

stone kiln
#

only possible to run it 24/7 is in a VPS

#

not possible when pc is powered off

shrewd field
#

Ok

#

How can I setup a vps

stone kiln
#

buy one ๐Ÿ˜‚

shrewd field
#

I have heroku

#

Is it a good vps

stone kiln
#

Heroku is bleugh

shrewd field
#

Bluegh

#

??

#

U mean good

#

Or bad

inner jewel
#

heroku can't handle almost anything

shrewd field
#

Ok

#

Then what free alternative I have

stone kiln
#

nothing

#

free = bad

shrewd field
#

Or the cheapest good vps

#

Ok

#

Cheapest vps

stone kiln
#

search on the internet

weak parrot
#

^^

inner jewel
stone kiln
#

^

#

use that

#

@inner jewel you forgot to add after the lmgtfy the .com

inner jewel
#

blame mobile

shrewd field
#

Ok how do I set it up

#

When I buy

languid dragon
#

There should be tutorials on how to do it with the VPS provider

shrewd field
#

Ok

stone kiln
#

and if not just search google

#

on how to do that

#

or Youtube

shrewd field
#

Hey

#

On one vps how many bots can I host

stone kiln
#

1

shrewd field
#

Only

#

1

#

Ok

shy flicker
#

@stone kiln my bot is in free VPS

#

What do you say about it?

#

Isnt it good??

stone kiln
#

free is worse then payed

shy flicker
#

Ugh look at my bot fisrt

stone kiln
#

and free has a lot of draw backs

shy flicker
#

๐Ÿคฆ

#

First see my bot

surreal peak
#

-bots @shy flicker

gilded plankBOT
#
Froosty#2138
Bots

@gentle ether

surreal peak
#

not using help

#

isnt that the bot i added ?

#

oh nvm

shy flicker
#

what ??

earnest phoenix
#

@shrewd field OVH is so freaking cheap

#

$3 and good specs sorta

#

and they have amazing support

shrewd field
#

ok thanks that is what i have chosen

neon pasture
#

How do I start sharding on Eris?

earnest phoenix
#

Morning everyone

winged osprey
#

@neon pasture in your eris client options you can set maxShards to the number of shards

#

you can also set maxShards to auto to use the recommended discord amount

neon pasture
#

and that is 2.5k right?

winged osprey
#

discord recommends a shard every 1k guilds, but you don't have to shard at all until you hit 2.5k

neon pasture
#

and you guys would recommend 1.5k right?

winged osprey
#

eh its best to shard around 2100-2200, bc u start getting dead guilds around there

neon pasture
#

Everyone told me to start sharding with 1k guilds.

#

But where do I place maxShards?

#

Inside new eris?

winged osprey
#

yeah

#

2nd parameter

#

new Eris('token', { options here });

neon pasture
#

Is there a doc for?

winged osprey
#

thx clipboard

#

idk what that was

earnest phoenix
#

Isn't Eris notorious for bad documentation?

winged osprey
#

eh eris docs are alright

uncut slate
#

compared to D.js docs, eris docs are trash, but eris docs are fine to me

earnest phoenix
#

d.js docs are so nice

neon pasture
#

I have: maxShards: 2, but it only send the bot.on message once.

#

Doesn't it need to send it twice?

winged osprey
#

no

#

each shard only handles a fraction of your guilds

earnest phoenix
#

^

neon pasture
#

So I can count up all the guilds with client.guilds.size? right?

uncut slate
#

Yes, you can

#

in the case of Eris, just don't worry about sharding

#

at all

neon pasture
#

that's cool

#

is it .size or .memberCount?

uncut slate
#

there is nothing you need to do for sharding specifically other than set your config.shardCount to auto

#

client.guilds.size

neon pasture
#

shardCount?

#

I only did maxShards.

uncut slate
#

oh yeah, my bad

#

it's maxShards

neon pasture
#

That is so simple then

uncut slate
#

set maxShards to auto (or your own value) and that's all you need to worry about

neon pasture
#

way better then discord.js

uncut slate
#

yeah

#

the rest is taken care of internally

neon pasture
#

How do I see how many shards there are running?

#

with auto

uncut slate
#

client.shards.size

#

IIRC

neon pasture
#

that's cool

uncut slate
#

yeah

neon pasture
#

Thanks for helping me*

uncut slate
#

don't worry you'll probably have more questions

earnest phoenix
#

We're always glad to help!

#

Just call 811 before you code! kappa

neon pasture
#

You guys are way better then the discord.js server

#

811?

earnest phoenix
#

United States call before you dig

neon pasture
#

safe digging.

#

why lol

#

Why doesn't this return client.shards.size + client.guilds.size; work?

uncut slate
#

because both of those are integers

#

so you're adding them up

neon pasture
#

I'm so noob lol

#

Forgot about that.

uncut slate
#

I wouldn't say that's a good way to display them either

#

right next to each other like that

neon pasture
#

Was testing

#

var test = `${client.shards.size} ${client.guilds.size}`; return test;

#

This should work right?

shrewd field
#

hey i have an unban command but it only works on one person whom i put his id in and the reason doesnt appear.
how can i make it to unban an id that i put and send the user u have been unbanned from ${guild.name}. Thank you

neon pasture
#

discord.js?

shrewd field
#

yep

neon pasture
#

You know we can't spoon-feed right?

shrewd field
#

i know

neon pasture
#

okay good

shrewd field
#

look

#

wait

neon pasture
#

Wouldn't ask help to me if I was you ๐Ÿ˜‰

prime cliff
#

He has been spoonfed too much tbh why cant you figure out something so simple?

shrewd field
#

huh

#

i wasn't spoon fed

neon pasture
#

message.channel.send

shrewd field
#

send what

neon pasture
#

never mind

#

isn't it client.user.username?

shrewd field
#

ok

neon pasture
#

What is the error btw?

shrewd field
#

how can i make it do a person's id

neon pasture
inner jewel
#

arguments

lethal sun
#

yes

#

args

prime cliff
#

@shrewd field Let me guess you want to get the banned user by id?

shrewd field
#

umm

#

jefree

#

i have his id

#

i want to unban him when i do unban (id)

prime cliff
#

Yea but you want to get the username of a person by banned id

shrewd field
#

i already have it

#

in the ban command

#

it gives me the banned id

inner jewel
#

you do message.content === prefix + "unban"

shrewd field
#

ya

inner jewel
#

which makes it impossible to receive args

shrewd field
#

why u need args

inner jewel
#

to receive the id

#

.-.

shrewd field
#

i dont get it

inner jewel
#

split the message content

prime cliff
#

Oh

inner jewel
#

on spaces

prime cliff
#

Oh lol nice one @inner jewel

inner jewel
#

if the first part is === prefix + "unban"

#

the id is the second

#

check if the second actually exists tho

shrewd field
#

then

#

u mean

#

prefix + "unban" then message.content.fetchID

#

or something like that

inner jewel
#

what

#

ni

#

no*

#

learn about string splitting

#

google is your friend

prime cliff
#

You need to get the argument from the message.content @shrewd field

shrewd field
#

what argument

prime cliff
#

๐Ÿคฆ

shrewd field
#

can u give examples

prime cliff
#

No

#

No spoonfeeding

neon pasture
#

I'm so nub lol, I used .client. When I have this: var bot = new Eris.CommandClient.

prime cliff
#

@inner jewel i explained it to him in a simple way and he still dosent get it ;-;

shrewd field
#

which way

#

ok

#

so i need to do this

#

let args = message.content.split(" ").slice(1);

shrewd field
#

ok

#

then

restive silo
#

args are explained there

shrewd field
#

what do i do after reading

restive silo
#

you edit your code

shrewd field
#

and add

restive silo
#

the stuff from the tutorial

#

yes

shrewd field
#

add what the stuff from there

earnest phoenix
#

Hi deni

shrewd field
#

hi

earnest phoenix
#

I finally got custom playing messages to work on my PC ๐Ÿ˜„

inner jewel
#

don't keep asking for spoonfeeding, that will get you nowhere

shrewd field
#

ok

#

demi

#

how did u get the custom playing messages

inner jewel
#

sending a gateway presence update

shrewd field
#

when i do client.setgame("Playing in 2 servers") it wont work

neon pasture
#

Why isn't this working: maxShards: auto?

#

auto is not defined

inner jewel
#

maxShards: 'auto'

earnest phoenix
#

Settings > Games > Select app > Rename > Turn on overlay @shrewd field

shrewd field
#

ok then

tawny lava
#

wait why turn on overlay?

shrewd field
#

ya

earnest phoenix
#

Idk but i did and it work so

shrewd field
#

u mean for bots

#

or humans

earnest phoenix
#

humans

tawny lava
#

that's not for bots lul

shrewd field
#

ohh

#

ok

inner jewel
#

it's Presence#setGame(Game.of("Thrones")) for me

shrewd field
#

i was wondering what is for bots

inner jewel
#

:^)

shrewd field
#

ok

earnest phoenix
#

yeah that

inner jewel
#

no it won't work for you

tawny lava
#

that's not discord.js

inner jewel
#

^

tawny lava
#

so it won't work for you

shrewd field
#

what is discord.js

earnest phoenix
#

ik

shrewd field
#

this

tawny lava
#

read the docs

earnest phoenix
#

n.js

earnest phoenix
#

i user node.js (discord.js)

tawny lava
#

read it

shrewd field
#

client.user.setPresence({ game: { name: "Use--help to get started || Playing on 44 servers" } });

#

this

earnest phoenix
#

Deni

#

Deni

tawny lava
#

try it

#

instead of asking, try it

inner jewel
#

hardcoding guild count in the string

shrewd field
#

i did

earnest phoenix
#

you dont put the server count if you want it auto wait and ill look on my bot

#

i lost my usb...

#

fu*k

shrewd field
#

i got this

#

for

inner jewel
#

...

prime cliff
#

This guy is so dense >_<

inner jewel
#

maybe because setPresence returns nothing

#

please, go learn JS basics

#

you'll get nowhere without learning at least that

shrewd field
#

ok

#

i did learn that

uncut slate
#

setPresence returns a promise, which is recognized as an object by Discord.js

#

if your object doesn't have a content, embed or file key (which a promise doesn't) you have no message content

shrewd field
#

it has a content

#

what do u mean

uncut slate
#

It doesn't, at least your screenshot there doesn't

#

I mean what I just said. Read it.

shrewd field
#

how could i make it have

uncut slate
#

What do you want the content to be?

shrewd field
#

if it is like this

#

will it be correct

earnest phoenix
tawny lava
#

try it

#

thonk

shrewd field
#

ok

neon pasture
#

What is .setGame in Eris?

earnest phoenix
#

beeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeep

uncut slate
#

editStatus @neon pasture

neon pasture
#

Thank you

earnest phoenix
#

Do a reaction

inner jewel
#

D??help

earnest phoenix
#

no

tawny lava
#

D??help

earnest phoenix
#

no

tawny lava
#

gg bad bot

inner jewel
#

D??help

tawny lava
#

delete

earnest phoenix
#

no

#

Im not a bot

inner jewel
#

mmm bot speaks here

tawny lava
#

LIES

inner jewel
#

needs mute

earnest phoenix
#

...

tawny lava
#

yes

earnest phoenix
#

AGH

#

NUUUUUUUUU

inner jewel
#

autoresponds

tawny lava
#

yes

inner jewel
#

shitpost mute too

tawny lava
#

hello b1nzy?

#

I smell userbot

earnest phoenix
#

...

inner jewel
#

same

earnest phoenix
#

Wish i never did that

tawny lava
#

sad

inner jewel
#

sentient bot

shrewd field
#

hey

neon pasture
#

I think I'm doing something wrong bot.user.editStatus("online", "Testing");

shrewd field
#

which one i should pick in the vps

neon pasture
#

SSD 1

shrewd field
#

better

neon pasture
#

I only use 100MB

shrewd field
#

is it enough for a bot

tawny lava
#

I use 300mb but I have the 4gb ssd 2 for some reason

shrewd field
#

that is not like a professtional bot

tawny lava
#

@shrewd field more than enough

#

you get 2 gbs

shrewd field
#

ok

#

thanks

neon pasture
#

bot.user.editStatus("online", "Testing");

#

What's wrong?

shrewd field
#

the location

#

should it be the closest to my location

#

does anyone know

neon pasture
#

Your choice

shrewd field
#

doesnt matter

#

or it does

#

thisis what i have

#

which one do i chose

elder badge
#

send private message in jda?

inner jewel
elder badge
#

k thanks

earnest phoenix
#

What does my playing message say to you?

prime cliff
#

@earnest phoenix visual studio code v2

earnest phoenix
#

ok

lethal sun
#

How to make so when you start up the bot the console send a message with the server count? Discord.js

#

or even send a message in a guild with the server count

#

not dbl server count

stone kiln
#

client.guilds.size

#

gives you the guilds size

prime cliff
#

@lethal sun not sure but the client should have a ready event that fires

#

And what computerfreaker said

lethal sun
#

ok imma check that out

#

thanks

stone kiln
#

i have it in my bot

#

so i know that it works ๐Ÿ˜›

earnest phoenix
#

do you even d.js

faint jetty
#

@Deni#0274 choose the one your users will be nearest to...

#

what

#

@Deni#0274

#

tfw

umbral pelican
#

had off

#

@shrewd field

fleet epoch
#
   token: "token here",
   id: "id here"
})

dbclient.postStats("17", (err, res) => {
   if(err) {
       console.error(err)
   } else {
       console.log(res)
   }
})```
#

any ide why it shows a error

carmine berry
#

"17"

umbral pelican
#

because you're using some weird package GWlgbtqpFeelsthinkingman

carmine berry
#

pretty sure in the server count example it says it needs to be a number not a string

fleet epoch
#

const dbl = require(discord-bot-list)

#

oh so get rid of quotes?

carmine berry
#

yep

earnest phoenix
#

Why have a dependency just for posting ur stats

#

Its easier to just do it manually