#development
1 messages ยท Page 1414 of 1
still i didn't uff
Its slow, its big, its easily corruptible
can't help you then
you will have to understand how documentations work
Don't use json
we don't spoonfeed here if that's what you want
switch to literally anything other than json
look at quick.db
just not json
please
you will cry
json 

I'm glad that json parsing on java is aids 
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?
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.
sqlite is also a great option
What will be the fastes? ๐
depends what your bot does
Making temporary channels. ๐
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
both quick.db and enmap are based on sqlite btw - they're not databases, they're wrappers.
do quick.db really require Python to be on your OS?
sqlite needs to be compiled, so yes
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.
this is bs
lmao
Why? It's super simple to install.
RIP 20MB...
If you're worried about 20mb of space, you've got bigger problems than requiring python.
yeah uh im gon buy a 970 evo once I filled my 128gb drive 100%
its all programs
imagine running a program from google drive
its an ssd
i have an hdd of 1 tb
is the hdd also full?
then move some programs to it
its slow
i will convert the bot to a SQL ๐ Thank for the help ๐
who cares, most programs dont need that much speed
i run games from my hdd
and leave ssd only for important shit
ooh
what could be more important than helltaker????
Is there a way that I can just right click my folder then > open in VS code
its kinda frustrating opening it
code .
That option was there on installation, not sure if you can put it back
disk speed will mostly affect loading times, once the program is in memory its speed will be the same
from the terminal
but yes, code . in any folder opens vscode in that folder.
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();
@finite nimbus there was a gateway timeout
okey but how to fix it?
catch some errors
Uhh
It's discord.js issue
manager.on("error")
wut
yes, so you catch the error and have a look at ways you can fix it
are you using fetchAllMembers:true?
@carmine summit what did you dO
npm i quick.db
right thanks
No
add client.on("debug",console.log) to your shard file
and see what the logs say
you have bot.js
And bot.js - bot file
okey
ran it, same error
is this "finish"?
nope, its still installing
o
wait until it says ALL DONE
oki
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
whats your discord.js version?
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
v12
there is no v13 yet wtf

๐
is node up2 date?
No
where are you hosting? heroku?
heroku
paid or free?
show us your package.json
fetchAllMembers: true, sync: trueAdd it to bot options?
I can tell you my discord.js version without sending package
free
not sure if it will manage to run 2 shards
the package json may have more information that can be useful
"discord.js": "^12.3.1",
whats the node.js version in engines?
12.x
why is it taking so long 
Because it's a complex thing it has to install
I've seen this take 15-20 minutes on older machines
build tools?
ive seen it take 40+min xD
try updating discord.js to 12.5.1
otherwise there is not much else we can do, there is not enough information
would need to see more logs
finally ita all done
need to see more logs then
hastebin it please
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.
what happens if -g
Yeah but its from dblapi.js
That's a lot of commands
that would indicate you have an incorrect dbl token inserted.
okey wait i will remove dbl api
or just, y'know, fix the token ๐
why is process.env.TOKEN undefined?!?!
.env
TOKEN=ohhellothere<insertwaveemojihere>
package.json
"dotenv": "^8.2.0",
did you require("dotenv").config() ?
yes
the "" ensures the entire thingy is passed in if there are any spaces or #s etc
no. This is not javascript.
env files do not use quotes.
i used quotes
bruh
it worked
lmao
it doesnt need quotes
case and point PREFIX="nya "
that's literally the same error, so... still the wrong token?
huh wait
shit. I've been wrong for years apparently. wtf.
yes.
any decent vps host will beat any free host
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
I know, and i want to fix that error
so I'm still having a rust issue when trying to install the request crate
why sharding with 44 Guilds?
100
error: failed to run custom build command for `openssl-sys v0.6.7
i have 300 and only 1 shard
๐คทโโ๏ธ
its possible that your host cant handle a 2nd shard. does it worked before?
hm
Shit, Iโm almost at 60 guilds in less than 12 hours. I may want to verify this
if you grow to fast you get flagged and then wait until you have 250 Guilds
wait but how would it grow past 100
It wouldnโt
ohh wait this where before october nvm
lma9
why dont you
//returned object```
look
look
;-;
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
Use Array.isArray()
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
@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.
@sudden geyser well how did you install it anyway?
I just plopped it in Cargo.toml and used it like so. I don't see the error in your case.
car go
Are you sure, I used to do it like that.
Unless it was the "^"
well what is the actual error
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).```
See if the building section in the documentation is helpful: https://docs.rs/openssl/0.10.30/openssl/#building
API documentation for the Rust openssl crate.
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
Yes, but that does not mean you won't hit an error like that. For example, not having OpenSSL
apt install openssl you say
Make it not open a new tab?
yes
You're using <a id=""> right?
yes
Then there's probably a target="_blank" somewhere that you should remove
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.
I don't think the issue is with _blank or it might be the issue but not on my end. The thing is I have placed the scroll method inside my code which is in the child body of the site. The div where it should redirect is in the parent body. The anchor tag is in my code.
Is it in your bot description?
yes dear
Krista for the most part, searching up the error brings up posts saying, "did you install openssl correctly" or "try upgrading your package version"
yup yup ๐
Are you using an iframe?
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
How can I get the output we printed with console.log in the eval command?
like that
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
are you doing it as an embed field name?
yes
in description ?
field value
it may be better to get the current time in MS before the message was sent, then after it was sent: https://stackoverflow.com/a/44378174/14695788
Alright
what's the most common port used for the dbl api?
nice
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
anyone
where are you placing it
yes
field title or field value
if its in field it won't work
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?
then where will it work
field value will work, field title won't because it doesn't support markdown
It's field value
๐ค
in desc
show your code
try in description
i need help too
๐
embed.add_field(name="Test", value="[Click Here](link hidden)", inline=False)
make sure the link is a valid link
it is
discord invitation link
valid 101%
works even with inv links
it's even functional
so you must be providing an invalid url
pussygrabber
what about redis database, anyone would recommend that?
I like mysql the most for now
from my personally experience, sqlite for small scale and postgresql for large scale
avoid mysql at all costs
really?
it's also garbage
what O:
postgresql is good, I agree, I wasnt sure which one to pick, but I heard that big companies like to use mysql
hmm
they only use it because their software is built in the dinosaur age
yeah, that makes sense
is MariaDB any better or no
kind of
It is, yes
Eh MySQL doesnโt disconnect if you use pools
i liked maria more than mysql
At least not for me
with flask how can i get the value of checkboxes when theyre updated without the person having to press a submit button
No clue what flask is but using JS to trigger onchange works well.
you have no clue what flask is? It is like express js but in python
does onchange capture the status
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
You can check the current state via. JS if onchange got triggered
yes, but can i get the state via onchange?
or do i need my own thing?
(website => somethat that you can open with your browser => browser => a programm on your computer)
huh wut? you're speaking about a checkbox on your website?
Ah okay
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?
why would you need your own system for that
Bc it's like for modules
Yes you can, instead of using onchange you can use onclick, check if the checkbox is checked (using JS) and send your request
So I need to see if it's checked or not
Onclick got it
Onclick I have a js function
But how would I see if it's checked? Sorry I'm not too smart lmao
You can use onclick or native JS adding an eventlistener on your checkbox
I know onclick
let box = document.getElementById('elementid');
box.addEventListener('change', function(event)
{
if(event.target.checked)
{
// haha checked
}
});
But onclick sends post request
Wait my brain hurts
I don't know any js
So bear with me lol
Can but no, they should not
So i need like a function for each?
That destroys the definition of an unique ID
For each checkbox?
errr... you're speaking about multiple checkboxes?
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
Mhm
You should think about the possible abuse, JS is not server sided
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?
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
well however u like, lol
but sending a request each time the element changes can result in a huge abuse
it requires a little more work, pressing the submit butten and hammer F5 will result in the same spam
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
I'm sure a lot of code snippes will explain how to supress form spam
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
I'm torn, hyper or reqwest?
Yo guys
Why when i using play command now it have this error
Error: Error parsing info: Unable to retrieve video metadata
reqwest if you don't care about your build time & dependency tree going up
hyper if you care about it
or minireq
reqwest time brrrrrr
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';
}
};
@honest perch why are you splitting args with that
why not
isnt it already an array
no
ah
does it throw pp or an error?
it returns true
yes
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
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
console.log args a sec
now im getting ```
Error: TypeError [ERR_INVALID_ARG_TYPE]: The "request" argument must be of type string. Received undefined
it's undefined
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
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.
well, the commands are a collection
Maybe log args[0] and args[1] and make sure they're what you expect.
Ooo
args seems to be a string...? weird
Yo
Somebody can help with ydtl? Error: Error parsing info: Unable to retrieve video metadata
yes because my brain isnt functioning
How are you defining args in your message.js event?
You have to replace the old command in the collection with the new one
that doesnt matter, as its not using anything from the message event
So what's passing args then? How is this file called?
its just client.reload = require('./reload'); args is just a string
just evaled with client.reload('file filenamehere')
You have to replace the old command in the collection with the new one
it calls the file
All your commands are stored in the collection, when you delete the require.cache for the file you only delete it from there
this requires it and does nothing with it
not from the collection with the commands
and also you don't add the new, edited command inside the collection
ok, nvm im going on a walk, thanks for the help anyway
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.
You're supposed to use that SystemTime::now() logic for both timestamps, not just one.
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.
An idea ?
Uncaught TypeError: Cannot read property 'author' of undefined
whatever you tried accessing .author on is undefined
How do I setup lavalink on Ubuntu
Run jar file
How i can fix it? Discord.js YTDL module
Error: Error parsing info: Unable to retrieve video metadata
Just run the jar file
How would I use oldMember and newMember to see if someone's role gets changed in discord.js?
It was fixed in latest update
Update to latest version
Lib?
Already, but doesnt working
What?
Wats the lib
Try uninstalling and installing again
K, give me a sec
K
discord.js
Can't help ya
It was fixed for me in latest update so it should work for you
oHHhHhHh
doesnt work
its expecting std::time::SystemTime but getting chrono utc thingy
Still not working
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```
displayGuildURL 
...
Don't make up your own property names
it's iconURL()
Read docs https://discord.js.org
time to ping lite again 
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)
})```
@sudden geyser yoooooooo
yo
roles.fin() ๐ฟ
even the deprecated signature
That is some old old old code
member.username find("a", "a") roles.find()
those are old
addRole()
Damn
oof
Sooo
Somebody can help?
Error: Error parsing info: Unable to retrieve video metadata
.-. Iโm not used to embeds
Discord.js
so the issues are that it cant interpret the i64 timestamp as a SystemTime
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()
i just want to give role when join server
member.roles.add('782009098358751232');
})```
yeah
it exist
if it doesnt
it exist
No error?
no nothing
how many people are using your bot?
no spoon

for my server
ok makes sense
Bruh...
You know why my bot crashes every time I write a message
@silent cloud have you updated ytdl-core to latest?
where is that error being thrown from?
From module._.
who
play.js line 36?
is there a song.url?
Users gives it when using: *play (songURL)
Either the ytserach cant find anything oe u get rate limited or u code is wrong
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
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??
@earnest phoenix are you using mongoose?
yeah
you can make the default for the field null
and it wont auto generate?
seems like it still saves a empty array
whats the issue with it initialising an empty array?
one second
I'm planning to increase it
so much arrays creating is gonna eat lots of data
hmm... But i still need to do something with the arrays ๐ค
dont add it in your base schema you can add additional stuff later (this is the beauty of NOSQL)
wdym not add?
My idea is to not generate those arrays and the start but when they are needed i want to initialize them
you can add stuff to any document as you like
MongoDB is not bound to a schema like mysql
hmm
it's mongoose
you can still add stuff later on
and it doesn't need to be in the schema right?
and mongoose is just a client to connect to a mongodb database

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
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
cuz i for example only need the array of prefix cuz a admin decided to add a prefix
you know a dependencies like puppetter to make some kind of screenshots
sure but why?
but i don't want others to create since there is no need
Yes, Puppeteer
other of puppeteer
I don't think so
if you need them later then there is a need
You need a browser to take a screenshot
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
So it needs to be a browser or a headless one at least
also why a array for prefix? did you want to allow mutiple prefix?
i have multi prefix feature
then start the array with the default prefix
or make the array empty by default
how can i get the client ws ping time in serenity, cant seem to find it in the docs
then i dont get why you get stuck on it
ok ig ill store the arrays
Dice you said you "read"
no pc handy?
lol why?
2nd gen i5 from 10 years ago moment
i know a guy who uses an i5-2500 and he has little issues opening a browser
did you run any 3rd party Anti Virus software?
3rd party Anti virus software eats your performance
poo
also did you use windows 10? if yes use the win 10 debloater script to remove the crap that is installed
oki
API documentation for the Rust Shard struct in crate serenity.
just use linux bruh
i meant Crazy Shooting
me confused rn
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
This is only if you bought a computer preinstalled with it
most of the stuff gets installed again if you make a clean windows installation
there is but its a struct
and on the docs there's no latency under client
no ping either
this is problem from ytdl-core-discord
what framework did you use?
serenity
Hi, when I do node . it doesn't run I have it installed tho
did you try node index.js?
yes
show me your console
what is the output of node -v
i did that too
but what did it output
^
v14.15.1
ah
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.
what happens when you type in node .
it's under shard
new line nothing
send the console output
So, the very first step you need to take SAVE YOUR FILE
and it's a method
my bot does not send a welcome message
it worked
Why
There we go. ๐
API documentation for the Rust Shard struct in crate serenity.
it worked i didn't save file lol
Common issue ๐
heartbeat is what you look for i guess
my bad
and there is latency
my bot does not send a welcome message why ?
code?
some more informations. like errors, code snipets
i'm still waiting dice
?dnw
why did you ask me to wait
API documentation for the Rust Shard struct in crate serenity.
s
the bot does not send anything nor an error message
idk if its the correct one but looks like to be the only one
show your code
code snipet
this function takes 1 argument but 0 arguments were supplied
yay clear english error messages!
read what the docs say
doodoo
what do you mean what code
You bot's code. the programming. the lines that you wrote for the welcome message.
Java
sometimes i wonder how people here get the Developer role
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.
i tried to pass in:
ctx
&ctx
ctx.shard
&ctx.shard
@umbral zealot welcome to dbl lad
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
yeah ๐
Just
tsuj
i don't know how to use quick.hook api
Use a webhook with different payloads
The docs couldn't be clearer
different payload?
Re-use one instead of constantly re-creating multiple
Webhooks support different names and avatars for each message
None of my business from here
written by plexidev
apparently a simple way to send webhooks
like really simple
I ain't getting in JS devs' business, y'all sort this out yourselves
look at the docs
I'm only explaining the logic
i'm sorry, I just start to use javascript
Learn more
flaaaaaaaaaaaaaaaaaaazzzzz
API documentation for the Rust ShardRunnerInfo struct in crate serenity.
hmm
context has this
yeah

sorry-
https://docs.rs/serenity/0.5.2/serenity/client/struct.Client.html#structfield.shard_manager
https://docs.rs/serenity/0.5.2/serenity/client/bridge/gateway/struct.ShardManager.html#structfield.runners
https://docs.rs/serenity/0.5.2/serenity/client/bridge/gateway/struct.ShardRunnerInfo.html#structfield.latency
idk man
ctx.shard is a shard messenger
you want the manager
i just want the fucking api ping man 
do it barebone
meaning?
dont use any mainframe, call the API barebone and then just measure the delay
no don't give up
No giv up forever
ok sorr
take a break get some sleep and maybe you get an idea
Error [VOICE_CONNECTION_TIMEOUT]: Connection not established within 15 seconds.
why i got this error ?
you have shit wifi
the connection could not established within 15 seconds
๐ฎ
that's why
did you use opus?
its vps 1gb download 1gb upload
That's slow!!!!!!!!!!!!!!!!!!!!!
in my country its not
you dont need opus for that
That's slow!!!!!!!!!!!!!!!!!!!!!
but it makes the websocket more efficent
its was working before
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
The user isn't cached then
hmm what determines if a user is cached then?
Or you are running that piece of code before the client logins
Users are cached when there are received via a message or event
I might, but that bit of code has always worked before
Intents update changed a lot.
Yeah, which is why all the docs pages had a notification for like 4 months.
I haven't worked on the bot in like 8 months
ah, might not have seen it because this server crashes for me soemtimes
I use D.js, not sure version
:)
V11 is Deprecated and is unable to access the Discord API anymore
so make sure to update
%sell allbuy
might have auto updated then, because the connection is going through, just various things broke
V12 did some breaking changes to the Libary
was removing the userid from GuildMembers one of them?
a
better read the d.js docs for all changes
alright..
I can test here my bot?
I am trying to download postgress admin but I don't know which one
not this channel go -->#commands
Yeah but how do I test my bot?
is your bot in this guild?
what do you mean?
i don't know what you mean
@stark abyss i think you want to download x64
okay ty
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
So, what i can do with this?
Only wait?
in json file there should be "main" and see if it's index.js there as well maybe that can help idk
@stark abyss I have index.js and the version inside the package.json too
you're not supposed to put your index.js in there
show your package.json
do you have a bot.js file?
then its all good, you dont need to do anything manualy in quick.hook
do I add bot.js inside quick.hook file?
no
Why you using old ytdl?
you should leave quick.hook alone
not do anything to it
let it install normally when you deploy
@silent cloud i don't use that anymore, I'm just leaving there. ๐
@quartz kindle when I deploy it keep getting the error valid main entry all the time
hmm
@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
I have question, how do I make my bot to speak with custom emojis?
@quartz kindle I don't know about heroku command line
yes add it you your package.json
for example between dependencies and devDependencies
or after description, doesnt matter
@quartz kindle i added it here
did it make any difference or still broken?
I'm running it, i hope it works..๐ช
btw are you deploying with the node_modules folder?
did you put node_modules in your github?
yes
remove it
remove it? will it work on my other package?
node_modules should always be reinstalled from package.json, never moved around
i believe heroku auto installs them from the package.json
keep in mind, you don't need a package for everything
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? ๐ฆ
@sudden geyser ohh.
@wintry raptor a simple if statement could work.
if(!myVariable) return false
``` not the most elegant way but it works
@quartz kindle @sudden geyser thanks y'all for helping me, it works!
but i think there is even a way to check it within MYSQL (havent used it in a while)
you're returning in a callback
just for testing ๐
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
yea
promisify works perfect with mysql, im using it aswell
Never heard about that stuff ๐ Been working node.js for two days ๐
without its a bit more annoying since you should query Databases async due to the fact that they cant answer instantly
mysql got its use cases
Some infos , I should add?
why the uptime of the bot in your guild stats?
i think they're bot stats
thats my debug command, just named it wrong
but no one will actually care about your bot stats other than you yourself
i know a guy who use them to check if he found a way to ddos the bot with commands
just wanted to know, If I should add other info
maybe metrics like cpu and ram usage
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
cpu, ram yes, whats metrics
thats just for bot devs
do it overkill and use chart.js to make a graph for the past ram usage
cpu and ram usage are metrics
lol xD
looks like a stats command only but aight
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
yes, thats way I have a panel





