#development

1 messages ยท Page 520 of 1

iron crag
#

dont do stuff to my bot please

topaz fjord
#

Reset your token then

tight heath
#

dw

#

I'm not doing anything

bright spear
tight heath
#

I was just checking if it's actually a working token

#

then use w/o s

#

smh

prisma sedge
#

Lmao

tight heath
#

who gives a shit

bright spear
#

if you make your token public ur honestly asking people to use it

prisma sedge
#

please Host my bot here is token

tight heath
keen drift
#

please host my bot too

topaz fjord
#

lmao

iron crag
#

ik

#

i changed my token

tight heath
#

okay

#

good

bright spear
#

pls host my bot the token is 264811613708746752264811613708746752264811613708746752264811613708746752264811613708746752

tight heath
#

:)

#

@bright spear is that hextodec

#

lmao

bright spear
#

no its luca's id 5 times

keen drift
#

lmao

tight heath
#

oh el mao

keen drift
#

u bl i nd

tight heath
#

my token is [redacted]

#

host my bot plox

#

actually it's hosted

#

sad

topaz fjord
#

my token is gay

bright spear
#

here you go heres my real token MjY0ODExNjEzNzA4NzQ2NzUy.C0grJQ.dGhpc2lzYWZha2VfdDBrM251bnViLi4u

#

(luca's github repo)

tight heath
prisma sedge
#

yes

tight heath
#

such resource usage much wow

prisma sedge
#

heard of the new challenge.

topaz fjord
#

No fuck off

prisma sedge
#

to participate everyone do eval client.token

#

3

#

2

#

1

tight heath
#

Error [TOKEN_INVALID]: An invalid token was provided.

#

@prisma sedge okay I win

prisma sedge
tight heath
#

hahayes

bright spear
#

is that

#

betterdiscord

tight heath
#

no

#

that's f.lux

bright spear
#

oh

#

it affects screenshots?

tight heath
#

apparently

prisma sedge
#

no u

tight heath
#

thing is

iron crag
#

how do i make it so people can't see my token?

tight heath
#

new file: .gitignore

/data/settings.json
keen drift
#

you give it to me

bright spear
quartz kindle
#

what

#

the fuck

bright spear
keen drift
#

Luca

#

lmao

tight heath
#

also

#

why choose humans anyways

#

just use a random function

#

or robot hamsters

prisma sedge
#

Hoomans

iron crag
#

how do i know if the .gitignore works

#

@tight heath

bright spear
#

the file wont show on github anymore

iron crag
#

o

bright spear
#

also

#

pls dont use discord bot maker

tight heath
#

best advice you can get

earnest phoenix
#

any vps good thats under 5$ a month

tight heath
#

palerino

earnest phoenix
#

@earnest phoenix yes

iron crag
#

;p

earnest phoenix
#

Vultr is good

quartz kindle
#

galaxygate is 3$

tight heath
#

^

earnest phoenix
#

vultr is ipv6 at 2.50$/m

quartz kindle
#

and there was that german one for 2.5 euros

earnest phoenix
#

im using galaxy gate atm

quartz kindle
#

i forgot the name

earnest phoenix
#

3$/m

#

hetzner

quartz kindle
#

yeah hetzner

earnest phoenix
#

Webdock is 4 euros a month

#

which is about 5 usd

bright spear
#

is skysilk still free

tight heath
#

-> 1&1 hosting

#

hahano

quartz kindle
#

hetzner has 2gb ram for 2.49 euro

earnest phoenix
#

Webdock is where you should go for CPU

#

is the vultr vps good for a bot with music?

#

They don't have much storage, but in return they give you a beast cpu

#

You can get a core i7 6700 for like $4.50 a month

#

its good for a bot with music then?

quartz kindle
#

wait what

earnest phoenix
#

Should be

tight heath
#

skysilk

quartz kindle
#

do you actually get full 4 cores / 8 threads for 4 euro?

earnest phoenix
#

ew

quartz kindle
#

jesus

earnest phoenix
#

Yes

tight heath
#

lmao

earnest phoenix
#

skysilk is so bad

#

But there's a catch, Tim

tight heath
#

el mao

quartz kindle
#

whats the catch

earnest phoenix
#

You get only 3 gigs of space

quartz kindle
#

duh

#

its written there

#

how's that a "catch"

earnest phoenix
#

3 gigs is really small...

#

Its not very good if you are storing lots of data

quartz kindle
#

sounds perfect for my needs

earnest phoenix
#

its enough for node.js and maybe a simple database

#

Tbh, its not enough for me

#

uh

quartz kindle
#

wait

earnest phoenix
#

the 3.50 vps for vultr is only 512 mb

quartz kindle
#

does that include the OS installation?

earnest phoenix
#

Yes

#

they install your distro

quartz kindle
#

how much space does ubuntu 18 use

earnest phoenix
#

maybe about 6-700 megs?

#

gez

quartz kindle
#

so then you have 2.3gb free?

earnest phoenix
#

is the price in usd?

quartz kindle
#

or they put it in a different volume?

earnest phoenix
#

cuz if it is

#

I cant say for sure tim

#

I dont have that plan

#

the 5$ one for me is 6.90

#

Im on their ssd 8 plan

#

@earnest phoenix How much storage do you need?

#

idk

#

Just starting?

#

my bot is on 480 servers

#

Do you have a large database?

#

i dont use database

#

Ah.

#

then to be honest, the webdock plan I mentioned is enough for you

last ferry
#

i pay like 15 a month for mine kek

earnest phoenix
#

this is how much bandwidth my bot uses

#

blue: download
purple: upload

quartz kindle
#

jesus

earnest phoenix
#

ikr

quartz kindle
#

are you torrenting with it?

earnest phoenix
#

idk

quartz kindle
#

that would actually be an interesting idea

#

torrent bot

earnest phoenix
#

11 terabytes?

keen drift
#

wtf is your bot doing

earnest phoenix
#

no

#

its unlimited

#

Unlimited bandwidth? Hmm...

#

thats what it says

#

Usually hosting companies don't do that

#

galaxy gate i think does

keen drift
#

it usually throttles after

#

but they all claim unlimited

last ferry
#

this is mine over two weeks lol

keen drift
tight heath
quartz kindle
#

252gb ram and 9gb swap

#

@_@

earnest phoenix
#

where?

quartz kindle
#

fishy's

earnest phoenix
#

lul

quartz kindle
#

@earnest phoenix did you see this?

#

4gb ram and 300gb hdd for 4 euros?

#

wat

#

10gb ram for 8 euro

earnest phoenix
#

Oversellllll

#

They're probably using openvz, which means they can oversell greatly

quartz kindle
#

what an ugly website

#

it does feel like a marketing scam lmao

earnest phoenix
#

Try it, sign up for a server

quartz kindle
#

i cant right now

#

but webdock does seem very nice. hit me up if anything better comes up

#

i still have webhosting paid for 2 more years, then i'll switch to a vps

earnest phoenix
#

Webdock is probably the best that you're going to get on a vps. only thing better would be a dedicated server

#

You pay yearly, Tim?

quartz kindle
#

prepaid for 3 years

earnest phoenix
#

Ouch.

#

Signing your deal hunting rights for 3 years

#

The most I'll ever do at a time is yearly

#

And thats if I really love my service

quartz kindle
#

well, when you dont have much funds, you try to bargain xd

earnest phoenix
#

What company are you with?

keen drift
#

@quartz kindle Hetzner?

#

tbh idc what virtualization it's, as long it's cheap for me

quartz kindle
#

im on interserver right now

keen drift
#

My app can deploy anywhere

#

@quartz kindle which plan Thonkang

quartz kindle
#

cheapest webhosting

keen drift
#

For your bot?

quartz kindle
#

no, my website

#

my bot is on google gce

keen drift
#

o

#

my website is on github pages

#

What was your cost on google gce again Thonkang

quartz kindle
#

but im thinking of getting a single vps for everything in the future

#

im on free tier

keen drift
#

for what size bot tho

quartz kindle
#

im building a unified api for both my website and my bot, so it makes no sense to have the website in a separate server, but i didnt think of doing that before so now im stuck with managing multiple projects until i get them working under the unified api lmao

keen drift
#

size of bot under gce?

quartz kindle
#

like 120-250mb ram, 300mb hdd, 400 guilds

keen drift
#

o understandable

quartz kindle
#

i still dont know what im gonna do regarding databases

#

the website is on mysql, and my api is on redis

keen drift
#

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

#

both of my website, dashboard and bot is on mongo

#

one single db

quartz kindle
#

is it fast enough for a rest api?

keen drift
#

yes

quartz kindle
#

hmm i might give it a try then

keen drift
#

if indexed correctly

earnest phoenix
#

Unified api.

quartz kindle
#

how about ram usage? i dont wanna waste too much ram with a db

earnest phoenix
#

That sounds interesting

quartz kindle
#

my database is small, mostly text, on redis is using like 9mb ram

keen drift
#

I'm using about 500mb with it

#

with 300-400k records

#

if anything redis would use more since it's memory db

#

how fast does it need to be Thonkang

slim heart
#

I can use xmlHttp to do oauth2 right? :o

quartz kindle
#

well, im probably overthinking about performance

#

i want it to be the same performance as google's apis

#

but i dont think it will matter what kind of db i use

earnest phoenix
#

You said you were using GCE?

quartz kindle
#

my bot is on gce yes

earnest phoenix
#

Wow. they are expensive

quartz kindle
#

im on free tier

#

so im not paying anything

earnest phoenix
#

Isnt that only for a year?

quartz kindle
#

the bonus credit is for a year, but the lowest tier vps is free forever

#

but bandwidth is not

#

im using about 1$/mo in bandwidth charges

#

taken from the free credit

keen drift
#

cost really gets out of hand when you have a large bot

sick cloud
#

i pay a bit for yt

quartz kindle
#

my bot will never get that large because it targets a relatively small/specific audience

sick cloud
#

also i pay for increased yt api resources

#

Google suck with that

quartz kindle
#

btw how's mongo with sharding?

#

is it good with multiple connections?

lofty hamlet
#

Hi !

#

You can help me ?

tight heath
#

yeah

#

mongo is bae tbh

#

@lofty hamlet sup?

earnest phoenix
#

Multiple connections are fine

#

imagine only being able to use 1 connection total. lol

sick cloud
#

i use rethink

tight heath
#

rethink is fine to an extent

sick cloud
#

its out of date ish

tight heath
#

but I noticed it's like a gigantic memory hog

sick cloud
#

but still good

#

yeah

keen drift
#

@quartz kindle yeah it's

#

good

sick cloud
#

but it's realtime @tight heath

lofty hamlet
#

This code send all my discord of my bot but i want send just the the top 5 of the big discord where is my bot

            fonction.channellogs(message)
            if (message.author.id === '403159739178942464') {
                var embed = new Discord.RichEmbed()
                    .setColor(embedcolor)
                    .setAuthor("Akimitsu", +bot.user.avatarURL + bot.guilds.size)
                    .setDescription(bot.guilds.map(r => `:arrow_forward: ***${r.name}***` + ` | **${r.memberCount}** membres`))
                    .setFooter("- by Nebulus")
                message.channel.send(embed);
            } else
                message.channel.send(':Croix: **Cette commande est interdite pour manque de confiance** :Croix:');
            break;```
#

Help me plz

keen drift
#

Mongo is CRUD

quartz kindle
#

my project right now includes 1 bot (maybe more than one if i port it to telegram/etc), 1 api and 1 website. all have to access the same database, which includes user information, api keys, and filenames pointing to storage

tight heath
#

@sick cloud mmm but like resources = money vs minor speed changes

#

๐Ÿค”

lofty hamlet
#

?

tight heath
#

I mean I still use both

lofty hamlet
#

Can you help me ?

earnest phoenix
#

CRUD is quite useful

tight heath
#

bot.guilds.sort(memberCount).map(...).first(5)

lofty hamlet
#

Hu ?

#

Wait

#

.setDescription(bot.guilds.map(r => `:arrow_forward: ***${r.name}***` + ` | **${r.memberCount}** membres`).sort(memberCount).first(5))

#

?

earnest phoenix
#

rave, your order is a bit off

tight heath
#

shhhhhhha

earnest phoenix
#

nebulus, don't copy things without understanding them

#

You want to sort the guilds first.

tight heath
#

yea

lofty hamlet
#

Yes

keen drift
#

yes

tight heath
#

I'm having brain lags at 11.40 already

lofty hamlet
#

This is ?

#

.setDescription(bot.guilds.map(r => `:arrow_forward: ***${r.name}***` + ` | **${r.memberCount}** membres`).sort(memberCount).first(5))

#

I go to try this

earnest phoenix
#

and...ya ignored what I said...

lofty hamlet
#

I have no ignored

#

I have understan

tight heath
#

first sort

lofty hamlet
#

d

tight heath
#

then map

earnest phoenix
#

^ which was said above

tight heath
#

^ exactly

lofty hamlet
#

But i'm french i don't understan everythink

tight heath
#

oof I have (had) French in school

#

I don't understand anything actually

#

๐Ÿ‘Œ

lofty hamlet
#

Donc tu me comprend ?

#

๐Ÿ˜‰

#

@earnest phoenix ?

#

memberCount is not defined

#

..

tight heath
#

.sort((a, b) => b.memberCount - a.memberCount)

lofty hamlet
#

.setDescription(bot.guilds.map(r => `:arrow_forward: ***${r.name}***` + ` | **${r.memberCount}** membres`).sort(memberCount).first(5))

tight heath
#

no

lofty hamlet
#

I have don't understand

tight heath
#
.setDescription(bot.guilds
    .sort((a, b) => b.memberCount - a.memberCount)
    .first(5)
    .map(r => `:arrow_forward: ***${r.name}*** | **${r.memberCount}** membres`)
    .join('\n'))
lofty hamlet
#

.... Wait

#

I don't understand

#

@tight heath

tight heath
#

yes

#

I fixed it

#

smh

earnest phoenix
#

Because .first() is not an array method..

tight heath
#

forgot map returns an Array

earnest phoenix
#

don't copy paste things randomly

tight heath
#

not a Collection

#

lmao

lofty hamlet
#
                        .sort((a, b) => b.memberCount - a.memberCount)
                        .map(r => `:arrow_forward: ***${r.name}*** | **${r.memberCount}** membres`)
                        .first(5))```
tight heath
#

it works now

#

tho

lofty hamlet
#

This code is false ?

tight heath
#

like I sent it

#
.setDescription(bot.guilds
    .sort((a, b) => b.memberCount - a.memberCount)
    .first(5)
    .map(r => `:arrow_forward: ***${r.name}*** | **${r.memberCount}** membres`)
    .join('\n'))
lofty hamlet
#

I don't understand this code ๐Ÿ˜ข

tight heath
#

first, sort by memberCount, highest -> lowest

#

take the first 5

#

map them to name | members

#

join them into a string, line-seperated

lofty hamlet
#

Ok ok i test this code ?

#
    .sort((a, b) => b.memberCount - a.memberCount)
    .first(5)
    .map(r => `:arrow_forward: ***${r.name}*** | **${r.memberCount}** membres`)
    .join('\n'))```
#

Mmmmhhh

sick cloud
#

as long as you have permission to show that data

quartz kindle
#

whats the best mongodb admin panel? something like phpmyadmin

tight heath
#

this is how it should look like

lofty hamlet
#

Thanks !

#

It's fonctinnaly

tight heath
#

yw

earnest phoenix
#

@quartz kindle Admin panel? for what?

keen drift
#

@quartz kindle I don't actually use any admin panel, I perform query on the cli

earnest phoenix
#

I just use the shell

#

Lol

lofty hamlet
#

I love you @tight heath โค

#

๐Ÿ˜‚

tight heath
#

thank

earnest phoenix
#

MongoDB admin panel = lazy way

lofty hamlet
#

I go to my bed ๐Ÿ˜ƒ

quartz kindle
#

for example to preview the structure and set up indexes

lofty hamlet
#

Goodbye have a nice night

keen drift
#

there's no structure

#

and indexing I just do in the code

earnest phoenix
#

MongoDB is schemaless

#

Its not like sql

quartz kindle
#

yeah but i mean

#

i insert data on it, and i want to like, preview it

#

like dump all

#

into a single object

keen drift
#

for local env

#

my production database doesn't bind to public ip, so I only do it via cli

quartz kindle
#

i'll probably do something via the api like im doing with redis

#

i had to make a custom dump function because redis doesnt have one

#

just to make sure the data im inputing is being inputted correctly

#

with the correct keys and such

glossy sand
#

hey there's lots of js people in here right

#

how do i remove all entries from a map whose values match a certain predicate?

#

right now i'm thinking something like

const toRemove = [...map.entries()].filter(e => predicate(e[1]));
for (const [k, v] of toRemove) map.delete(k);
#

but that seems ugly

hushed berry
#
new Map([...map0].filter(([k, v]) => !predicate(v))
``` maybe
#

i'm not too familiar with js btw

#

@glossy sand lmfao

glossy sand
#

ew

#

that feels even more disgusting

hushed berry
#

lmfao

#

it's ez in java

#

wait

#

grooy i eamn

#

๐Ÿ˜Ž

glossy sand
#

yeah in java u can just remove from the entry set

hushed berry
#
map = map.findAll { !predicate.test(it.value) }
#

HECK

#

why wont it recognize my groovy

#

๐Ÿ˜”

bright spear
#

lmao

#

add it to hljs

glossy sand
#
map.entrySet().removeIf(predicate);
hushed berry
#

no it works

#

i just

#

dunno why

bright spear
#
memes
#
map = map.findAll { !predicate.test(it.value) }```
#

oof

#
map = map.findAll { !predicate.test(it.value) }```
hushed berry
#
aaaaaa```
bright spear
#

is there an invisible char in urs

hushed berry
#

probably

bright spear
#

or smth

hushed berry
#
map = map.findAll { !predicate.test(it.value) }```
#

there

#

wow it didnt even do anyhting

#

lmfao

bright spear
#

lol

glossy sand
#

nobody's ever gonna see my question again

hushed berry
#

๐Ÿ˜‚

#

sorry dorry

glossy sand
#

i'll just stick with my ugly soln

hushed berry
#

you can post it again

bright spear
glossy sand
#

i don't think there's a better way

hushed berry
#

also

#

I think you can just do a for loop

#

and just remove in it

glossy sand
#

uhhh concurrent modification?

#

sounds sketchy

keen drift
#

You can take a look at the djs Collection.sweep

#
  sweep(fn, thisArg) {
    if (thisArg) fn = fn.bind(thisArg);
    const previousSize = this.size;
    for (const [key, val] of this) {
      if (fn(val, key, this)) this.delete(key);
    }
    return previousSize - this.size;
  }
glossy sand
#

oh

hushed berry
#
for(let e of map) {
    if(!predicate(e[1]) {
               map.remove(e[0])
         }
}
#

maybe

glossy sand
#

i guess js doesn't care about concurrent modification

hushed berry
#

its because its an iteraotr

#

i think

#

i dont write js ๐Ÿ˜‚

#

but im trying

keen drift
#

extends Map

glossy sand
#

yeah ok

#

i was just wary of doing something like that because it would throw a runtime exception in java

cyan timber
#

Iโ€™m having trouble setting up my bot I have no experience and keep getting errors with install npm

west raptor
#

what are you trying to run

cyan timber
#

Me?

#

Just trying to make a bot for my server so it can moderate

west raptor
#

no like

#

what are you running in the terminal

cyan timber
#

I donโ€™t know I have no idea what Iโ€™m doing just following this guide on the internet

west raptor
#

๐Ÿ™ƒ

#

ok

#

can you uh link me

cyan timber
#

I donโ€™t understand

#

Lmao

#

I sent a picture of the error

tawdry mountain
#

How do i get my Bot to go online?

#

Ive had trouble doing it

keen drift
#

which framework

tawdry mountain
#

Ive tried using The Node.js thing

keen drift
tawdry mountain
#

Idk Oof

keen drift
#

lmao

tawdry mountain
#

.

keen drift
#

tfw you copy and pasting something you don't know

west raptor
#

yes

earnest phoenix
#

@tawdry mountain

#

Dm and I can help

#

Anyone need free bot hosting I have Microsoft azure free

keen drift
#

@earnest phoenix what spec on azure tho

earnest phoenix
#

THE SPECS

#

7gb ram
iten xeon
1 gigabyte connection both ways
120gb ssd

#

@keen drift

keen drift
#

free Thonkang

#

for how long @earnest phoenix

earnest phoenix
#

1-2 months probaly more

#

24/7

#

i host daddy bot and daddy music

#

my bots on them

#

you want to se

keen drift
#

o I was hoping for longer

earnest phoenix
#

e

#

no like its longer

keen drift
#

how did you get it for free Thonkang

earnest phoenix
#

school pays for it

#

XD

#

dm

#

me

keen drift
#

man lucky

earnest phoenix
#

let me show you the bots ping

#

14ms

#

me and this other guy host our bots on the vm

#

its a vm

keen drift
#

@earnest phoenix what is it called that your school is paying for

#

Azure Imagine or something

earnest phoenix
#

yes

bright spear
earnest phoenix
#

no i have the regular

#

not student

bright spear
#

u literally said your school pays for it

keen drift
#

I wish I had free 8gb vm, do you know how much bs I can run on it

#

a l 0 t

earnest phoenix
#

i know i did

#

they pay for the it

#

for it

#

but not the student version

keen drift
#

so they pay like $100 per student?

#

lmao

#

a month

bright spear
#

im pretty sure Microsoft Imagine is only a student version

earnest phoenix
#

Microsoft azure

#

here

#

one sec

keen drift
#

tell ur school to make me an account

earnest phoenix
#

i can make you a vm

#

seprate

#

for you only

#

where

#

you can rdt

#

rdp

keen drift
#

how long does it last Thonkang

earnest phoenix
#

wdym

#

the rdt

#

runs 24/7

#

you just have to install node js or whatever u use

#

i get 12-16ms ping on my bots

#

i did a speed test

#

got 1000+mbps upload download

keen drift
#

like how many months, 1-2 months right?

earnest phoenix
#

prob longer

#

if not you can always backup and i can ask my school for another

#

16ms

#

15

#

XD

#

here dm me

keen drift
#

hm why not, dm me one, it got ssh access rite?

#

oh it's windows

#

lmao

#

it got linux?

earnest phoenix
#

i can make a vm with linux operating system

#

what you need

#

kali backtrack

keen drift
#

ubuntu

earnest phoenix
#

plus its my birthday so this is how i can talk here

#

XD

keen drift
#

hm?

#

white names can't talk in development?

earnest phoenix
#

i can't verify my phone

keen drift
#

oh

#

rip

earnest phoenix
#

says invalid

#

XD

#

but its my birthday so wwoooo

keen drift
#

#rip

earnest phoenix
#

so dm me

#

you want ubuntu server

empty owl
#

Someone pls help Discord Bot Offline No error message Uptime says its online but discord says otherwise

#

I hosted a bot on glitch.com(I know its not supposed to be a vps). I put injs const server = require('./server.js'); above everything else in index.js and put const https = require('https'); const express = require('express'); const app = express(); app.get("/", (request, response) => { console.log(Date.now() + " Ping Received"); response.sendStatus(200); }); setInterval(() => { https.get(`https://enshrined-broccoli.glitch.me/`); }, 6000) const listener = app.listen(process.env.PORT, function() { console.log('Your app is listening on port ' + listener.address().port); }); in server.js

It was supposed to ping the bot but discord says that the bot is offline and uptime and glitch says it is up and live. Can someone please help me?

Also, I have another bot that has this as its pinger

const express = require('express');
const app = express();
app.get("/", (request, response) => {
  console.log(Date.now() + " Ping Received");
  response.sendStatus(200);
});
app.listen(process.env.PORT);
setInterval(() => {
  https.get(`https://nervous-gerbil.glitch.me`);
}, 6000);```
#

(PING ME WHEN U ARE RESPONDING TO ME)

keen drift
#

wtf am I reading

empty owl
#

discord.js

#

also idc if I get 20+ pings

sick cloud
#

that's a simple error with a simple fix. stop using glitch.

keen drift
#

man at least make the first one readable

earnest phoenix
#

should i change to this vps

#

i have the 3$ one atm

keen drift
#

@earnest phoenix it's not bad, def one of the cheaper options

#

I'm currently on Hetzner

earnest phoenix
#

will it make a difference for the music

keen drift
#

music I'll stick with US providers I suppose

earnest phoenix
#

meaning minimal lag

keen drift
#

my bot doesn't do audio

#

altho latency shouldn't impact it much

earnest phoenix
#

i have the 3$ atm if i choose the 5$ one will it make it less lag(3$ one has a bit of lag)

keen drift
#

depends what resource deprivation

earnest phoenix
#

this is the 3$ one

keen drift
#

But what resource are you depriving on the $3

earnest phoenix
#

wdym?

keen drift
#

Which resource is lacking

#

Insufficient computing power, not enough ram

earnest phoenix
#

ram is enough im guessing

keen drift
#

guessing

earnest phoenix
#

eww

#

...

#

@earnest phoenix

#

come on mine

#

?

#

i have 3 guys on my vps

#

XD

#

tf

#

ASK @earnest phoenix

#

ummm

#

@earnest phoenix

keen drift
#

@earnest phoenix gimme vm

earnest phoenix
#

AND FISHY

#

IN A SEC

#

why you pinging me

keen drift
#

yeah I'm in the process jerrycheese

earnest phoenix
#

because

#

do i trust?

#

this guy has 3$

#

XD

#

one

#

eww

keen drift
#

i just want a vm for running some data aggregators

earnest phoenix
#

whats your specs for your vps?

#

recomment my service

#

xd

#

free

#

i got 4GB RAM

keen drift
#

my bot needs higher spec than 8gb tho PepeRain

earnest phoenix
#

kk

#

whats the specs?

#

and speed test

#

1gbps

#

XD

#

ummm

#

you want windows or ubuntu

#

nut

keen drift
#

n u t ty

earnest phoenix
#

yo @keen drift do you trust him?

keen drift
#

idk

earnest phoenix
#

ask iam

keen drift
#

but I'm not running anything sensitive on it

#

i already have a host for my bot

#

I just need some data vms

earnest phoenix
#

i use ubuntu

#

this ok

#

and 120gb ssd

#

wait a min

keen drift
#

@earnest phoenix oh yeah, does azure support key auth

#

I'll give you my public key if it does

earnest phoenix
#

wdym

#

oh ssh

keen drift
#

yeah

earnest phoenix
#

yeah ask i am32but

#

he's on it rn

#

his own

#

i made

keen drift
#

does it not offer it on the creation page

earnest phoenix
#

how are you making the vps @earnest phoenix ?

keen drift
#

his school is paying for his azure account

#

kek

earnest phoenix
#

ooo

#

XD

#

those are good specs

#

Btw my school limits me to 400$

#

aa month

#

damn

keen drift
#

that's still a lot

earnest phoenix
#

and also you get 1 gigbit

#

your school is rich

#

upload and download speed

#

i would like a better vps tho

#

this is

#

what are you running your bot on rn

#

or are you even

#

would you like anything in return?

#

no

#

fuk that

#

i dont want shit

#

XD

#

its my birthday

#

o

#

happy bday

#

my bot gets 12-16ms ping

#

XD

#

damnnn

#

also wdym what is my bot running on

#

on the vm

#

os?

#

windows 10

#

on the vps

#

node js and python for my music bot

#

i use ubuntu

#

@keen drift ports and key?

#

in dms

keen drift
#

ports?

earnest phoenix
#

open ports

keen drift
#

o none

earnest phoenix
#

like 80 443

#

22

#

i use FileZilla and putty

keen drift
#

ye 22

earnest phoenix
#

XD

#

ssh http https

#

give me the key

#

in dms

#

so i can set it

#

yo @earnest phoenix do you recommend windows os?

#

for the vps

#

are you running your bot on node js

#

or python

#

node js

#

windows

empty owl
#

Use glitch

earnest phoenix
#

eww

#

no

empty owl
#

Or repl

earnest phoenix
#

they on microsoft azure

#

with me

#

i use ubuntu

#

atm

empty owl
#

Or just self host it

earnest phoenix
#

we are

#

but windows is good as well

#

any is fine

#

self hosting it on microsft azure

#

vm

#

but i will make windows 10 for you @earnest phoenix

#

o ok, thank you

#

but you have to install all your programs

#

yea ik

#

like node js

#

and shit

#

yep

#

by the way

#

yea?

#

@keen drift @earnest phoenix @earnest phoenix Backup all your new shit every day and make a group chat and add me and all you guys so if something goes wrong with the vps i will tell you

#

make a group chat on discord, right?

keen drift
#

forgot that's a thing

#

lmao

earnest phoenix
#

XD

#

yes

#

@keen drift can you make the group chat

keen drift
#

o, I suppose

earnest phoenix
#

or do you want me?

keen drift
#

yeah it needs friends for group dm, kek

#

good stuff

earnest phoenix
#

fish this ok

keen drift
#

yeah

earnest phoenix
#

kk

#

by the way

#

guys dont be doing huge transfers

#

because it bases the price of the how much i use

#

to that

#

but dw

#

ok ๐Ÿ™‚

#

@earnest phoenix accept my friend request

#

@keen drift

keen drift
#

dem key is on it rite Thonkang

earnest phoenix
#

yes

#

wait @earnest phoenix you from canada?

#

yes

#

same

#

fuck

#

?

#

NOOOOOOOOOOOOOOOOOOOO

#

IT WONT LET ME RUN MORE THEN VCPUS EACH PERSON GAT

#

GAYYY

slim heart
#

How could I restart a certain module of my js program? Like I have a js file for each of my events how could I run a command that'd restart only one of them instead of crashing everything?

trim saddle
#

is it a discord event?

slim heart
#

yea

trim saddle
#

you got a reload cmd?

slim heart
#

I can reload specific commands yeah, but not a whole event

#

?

trim saddle
#

idk js

lament meteor
#

@slim heart clear the file cache

crisp lodge
#

Is there even a dispose function in javascript? Thonk

sinful lotus
#

is there a way to simplify the addition of this thing

async (client) => {
    const results = await client.shard.broadcastEval('this.getQueues()');
    let connections = 0;
    let queues = 0;
    let moes = 0;
    let quotes = 0; 
    for (const data of results) {
        conections = connections + data.connections;
        queues = queues + data.music;
        moes = moes + data.moe;
        quotes = quotes + data.quote;
    };
    return {
        connections: connections,
        music: queues,
        moe: moes,
        quote: quotes,
    };
};
earnest phoenix
knotty steeple
#

@slim heart delete file cache

restive silo
#

@sinful lotus yes

#

use reduce

#

like ```js
const results = await client.shard.broadcastEval('this.getQueues()');
const connections = result.reduce((prev, val) => prev + val.connections, 0)

#

should be less of a pain

sinful lotus
#

@restive silo owo thankies doggowave

amber junco
#

How do you make a user upvote a bot before using the command?

knotty steeple
#

check if they upvoted

amber junco
#

Yes

knotty steeple
#

if not tell them to vote

#

if yes run the command

amber junco
#

Yes , how do you do that?

#

I mean my bot needs to do it

knotty steeple
#

read the docsโ„ข

amber junco
#

k...

#

docs of my library?

knotty steeple
#

tools

amber junco
#
const Discord = require("discord.js");

module.exports.run = async (client) => {
  await client.user.setActivity(`${client.guilds.size} servers! OwO | !help`, { type: "WATCHING" });
/*await client.user.setActivity(`Maintenance Please Wait`, { type: "PLAYING" });*/
  await client.user.setStatus("online");

  console.log(`eyyy I am online.  I am connected to ${client.guilds.size} Servers, ${client.channels.size} Channels and ${client.users.size} Users. thanks for the summon!`);
};

const client = new Discord.Client();
const DBL = require("dblapi.js");
const dbl = new DBL(MY TOKEN IS HERE.. LMAO', client);

// Optional events
dbl.on('posted', () => {
  console.log('Server count posted!');
})

dbl.on('error', e => {
 console.log(`Oops! ${e}`);
})
#

Thats my ready event

#

and it wont post the server count

ruby dust
#

sometimes in python the infinite loop stops looping after a while, most often after a day or 2, I might know the reason why this is happening, but does anyone know how I can circumvent that from ever happening in the future?

amber junco
#

nice pfp

quartz kindle
#

you already have client, why are you defining it again?

amber junco
#

@quartz kindle I tried removing const client = new Discord.Client(); then console said client is not defined

#

like wtf

bitter sundial
#

the code is outside the run function

amber junco
#

oh

quartz kindle
#

and client should be defined at the top

bitter sundial
#

thats the ready event in some command handler thingy

#

so client is defined in the arguments of the run function

#

and I dont think the autoposter will work if you add it after the ready event

#

can you add it on bot launch?

amber junco
#

So I create a new file called bot launch?

quartz kindle
#

why wouldnt it work after the ready event?

bitter sundial
#

@quartz kindle because the module waits for the ready event

amber junco
#

So i put all the code above the ready?

quartz kindle
#

cant it detect if the client is already ready?

bitter sundial
#

I think I forgot and I wasnt sure how to check that

quartz kindle
#

oh

bitter sundial
#

@amber junco put it in the file you run when you start your bot

amber junco
#

ready

#

is thats where i put it

bitter sundial
#

what's the command you start your bot with

hushed berry
#

run bot

amber junco
#

node index

#

in command prompt

bitter sundial
#

open index.js

#

does it have a client = new Discord.Client()

uncut delta
#

Did you already have client?

amber junco
#

const client = new Discord.Client({disableEveryone: true});
It has this

uncut delta
#

Yeah that's client defined

bitter sundial
#

yeah

#

so you can place the dbl code under that

uncut delta
#

That must work if that's your ready event

#

module.exports.run = async (client) => {
  await client.user.setActivity(`${client.guilds.size} servers! OwO | !help`, { type: "WATCHING" });
/*await client.user.setActivity(`Maintenance Please Wait`, { type: "PLAYING" });*/
  await client.user.setStatus("online");

  console.log(`eyyy I am online.  I am connected to ${client.guilds.size} Servers, ${client.channels.size} Channels and ${client.users.size} Users. thanks for the summon!`);



const DBL = require("dblapi.js");
const dbl = new DBL(MY TOKEN IS HERE.. LMAO', client);

// Optional events
dbl.on('posted', () => {
  console.log('Server count posted!');
})

dbl.on('error', e => {
 console.log(`Oops! ${e}`);
})
}```
#

Try this maybe?

#

Wait

#

Put it in index js

#

Define a new ready event specially for dbl

#

@amber junco

amber junco
#

k

#

So I can put it anywhere

#

or in a certain place? @uncut delta

uncut delta
#

Try only in ready event

amber junco
#

sorry for ping

#

ok

#

wait wdym ready event you told me to put it in index

uncut delta
#

Put it after you defined client maybe

bitter sundial
#

which is what I just told him to do before you stepped in lol

amber junco
#

Lol

#

Yes

#

And I got confused

#

IT WORKS

#

Yay

#

Thanks guys

earnest phoenix
#

is there a video or anything about using the api webhook setting to show how many servers the bot is in on the website

ruby dust
#

api and webhook don't go well together Thonk

#

it's either one or the other

earnest phoenix
#

been trying for some days and cant seem to get it working

ruby dust
#

what lang you use?

earnest phoenix
#

.py

ruby dust
#

I suggest using either aiohttp or request libraries for API related stuff in python

#

I'm using aiohttp

earnest phoenix
#

done that seems to not work

#

but il try again see if i missed something

ruby dust
#

basic way in my case:

#
async with aiohttp.ClientSession() as session:
    await session.post(url, data = payload, headers = headers)
earnest phoenix
#

class DiscordBotsOrgAPI:
    """Handles interactions with the discordbots.org API"""

    def __init__(self, bot):
        self.bot = bot
        self.token = 'dbl_token'  #  set this to your DBL token
        self.dblpy = dbl.Client(self.bot, self.token)
        self.bot.loop.create_task(self.update_stats())

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

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

ruby dust
#

oh you are using the actual dbl lib

earnest phoenix
#

done that but is the dbl the Authorization: token right

ruby dust
#

yes

#

but the token must be your bot's token on dbl, not the actual discord bot login token

#

it's hard for me cause I don't use the lib

#

I used to manually post server count

earnest phoenix
#

gotta use that token what i covered

ruby dust
#

hmm

#

idk where you got that page from

#

it's actually in here

#

unless there's another page like that that I don't know about

earnest phoenix
#

welp i was there im dumb lol

#

been useing the wrong stuff all this time lol

#

ill give it ago this time see what gappens

#

welp

Traceback (most recent call last):
File "/usr/bin/pip", line 9, in <module>
from pip import main
ImportError: cannot import name main

#

think i killed pip

bitter sundial
#

there's two places to get a token from

#

api docs and the edit page

earnest phoenix
#

well it dont let me use pip i had to use pip3 weird

slim heart
#
if(command == "reload") {
        console.log("o")
        let arg1 = args[0]
        if(arg1 == "config") {
            console.log("oo")
            client.config = require('../../config.js')
        }
    }``` Why isn't this working? Ignore the o's i was just making sure the command worked. For some reason it just doesn't seem to make a difference in client.config
young sonnet
#

@slim heart
client.config = require('../../config.js') > client.config = require('..../config.js')

#

Try that

slim heart
#

well now "Cannot find module '..../config.js'"

young sonnet
#

hm

#

can you show me your directories tree

#
  • with files
slim heart
#

Y: is bot directory:
Config.js: Y:/config.js
Index.js Y:/index.js > runs event message Y:/events/message.js > runs admincmds Y:/modules/commands/admincmds.js which has that code

young sonnet
#

wait

#

IntelliJ takes ages to start...

earnest phoenix
#

humm

slim heart
#

#topgg-api ? i think u should go there i may be wrong

earnest phoenix
#

this is for code problems right lol

slim heart
#

Yeah but you're having problems with dblapi?

earnest phoenix
#

il post in there then

young sonnet
#

Oh

#

@slim heart try .../config.js

slim heart
#

still cannot find module

young sonnet
#

hmm

slim heart
young sonnet
#

I don't know what you're doing but ../../config.js works fine here

slim heart
#

yea

#

it doesn't overwrite it tho

#

idk sksk

#

oh u know what

#

I'm dumb

#

I need to clear the require cache first

young sonnet
#

I'm developing a webpanel for my discord bot. I want to filter guilds where my bot is in and where the user has Manage Server permission. How can I do this?(Note: Panel is hosted separately)

prime cliff
#

Thats too easy just filter what servers the user is in and if they have perms

young sonnet
#

How?

prime cliff
#

๐Ÿ™ƒ which lang is your bot

young sonnet
#

js

prime cliff
#

Do you have any web experience and a database?

young sonnet
#

I do have web experience, but not much. And I don't use any database, but I'm going to use it.

warped ruin
#

perms & 32 != 0

#

idk which perm it was

young sonnet
#

ok

lofty hamlet
#

Hi !

#

I want to make a welcome message with canvas with avatar member and pseudo member but my code does't work

#

You can help me ?

#
    const channel = member.guild.channels.find(ch => ch.name === 'welcome');
    if (!channel) return;

    const canvas = Canvas.createCanvas(700, 250);
    const ctx = canvas.getContext('2d');

    const background = await Canvas.loadImage('./wallpaper.png');
    ctx.drawImage(background, 0, 0, canvas.width, canvas.height);

    ctx.strokeStyle = '#74037b';
    ctx.strokeRect(0, 0, canvas.width, canvas.height);

    // Select the font size and type from one of the natively available fonts
    ctx.font = '60px sans-serif';
    // Select the style that will be used to fill the text in
    ctx.fillStyle = '#ffffff';
    // Actually fill the text with a solid color
    ctx.fillText(member.displayName, canvas.width / 2.5, canvas.height / 1.8);

    ctx.beginPath();
    ctx.arc(125, 125, 100, 0, Math.PI * 2, true);
    ctx.closePath();
    ctx.clip();

    const { body: buffer } = await snekfetch.get(member.user.displayAvatarURL);
    const avatar = await Canvas.loadImage(buffer);
    ctx.drawImage(avatar, 25, 25, 200, 200);

    const attachment = new Discord.Attachment(canvas.toBuffer(), 'wallpaper.png');

    channel.send(`Welcome to the server, ${member}!`, attachment);
});```
#

My code ๐Ÿ‘

lofty hamlet
#

wath ?

#

My error is snekfetch is not defined but is defined and the second error is a blank and i don't know

#

If not you don't have code for a welcome message equal to koyabot ? @brittle nova or other people because i wander

tight heath
#

First of all

#

Hecking define snekfetch then

#

const snekfetch = require('snekfetch')

#

first npm i snekfetch

#

Second

#

Instead of copying example code from djs.guide

earnest phoenix
#

Who knows how to detect when my bot doesnโ€™t have the required perms for something

tight heath
#

Why not try creating your own with canvas-constructor

#

@earnest phoenix language?

earnest phoenix
#

Python

tight heath
#

:c

earnest phoenix
#

Do you know?

west raptor
#

rave uses js iirc

tight heath
#

Ya

#

JS and learning Go

earnest phoenix
#

Who uses python

west raptor
#

same

earnest phoenix
#

๐Ÿ

west raptor
#

im learning go also

tight heath
#

Good boy

earnest phoenix
#

How do ppl become certified dev

tight heath
#

Apply for certification

earnest phoenix
#

Where

tight heath
#

@earnest phoenix Channel.permissions_for()

west raptor
tight heath
#

Or Member.server_permissions

#

:)

hushed berry
#

ravey!!

#

welcome to hell

#

๐Ÿ˜Ž

tight heath
#

Groovy!!

#

I live here

hushed berry
#

๐Ÿ˜Ž

tight heath
#

In hell, I mean

#

I've been using JS for 9 months

#

I know how hell feels

#

๐Ÿ˜‹

keen drift
#

9 months

#

that's a rookie number

earnest phoenix
#

can anyone help me with making a bot

keen drift
#

so what did you try so far attempting to make a bot

earnest phoenix
#

i made the bot on the developer page

#

on discord

keen drift
#

what a start SWEATSTINY

#

what language you going with

earnest phoenix
#

now i joined the server to put it on the bots list

keen drift
earnest phoenix
#

uh

#

english?

keen drift
#

@hushed berry help

hushed berry
#

@earnest phoenix sorry mate, its not that simple

queen sentinel
#

English

#

English

hushed berry
#

What you've done there is create the bot account.

#

Which is quite short of the actual bot

#

To make anything more, you'll have to learn at least basic programming skills in a well known language

earnest phoenix
bright spear
#

no no