#development

1 messages ยท Page 1414 of 1

vale garden
#

why

#

whats wrong with json

earnest phoenix
#

still i didn't uff

pure lion
vale garden
#

oof ok

#

im using json

#

ooooof

rustic nova
pure lion
#

Don't use json

rustic nova
#

we don't spoonfeed here if that's what you want

vale garden
#

i mean a package which uses json

#

tinyDB

pure lion
#

switch to literally anything other than json

#

look at quick.db

#

just not json

#

please

#

you will cry

rustic nova
#

json KEK

pure lion
rustic nova
#

I'm glad that json parsing on java is aids Kek

wintry raptor
#

Hello, i have the bot running with all data stored in json ATM. Will i be better if i convert over to SQL? Or what will be the best?

rustic nova
#

yes

#

please

#

please

#

definitely

umbral zealot
#

yes, anything is better than just JSON files. You can use SQL if you're familiar, or if you're not, you could use quick.db, nedb, or enmap.

quartz kindle
#

sqlite is also a great option

wintry raptor
#

What will be the fastes? ๐Ÿ™‚

quartz kindle
#

depends what your bot does

wintry raptor
#

Making temporary channels. ๐Ÿ˜›

quartz kindle
#

if your bot does a lot of writes to the database, a database server will probably be faster, if your bot does a lot of reads, sqlite will probably be faster

umbral zealot
#

both quick.db and enmap are based on sqlite btw - they're not databases, they're wrappers.

carmine summit
#

do quick.db really require Python to be on your OS?

quartz kindle
#

sqlite needs to be compiled, so yes

umbral zealot
#

yes, because SQLite modules need to build from source so they need python and the c++ build tools.

#

So it's not just quick.db it's anything using sqlite, sqlite3, or better-sqlite3.

carmine summit
#

this is bs

quartz kindle
#

lmao

umbral zealot
#

Why? It's super simple to install.

carmine summit
#

RIP 20MB...

umbral zealot
#

If you're worried about 20mb of space, you've got bigger problems than requiring python.

carmine summit
#

yeah uh im gon buy a 970 evo once I filled my 128gb drive 100%

quartz kindle
#

upload some stuff to google drive or mega and free up some space

#

xD

carmine summit
#

its all programs

#

imagine running a program from google drive

#

its an ssd

#

i have an hdd of 1 tb

quartz kindle
#

is the hdd also full?

carmine summit
#

nope

#

its 10% full

quartz kindle
#

then move some programs to it

carmine summit
#

its slow

wintry raptor
#

i will convert the bot to a SQL ๐Ÿ™‚ Thank for the help ๐Ÿ™‚

quartz kindle
#

who cares, most programs dont need that much speed

#

i run games from my hdd

#

and leave ssd only for important shit

carmine summit
#

ooh

pure lion
#

what could be more important than helltaker????

carmine summit
#

Is there a way that I can just right click my folder then > open in VS code

#

its kinda frustrating opening it

pure lion
#

code .

umbral zealot
#

That option was there on installation, not sure if you can put it back

quartz kindle
#

disk speed will mostly affect loading times, once the program is in memory its speed will be the same

pure lion
#

from the terminal

umbral zealot
#

but yes, code . in any folder opens vscode in that folder.

finite nimbus
#
const { ShardingManager } = require('discord.js');
const manager = new ShardingManager('./bot.js', { token: 'token', totalShards: 2 });

manager.on('shardCreate', shard => console.log(`Launched shard ${shard.id}`));
manager.spawn();
pure lion
#

@finite nimbus there was a gateway timeout

finite nimbus
#

okey but how to fix it?

pure lion
#

catch some errors

carmine summit
#

wifi go brrr

#

10kbps

finite nimbus
#

Uhh

#

It's discord.js issue

pure lion
#

manager.on("error")

carmine summit
pure lion
quartz kindle
pure lion
#

@carmine summit what did you dO

quartz kindle
#

from admin powershell

carmine summit
#

npm i quick.db

pure lion
#

ah

#

yeah do that

carmine summit
#

right thanks

finite nimbus
carmine summit
#

ive been using the host's ide for too long

#

lol

quartz kindle
#

and see what the logs say

finite nimbus
#

manager.on("debug",console.log)

#

?

quartz kindle
#

no

#

client

#

in the shard file

#

bot.js

finite nimbus
#

i have shard.js

#
  • shards manager
quartz kindle
#

you have bot.js

finite nimbus
#

And bot.js - bot file

quartz kindle
#

bot.js is the shard

#

shard.js is the manager

finite nimbus
#

okey

carmine summit
quartz kindle
#

did you wait for it to finish?

#

you have to wait until it says ALL DONE

carmine summit
quartz kindle
#

nope, its still installing

carmine summit
#

o

quartz kindle
#

wait until it says ALL DONE

carmine summit
#

oki

finite nimbus
#

I added debug to file

#
2020-11-28T12:43:09.409402+00:00 app[worker.1]: (node:4) UnhandledPromiseRejectionWarning: Error [SHARDING_READY_TIMEOUT]: Shard 0's Client took too long to become ready.
2020-11-28T12:43:09.409424+00:00 app[worker.1]:     at Timeout.onTimeout (/app/node_modules/discord.js/src/sharding/Shard.js:163:16)
2020-11-28T12:43:09.409425+00:00 app[worker.1]:     at listOnTimeout (internal/timers.js:554:17)
2020-11-28T12:43:09.409425+00:00 app[worker.1]:     at processTimers (internal/timers.js:497:7)
2020-11-28T12:43:09.409501+00:00 app[worker.1]: (node:4) 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: 5)
2020-11-28T12:43:10.032809+00:00 app[worker.1]: /app/bot.js:25
2020-11-28T12:43:10.032814+00:00 app[worker.1]:     bot.ws.connection.triggerReady()
2020-11-28T12:43:10.032819+00:00 app[worker.1]:                       ^
2020-11-28T12:43:10.032820+00:00 app[worker.1]: 
2020-11-28T12:43:10.032820+00:00 app[worker.1]: TypeError: Cannot read property 'triggerReady' of undefined
2020-11-28T12:43:10.032821+00:00 app[worker.1]:     at Timeout._onTimeout (/app/bot.js:25:23)
2020-11-28T12:43:10.032821+00:00 app[worker.1]:     at listOnTimeout (internal/timers.js:554:17)
2020-11-28T12:43:10.032821+00:00 app[worker.1]:     at processTimers (internal/timers.js:497:7)
2020-11-28T12:43:10.730596+00:00 app[worker.1]: Loading 106 commands!
#

Same error

quartz kindle
#

whats your discord.js version?

finite nimbus
#
2020-11-28T12:44:10.012005+00:00 app[worker.1]: [WS => Manager] Fetched Gateway Information
2020-11-28T12:44:10.012006+00:00 app[worker.1]:     URL: wss://gateway.discord.gg
2020-11-28T12:44:10.012007+00:00 app[worker.1]:     Recommended Shards: 1
2020-11-28T12:44:10.012074+00:00 app[worker.1]: [WS => Manager] Session Limit Information
2020-11-28T12:44:10.012075+00:00 app[worker.1]:     Total: 1000
2020-11-28T12:44:10.012075+00:00 app[worker.1]:     Remaining: 955
2020-11-28T12:44:10.012139+00:00 app[worker.1]: [WS => Manager] Spawning shards: 0
2020-11-28T12:44:10.013276+00:00 app[worker.1]: [WS => Shard 0] [CONNECT]
2020-11-28T12:44:10.013277+00:00 app[worker.1]:     Gateway    : wss://gateway.discord.gg/
2020-11-28T12:44:10.013277+00:00 app[worker.1]:     Version    : 6
2020-11-28T12:44:10.013278+00:00 app[worker.1]:     Encoding   : json
2020-11-28T12:44:10.013278+00:00 app[worker.1]:     Compression: none
2020-11-28T12:44:10.013409+00:00 app[worker.1]: [WS => Shard 0] Setting a HELLO timeout for 20s.
2020-11-28T12:44:10.163676+00:00 app[worker.1]: [WS => Shard 0] [CONNECTED] wss://gateway.discord.gg/?v=6&encoding=json in 150ms
2020-11-28T12:44:10.165148+00:00 app[worker.1]: [WS => Shard 0] Clearing the HELLO timeout.
2020-11-28T12:44:10.165328+00:00 app[worker.1]: [WS => Shard 0] Setting a heartbeat interval for 41250ms.
2020-11-28T12:44:10.165596+00:00 app[worker.1]: [WS => Shard 0] [IDENTIFY] Shard 0/2
2020-11-28T12:44:10.494078+00:00 app[worker.1]: [WS => Shard 0] [READY] Session 6996bf906c27eb289621af00dbc34ebe.
2020-11-28T12:44:10.494392+00:00 app[worker.1]: [WS => Shard 0] [ReadyHeartbeat] Sending a heartbeat.
2020-11-28T12:44:10.885257+00:00 app[worker.1]: [WS => Shard 0] Heartbeat acknowledged, latency of 391ms.
2020-11-28T12:44:11.614551+00:00 app[worker.1]: [WS => Shard 0] Shard received all its guilds. Marking as fully ready.
#

New output

finite nimbus
quartz kindle
#

there is no v13 yet wtf

carmine summit
finite nimbus
#

๐Ÿ˜‚

lusty quest
#

is node up2 date?

quartz kindle
#

shard 0 seems to be working

#

any logs for shard 1?

finite nimbus
#

No

quartz kindle
#

where are you hosting? heroku?

finite nimbus
#

heroku

lusty quest
#

paid or free?

carmine summit
#

show us your package.json

finite nimbus
#

fetchAllMembers: true, sync: trueAdd it to bot options?

finite nimbus
finite nimbus
lusty quest
#

not sure if it will manage to run 2 shards

quartz kindle
#

the package json may have more information that can be useful

finite nimbus
#

"discord.js": "^12.3.1",

quartz kindle
#

whats the node.js version in engines?

finite nimbus
#

12.x

carmine summit
#

why is it taking so long angeryBOYE

umbral zealot
#

Because it's a complex thing it has to install

#

I've seen this take 15-20 minutes on older machines

lusty quest
#

build tools?

quartz kindle
#

ive seen it take 40+min xD

lusty quest
#

2 hours on a celeron

#

and 800kb/s downspeed

quartz kindle
#

otherwise there is not much else we can do, there is not enough information

#

would need to see more logs

carmine summit
#

finally ita all done

finite nimbus
#

I updated to 12.5

#

Same error, nothing changed

quartz kindle
#

need to see more logs then

finite nimbus
#

Logs from this session

pure lion
#

hastebin it please

umbral zealot
rustic nova
#

this though

2020-11-28T12:54:52.184608+00:00 app[worker.1]: (node:18) UnhandledPromiseRejectionWarning: Error: 401 Unauthorized
2020-11-28T12:54:52.184640+00:00 app[worker.1]:     at IncomingMessage.<anonymous> (/app/node_modules/dblapi.js/src/index.js:118:25)
2020-11-28T12:54:52.184641+00:00 app[worker.1]:     at IncomingMessage.emit (events.js:326:22)
2020-11-28T12:54:52.184642+00:00 app[worker.1]:     at endReadableNT (_stream_readable.js:1241:12)
2020-11-28T12:54:52.184642+00:00 app[worker.1]:     at processTicksAndRejections (internal/process/task_queues.js:84:21)
2020-11-28T12:54:52.184770+00:00 app[worker.1]: (node:18) 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)
2020-11-28T12:54:52.184859+00:00 app[worker.1]: (node:18) [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.
carmine summit
#

what happens if -g

pure lion
#

global install

#

it doesnt path any more

#

super unintuitive

pure lion
#

That's a lot of commands

umbral zealot
#

that would indicate you have an incorrect dbl token inserted.

finite nimbus
#

okey wait i will remove dbl api

umbral zealot
#

or just, y'know, fix the token ๐Ÿ˜›

carmine summit
#

why is process.env.TOKEN undefined?!?!

.env

TOKEN=ohhellothere<insertwaveemojihere>

package.json

    "dotenv": "^8.2.0",
umbral zealot
#

did you require("dotenv").config() ?

carmine summit
#

yes

pure lion
#

or just require("dotenv/config")

#

put the token in ""s

carmine summit
pure lion
#

the "" ensures the entire thingy is passed in if there are any spaces or #s etc

umbral zealot
#

env files do not use quotes.

pure lion
#

i used quotes

carmine summit
#

bruh

pure lion
#

it worked

carmine summit
#

lmao

carmine summit
#

it doesnt need quotes

pure lion
#

case and point PREFIX="nya "

umbral zealot
finite nimbus
#

huh wait

umbral zealot
broken sentinel
#

do you think vps hosting is good

#

?

umbral zealot
#

yes.

lusty quest
#

any decent vps host will beat any free host

finite nimbus
#

Still doesn't work

rustic nova
#
2020-11-28T13:04:35.036717+00:00 app[worker.1]: [WS => Shard 0] Shard received all its guilds. Marking as fully ready.
2020-11-28T13:04:35.037390+00:00 app[worker.1]: Bots is ready and working in 44 servers with 17615 users!
2020-11-28T13:05:02.467698+00:00 app[worker.1]: (node:4) UnhandledPromiseRejectionWarning: Error [SHARDING_READY_TIMEOUT]: Shard 0's Client took too long to become ready.
2020-11-28T13:05:02.467712+00:00 app[worker.1]:     at Timeout.onTimeout (/app/node_modules/discord.js/src/sharding/Shard.js:163:16)
2020-11-28T13:05:02.467713+00:00 app[worker.1]:     at listOnTimeout (internal/timers.js:554:17)
2020-11-28T13:05:02.467713+00:00 app[worker.1]:     at processTimers (internal/timers.js:497:7)
2020-11-28T13:05:02.468055+00:00 app[worker.1]: (node:4) 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)
2020-11-28T13:05:02.468125+00:00 app[worker.1]: (node:4) [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.
#

that's discordjs now

finite nimbus
#

I know, and i want to fix that error

pure lion
#

so I'm still having a rust issue when trying to install the request crate

lusty quest
#

why sharding with 44 Guilds?

finite nimbus
pure lion
#
error: failed to run custom build command for `openssl-sys v0.6.7
lusty quest
#

i have 300 and only 1 shard

finite nimbus
#

๐Ÿคทโ€โ™‚๏ธ

lusty quest
#

its possible that your host cant handle a 2nd shard. does it worked before?

pure lion
#

hm

earnest phoenix
#

Shit, Iโ€™m almost at 60 guilds in less than 12 hours. I may want to verify this

lusty quest
#

if you grow to fast you get flagged and then wait until you have 250 Guilds

pure lion
#

wait but how would it grow past 100

earnest phoenix
#

It wouldnโ€™t

lusty quest
#

ohh wait this where before october nvm

pure lion
#

lma9

carmine summit
#

@quartz kindle help me

pure lion
#

why dont you

carmine summit
#
//returned object```
pure lion
carmine summit
#

look

pure lion
#

look

carmine summit
#

it says object

#

in typeof

#
//returned object```
pure lion
carmine summit
#

;-;

#

Error: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received an instance of Array

#
let result = []
result.concat(api.data.auctions);
#

result is an array, auctions is an array, HOW IS IT NOT MERGING

#

this is illegal

pure lion
#

TypedArray

#

also is this good formatting for a github error request thingy

summer torrent
pure lion
#

Hello,

In trying to install the request crate, the error in the title occurs followed by this stack:

%= stack here =%

I have tried a lot; running it on my home machine (windows) and my VPS (Debian 10), installing packages mentioned in the docs

#

i am too awkward to make an error req please say if its good i dont want to look stupid asoighadoighwads

earnest phoenix
#

does the repo not have an issue template thonk

#

if not that's fine

pure lion
#

nyet

#

ok cool

sudden geyser
#

@pure lion keep in mind, the request crate doesn't actually make requests.

#

It's more or less a template crate for what requests can look like.

#

I think it's used by Hyper.

#

It also doesn't look maintained.

#

Last publish was 5 years ago.

pure lion
#

@sudden geyser well how did you install it anyway?

sudden geyser
#

I just plopped it in Cargo.toml and used it like so. I don't see the error in your case.

warm marsh
#

inside the cargo.toml file

#
[dependencies]
request="*"
#

Wait, is the D capitalised?

sudden geyser
#

Cargo doesn't allow a single wildcard

#

no its not

quartz kindle
#

car go

warm marsh
#

Are you sure, I used to do it like that.

sudden geyser
#

brr

#

yes I'm sure

warm marsh
#

Unless it was the "^"

pure lion
#

anywho

#

why it broked

sudden geyser
#

well what is the actual error

pure lion
#

here's the stack

sudden geyser
#

The error comes from a build error in the openssl-sys crate.

#

The actual error is: ```rust
thread 'main' panicked at '

Internal error occurred: Command "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-m64" "-Wall" "-Wextra" "-o" "/root/apps/nyaaa-bot/target/debug/build/openssl-sys-3b127dc3c2d14bd6/out/src/openssl_shim.o" "-c" "src/openssl_shim.c" with args "cc" did
not execute successfully (status code exit code: 1).```

pure lion
#

then how would i fix

#

sdghiklp;

sudden geyser
earnest phoenix
#

Is there any way in which I can scroll to a particular div by clicking on anchor tag without getting any redirect on the page? Currently, It's getting scroll but in a new tab.

#

Since the JS is not working

pure lion
#

i dont even have any interaction with the crate

#

why is sioghsodghis

#

smh my head

sudden geyser
#

Yes, but that does not mean you won't hit an error like that. For example, not having OpenSSL

pure lion
#

apt install openssl you say

earnest phoenix
#

yes

pale vessel
#

You're using <a id=""> right?

earnest phoenix
#

yes

pale vessel
#

Then there's probably a target="_blank" somewhere that you should remove

sudden geyser
#

Oh, this is interesting. rust running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-m64" "-Wall" "-Wextra" "-o" "/root/apps/nyaaa-bot/target/debug/build/openssl-sys-3b127dc3c2d14bd6/out/src/openssl_shim.o" "-c" "src/openssl_shim.c" cargo:warning=src/openssl_shim.c: In function โ€˜SSL_CTX_set_ecdh_auto_shimโ€™: cargo:warning=src/openssl_shim.c:115:41: warning: unused parameter โ€˜ctxโ€™ [-Wunused-parameter] cargo:warning= int SSL_CTX_set_ecdh_auto_shim(SSL_CTX *ctx, int onoff) { cargo:warning= ~~~~~~~~~^~~ cargo:warning=src/openssl_shim.c: In function โ€˜DH_new_from_paramsโ€™: cargo:warning=src/openssl_shim.c:126:7: error: dereferencing pointer to incomplete type โ€˜DHโ€™ {aka โ€˜struct dh_stโ€™} cargo:warning= dh->p = p; cargo:warning= ^~ cargo:warning=src/openssl_shim.c: In function โ€˜X509_get_extensions_shimโ€™: cargo:warning=src/openssl_shim.c:137:13: error: dereferencing pointer to incomplete type โ€˜X509โ€™ {aka โ€˜struct x509_stโ€™} cargo:warning= return x->cert_info ? x->cert_info->extensions : NULL; cargo:warning= ^~ cargo:warning=src/openssl_shim.c:138:1: warning: control reaches end of non-void function [-Wreturn-type] cargo:warning= } cargo:warning= ^ exit code: 1
@pure lion I missed this part.

pure lion
#

ah

#

why is my build not finishing

#

uhh

#

nvm

earnest phoenix
pale vessel
#

Is it in your bot description?

earnest phoenix
#

yes dear

pale vessel
sudden geyser
#

Krista for the most part, searching up the error brings up posts saying, "did you install openssl correctly" or "try upgrading your package version"

earnest phoenix
pale vessel
#

Are you using an iframe?

earnest phoenix
#

Nope

#

Custom Code

vale garden
#

hi

#
str(discord.utils.get(bot.emojis, id = {id}))
#

im sending emojis in an embed using this format

#

i have done this in a previous cmd and it has worked

#

now for some reason it is sending None

#

it works if i use a emoji from my previous cmd tho

#

plz help

earnest phoenix
#

What emojis are they

#

Custom?

vale garden
#

wait nvm

#

i was using the message id

#

lmao

#

im dumb

#

aaaaaaaaa

quick ridge
#

How can I get the output we printed with console.log in the eval command?

#

like that

pure lion
#
async fn ping(ctx: &Context, msg: &Message) -> CommandResult {
    let mut message = msg.channel_id.say(ctx, "Pinging...").await.unwrap();
    println!("First sent: {:?}\n",msg.id);
    println!("Second sent: {:?}\n",message.id);
    let m_timestamp1 = msg.timestamp.timestamp();
    let m_timestamp2 = message.timestamp.timestamp();
    message.edit(ctx, |m| {
        m.content(format!("Pong in {}ms", m_timestamp1 - m_timestamp2))
    }).await?;
    Ok(())
}
```Here's my ping command. It only sends 0 or -1 and -2 sometimes if im lucky
earnest phoenix
#

Click Here Guys, this method is not working in the embed field.

#

What's wrong

pure lion
earnest phoenix
#

yes

earnest phoenix
#

field value

sudden geyser
pure lion
#

Alright

rustic nova
#

what's the most common port used for the dbl api?

pure lion
#

I'll try that uwu

#

@rustic nova probably 6969

rustic nova
#

nice

snow tendon
#

Hi,
I have a giveaway bot. But it has a problem. When you use g!start in a new server, it doesn't responds before you reboot the bot.

#

how can i fix it

#

my english is not so good. i can show you with examples

pure lion
#

@sudden geyser how can i parse it to a timestamp?

#

oh

#

nvm

earnest phoenix
#

where are you placing it

snow tendon
#

yes

earnest phoenix
#

field title or field value

snow tendon
#

if its in field it won't work

midnight blaze
#

so after trying out sqllite3, mongodb, PostgreSQL, quickdb, enmap and mysql..
I dont really know with which I should continue generally to invest more time. I really want to stick to one db and get better with it, which one would you pick?

earnest phoenix
#

field value will work, field title won't because it doesn't support markdown

#

It's field value

#

๐Ÿค”

snow tendon
#

in desc

earnest phoenix
#

show your code

snow tendon
#

try in description

earnest phoenix
#

make sure the link is a valid link

#

it is

#

discord invitation link

#

valid 101%

#

it's even functional

#

so you must be providing an invalid url

carmine summit
#

pussygrabber

midnight blaze
#

what about redis database, anyone would recommend that?

earnest phoenix
#

redis ๐Ÿšฎ

#

overpriced garbage

midnight blaze
#

I like mysql the most for now

earnest phoenix
#

from my personally experience, sqlite for small scale and postgresql for large scale

#

avoid mysql at all costs

midnight blaze
#

really?

earnest phoenix
#

it's also garbage

midnight blaze
#

what O:

earnest phoenix
#

sec let me grab the tag

midnight blaze
#

postgresql is good, I agree, I wasnt sure which one to pick, but I heard that big companies like to use mysql

#

hmm

earnest phoenix
#

they only use it because their software is built in the dinosaur age

midnight blaze
#

yeah, that makes sense

pale vessel
#

is MariaDB any better or no

earnest phoenix
#

kind of

boreal iron
#

It is, yes

blissful coral
#

Eh MySQL doesnโ€™t disconnect if you use pools

earnest phoenix
#

i liked maria more than mysql

blissful coral
#

At least not for me

drifting wedge
#

with flask how can i get the value of checkboxes when theyre updated without the person having to press a submit button

boreal iron
#

No clue what flask is but using JS to trigger onchange works well.

midnight blaze
#

you have no clue what flask is? It is like express js but in python

drifting wedge
#

like if its checked or not?

#

onchange send post request to python, but can i send the checkbox's status (checked or not) with the js post

boreal iron
#

You can check the current state via. JS if onchange got triggered

drifting wedge
#

or do i need my own thing?

boreal iron
#

you're speaking about an element in a dom?

#

(website)

drifting wedge
#

Well I don't do jรก

#

Js

#

So I'm not sure

midnight blaze
#

(website => somethat that you can open with your browser => browser => a programm on your computer)

boreal iron
#

huh wut? you're speaking about a checkbox on your website?

drifting wedge
#

Yes

#

I want to send a post request to flask when it gets updated

boreal iron
#

Ah okay

drifting wedge
#

But I want to know if I can send the checkbox state with the post

#

Or would I need my own system to do that?

midnight blaze
#

why would you need your own system for that

drifting wedge
#

Bc it's like for modules

boreal iron
#

Yes you can, instead of using onchange you can use onclick, check if the checkbox is checked (using JS) and send your request

drifting wedge
#

So I need to see if it's checked or not

drifting wedge
#

Onclick I have a js function

#

But how would I see if it's checked? Sorry I'm not too smart lmao

boreal iron
#

You can use onclick or native JS adding an eventlistener on your checkbox

drifting wedge
#

I know onclick

boreal iron
#
let box = document.getElementById('elementid');

box.addEventListener('change', function(event)
{
  if(event.target.checked)
  {
     // haha checked
  }
});
drifting wedge
#

But onclick sends post request

#

Wait my brain hurts

#

I don't know any js

#

So bear with me lol

boreal iron
#

Don't need to use onclick

#

Just add an eventlistener to the element

drifting wedge
#

Ok. Can 2 things have the same Id?

#

Like but send different data?

boreal iron
#

Can but no, they should not

drifting wedge
#

So i need like a function for each?

boreal iron
#

That destroys the definition of an unique ID

drifting wedge
#

For each checkbox?

boreal iron
#

errr... you're speaking about multiple checkboxes?

drifting wedge
#

Yes

#

Like one per thing

#

Like 1 checkbox per module kinda

boreal iron
#

oof, you make your life complicated without submit button
Do you really wanna send a request each time the checkbox state changes?

#

I mean creating 2 lines of code in my browser will change your checkbox 1000 times per second, just to troll you

#

lmao

drifting wedge
#

Mhm

boreal iron
#

You should think about the possible abuse, JS is not server sided

drifting wedge
#

Might jus trave submit

#

Might just have submit*

#

Wait tho, can't u just edit it to send a bunch of post requests regardless?

#

Like make a script that sends 10000000 post requests?

boreal iron
#

Adding a submit button and fetching the $_POST data via. PHP has no possible way to manipulate the input on the client side, for example

drifting wedge
#

I got it

#

It's fine ig then

#

I'll just use flask

#

Lol

boreal iron
#

well however u like, lol

drifting wedge
#

It's a good point

#

With spam and stuff

boreal iron
#

but sending a request each time the element changes can result in a huge abuse

drifting wedge
#

Thanks

#

A submit button is fine?

#

Abuse wise?

boreal iron
#

it requires a little more work, pressing the submit butten and hammer F5 will result in the same spam

drifting wedge
#

Hmm

#

How would I add a cooldown turn?

#

Then...

#

Not sure if there even is a way

boreal iron
#

you need to generate a token if the website is loaded, cache it in your session and compare it the next time the form's being send... token != last token -> don't send the form again (client used F5)

#

sound complicated but it easy

drifting wedge
#

Uhhh

#

It's fine the way it is lmao ๐Ÿ˜‚

boreal iron
#

I'm sure a lot of code snippes will explain how to supress form spam

drifting wedge
#

I doubt there will be much lmao

#

I think it'll just break from usage lmao

boreal iron
#

Anyway the easiest solution for all this is PHP, it's server sided, the client can't manipulate the data and you can send your POST using it, too

pure lion
#

I'm torn, hyper or reqwest?

silent cloud
#

Yo guys

#

Why when i using play command now it have this error

#

Error: Error parsing info: Unable to retrieve video metadata

sudden geyser
#

reqwest if you don't care about your build time & dependency tree going up

#

hyper if you care about it

#

or minireq

pure lion
#

reqwest time brrrrrr

honest perch
#

ok so i have ```js
module.exports = (args) => {
if (args.split(' ')[0] === 'file') {
try {
return delete require.cache[require.resolve(args.split(' ')[1])];
} catch (e) {
throw Error('This file does not exist :pognt:');
}
} else {
return 'pp';
}
};

pure lion
#

@honest perch why are you splitting args with that

honest perch
#

why not

pure lion
#

isnt it already an array

honest perch
#

no

pure lion
#

ah

honest perch
#

args is just a name

#

just because my brain isnt operating today

pure lion
#

does it throw pp or an error?

honest perch
#

it returns true

pure lion
#

ah

#

then it means the cache was deleted

honest perch
#

yes

pure lion
#

you need to re-require the file

#

how can i convert u type numbers into i type numbers for my ping command? (rust)

#
async fn ping(ctx: &Context, msg: &Message) -> CommandResult {
    let mut message = msg.channel_id.say(ctx, "Pinging...")
        .await
        .unwrap();
    let timestamp1 = SystemTime::now()
        .duration_since(UNIX_EPOCH).unwrap()
        .as_millis();
    let timestamp2 = message.timestamp.timestamp();
    println!("{}\n{}", timestamp1, timestamp2);
    message.edit(ctx, |m| {
        m.content(format!("Pong in {}ms", timestamp1 - timestamp2))
    }).await?;
    Ok(())
}
```here is el code
#
expected `u128`, found `i64```
#

that is being thrown from timestamp2

honest perch
#

ok so i now have ```js
module.exports = (args) => {
if (args.split(' ')[0] === 'file') {
try {
/**
*
* @param {*} args the name of the thingie being passed
*/
function reload(args) {
delete require.cache[require.resolve(args.split(' ')[1])];
require(args.split(' ')[1]);
}
return reload(args);
} catch (e) {
throw Error('This file does not exist :pognt:');
}
} else {
return 'pp';
}
};

#

and

#

it still doesnt work

pure lion
#

console.log args a sec

honest perch
#

ah ic

#

i did wrong thingie

pure lion
#

here are my two timestamps

honest perch
#

now im getting ```
Error: TypeError [ERR_INVALID_ARG_TYPE]: The "request" argument must be of type string. Received undefined

pale vessel
#

it's undefined

cinder patio
#

Do you store the command functions inside a map or something? Because just calling require won't magically replace the old function with the new one

umbral zealot
#

delete require.cache[require.resolve(args.split(' ')[1])]; <--- not magical.

#

That's a perfectly fine way to clear the cached version of a required module.

honest perch
#

well, the commands are a collection

umbral zealot
#

Maybe log args[0] and args[1] and make sure they're what you expect.

silent cloud
#

Ooo

pale vessel
#

args seems to be a string...? weird

silent cloud
#

Yo

#

Somebody can help with ydtl? Error: Error parsing info: Unable to retrieve video metadata

honest perch
umbral zealot
#

How are you defining args in your message.js event?

cinder patio
#

You have to replace the old command in the collection with the new one

honest perch
#

that doesnt matter, as its not using anything from the message event

umbral zealot
#

So what's passing args then? How is this file called?

honest perch
#

its just client.reload = require('./reload'); args is just a string

umbral zealot
#

Ok that's how it's required. How is it called

#

like, executed.

honest perch
#

just evaled with client.reload('file filenamehere')

umbral zealot
#

So you call client.reload() and it calls reload()?

cinder patio
#

You have to replace the old command in the collection with the new one

honest perch
#

it calls the file

umbral zealot
#

I presume that's what reload() does

#

oh. wait a sec

#

no it's not

cinder patio
#

All your commands are stored in the collection, when you delete the require.cache for the file you only delete it from there

umbral zealot
#

this requires it and does nothing with it

cinder patio
#

not from the collection with the commands

#

and also you don't add the new, edited command inside the collection

honest perch
#

ok, nvm im going on a walk, thanks for the help anyway

umbral zealot
#

The same sort of code that initially requires this should also be here

#

so if you're adding to client.commands(), you need to do it here, too.

sudden geyser
#

Then you can easily do the subtraction

#

and if you really wanted to convert it to a u128, you could probably use the .parse::<T>() method.

earnest phoenix
#

An idea ?

Uncaught TypeError: Cannot read property 'author' of undefined

sudden geyser
#

whatever you tried accessing .author on is undefined

delicate shore
#

How do I setup lavalink on Ubuntu

drifting wedge
#

Run jar file

delicate shore
#

I only have SSH access

#

Just so you know

silent cloud
#

How i can fix it? Discord.js YTDL module

Error: Error parsing info: Unable to retrieve video metadata

drifting wedge
#

Just run the jar file

errant hornet
#

How would I use oldMember and newMember to see if someone's role gets changed in discord.js?

delicate shore
silent cloud
errant hornet
#

What?

drifting wedge
#

Wats the lib

delicate shore
#

Try uninstalling and installing again

silent cloud
#

K, give me a sec

delicate shore
#

K

errant hornet
#

discord.js

drifting wedge
#

Can't help ya

delicate shore
#

It was fixed for me in latest update so it should work for you

pure lion
#

doesnt work

#

its expecting std::time::SystemTime but getting chrono utc thingy

silent cloud
onyx hare
#

i need help grabbing guild icon for an embeded message i thought i could grab it the same way as users one but i errored xD ```js
.setImage(msg.guild.displayGuildURL({ format: 'png' }))

``` msg.guild.displayGuildURL is not a function```
pale vessel
#

displayGuildURL fullbruh

silent cloud
#

...

pale vessel
#

Don't make up your own property names

#

it's iconURL()

#
pure lion
#

time to ping lite again kekw

gusty quest
#

so hello, i have this problem i made like when user joined to give role and type message in console but nothing is logging this is my code:

```client.on('guildMemberAdd', member => {

console.log('User ' + member.username +' has joined the server!')

var role = member.guild.roles.fin('name', 'Not Verifed');

member.addRole(role)

})```

pure lion
#

@sudden geyser yoooooooo

sudden geyser
#

yo

pale vessel
#

roles.fin() ๐Ÿ—ฟ

sudden geyser
#

even the deprecated signature

gusty quest
#

yea but i dont have any errors

#

idk

pale vessel
#

member.username find("a", "a") roles.find()

#

those are old

#

addRole()

#

Damn

gusty quest
#

oof

silent cloud
#

Sooo

#

Somebody can help?

Error: Error parsing info: Unable to retrieve video metadata

onyx hare
#

.-. Iโ€™m not used to embeds

silent cloud
#

Discord.js

pure lion
# sudden geyser yo

so the issues are that it cant interpret the i64 timestamp as a SystemTime

gusty quest
#

i fixed something

#

but again nothing

pure lion
#

relevant code:

    let timestamp1 = theFuckingNow
        .duration_since(UNIX_EPOCH).unwrap()
        .as_millis();
    let timestamp2 = theFuckingNow
        .duration_since(message.timestamp.timestamp()).unwrap()
        .as_millis();
```and the error is at message.timestamp.timestamp()
gusty quest
#

i just want to give role when join server

#

    member.roles.add('782009098358751232');
})```
pale vessel
#

That should work if the role exists in the guild

pure lion
#

yeah

gusty quest
#

it exist

pure lion
#

if it doesnt

gusty quest
#

it exist

pale vessel
#

No error?

gusty quest
#

no nothing

pure lion
#

how many people are using your bot?

gusty quest
#

0

#

its private bot

pure lion
pale vessel
gusty quest
#

for my server

pure lion
#

ok makes sense

gusty quest
#

even with old code

#

doesnt give errors

#

?

silent cloud
#

Bruh...

earnest phoenix
#

You know why my bot crashes every time I write a message

pure lion
#

gg

#

wrong channel

silent cloud
#

@delicate shore so...it doesnt working again

pure lion
#

@silent cloud have you updated ytdl-core to latest?

silent cloud
#

Yep

#

4.1.0

pure lion
#

where is that error being thrown from?

silent cloud
#

From module._.

pure lion
#

who

silent cloud
pure lion
#

play.js line 36?

silent cloud
#

...

pure lion
#

is there a song.url?

silent cloud
#

Users gives it when using: *play (songURL)

earnest phoenix
#

Either the ytserach cant find anything oe u get rate limited or u code is wrong

silent cloud
#

Code never wrong

#

Thats EvoBot code

#

Never rate limited too, bcs my hosting was down around 3 weeks

#

And bot was offline

#

It works in october

#

But now not

earnest phoenix
#

Mongodb question:

I have several arrays in my mongodb schema
When i create a blank document without putting anything in arrays
It still auto creates them... There is a way to prevent that by making them undefined and saving the document but is there any other way?

I'm using JavaScript

#

What do i need for an decode / encode for my bot?? Do i need to install something like npm i base-64??

pure lion
#

@earnest phoenix are you using mongoose?

earnest phoenix
#

yeah

pure lion
#

you can make the default for the field null

earnest phoenix
#

and it wont auto generate?

pure lion
#

well

#

show me your schema so far

earnest phoenix
#

seems like it still saves a empty array

pure lion
#

whats the issue with it initialising an empty array?

earnest phoenix
#

one second

#

I'm planning to increase it

#

so much arrays creating is gonna eat lots of data

pure lion
#

you dont need to put required: false

#

that's a default

earnest phoenix
#

hmm... But i still need to do something with the arrays ๐Ÿค”

lusty quest
#

dont add it in your base schema you can add additional stuff later (this is the beauty of NOSQL)

earnest phoenix
#

wdym not add?
My idea is to not generate those arrays and the start but when they are needed i want to initialize them

lusty quest
#

you can add stuff to any document as you like

#

MongoDB is not bound to a schema like mysql

earnest phoenix
#

hmm

pale vessel
#

it's mongoose

lusty quest
#

you can still add stuff later on

earnest phoenix
#

and it doesn't need to be in the schema right?

lusty quest
#

and mongoose is just a client to connect to a mongodb database

pale vessel
lusty quest
#

theoretical no or just set it as array and then push later the stuff you want to have in the array

#

with the normal MongoDB client its possible

earnest phoenix
#

um ok ill try

#

thanks

lusty quest
#

but i dont get why you dont want the arrays from the beginning

#

just make them empty and if you need them push stuff into them

earnest phoenix
#

cuz i for example only need the array of prefix cuz a admin decided to add a prefix

sharp pendant
#

you know a dependencies like puppetter to make some kind of screenshots

lusty quest
#

sure but why?

earnest phoenix
#

but i don't want others to create since there is no need

pale vessel
#

Yes, Puppeteer

sharp pendant
#

other of puppeteer

pale vessel
#

I don't think so

lusty quest
#

if you need them later then there is a need

pale vessel
#

You need a browser to take a screenshot

lusty quest
#

or if you dont know them yet you can still add them later to the Schema and mongodb will add them to documents that query with them

pale vessel
#

So it needs to be a browser or a headless one at least

lusty quest
#

also why a array for prefix? did you want to allow mutiple prefix?

earnest phoenix
#

i have multi prefix feature

lusty quest
#

then start the array with the default prefix

earnest phoenix
#

i do actually

pale vessel
#

or make the array empty by default

pure lion
#

how can i get the client ws ping time in serenity, cant seem to find it in the docs

lusty quest
#

then i dont get why you get stuck on it

earnest phoenix
#

ok ig ill store the arrays

pale vessel
#

Dice you said you "read"

pure lion
#

i do

#

read

#

i read everything

#

on my shitty tiny phone screen

lusty quest
#

no pc handy?

pure lion
#

because my pc doesn't want to let me open chrome

#

or any browser

lusty quest
#

lol why?

pure lion
#

2nd gen i5 from 10 years ago moment

lusty quest
#

i know a guy who uses an i5-2500 and he has little issues opening a browser

pure lion
#

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

#

not that guy

lusty quest
#

did you run any 3rd party Anti Virus software?

pure lion
#

i only have mcaffe which won't open either

#

fuck lag

#

aaa

lusty quest
#

3rd party Anti virus software eats your performance

pure lion
#

poo

lusty quest
#

also did you use windows 10? if yes use the win 10 debloater script to remove the crap that is installed

pure lion
#

oki

pale vessel
earnest phoenix
#

just use linux bruh

lusty quest
#

rust is a programing language?

#

or did you mean krista?

pale vessel
lusty quest
#

i meant Crazy Shooting

pale vessel
#

me confused rn

lusty quest
#

Krista cant open any browser on the PC bcs it just runs out of potato juice

#

and i wanted to know some basic to to maybe get some juice back

hollow sedge
lusty quest
#

most of the stuff gets installed again if you make a clean windows installation

hollow sedge
#

Oh

#

Nvm then

pure lion
#

i am very stuck'd

#

yes

#

didn't work

#

i can't find the ws latency

lusty quest
#

is it a client property?

#

i know you are on rust but it would make sense for me

pure lion
#

there is but its a struct

#

and on the docs there's no latency under client

#

no ping either

neon heart
lusty quest
#

what framework did you use?

pure lion
#

serenity

stark abyss
#

Hi, when I do node . it doesn't run I have it installed tho

pure lion
#

did you try node index.js?

stark abyss
#

yes

pure lion
#

show me your console

lusty quest
#

what is the output of node -v

stark abyss
#

i did that too

umbral zealot
#

but what did it output

pure lion
#

^

stark abyss
#

v14.15.1

pure lion
#

ah

umbral zealot
#

Ok so node is installed. If you do node . and it outputs nothing it means you don't have code in the .js file that runs.

pure lion
#

what happens when you type in node .

pale vessel
#

it's under shard

stark abyss
#

new line nothing

pure lion
#

send the console output

umbral zealot
#

So, the very first step you need to take SAVE YOUR FILE

pale vessel
#

and it's a method

pure lion
#

flaze

#

wait

hollow rose
#

my bot does not send a welcome message

stark abyss
#

it worked

hollow rose
#

Why

umbral zealot
#

There we go. ๐Ÿ‘

lusty quest
stark abyss
umbral zealot
#

Common issue ๐Ÿ˜„

lusty quest
#

heartbeat is what you look for i guess

stark abyss
#

my bad

lusty quest
#

and there is latency

hollow rose
#

my bot does not send a welcome message why ?

stark abyss
#

code?

lusty quest
pale vessel
#

i'm still waiting dice

stark abyss
#

?dnw

pale vessel
#

why did you ask me to wait

lusty quest
pure lion
#

s

hollow rose
lusty quest
#

idk if its the correct one but looks like to be the only one

umbral zealot
lusty quest
pure lion
#
this function takes 1 argument but 0 arguments were supplied
umbral zealot
#

yay clear english error messages!

lusty quest
#

read what the docs say

pure lion
#

i am

#

asdfgdhgfstryuj

pale vessel
#

did you provide self

#

dslfm,d

pure lion
#

yes

#

adjklghadolst9u4qw90et[GA

pale vessel
#

doodoo

hollow rose
umbral zealot
#

You bot's code. the programming. the lines that you wrote for the welcome message.

hollow rose
#

Java

lusty quest
#

sometimes i wonder how people here get the Developer role

umbral zealot
#

You do realise this is the #development channel, for programmers, and since you're a bot developer, you wrote code, right?

#

Like... the welcome code. what is it?

#

Yeah sometimes it's absolutely mindboggling that someone got their bot approved but have no idea what their code is. Makes you wonder if all they did was submit a clone. lol.

pure lion
#

i tried to pass in:
ctx
&ctx
ctx.shard
&ctx.shard

umbral zealot
#

oh thanks for your token MarioFP

#

Go reset that right away dude. smh.

pure lion
#

@umbral zealot welcome to dbl lad

pale vessel
#

it's not that one

pure lion
#

mm yse

#

the command function has two args, the ctx and the message

#

no self

jaunty surge
#

hi, anyone know how I can write a code for a webhook, like when a user type /hook @jaunty surge (message), the bot will create a webhook with the message.author name and say message, then delete the webhook in one single run

pure lion
#

you were here yesterday

jaunty surge
#

yeah ๐Ÿ˜‚

slender thistle
#

Just

pure lion
#

tsuj

jaunty surge
#

i don't know how to use quick.hook api

slender thistle
#

Use a webhook with different payloads

pure lion
jaunty surge
#

different payload?

slender thistle
#

Re-use one instead of constantly re-creating multiple

#

Webhooks support different names and avatars for each message

pure lion
#

shiv they clearly need to learn js

#

if they cant even read docs

pale vessel
#

you don't even need that package

#

wtf even is that

slender thistle
#

None of my business from here

pure lion
#

written by plexidev

pure lion
#

like really simple

slender thistle
#

I ain't getting in JS devs' business, y'all sort this out yourselves

pure lion
#

look at the docs

slender thistle
#

I'm only explaining the logic

jaunty surge
#

i'm sorry, I just start to use javascript

pale vessel
#

Learn more

pure lion
#

flaaaaaaaaaaaaaaaaaaazzzzz

pale vessel
pure lion
#

hmm

pale vessel
pure lion
#

yeah

pale vessel
#

ok i'm looking at the wrong thing

#

no im not

pure lion
jaunty surge
#

sorry-

pure lion
#

ctx.shard is a shard messenger

pale vessel
#

you want the manager

pure lion
#

i just want the fucking api ping man ooohhhhh

lusty quest
#

do it barebone

pure lion
#

meaning?

lusty quest
#

dont use any mainframe, call the API barebone and then just measure the delay

pure lion
#

ah

#

cba

#

ok who needs api latency anyway

pale vessel
#

no don't give up

pure lion
#

flazepe

#

I'll come back to this when I'm better at rust

pale vessel
#

yeah

#

you're rusty rn

pure lion
#

No giv up forever

pale vessel
#

ok sorr

lusty quest
#

take a break get some sleep and maybe you get an idea

pure lion
#

yeah

#

ma y b e

quick ridge
#

Error [VOICE_CONNECTION_TIMEOUT]: Connection not established within 15 seconds.
why i got this error ?

pure lion
#

you have shit wifi

pale vessel
#

the connection could not established within 15 seconds

quick ridge
pale vessel
#

that's why

lusty quest
#

did you use opus?

quick ridge
pure lion
#

thats too slow

#

smh my head

pale vessel
#

That's slow!!!!!!!!!!!!!!!!!!!!!

quick ridge
pure lion
#

That's slow!!!!!!!!!!!!!!!!!!!!!

lusty quest
#

but it makes the websocket more efficent

quick ridge
#

its was working before

pale vessel
#

try debugging

#

client.on("debug", console.log)

jaunty surge
#

@pure lion i got it work!

#

thank you

gloomy imp
#

Hello, I'm running into a weird error

client.users.cache.get is not actually getting the user, even though the id is 100% right

cinder patio
#

The user isn't cached then

gloomy imp
#

hmm what determines if a user is cached then?

cinder patio
#

Or you are running that piece of code before the client logins

solemn latch
#

Users are cached when there are received via a message or event

gloomy imp
#

I might, but that bit of code has always worked before

solemn latch
#

Intents update changed a lot.

gloomy imp
#

so there was an update

#

hm

solemn latch
#

Yeah, which is why all the docs pages had a notification for like 4 months.

gloomy imp
#

I haven't worked on the bot in like 8 months

lusty quest
#

pretty much everywhere you got announcements on it.

#

did you still use D.js V11?

gloomy imp
#

ah, might not have seen it because this server crashes for me soemtimes

#

I use D.js, not sure version

pure lion
lusty quest
#

V11 is Deprecated and is unable to access the Discord API anymore

#

so make sure to update

toxic raven
#

%sell allbuy

gloomy imp
#

might have auto updated then, because the connection is going through, just various things broke

lusty quest
#

V12 did some breaking changes to the Libary

gloomy imp
#

was removing the userid from GuildMembers one of them?

lusty quest
#

no pretty much everything uses now a cache

#

and other stuff

gloomy imp
#

a

lusty quest
#

better read the d.js docs for all changes

gloomy imp
#

alright..

stark abyss
upper drift
#

I can test here my bot?

stark abyss
#

I am trying to download postgress admin but I don't know which one

upper drift
#

Yeah but how do I test my bot?

stark abyss
#

is your bot in this guild?

upper drift
#

what do you mean?

stark abyss
#

i don't know what you mean

whole ocean
#

@stark abyss i think you want to download x64

stark abyss
#

okay ty

jaunty surge
#

Error: Cannot find module '/app/node_modules/quick.hook/index.js'. Please verify that the package.json has a valid "main" entry how can I fix that. I host this in heroku, I used quick.hook package but it said i don't have valid entry, even though my index.js is in the quick.hook directory inside node_modules

silent cloud
#

Only wait?

stark abyss
#

in json file there should be "main" and see if it's index.js there as well maybe that can help idk

jaunty surge
#

@stark abyss I have index.js and the version inside the package.json too

quartz kindle
#

show your package.json

jaunty surge
#

where do I put it

#

sure

stark abyss
#

your main is bot.js tho

#

not index.js

quartz kindle
#

do you have a bot.js file?

jaunty surge
#

the index.js is like the whole source code for package quick.hook

#

yes

quartz kindle
#

then its all good, you dont need to do anything manualy in quick.hook

jaunty surge
#

do I add bot.js inside quick.hook file?

quartz kindle
#

no

silent cloud
#

Why you using old ytdl?

quartz kindle
#

you should leave quick.hook alone

#

not do anything to it

#

let it install normally when you deploy

jaunty surge
#

@silent cloud i don't use that anymore, I'm just leaving there. ๐Ÿ˜‚

silent cloud
jaunty surge
#

@quartz kindle when I deploy it keep getting the error valid main entry all the time

quartz kindle
#

hmm

jaunty surge
#

@quartz kindle ohh and..

#

it work on the bot that I don't host on heroku, it work while I run terminal on vsc

#

but when I use it on heroku it show me the error

quartz kindle
#

whats the nodejs version in heroku?

#

do node -v from the heroku command line

upper drift
#

I have question, how do I make my bot to speak with custom emojis?

jaunty surge
#

@quartz kindle I don't know about heroku command line

quartz kindle
#

try adding engines to you package.json

#
  "engines": {
    "node": "12.x"
  }
jaunty surge
#

how do you do that

#

ohh you just copy that code in?

quartz kindle
#

yes add it you your package.json

#

for example between dependencies and devDependencies

#

or after description, doesnt matter

jaunty surge
quartz kindle
#

did it make any difference or still broken?

jaunty surge
#

I'm running it, i hope it works..๐Ÿ˜ช

quartz kindle
#

btw are you deploying with the node_modules folder?

jaunty surge
#

the github folder

#

github/mybot/etc(include node_module)

quartz kindle
#

did you put node_modules in your github?

jaunty surge
#

yes

quartz kindle
#

remove it

jaunty surge
#

remove it? will it work on my other package?

quartz kindle
#

node_modules should always be reinstalled from package.json, never moved around

jaunty surge
#

ohh

#

right..

quartz kindle
#

i believe heroku auto installs them from the package.json

sudden geyser
wintry raptor
#

Hello, i think i got braindead or something. Working on i function in node.js that gonna send out true or false if there is something stored under the guild ID in the Databas(mysql) but i cant get that to work. What do i need to search for to find the right stuff for that? ๐Ÿ˜ฆ

jaunty surge
#

@sudden geyser ohh.

lusty quest
#

@wintry raptor a simple if statement could work.

#
if(!myVariable) return false
``` not the most elegant way but it works
jaunty surge
#

@quartz kindle @sudden geyser thanks y'all for helping me, it works!

lusty quest
#

but i think there is even a way to check it within MYSQL (havent used it in a while)

wintry raptor
#

ignore the test =

earnest phoenix
#

you're returning in a callback

wintry raptor
#

just for testing ๐Ÿ˜›

earnest phoenix
#

i.e. you're returning in another function

#

if the package you're using doesn't have an async equivalent of query

#

wrap query in a promise

#

you can use promisify iirc

lusty quest
#

yea

molten yarrow
#

promisify works perfect with mysql, im using it aswell

wintry raptor
#

Never heard about that stuff ๐Ÿ˜› Been working node.js for two days ๐Ÿ˜›

lusty quest
#

without its a bit more annoying since you should query Databases async due to the fact that they cant answer instantly

earnest phoenix
#

mysql is garbage anyways

#

๐Ÿ™ƒ

lusty quest
#

mysql got its use cases

tired panther
lusty quest
#

why the uptime of the bot in your guild stats?

earnest phoenix
#

i think they're bot stats

tired panther
#

thats my debug command, just named it wrong

earnest phoenix
#

but no one will actually care about your bot stats other than you yourself

lusty quest
#

i know a guy who use them to check if he found a way to ddos the bot with commands

tired panther
lusty quest
#

maybe metrics like cpu and ram usage

sudden geyser
#

add stuff your users will care about, not stuff like the join and leave count (assuming that's for your bot and not the sever)

#

users probably don't have interest in ram usage

#

or make some stats specific for nerds

tired panther
tired panther
lusty quest
#

do it overkill and use chart.js to make a graph for the past ram usage

#

cpu and ram usage are metrics

sudden geyser
#

looks like a stats command only but aight

lusty quest
#

its not a joke. you could use a time series database and Grafana to make a nice metrics display for your bot

#

iirc brain got one

tired panther