#development

1 messages ยท Page 926 of 1

halcyon ember
quartz kindle
#

@hardy vector in discord.js v12 avatarURL is a function

halcyon ember
#

but say i have an embed

#

and I have two urls

#

that both show prettymuch the same json

hardy vector
#

oh

halcyon ember
#

excpet with a few different values

#

how am I supposed to put it inside of the same embed?

#

const { algos } = await fetch('http://ric.pikapools.com/api/stats').then(response => response.json()); is what it does right now, but both of my jsons have the algos value

hardy vector
#

(node:5966) UnhandledPromiseRejectionWarning: TypeError: message.member.avatarURL is not a function
at Object.execute (/Users/sadashivappakenchannavar/Desktop/Frosty/commands/avatar.js:9:34)
at Client.<anonymous> (/Users/sadashivappakenchannavar/Desktop/Frosty/bot.js:57:31)

#

๐Ÿ˜ฆ

quartz kindle
#

dont destructure it

#
a = await fetch('http://ric.pikapools.com/api/stats1').then(response => response.json());
b = await fetch('http://ric.pikapools.com/api/stats2').then(response => response.json());
#

a.algos
b.algos

halcyon ember
#

wait what

#

you can do that?

#

im so retarded lol

quartz kindle
#

yes

#

doing { bla } = result is the same as doing bla = result.bla

#

@hardy vector member.user

#

avatar functions are on users, not on members

#

or use message.author

fading laurel
#

Question: What role permissions do you need to have to avoid a ban?

#

I know the admin permission avoids it

white anvil
#

there is no role permission that guarantees you cant get banned

quartz kindle
#

its not a permission, its the order of the roles

#

you can only get banned by a role that is above your highest role

fading laurel
#

So if role a has the administrator permission toggled on and role b is above role a, role b can ban role a?

pale vessel
#

administrator works for me

quartz kindle
#

of both have admin, b should be able to ban a

fading laurel
#

ok cool, got my info now

quartz kindle
#

if only a has admin, but b has ban members, im not sure tbh

#

but b should still be able to ban

fading laurel
#

I'll just make it so the bot can't ban admins or mods of a server

#

ban/warn/mute

#

Should mods be able to edit welcome/leave messages?

astral yoke
#

very quick question

#

how do you delete the bots message

fading laurel
#

In what lib

astral yoke
#

d.js 11

fading laurel
#

So, the bot sends the message after you send the command and you want it deleted?

astral yoke
#

like message.channel.send("")

#

i want it to then delete that aka its own message

sudden geyser
astral yoke
#

ty

neat ingot
#

wassup peoples! ^_^

#

so i put a website onto my contabo host. cant help but notice that its load time is a little slower now compared to when it was on heroku. wondering if maybe heroku has some kinda infrastructure to cache requests in the cloud for quicker loading or something, anyone any ideas?

modest maple
#

I dont have any real latency issues with contabo?

#

my avg time is <5ms on the api and <100 on the page msot of the time

neat ingot
#

:/

#

12 seconds before interactive? cmon now...

#

lol

quartz kindle
#

jesus

neat ingot
#

i can save 0.1second by testing the https route instead of http route which redirects

#

such performance enhancements ๐Ÿ˜

quartz kindle
#

its not even bad for me

#

clocking at 2.9 sconds load time

#

its a bit big tho, 2+mb

#

you could optimize your images

neat ingot
#

yea images are taking 4.5s apparently

#

google recommends me to change format to next-gen formats

fading laurel
#

Do you guys host your bots on Heroku or a VPS?

#

Just curious, I host my stuff on a VPS

neat ingot
#

my bots on digital ocean (vps) atm.

#

some use heroku

fading laurel
#

GH student?

neat ingot
#

huh>?

#

im not a student

fading laurel
#

Oh, I see

neat ingot
#

unfortunately, im a grown ass man ๐Ÿ˜

fading laurel
#

50 dollars credit renewable every year in gh student pack

neat ingot
#

oh nice

#

i think github used to do a student discount as well

#

idk since microsoft purchased it

fading laurel
#

So for a HS senior -> college freshman like myself, I get a free server for 10 months a year

neat ingot
#

but it used to!

#

lmao

#

cant argue with free ๐Ÿ˜„

fading laurel
#

Yeah, I guess the 50 dollar credit is the "discount" now

#

For sure dude

#

I was using vultr until my friend went on about gh student and the benefits it provides

neat ingot
#

theres an agar.io extension i use (delta) thats hosted on glitch!! ๐Ÿ˜ฎ

#

was honestly surprised how well it performs

#

hosts custom game servers and such no issue

fading laurel
#

some twitch bots are hosted on glitch

neat ingot
#

tons disco bots too

fading laurel
#

really? lol

#

that's a good way of doing it

neat ingot
#

yea all the nubs use it cuz its free lol

fading laurel
#

It's free real estate

#

literally

neat ingot
#

yea for sure

#

but i'd rather pay a few bucks a month for more control

fading laurel
#

This pandemic made me make this bot in 3 weeks instead of 2 months

#

Yeah, I run a lot of stuff on my server other than bots

#

such as a full fledged VPN

neat ingot
#

lmao

fading laurel
#

I hate my ISP throttling me, so I decided to do something about it

neat ingot
#

i actually cut off heroku as a host provider the past few days, gonna be moving all my stuff to contabo i think

fading laurel
#

For a website, I just use github pages

#

I don't think too much into those lol

neat ingot
#

but they have no good system monitoring tools

#

so i need to add like 3-4 docker containers with things like cADVISOR and prometheus to diy it :/

fading laurel
#

idk much about it, I just host on there and that's about it

neat ingot
#

ive never tried hosting a site on github

#

that'd have to be a static page tho yea?

fading laurel
#

It's really easy actually

#

You can change the domain name, but the main index page is your github username

neat ingot
#

ahh yea, i ca nt be dealing with that tbh

fading laurel
#

You can change it to something else

neat ingot
#

i need my url to be short and snappy ๐Ÿ˜›

fading laurel
#

Just need to pay for a domain

neat ingot
#

hmm

#

might need to look into that ๐Ÿ™‚

fading laurel
#

Glad I could help ๐Ÿ™‚

#

Now for this mod admin thing that's plaguing me

slender mountain
#

what mod admin thing

fading laurel
#

Have to differentiate commands between moderators and true admins

#

Just updated with that patch

quartz kindle
#

admins have admin permission, mods dont

#

however, how would you qualify mods? if they have either of the manage_x permissions?

#

or only if they have ban/kick permission, and managing roles/emojis/channels is irrelevant?

hardy vector
#
let owo = qdb.fetch(`uwus_${message.guild.id}`)
    if (message.content === "uwu" || message.content === "owo") {
        owo.add(`uwus_${message.guild.id}`, 1)
    }```
this is my code to track uwu and owo
but this is my code to see how mnay
```js
const Discord = require('discord.js')
const db = require('quick.db')
module.exports = {
    name: 'uwu',
    description: 'see how many uwus',
    execute: async(client, message, args) => {
        let owo = db.fetch(`uwus_${message.guild.id}`)
        if (owo === null) owo = 0
        message.channel.send(`There have been ${owo} uwus or owo in this server`)
    },
};```
when i do uwu
and check
it says there have been 0 uwus or owo in this server and gives me this error
(node:6569) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'add' of null
    at Client.<anonymous> (/Users/sadashivappakenchannavar/Desktop/Frosty/bot.js:162:7)
    at Client.emit (events.js:323:22)
quartz kindle
#

what database are you using? what is qdb?

hardy vector
#

quick.db

#

qdb is what i defined quick.db as

quartz kindle
#

is qdb.fetch() supposed to return a table?

#

i dont think so

#

you probably want to qdb.add() and not owo.add()

earnest phoenix
#

how do i fix this?

#

it says the members ID and not the actual mention.

slender thistle
#

Put the text in embed description

earnest phoenix
#

i dont have a description

quartz kindle
#

you're using py right? check the docs

neat ingot
#

@slender mountain I have an array of permissions for each command, one array for bot required permissions, and one for user permissions required to use the command. i find that works best for various 'admin' commands ๐Ÿ™‚

slender mountain
#

lol wrong person dab

neat ingot
#

oh, my bad lol

#

@fading laurel <- this guy!

earnest phoenix
#

also how do i do author mention

#

such as

#

{member.mention}

#

but whats the author one

neat ingot
#

you get all mentions from message.mentions. not member?

zenith terrace
#

language?

neat ingot
#

seems javascript from {}

earnest phoenix
#

no

#

py

neat ingot
#

what do you mean the author mention? cause as far as i know, thats not a thing.

earnest phoenix
#

excuse the shit line

#

but

#

why does the black change

modest maple
#

what?

earnest phoenix
#

you look like a what

#

If you implement sharding at around 1k guilds, those 1k guilds won't be split into multiple shards will they? Those 1k guilds will be on 1 shard, correct?

modest maple
#

no

neat ingot
#

i think you can define the number of shards

modest maple
#

they get split evenly

fading laurel
#

@slender mountain I have an array of permissions for each command, one array for bot required permissions, and one for user permissions required to use the command. i find that works best for various 'admin' commands ๐Ÿ™‚
@neat ingot

May be a good idea

#

I'll put it in at v2.0

#

Ban user permission should be enough to consitute a mod for now

zenith terrace
#

not all mod roles in servers get ban perm

earnest phoenix
#

how i can do {serverName} variable to my bot?;
m!setlwelcome Welcome to {serverName}!

fading laurel
#

String.Replace in CS

quartz kindle
#

parse the text and replace it

neat ingot
#

you have to search and replace {serverName} in the string before sending it to discord

quartz kindle
#

string.replace() in js

neat ingot
#

^

zenith terrace
#

if u want a perm that mostly every staff role gets, manage messages is ur best option

earnest phoenix
#

ok thx

fading laurel
#

not all mod roles in servers get ban perm
@zenith terrace

So then what perks would constitute a mod

#

Perms

neat ingot
#

imo the permissions should be based on the command in question

zenith terrace
#

if u want a perm that mostly every staff role gets, manage messages is ur best option
@fading laurel

neat ingot
#

like, kick/ban/manage guild are all different mod things

fading laurel
#

Yeah, true

#

Ok I get what ur saying

earnest phoenix
#

how i use that?

#

string.replace()

fading laurel
#

I don't know to check if something from x is in list Y in cs

#

That's the problem

neat ingot
#
"mystring".replace('my', 'your');
fading laurel
#

Oh wait

pale vessel
#
"yourstring".replace('your', 'our');```
fading laurel
#

I'm dumb, I just figured it out

#

Instead of if x contains something from the list, I should check if the list contains x

earnest phoenix
#

@neat ingot the result is....

neat ingot
#
"replace all spaces".replace(' ', '_');```
earnest phoenix
#

so replace_all_spaces

#

?

neat ingot
#

no

quartz kindle
#

"ABC".replace("A","Z") = "ZBC"

earnest phoenix
#

oh

fading laurel
#

^^

earnest phoenix
#

i can put a array?

#

in A

quartz kindle
#

no

earnest phoenix
#

Mmm

quartz kindle
#

you can chain replaces, or use a loop

fading laurel
#

Array isnt the same as a string

#

Use a loop to iterate

neat ingot
#

although, strings are arrays iirc ๐Ÿ˜„

quartz kindle
#

"ABC".replace("A","X").replace("B","Y") = "XYC"

fading laurel
#

In js, can you indent the replace statements to make them prettier?

quartz kindle
#

indentation doesnt affect the code

#

so you can do whatever you want with it

fading laurel
#

In some langs

#

Python on the other hand

quartz kindle
#

ye python is weird

fading laurel
#

It's easy to learn tho

neat ingot
#

pi ugli

slender mountain
#

python dont have switch/case statements

fading laurel
#

Easy to learn

#

Not to use

earnest phoenix
#

"ABC".replace("A","X").replace("B","Y") = "XYC"
@quartz kindle ty

modest maple
#

python dont have switch/case statements
What

pale vessel
#

small brain

earnest phoenix
#

How tf do I use css on the website

#

Or is that premium

#

whatever

royal portal
#

how do I make it so

#

if message.content.includes "something"

#

then do nothing

fading laurel
#

What lang

royal portal
#

discord.js

fading laurel
#

{}

neat ingot
#

there are multiple ways it can be done

fading laurel
#

I think

royal portal
#

so just {} ?

neat ingot
#

an easy way it so check the message.content.length

fading laurel
#

That's how I did it back in the day

neat ingot
#

a better way is to check if the string contains valid characters using regexp

fading laurel
#

{} is the same thing as pass in python

royal portal
#

@fading laurel works, thank you

#

thanks for suggestion too @neat ingot

#

๐Ÿ˜„

neat ingot
#

what are you checking?

#

like, whats your condition?

royal portal
#

well it works now

slender mountain
#
if (message.content == "something") return
#

includes?

#

oh

#
if (message.content.includes("something")) return
neat ingot
#

@quartz kindle wth is this Astrologico api actually for?

#

im guessing your main use case was the astrobot?

quartz kindle
#

astrological and astronomical calculation

neat ingot
#

like lat lng for space?

quartz kindle
#

ie: what is the position of an object at any given moment in time

#

yes

#

can be used for telescope tracking and such

#

but its main use case is astrology charts

neat ingot
#

oh nice! many folks use it? seems to have been up a few years now ๐Ÿ˜„

quartz kindle
#

not really, i released it not long ago

neat ingot
#

๐Ÿ˜ฎ

#

says 1999 on the site lol

quartz kindle
#

the beta was made public on early january

neat ingot
#

LIES!

#

lol

quartz kindle
#

no, 1999 is when my partner started working as a professional astrologer

neat ingot
#

ahhh ok, so just use that date cause why not? ๐Ÿ˜›

quartz kindle
#

yeah because thats when it all started

neat ingot
#

partner = irl life partner? o0

quartz kindle
#

business partner

neat ingot
#

or just, normal work parner

#

ahh rip, she looks cute

#

lol

quartz kindle
#

lmao

#

she twice my age

neat ingot
#

lot to learn from an experienced lady ๐Ÿ˜›

quartz kindle
#

anyhow, we're building a company centered around astrology, and techincally its since 1999 because thats when she started working with it and has been working ever since

#

just that the website and projects are starting to come now, because im doing them

amber fractal
#

Tim how old are you?

neat ingot
#

ahhh yea, i get that ๐Ÿ™‚

quartz kindle
#

29

neat ingot
#

i think hes like 25

#

oh iw as close

#

tbh surprised you dont have more patreon backers

quartz kindle
#

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

#

my patreon is only about 1 month old anyway

#

my only backer is not even a bot user lmao

#

my bot users promised but didnt deliver

neat ingot
#

savages

#

i tried patreon a few years ago, but i never really posted there and it never went anywhere cause of it ๐Ÿ˜›

quartz kindle
#

rip

amber fractal
#

Were you still making a lib?

earnest phoenix
#

my bot is finally on track

#

only got 170 lines tho

#

damn

#

thats it?

#

first bot i code bro

#

damn mines like 10k lines

neat ingot
#

man, i have single commands with more lines ๐Ÿ˜„

earnest phoenix
#

thats all the commands i have for now

#

horror

#

can i show you my bot?

#

sure

#

dms

#

when i try and run node index.js it runs the completely wrong bot

#

const Discord = require('discord.js');
const client = new Discord.Client();

client.once('ready', () => {
    if (message.content === '!ping') {
        // send back "Pong." to the channel the message was sent in
        message.channel.send('Pong.');
    }
});

client.login('seeewe');```
neat ingot
#

remove your token

#

go refresh it now

#

you leaked it

earnest phoenix
#

oy

neat ingot
#

alarms sound

earnest phoenix
#

ruf

#

Still regen it

neat ingot
#

^

earnest phoenix
#

just to be save

#

will

neat ingot
#

i screenshotted it and am currently hacking you

#

go fasst!

earnest phoenix
#

crisis averted

#

token regened

neat ingot
#

๐Ÿ˜›

earnest phoenix
#

be careful next time

#

ok

neat ingot
#

you should keep your tokens and important credentials ina config file, or .env file

fading laurel
#

Best would be to use a json file

neat ingot
#
module.exports = {
  token: "aksjhdiuahsndas"
}

^ config file

const config = require('./config.js');

^in your code

earnest phoenix
#

how did u make it with that color text

neat ingot
#

with my mind

amber fractal
#

You could put it in json and require it too

fading laurel
#

put js next to your code blocks

amber fractal
#

Dont even need to parse it

neat ingot
#

yea, json is also valid option. i use js file so i can have functions that return config data

#

^example

fading laurel
#

Json is good for all languages, so I use it in C#

#

And then I interpret the json in a helper class

earnest phoenix
#

tries to show me his bot but its offline

neat ingot
#

f

earnest phoenix
#

fat L @earnest phoenix

fading laurel
#

offline bots pretty lit ngl

earnest phoenix
#

lol hes mad

fading laurel
#

lmaoooo

earnest phoenix
#

Is there a NPM package or something that can recognize words through voices?

neat ingot
#

lmao

fading laurel
#

Maybe?

neat ingot
#

google has many api's for such things

summer torrent
#

๐Ÿค”

fading laurel
#

STT package

#

not TTS

neat ingot
#

to determine things said, objects within pictures, etc

earnest phoenix
#

I am trying to make voice commands lol

#

cant wait till my bot gets approved damn

neat ingot
#

fancy

earnest phoenix
#

it got declined cause it was offline

#

and i didnt realize

neat ingot
#

lol

fading laurel
#

RIPPP

earnest phoenix
#

f

neat ingot
#

i dreaded that happening to mine

#

i got lucky af ๐Ÿ˜„

fading laurel
#

Just posted my request today

earnest phoenix
#

it takes so long

summer torrent
#

speech recognition ๐Ÿค”

neat ingot
#

^

fading laurel
#

Mine's been online since the dawn of time

#

๐Ÿ˜‚

earnest phoenix
#

they should have a automatic system

#

to check the bots

neat ingot
earnest phoenix
#

cause it takes too long

fading laurel
#

Mods are volunteers after all, so they have a day job I assume

earnest phoenix
#

mods dont check bots

#

only the site admins do

fading laurel
#

Ohhhhh that makes more sense

earnest phoenix
#

and theres only like

#

not alot

neat ingot
#

mods refuse bots all day?

fading laurel
#

I've already got mine in 10 servers idk how

earnest phoenix
#

site admins

#

thats why its so slow

neat ingot
fading laurel
#

Website moderators

earnest phoenix
#

I found a speech recognition NPM module but I have no idea how to read the documentation.

fading laurel
#

awgh

earnest phoenix
#

not many bots have the same name as mine so

fading laurel
#

that's gonna be me when I learn rust and serenity

#

I find it, but I have no clue how to read the docs

earnest phoenix
#

is ur bot in py? @fading laurel

fading laurel
#

C#

#

gonna make another one in Rust

#

I got fed up with AIO bots with admin features

earnest phoenix
#

i find py easy

fading laurel
#

Same

neat ingot
#

i've been removing the admin commands from my bot

fading laurel
#

but I like C# more due to its wide variety of usage

neat ingot
#

they are pointless to have imo

fading laurel
#

Good.

neat ingot
#

literally every bot has the same generic commands, and a real mod bot could do everything much better than a generalized command

fading laurel
#

If you want administration, add an admin bot

neat ingot
#

yea exactly lol

fading laurel
#

Exactly, that's what I'm making. A real mod bot.

#

With all the good features from various AIO bots and without the fluff of a web dashboard etc

neat ingot
#

fluff?

#

how dare you sir!

fading laurel
#

Web dashboards are good

#

but they're annoying if the bot completely relies on one

earnest phoenix
#

k

#

k

#

i just got rekt

neat ingot
#

rekt from what?

earnest phoenix
#

nhl

summer torrent
#

mods dont check bots
@earnest phoenix no

fading laurel
#

Oh I'm actually stupid. I can just pass the permission through the function itself and check that way

#

therefore, it's a universal function

#

abstraction ๐Ÿ’ฏ

earnest phoenix
#

@summer torrent ?

neat ingot
#

sure hes saying mods do check bots

earnest phoenix
#

they dont

summer torrent
#

*admins don't check bots

earnest phoenix
#

they cant

hardy vector
#
const Discord = require('discord.js')
const client = new Discord.Client()
const fetch = require("node-fetch");
const stringify = (options, sep = "&", eq = "=") => {
    return Object.keys(options)
      .map(key => {
        `${encodeURI(key)}${eq}${Array.isArray(options[key]) ? options[key].join(sep) : options[key]}`
      }).join(sep)
  }
module.exports = {
    name: 'djs',
    description: 'djs',
    execute: async(client, message, args) => {


    const versions = ["stable", "master", "rpc", "commando"];
    const querystring = stringify({ src: versions.includes(args.slice(-1)[0]) ? args.pop() : "stable", q: args.join(" "), force: false });
    
    const res = await fetch()
    const json = await res.json(`https://djsdocs.sorta.moe/v2/embed?${querystring}`);

    return json ? message.channel.send(json) : message.reply(`nothing was found for that.`);

    },
};```(node:8302) UnhandledPromiseRejectionWarning: TypeError: Only absolute URLs are supported
    at getNodeRequestOptions (/Users/sadashivappakenchannavar/Desktop/Frosty/node_modules/node-fetch/lib/index.js:1299:9)
    at /Users/sadashivappakenchannavar/Desktop/Frosty/node_modules/node-fetch/lib/index.js:1404:19
summer torrent
#

website mods can check bots

neat ingot
#

a mod was who accepted my bot

#

regular mod

summer torrent
#

please don't give false information @earnest phoenix

earnest phoenix
#

What are you talking about? thats just oliy with his alt pogey

neat ingot
#

took me a while

#

but there we go

earnest phoenix
#

waiting for mine

#

just be patient

quartz kindle
earnest phoenix
#

hes a website mod

#

also

#

not just a mod

neat ingot
earnest phoenix
#

nvm

#

theyre all web mods

neat ingot
#

tbf hes also a web mod

quartz kindle
neat ingot
#

lets just agree that its totally irrelevant

#

aint gonna change the wait time

quartz kindle
#

im pointing out the fact that he says not to dm him, and dm the mod who declined it instead, but it was he himself who declined it :^)

halcyon ember
#

Yo @quartz kindle

#

For my json

#

I want it to put in user input as the name of one of the objects

#

Like ricp.workers.(address) address is a variable from user input

quartz kindle
#

workers[address]

halcyon ember
#

Oh

#

With or without the period

quartz kindle
#

without

halcyon ember
#

And if Iโ€™m pulling out another object under the addres

quartz kindle
#

with

halcyon ember
#

Workers[address].value?

quartz kindle
#

yes

halcyon ember
#

Ok

#

Thanks

earnest phoenix
#

how do people do the welcome image?

#

like moo6

#

where it changes everytime

#

like the number and it displays your pfp and username

neat ingot
#

idk how 'moo' does it, but i use canvas.js to make images.

earnest phoenix
#

what

earnest phoenix
#

no

#

the welcome

#

one

neat ingot
#

i know the welcome one

#

but an image is an image

#

doesnt matter what its for

earnest phoenix
#

bro you're not helping

#

back off

quartz kindle
#

Lol

neat ingot
#

...

halcyon ember
#

When Iโ€™m using .message.content.slice I get the value in โ€˜โ€™ how do I make it not do that

#

He means the mee6 profile picture on join lol

quartz kindle
#

most generated graphics are done using canvas, although you can also do them with libraries such as jimp, sharp, or gm

neat ingot
#

i know what he means, i answered his question perfectly imo.

quartz kindle
#

yes dekita's answer is accurate and valid

earnest phoenix
#

@quartz kindle is there a canvas for py?

halcyon ember
#

He wants the function to get image url lol

neat ingot
#

no, he wants to create a unique image for the recently joined members.

earnest phoenix
#

^

halcyon ember
#

In that case use canvas

quartz kindle
#

for py there is tinker, idk what else

halcyon ember
earnest phoenix
#

f that

#

too much

halcyon ember
#

How do u make it so message.content doesnโ€™t get thrown in with โ€˜ marks

#

(node:656) UnhandledPromiseRejectionWarning: TypeError: Cannot read property '
RSA3aZhFTKABYLGbQBcwcakQDrDtD125VB' of undefined

quartz kindle
#

wdym

halcyon ember
#

Hereโ€™s my json

#

And I did workers[address] and thatโ€™s the error

quartz kindle
#

should be pools.workers[address]

halcyon ember
#

Oh pup

#

Oup

earnest phoenix
#

why this dont work in messageDelete?

 message.attachments.array()[0]
sudden geyser
#

What doesn't work about it.

earnest phoenix
#

the bot say [object Object]

quartz kindle
#

that means it works lol

#

an attachment is a class, check the docs to see what properties it has

earnest phoenix
#
message.attachments.array().content[0]
#

ยฟ?

rotund prism
#

hey guys, i'm curious to why my bot doesn't work properly. i'm coding my bot in python and it's mostly working.

#
@client.command(pass_contxt=True)
@has_permissions(manage_roles=True)
async def ps2register(ctx, member: discord.Member, *, cName):
    rUser = ctx.message.author
    message, serverID = ps2bot(rUser, member, cName)
    print(message)
    roleStranger = discord.utils.get(ctx.guild.roles, name="stranger")
    roleps2USA = discord.utils.get(ctx.guild.roles, name="Planetside 2 Division NA")
    roleps2EU = discord.utils.get(ctx.guild.roles, name="Planetside 2 Division EU")
    role20r = discord.utils.get(ctx.guild.roles, name="20r")
    roleRecruit = discord.utils.get(ctx.guild.roles, name="Recruit")
    roleFriend = discord.utils.get(ctx.guild.roles, name="Friend")
    roleUSA = discord.utils.get(ctx.guild.roles, name="NA")
    roleEU = discord.utils.get(ctx.guild.roles, name="EU")
    #    roleps2 = discord.utils.get(ctx.guild.roles, name="Planetside 2 Division NA")
    #    roleps2d = discord.utils.get(ctx.guild.roles, name="Planetside 2 Division EU")
    await ctx.send(message)
    if serverID == "17":
        print("Emerald server")  # NA server
        await member.add_roles(role20r, roleps2USA, roleRecruit, roleUSA)
        await member.remove_roles(roleStranger, roleFriend)
    if serverID == "13":
        print("Cobalt server")  # EU server
        await member.add_roles(role20r, roleps2EU, roleRecruit, roleEU)
        await member.remove_roles(roleStranger, roleFriend)```
#

add_roles seem to work but remove_roles do not work

sick cloud
#

should i use mongodb or mongoose

#

mongoose seems more complex

fading laurel
#

please use sql

sick cloud
#

no, i'm not using sql

civic flower
#

well what happens when you run it thats a problem?

#

and what is it meant to do "exactly"

rotund prism
#

@civic flower you talking to me?

#

well what it's supposed to do is grab the roles. from my script that detects what server they're on it assigns the role accordingly. the ps2bot function and assigning roles works fine

#

it's just removal of roles seems to be buggy. i have ensured it's using the correct names

civic flower
#

i see so its a sort of "saved" role over servers that have your bot. well describe the bugginess.

rotund prism
#

it assigns the roles that i want it to but it doesn't remove the roles

pallid vector
#

if someone that knows anything about servers can explain to me - is public outbound bandwidth for 7.95 mbps a lot?

magic jackal
#

I've checked 3 browsers now too

earnest phoenix
#

if it doesn't work with other bots discord did a bad again

#

@pallid vector no, thats a bit under 1mb/s , its equivalent of most people's home internet

pallid vector
#

oh okay, I see, thank you

graceful dock
#

It a discord bug

#

@magic jackal

magic jackal
#

hmm

#

I was pinged by a discord dev mentioning discord bot inviting is down right now

#

I think its them

pallid vector
#

is there any way to increase speeds? @earnest phoenix like what would be the equivalent of increasing speeds for VPSes? (what factor am I looking for)

earnest phoenix
#

i dont know which provider you're using

#

most providers will have increasing bandwidth speeds with every increasing tier

pallid vector
#

digitalocean if that matters

#

alright

earnest phoenix
#

okay so DO doesn't do that

#

DO has limits on how much bandwidth you can spend in each droplet tier

#

but the network going into the node is 1Gbps so you can expect a speed cap of 1Gbps and the normal speed of somewhere around 300Mbps

civic flower
#

may be instead of remove role, to add role and then have the added role be stranger

#

@rotund prism

earnest phoenix
#

Can anyone help/link me to somewhere where I can make upvoter only commands

neat ingot
#

Just keep record of who/when voted, and check that when vote locked commands are used.

hardy vector
#
const Discord = require('discord.js')
const client = new Discord.Client()
const fetch = require("node-fetch");
const stringify = (options, sep = "&", eq = "=") => {
    return Object.keys(options)
      .map(key => {
        `${encodeURI(key)}${eq}${Array.isArray(options[key]) ? options[key].join(sep) : options[key]}`
      }).join(sep)
  }
module.exports = {
    name: 'djs',
    description: 'djs',
    execute: async(client, message, args) => {


    const versions = ["stable", "master", "rpc", "commando"];
    const querystring = stringify({ src: versions.includes(args.slice(-1)[0]) ? args.pop() : "stable", q: args.join(" "), force: false });
    const res = await fetch()
    const json = await res.json(`https://djsdocs.sorta.moe/v2/embed?${querystring}`);
    console.log(json)

    return json ? message.channel.send(json) : message.reply(`nothing was found for that.`);

    },
};```(node:9597) UnhandledPromiseRejectionWarning: TypeError: Only absolute URLs are supported
#

why

pale vessel
#

fetch what?

hardy vector
#

djs docs

pale vessel
#

await fetch()

#

what are you fetching

#

bruh

#

it's empty

hardy vector
#

wait but what do i put there since i did everything else

#

isnt that fetching

pale vessel
#

but what the hell are you fetching?

hardy vector
#

djs docs

pale vessel
#

you're supposed to do fetch(link)

#

read fetch docs

sudden geyser
#

const res = await fetch() SGWhat

#

Yeah you have those two variables backwards

hardy vector
#

wdym

pale vessel
viral spade
#

Tim can you remember my proposed server setup, where theres multiple vps, some for bots (my statistics bot), some for the database (mysql), and one manager with info which guild data lies on which db server.
The bots cache this info and send the queries for the guilds to the respective database.

I was asking about the amount of connections that each db server would have, if every shard connected to each database. So lets say theres 1000 shards, then there would be 1000 connections per db server. You said and also my research found that that would be handable for a database server with moderate ram.

But better even would be to reduce the number of connections. This can be done, like you said a while ago, with opening/closing connections per transaction + proper query grouping. But i wonder how strongly does this strain on what resources?

I was wondering, would it make sense to instead do the following (assuming a vps with 100 shards):

  1. Use ipc to send all queries to the sharding manager/a separate process, who has a connection to all dbs (possibly multiple connections per db pooled) and return to the shard the values received via ipc again.
  2. You said something about internal sharding.. would this also reduce the connections drastically (as all shards in the same process would use the same db module with the connections)? How many shards per process can this handle?
earnest phoenix
#

kk

graceful dock
#

Any docs on how to get the user badges or status message ?

wheat jolt
#

not possible about the custom status

#

for badges, I think you can't them too, but I'm not sure

graceful dock
#

I saw a bot that was showing status + badges

wheat jolt
#

wait

#

I'm stupid

#

Yeah you can get the custom status

#

what lib

graceful dock
wheat jolt
#

why don't you search the docs?

graceful dock
#

but on the discord api docs

#

you can get the status but i dont really understand their docs

wheat jolt
#

I think it's just a get/post request?

graceful dock
#

i really dont know, im new in the discord developing universe

wheat jolt
#

mhm

summer torrent
#

user badges is now public on API

wheat jolt
#

๐Ÿ˜

graceful dock
#

my question can sound like a bit stupid but how can i / how to use the discord api?

summer torrent
wheat jolt
#

^

graceful dock
#

so i can use discord api?

wheat jolt
#

custom status

clear wraith
#

What does this mean?
(node:11189) UnhandledPromisRejectionWarning: RangeError: Invalid bitfield flag or number.

graceful dock
#

can you send me the link please?

summer torrent
#

@clear wraith show code

clear wraith
#

K

wheat jolt
clear wraith
#
const Discord = require("discord.js");
const fs = require("fs");

module.exports.run = async (bot, message, args) => {

  if(!message.member.hasPermission("MANAGE_SERVER")) return message.reply("You do not have perms to change the prefix for Me.");
  if(!args[0] || args[0 == "help"]) return message.reply("Usage: !prefix <new prefix>");
  
  let prefixes = JSON.parse(fs.readFileSync("./prefixes.json", "utf8"));
  
  prefixes[message.guild.id] = {
    prefixes: args[0]
  };
  
  fs.writeFile("./prefixes.json", JSON.stringify(prefixes), (err) => {
    if (err) console.log(err)
  });
  
  let sEmbed = new Discord.RichEmbed()
  .setColor("#FF9900")
  .setTitle("Prefix Set!")
  .setDescription(`The prefix has been set to ${args[0]}`);
  
  message.channel.send(sEmbed);
  
}

module.exports.help = {
  name: "prefix"
}```
wheat jolt
graceful dock
#

it doesnt look like this for me ๐Ÿ’€

sudden geyser
#

What does this mean?
It means you passed a bitfield flag or number that was not valid.

#

MANAGE_SERVER is not a thing.

#

that's your flag.

clear wraith
#

Ahhh

#

So id need to change that to admin

sudden geyser
#

no

summer torrent
#

@clear wraith that is MANAGE_GUILD

wheat jolt
#

@graceful dock then you're on the wrong docs

sudden geyser
#

Also using JSON as a database may lead to issues.

graceful dock
#

thank you tho

wheat jolt
#

np

clear wraith
#

ahhh, Ok @summer torrent

#

Thanks Guys

fiery stream
#

Hey

#

i need a bit of help

#
(node:13644) UnhandledPromiseRejectionWarning: TypeError: client.guilds.array is not a function
    at ElusiveBotSettingsProvider.init (C:\Users\Jassm\Desktop\Elusive\utils\SettingsProvider.js:49:43)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)```
#
        
        for (const guild in client.guilds.array()) {
            try {
              const result = await guildSettingsCollection.findOne({ guildId: client.guilds.array()[guild].id });
              let settings;``` thats the code
summer torrent
#

what is your djs version

pale vessel
#

maybe toArray() ?

fiery stream
#

latest

summer torrent
#

client.guilds.cache.array()

worn plaza
#

How to make a bot can nofication when someone upload a video on youtube?

fiery stream
#

oh thx

clear wraith
#

How is this not defined?

clear wraith
#

btw heres the error

#
let sChannel = channel.guild.channels.find(`name`, "logs");
  sChannel.send(`The channel **${channel}** has been created.`);
});
earnest phoenix
#

the method you're using is deprecated

worn plaza
#

thanks

clear wraith
#

huh

earnest phoenix
#

pass a function instead to find

summer torrent
earnest phoenix
#

don't spoonfeed

#

but yes

clear wraith
#

ok

summer torrent
#

that is example

pale vessel
#

same channel name lul

fiery stream
#

@summer torrent same thing with client.users.array()?

pale vessel
#

yes

#

just add .cache

summer torrent
#

yes

fiery stream
#

k cool

summer torrent
pale vessel
#

send him the guide thing

#

yes

graceful dock
astral yoke
#

howdy

pale vessel
#

you can get user badges on any library

#

tbh

astral yoke
#

if im making a owner only premium command where i can give a user premium in there server how would i do that with quick.db

copper cradle
#

you add a bool to the database

#

that shows wether or not the user is a premium user

#

that's literally basic

graceful dock
#

how @pale vessel ? do you have a link?

pale vessel
#

read discord docs

#

on how to fetch a user

graceful dock
#

yes with the flags

pale vessel
#

yes

graceful dock
#

do you have any tutorial on how to use ? i sound stoopid lol but im new so

pale vessel
#

discord api documentation

#

read it

graceful dock
#

oke ty

pale vessel
#

there's no tutorial for it because it's simple

#

just request

digital ibex
#

hi, Error: val is not a non-empty string or a valid number. val=undefined i am getting this error, at ```js
let hi = ms(momentMilliseconds);

graceful dock
#

@pale vessel so it is like just doing a request with python?

digital ibex
#

i have ```js
if (hi === undefined || isNaN(hi) || hi === '') hi = 'Permanent';

pale vessel
#

yeah

#

you need to provide your bot token in the headers. the docs tell you how to

graceful dock
#

what is the headers?

digital ibex
#

the error, both times, r happening let hi = ms(momentMilliseconds);

pale vessel
#

read docs

#

you can easily find it by googling discord api documentation

graceful dock
#

this?

pale vessel
#

@digital ibex permanent is not a valid number

#

yes

#

go to reference and you'll see what you have to add

digital ibex
#

OH

#

mb, i'm so dumb

graceful dock
#

thank you

digital ibex
#

wait, then how can i say hi is permanent?

fiery stream
#

yo i have one more question

astral yoke
#

dont ask to ask, just ask

fiery stream
#
eventFunction.run(...args));```
#

that gives me a error

#

saying run is not a function

digital ibex
#

whats eventFunction?

fiery stream
#

const eventFunction = require(`./events/${file}`); if (eventFunction.disabled) return; const event = eventFunction.event || file.split('.')[0]; const emitter = (typeof eventFunction.emitter === 'string' ? client[eventFunction.emitter] : eventFunction.emitter) || client; const { once } = eventFunction; try { emitter[once ? 'once' : 'on'](event, (...args) => eventFunction.run(...args)); } thats the entire thing

digital ibex
#

p sure u won't use run to exec the file, u'd use once or on right?

earnest phoenix
#

so I use ytsearch and when I try to select a song from search, It doesn't get registers and tells me it timed out, code:

          try {
            response = await message.channel.awaitMessages(msg => 0 < msg.content && msg.content < videos.length + 1 && msg.author.id == message.author.id, {
              maxMatches: 1,
              time: 10000,
              errors: ['time']
            });```
fiery stream
#

waiit no

digital ibex
#

oh @fiery stream

#

u need to do eventFunction.emit(...args)

fiery stream
#

k lemme ry

digital ibex
#

i never read the full code

#

mb

fiery stream
#

emit is not a func

digital ibex
#

2 secs

#

hav u got any files in the events folder currently?

fiery stream
#

yea message.js

#

just that

digital ibex
#

how r u exporting the file

#
  • the full error
fiery stream
#

module.exports = {

digital ibex
#

can u show more plz

#

also

distant plank
#

how do I make "db!help" and "db! help' work

digital ibex
#

just the structure of it

fiery stream
#

its prolly mroe then 500 charc

digital ibex
#

wh

#

the structure?

fiery stream
#

module.exports = {
run: async (msg) => {
if (msg.author.bot) return;
if (msg.channel.type !== 'text') return;
if (!client.provider.isReady) return;

digital ibex
#

wouldn't it be

#

wait, whats the full err ur getting?

fiery stream
#
TypeError: eventFunction.emit is not a function
    at CommandoClient.<anonymous> (C:\Users\Jassm\Desktop\Elusive\elusivebot.js:40:73)
    at CommandoClient.emit (events.js:322:22)
    at MessageCreateAction.handle (C:\Users\Jassm\Desktop\Elusive\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (C:\Users\Jassm\Desktop\Elusive\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (C:\Users\Jassm\Desktop\Elusive\node_modules\discord.js\src\client\websocket\WebSocketManager.js:386:31)     
    at WebSocketShard.onPacket (C:\Users\Jassm\Desktop\Elusive\node_modules\discord.js\src\client\websocket\WebSocketShard.js:436:22)
    at WebSocketShard.onMessage (C:\Users\Jassm\Desktop\Elusive\node_modules\discord.js\src\client\websocket\WebSocketShard.js:293:10)
    at WebSocket.onMessage (C:\Users\Jassm\Desktop\Elusive\node_modules\ws\lib\event-target.js:125:16)
    at WebSocket.emit (events.js:310:20)
    at Receiver.receiverOnMessage (C:\Users\Jassm\Desktop\Elusive\node_modules\ws\lib\websocket.js:800:20)
[nodemon] app crashed - waiting for file changes before starting...
#

i forgot to tell i have commando too

digital ibex
#

so

#

Object.module.export...

fiery stream
#

...

copper cradle
#

@fiery stream did you actually try to copy code without knowing that it's just pseudo code and hope it works?

worn plaza
#

i type node index and

copper cradle
#

I'm getting out of here

digital ibex
#
module.exports = async (params) => {
// whatever 
}
``` wouldn't that be the structure of it tho?
worn plaza
#

internal/modules/cjs/loader.js:1213
throw err;
^

SyntaxError: D:\discord bot\config.json: Unexpected token t in JSON at position 5
at parse (<anonymous>)
 at Object.Module._extensions..json (internal/modules/cjs/loader.js:1210:22)
 at Module.load (internal/modules/cjs/loader.js:1040:32)
 at Function.Module._load (internal/modules/cjs/loader.js:929:14)
 at Module.require (internal/modules/cjs/loader.js:1080:19)
 at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (D:\discord bot\index.js:1:55)
 at Module._compile (internal/modules/cjs/loader.js:1176:30)
 at Object.Module._extensions..js (internal/modules/cjs/loader.js:1196:10)
 at Module.load (internal/modules/cjs/loader.js:1040:32)

digital ibex
#

or am i ๐Ÿ—ฟ

copper cradle
#

what's inside the config.json file@worn plaza

#

wait

#

before you show

#

remove your token

#

so it doesn't get leaked

worn plaza
#

{

token:

}

copper cradle
#

that's the problem

#

it should be "token":

#

in json files every key must be a string

#

just assigning the name doesn't work, that only works in js

fiery stream
#

wdym zSnails?

pale vessel
#

valid json

copper cradle
#

not valid in json files

#

only in js

#

keys must be strings in json files

digital ibex
#

Error: val is not a non-empty string or a valid number. val=undefined i am getting this error, at ```js
let hi = ms(momentMilliseconds);

fiery stream
#

wait are u talking about my error?

copper cradle
#

no

digital ibex
#

i have ```js
if (hi === undefined || isNaN(hi) || hi === '') hi = 'Permanent';

copper cradle
#

your error is that you literally copied and pasted code without knowing that it means jazz

fiery stream
#

uh not really im trying to rewrite

digital ibex
#

like, permanent isn't a number but what can i do to not make it error?

copper cradle
#

just do if (!hi)

#

'' = false 0 is false and undefined vara are also false

#

falsy and truthy shit in js

digital ibex
#

oh

worn plaza
#

(node:13776) UnhandledPromiseRejectionWarning: Error [TOKEN_INVALID]: An invalid token was provided.
at WebSocketManager.connect (D:\discord bot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:135:26)
at Client.login (D:\discord bot\node_modules\discord.js\src\client\Client.js:221:21)
(Use node --trace-warnings ... to show where the warning was created)
(node:13776) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:13776) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

#

what error?

fiery stream
#

token isnt correct

distant plank
#

._.

digital ibex
#

wait, i'm confused @copper cradle

copper cradle
#

@Bรนi Xuรขn Huแบฅn#0222 did you add the token again?

earnest phoenix
#

I'm trying to use YTsearch to get results and add them to the queue but when I use the following code: let response; try { response = await message.channel.awaitMessages(msg => 0 < msg.content && msg.content < videos.length + 1 && msg.author.id == message.author.id, { maxMatches: 1, time: 10000, errors: ['time'] });
I get the following results

#

Trying to select #1

neat ingot
#

msg => 0 < msg.content && msg.content < videos.length + 1 && msg.author.id == message.author.id

#

whats this?

earnest phoenix
#
          video = await ytdl.getBasicInfo(videos[videoIndex - 1].videoId)``` here's where the response variable is used
neat ingot
#

why are you checking msg content is lower than 0?

#

comparing strings to numbers?

#

then comparing message content with another number: videos.length

earnest phoenix
#

how much of this do I not need?

neat ingot
#
await message.channel.awaitMessages(reply => {
    const valid_auth = reply.author === message.author;
    const valid_reply = parseInt(reply.content) < videos.length+1;
    return valid_auth && valid_reply;
});
``` seems like it should do what your trying
earnest phoenix
#

didn't work unfortunately

#

I really wanna have ytsearch but might have to remove it

earnest phoenix
#

What is the best JavaScript voice recognition API?

#

that I can use eris

pale vessel
#

library doesn't matter

pale vessel
#

you can't ping everyone

worn plaza
#

sorry

#

How to make a bot can notify member when youtuber upload a video?

earnest phoenix
#

They are called webwooks

#

@worn plaza

pine bear
#

I think slice isn't defined for this

client.on("message", async message => {
    if(message.author.bot || message.channel.type === "dm")return
    
    let messageArray = messgae.content.split(" ")
    let cmd = messageArray[0]
    let args = messageArray.slice(1)
    
    let commandFiles = client.commands.get(cmd.slice(length)) || client.commands.get(client.aliases.get(cmd.slice(length)))
    if(commandFiles) commandFiles.run(client, message, args)
})
marble juniper
#

message.content is a string

#

or am i dumb rn

grizzled raven
#

no

#

length isnt defined

pine bear
#

oh, oof

neat ingot
#

anyone here use prometheus+cadvisor+grafana per chance?

indigo cloud
#

can u tell me whats wrong with my script

#

it dosent seem to work

neat ingot
#

cause its not valid at all. you seem to be missing a few lines at the start

indigo cloud
#

ok

#

hmmm

neat ingot
#

like, above the 'if' there should be something

#

a function seems likely

indigo cloud
#

alright

neat ingot
#

but then your not calling any function within the client.on message event

pine bear
#

bruh, now it says massage is undefined.

neat ingot
#

well, you are, but your defining the function inline whilst calling it

#

ofc it does

pine bear
#

xd. . .

neat ingot
#

cant be checking if (message) when message isnt a thing yet

#

it should look something more like this:

#
client.on('message', function(message) {
    if (message.content.startsWith("$kick")){

    }
})```
#

but then, your still not defining client at all

#

as i said, you seem to be missing some code ffrom the start of your file.

#

also: you dont need to redefine the client.on('message') event

#

just handle that event one time, and do whatever you need to do or check in that one function

indigo cloud
#

ok thanks

neat ingot
#

for example:

client.on('message', function(message) {
    if (message.content.startsWith("$kick")){
      // do a thing
    }
    if (message.content.startsWith("$ban")){
      // do other thing
    }
})```
indigo cloud
#

ok so i put above each?

neat ingot
#

put what above each what?

indigo cloud
#

is this good?

neat ingot
#

no, because your still checking if the message content starts with kick, when you have no access to the message, because you defined your if statement outside of your message event handler client.on('message')

indigo cloud
#

i am getting frustrated

neat ingot
#

dw, if coding was easy everyone would do it ๐Ÿ˜›

indigo cloud
#

u guys are genius

#

thanks for the help btw

neat ingot
#

np ๐Ÿ™‚

indigo cloud
#

can u tell me what to change in the script

#

like in the first line

restive furnace
#

btw u dont need to use function(args) {} on node.js => 10, you can use (args) => {}, this came w ecma 6 i think.

indigo cloud
#

ok

earnest phoenix
#

This should be put in r/mildlyinfuriating

#

Why should developing a bot be that easy....

#

People litterally get verified bot developer from using this application

#

Ngl has pissed me off

indigo cloud
#

ok

#
module.exports={
    name: "ban",
    description: "Ban a specified user from the server",
    category:"moderation",
    usage: "<user id> <reason> ```
#

will this work?

#

if i add above the ban

earnest phoenix
#

How to, in channelUpdate event, check if the oldChannel is not nsfw and newChannel is nsfw?

pale vessel
#

channel#nsfw

#

it's a boolean

#

you can compare them

earnest phoenix
#

oh ok thx

tight plinth
#

if I want to switch to shoukaku, is "using https://github.com/Deivu/Kongou but modified to put my bot's comands in" a good idea?

GitHub

Implementation Example of Shoukaku. Contribute to Deivu/Kongou development by creating an account on GitHub.

#

coz I want to

pale vessel
#

if you want to, then why not

#

@tight plinth

tight plinth
#

yes

pale vessel
#

then it's not hard

#

don't rewrite

tight plinth
#

but the problem is not that

#

its the play command

#

a mess to make

pale vessel
#

yeah

#

it's not

#

how is it a pain

tight plinth
#

my brain is too small to do it

pale vessel
#

just use client.shoukaku

#

and join the vc

tight plinth
#

here is a shitty code I make, warning it burns eyes

cyan ivy
#

SAMA

pale vessel
#

what

tight plinth
pale vessel
#

hastebin

tight plinth
#

warning for eyes

#

cozit sucks

pale vessel
#

i used the vanilla shoukaku and it works flawlessly and it was hosted on heroku

#

i'm sure you can do it too

tight plinth
#

im sure i'll explode

pale vessel
#

although i couldn't keep it 24/7 cause heroku web

tight plinth
#

*my brain will

pale vessel
#

hmm

tight plinth
pale vessel
#

just trigger player#stopPlaying (or whatever it's called) and handle player on stop

tight plinth
#

worst command to make for me should be queue

pale vessel
#

use the usual way

#

arrays

tight plinth
#

like with a serverQueue and all the shit?

pale vessel
#

???

#

yeah

tight plinth
#

oh

pale vessel
#

it doesn't change anything lol

tight plinth
#

I'll try

indigo cloud
tight plinth
#

I'll inform you if I succeed/fail

pale vessel
#

okay

#

good luck

tight plinth
#

@indigo cloud make sure file exists

indigo cloud
#

it does

mossy vine
#

@indigo cloud its just node index.js

tight plinth
#

and its just node index.js

mossy vine
#

not node run

#

it doesnt do anything because your code is shit

pale vessel
#

true

tight plinth
#

^

indigo cloud
#

when i run node index.js it dosent show anything

mossy vine
#

because your code is shit

indigo cloud
#

ok then i will make another code to run the bot

neat ingot
#

@restive furnace yea i know you can do () to create a function; however, that function would have a 'lexical this scope' which isnt always ideal, i was just declaring the function to make it more obvious that it was a function ๐Ÿ™‚

midnight brook
#

does anyone use intellij idea

slender wagon
#

what is the command to show the total member count of all the servers that the bot is in

modest maple
#

what about it

#

@slender wagon what language

slender wagon
#

discord.js

#

example but shows only the online users

#

${bot.guilds.cache.size}

modest maple
#

thats probably because you

#

wait no?

#

that is counting the guild size of the bot

#

not the user count?

slender wagon
#

oh

#

my wrong

#

users*

#

insted of guilds

#

copied the wrong one

modest maple
#

the only way you can do to get non-cached users is fetch every guild's member list

#

which is gonna be pretty intense on the api

neat ingot
#

how does dbl handle that iin the dblapi?

#

do they just accept the cached guilds for guild counter i mean?

slender wagon
#
    console.log(" - " + guild.name );
    console.log();```
this only shows the log of it but it should be something similar to this right?
modest maple
#

yeah ig

slender wagon
#

alright

#

i'll try something out

#

ty

neat ingot
#

@modest maple was it you who has the contabo host and kept going on about the 'steal is high'?

modest maple
#

i kinda fixed it

neat ingot
#

so it was you yea? ๐Ÿ˜„

modest maple
#

yeah

neat ingot
#

u use grafana/prometheus/cadvisor?

#

is this where your 'steal' data came from?

modest maple
#

Seems to only go into the high numbers when its under high load on a single core

#

this is just observing the charts on netdata

neat ingot
#

netdata? is that some kinda system monitoring thing?

modest maple
#

yh

#

splitting the load into (litterally double the processes) basically reduced the steal to like 5% at most

neat ingot
#

lmao

#

nice

#

i've been looking into various monitoring tools, but cause i run all my things within docker containers it seems a little tricker to get the actual system resources

modest maple
#

how?

neat ingot
#

got graphs and junk displaying

modest maple
#

docker doesnt hide the usage

#

every single thing on my VPS is in a docker container

neat ingot
#

docker creates an environment with limited resources

#

so if you check your cpu within a container

modest maple
neat ingot
#

you get the restricted into

modest maple
#

theyre my docker containers there

#

which i can see the individual stats for

neat ingot
#

oh so netdata handles docker ok?

modest maple
#

it handles litterally everything

neat ingot
#

interesting. i've been researching for days now, and all i keep seeing is people talking about cadvisor and grafana

modest maple
#

also my docker doesnt limit resources per container lol

#

my desktop version does

neat ingot
#

tbf, this setup allows me to customize graphcs for any data thing

modest maple
#

but production gets 100% of the system

neat ingot
#

but i just want something to monitor load and cpu etc

modest maple
neat ingot
#

not the prettiest graphs in the world, but certainly gets the job done ๐Ÿ™‚

#

i do like the little 3 quarter pie charts at the top

modest maple
#

idrc about looks just about system loads

neat ingot
#

yea tbh i dont care too much, but i'd like a reasonable interface to deal with if possible ๐Ÿ˜„

modest maple
#

id defo say give net data a try tbf

neat ingot
#

added it to my trello todo ๐Ÿ™‚

#

ill have to check it out before invevsting more work into this other crap

#

cause tbqh, its insane

#

atm it uses 7 container

#

7

#

fucking 7!

modest maple
#

I have 7 going atm lol

neat ingot
#

to monitor 1 bot, 1 db, and 1 site? overkill!

modest maple
#

my db, and api is in a single service

#

as it keeps the db local host and secure

#

only port in and out is via the api through an express server now

neat ingot
#

yea its always good to keep things secure

#

so you just query the api internally ?

#

or is it still accessable from outsite?

modest maple
#

the api handles all db interactions

#

and then the bots interact with the api from the ouside with docker's internal networking

neat ingot
#

yea i like docker for that ๐Ÿ™‚

#

very easy to give specific network access to the apps that actually need it

modest maple
#

only thing i dis-like is the fact that unless u jump through alot of hoops docker dameon runs as root

#

so when you do top

#

every container process comes up as root

#

but i dont care too much considering most of the time ill use netdata

neat ingot
#

so how many containers does your setup use just for system monitoring?

modest maple
#

what just to monitor everything?

neat ingot
#

yea

#

dude this netdata example page just keeps scrolling forever with more and more graphs ๐Ÿ˜„

indigo cloud
#

PS C:\Users\xAutentiqz\Desktop\Discord Bot> node .
C:\Users\xAutentiqz\Desktop\Discord Bot\index.js:57
----- Command JS File -----
^^^^^^^^^

SyntaxError: Invalid left-hand side expression in prefix operation
at wrapSafe (internal/modules/cjs/loader.js:1047:16)
at Module._compile (internal/modules/cjs/loader.js:1097:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
at Module.load (internal/modules/cjs/loader.js:977:32)
at Function.Module._load (internal/modules/cjs/loader.js:877:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)

#

how to fix this?

hasty sparrow
#

Don't provide an invalid left-hand side expression in the prefix operation

indigo cloud
#

can i send u a pic and u tell me what to do

hasty sparrow
#

Hastebin/etc. the code snippet and send the link here

indigo cloud
hasty sparrow
#

index.js:57
Line 57 in index.js

neat ingot
#

run_main.js:74

#

whats that?

hasty sparrow
#

Node internals

indigo cloud
#

ok

neat ingot
#

ive never seen that before lmao

indigo cloud
#

so