#development

1 messages · Page 732 of 1

shy turret
#

the person who ban the user or the person banned?

grim aspen
#

the user who was banned

summer torrent
#

^

earnest phoenix
#

guild.user.username?

shy turret
#

how do you get the person who kicked/banned the user?

#

im gonna go afk for a bit

#

i should read docs again soon

earnest phoenix
#

Okay i search

indigo geyser
#

@shy turret you have to watch the audit log

earnest phoenix
indigo geyser
jovial idol
split hazel
#

I have zlib-sync installed

unique nimbus
#

Depends on bot usage and what it does however I don't know how it can reach that much unless the CPU is shit

split hazel
#

Cpu defo isn't bad

#

5ghz 16 core

summer torrent
#

@shy turret fetch executor from audit logs

#
const entry = await guild.fetchAuditLogs({ type: "MEMBER_BAN_ADD" }).then(audit => audit.entries.first());
let moderator = await guild.members.get(entry.executor.id);```
#

like this

earnest phoenix
#

This is nice

grave mist
#

I'm getting this error. Anyone know why?

#
Error: Client network socket disconnected before secure TLS connection was established
    at TLSSocket.onConnectEnd (_tls_wrap.js:1213:19)
    at Object.onceWrapper (events.js:281:20)
    at TLSSocket.emit (events.js:198:15)
    at endReadableNT (_stream_readable.js:1139:12)
    at processTicksAndRejections (internal/process/task_queues.js:81:17)
  code: 'ECONNRESET',
  path: null,
  host: 'discordbots.org',
  port: 443,
  localAddress: undefined }
earnest phoenix
grave mist
#

Whatever it is, just help me with the error if you can

scenic kelp
#

Also @grave mist that means that the request didn't make it through

earnest phoenix
scenic kelp
#

do you have a firewall or something?

grave mist
#

Nope

#

@earnest phoenix WHERE DO I USE IT

earnest phoenix
grave mist
earnest phoenix
scenic kelp
earnest phoenix
#

Omfg

grave mist
#

I just use the api

#

I don't put site name anywhere on code

earnest phoenix
#

Please make a request directly to top.gg

grave mist
#

Yea it does

scenic kelp
#

by api do you mean a library/module/package?

grave mist
#

Bro I'm not making any requests

scenic kelp
#

because 'api' means on their end

grave mist
#

Wait let me check the code wait

scenic kelp
#

if you're not making any requests then there's a package that's doing it

grave mist
#

I use this api

earnest phoenix
#

@scenic kelp library/module/package = Wrapper

grave mist
#

I mean package

#
const DBL = require("dblapi.js");
scenic kelp
#

meh

#

yeah that's the culprit

grave mist
#

Did they change the package too?

#

Whe

#

n

scenic kelp
#

nope tonkku hasn't updated it

earnest phoenix
#

The package Not up to date

#

Yes

scenic kelp
#

I can make a pull request real quick

earnest phoenix
#

Ty

scenic kelp
#

nvm he's already done it

earnest phoenix
#

You're a lifesaver smirk

grave mist
#

So what should I do now

earnest phoenix
#

Hmmm

#

@grave mist make an update: npm i dblapi.js

grave mist
#

K

quartz kindle
sudden geyser
quartz kindle
#

i havent updated my dbl code in like a year and it sill works

#

so the old domain still works

earnest phoenix
quartz kindle
#

yeah its better, but shouldnt crash because of that

grave mist
#

This is the error

#
Error: Client network socket disconnected before secure TLS connection was established
    at TLSSocket.onConnectEnd (_tls_wrap.js:1213:19)
    at Object.onceWrapper (events.js:281:20)
    at TLSSocket.emit (events.js:198:15)
    at endReadableNT (_stream_readable.js:1139:12)
    at processTicksAndRejections (internal/process/task_queues.js:81:17)
  code: 'ECONNRESET',
  path: null,
  host: 'discordbots.org',
  port: 443,
  localAddress: undefined }
earnest phoenix
#
  code: 'ECONNRESET',
  path: null,
  host: 'discordbots.org',
  port: 443,
  localAddress: undefined }
#

...

quartz kindle
#

that doesnt matter

earnest phoenix
#

@grave mist you're bot is in a vps?

grave mist
#

No in glitch but that isn't the problem cuz I have another bot that runs perfectly fine

earnest phoenix
#

does it use dbl's api?

grave mist
#

The another bot?

earnest phoenix
#

yeah

grave mist
#

Yea it uses it

earnest phoenix
#

weird then

quartz kindle
#

whats the node version in your package.json?

grave mist
#

11.x

#

In both bots

#

And the code of dblapi changes here

#

Does that cause the error?

quartz kindle
#

are both bots in the same glitch project? or two separate projects?

grave mist
#
 { webhookServer: server, webhookAuth: 'abc' }, client);
#

Separate

quartz kindle
#

hmm, try disabling the webhook to see if the problem stops

#

btw is your server http or https?

#

you use it for uptime robot?

grave mist
#

Yea

#

http

quartz kindle
#

if the problem is on the webhook, thats probably why, but if the problem is when POSTing then not

shy turret
#

@summer torrent thx, how do you detect on new audit msg?

quartz kindle
#

so try running it without the webhook

summer torrent
#

msg?

quartz kindle
#

to see if the error continues

vital lark
#

dont think you can do that

grave mist
#

k wait

shy turret
#

log*

#

wait

#

i got a better idea

#

for myself

grave mist
#

Still getting

#

As two errors with host name only different

quartz kindle
grave mist
#

Yea it does

#

But no replies

quartz kindle
#

can i see your full code?

grave mist
#

Full code of what?

#

Like which part

quartz kindle
#

main file probably, where all the servers, connections, webhooks, logins are done

#

also your package.json

grave mist
#
const http = require('http');
const express = require('express');
const app = express();
const db = require('quick.db');
app.get("/", (request, response) => {
  response.sendStatus(200);
}); 
setInterval(() => {
  http.get(`http://${process.env.PROJECT_DOMAIN}.glitch.me/`);
}, 80000); 
const server = app.listen(process.env.PORT)
const Discord = require("discord.js");
const client = new Discord.Client({ disableEveryone: true })
const DBL = require("dblapi.js");
const dbl = new DBL('a', client);
dbl.on('posted', () => {
})
``` that's enough of mail file I guess
#
{
  "scripts": {
    "start": "node index.js"
  },
  "dependencies": {
    "axios": "^0.19.0",
    "better-sqlite3": "^5.0.1",
    "bindings": "^1.3.0",
    "blapi": "^0.4.5",
    "canvas": "^2.6.0",
    "canvas-constructor": "^1.1.2",
    "cleverbot.io": "^1.0.4",
    "cpu-stat": "^2.0.1",
    "cpu-stats": "^1.0.0",
    "dblapi.js": "^2.3.0",
    "discord.js": "^11.5.1",
    "expres": "^0.0.5",
    "express": "^4.16.4",
    "ffmpeg": "0.0.4",
    "figlet": "^1.2.0",
    "fortnite": "^4.1.1",
    "google-tts-api": "^0.0.4",
    "isgd": "^1.1.3",
    "memejs": "^1.0.7",
    "memjs": "^1.1.0",
    "minimist": "^1.2.0",
    "moment": "^2.22.2",
    "moment-duration-format": "^2.2.2",
    "nekos.life": "^2.0.2",
    "node-gyp": "^3.8.0",
    "node-opus": "^0.3.2",
    "opus-encode": "^2.0.2",
    "os": "^0.1.1",
    "parse-duration": "^0.1.1",
    "parse-ms": "^2.0.0",
    "path": "^0.12.7",
    "pm2": "^3.2.8",
    "pretty-ms": "^4.0.0",
    "quick.db": "^6.2.0",
    "relevant-urban": "^2.0.0",
    "simple-youtube-api": "^5.1.1",
    "strict-uri-encode": "^2.0.0",
    "superagent": "^3.8.3",
    "weather-js": "^2.0.0",
    "ytdl-core": "^1.0.0"
  },
  "engines": {
    "node": "11.x"
  },
  "license": "MIT",
  "author": "Awesome Stickz"
}
#

A lot there tbh

#

@quartz kindle

quartz kindle
#

do you use axios for anything?

#

or superagent

grave mist
#

Yea, like only 1 time of each of them

#

I guess I found the thing that goes wrong

#

Both discordapp.com and discordbots.org uses TLS 1.3 and some said that node 10.x and higher uses TLS 2.3 so it can't do what it needs to. I switched to node 9.x to look it

quartz kindle
#

TLS 2.3 doesnt exist

grave mist
#

That's what someone in this post said

#

Shit

quartz kindle
#

this error happens when trying to connect to a TLS 1.0 website, with node 10+, because TLS 1.0 is deprecated for being insecure

grave mist
#

And yea, bot doesn't respond and error came

quartz kindle
#

current standard is TLS 1.2 or preferably TLS 1.3

#

but that would make it a server side problem if it were the case

#

and we are sure this is not the case, else the server would be throwing this error to everyone using node 10+

grave mist
#

Ok so, what else is the problem

quartz kindle
#

he probably mistyped TLS 1.3 lol

grave mist
#

I see

quartz kindle
#

i dont know what the problem is, but i can see you have a whole load of packages installed that you might not be using/needing

grave mist
#

Yea maybe

quartz kindle
#

although its unlikely that will fix the problem, you could probably do well with a cleanup

grave mist
#

Made it an year ago

quartz kindle
#

for example, you have a package called expres ?

grave mist
#

Yea'

quartz kindle
#

with is probably a mistake

grave mist
#

expres or express

quartz kindle
#

and both axios and superagent can basically do the same things

#

so having both is kinda redundant

#

express is the webserver
expres is idk what

grave mist
#

Yea looks like expres I added without seeing

quartz kindle
#

you probably dont need pm2 on glitch

grave mist
#

Yea I was using it on vps

#

But even after I clear these things, the error goes away?

quartz kindle
#

probably not

#

im still thinking what can be the cause

#

let me take a look at the dbl source code

grave mist
west raptor
#

hello, i'm having some issues
I have an iter called members_iter and there is a method on it called filter which is what it sounds like

well when I do: rs let bc = members_iter.filter(|m| m.user.read().bot).collect::<Vec<Member>>().len(); it doesn't work but this does: rs let bc = members_iter.filter(|m| !m.user.read().bot).collect::<Vec<Member>>().len();

#

the difference being the !

#

here the whole function for anybody wondering: ```rs
fn get_member_counts(ctx: &Context, guild: &Guild) -> (usize, usize) {
let members_iter = guild.members(&ctx.http, None, None).unwrap().into_iter();

let bc = members_iter.filter(|m| m.user.read().bot).collect::<Vec<Member>>().len();
let uc = guild.member_count as usize - bc;

(uc, bc)

}```

quartz kindle
#

@grave mist does the discordbots error always appear when you start your bot?

grave mist
#

Yea after like 2 mins

quartz kindle
#

only after 2 mins?

grave mist
#

Then bot restarts

#

And loops

#

I'm not sure

#

Let me check wait

quartz kindle
grave mist
#

It happens in same minute

#

What you mean

quartz kindle
#

try removing that interval to see if the error still happens

grave mist
#

That interval is to make bot project alive I guess

quartz kindle
#

yup, but its possible that its actually killing it instead of keeping it alive

#

if you want you can also set the timer lower, to like 30k, and see if the crash happens sooner lol

grave mist
#

Ok I removed interval

#

Let me check

#

Bot no respond

#

No error too

#

Ok it came

#

1 min after start

quartz kindle
#

do you have .catch() on your .login() ?

#

and client.on("error")?

grave mist
#

No

#

Like I said, bot logins and changes status

#

But not responding

quartz kindle
#

can i see your ready event?

grave mist
#

And then error occurs, it goes off and comes on

#

I have lots of things in it

#

Nothing related to http tho

quartz kindle
#

so the bot never responds to any message? but the ready event works?

grave mist
#

Yea

quartz kindle
#

so lets check the ready event

grave mist
#

What you wanna check in it

#

It logs things to console

#

Then uses function that changes status after a particualr time

#

It changes as long as the bot is alive

quartz kindle
#

any possible infinite loop or otherwise bot breaking things

grave mist
#

Nope bro cuz it was working fine before a week and I didn't change any code too

quartz kindle
#

if you want, try running a barebones test, just the discord client, a ready event and a simple message event

#

if that works, then the problem is somewhere in your code

grave mist
#

K I'll check later I have to sleep now

quartz kindle
#

👍

grave mist
#

Or you can look into my code?

west raptor
#

I'm still really confused

quartz kindle
#

sorry, i dont know rust, but if you're trying to filter bot users out of the iter thing and if ! also means NOT in rust, it should make sense to filter by not being a bot?

west raptor
#

i want to return the bot count and the member count (without bots included)

quartz kindle
#

so member count works, but bot count returns 0?

west raptor
#

correct

#

when im NOT checking for bots i works but it doesnt when I am

#

which is confusing me

quartz kindle
#

have you tried with !! ?

west raptor
#

members_iter.filter(|m| !m.user.read().bot).collect::<Vec<Member>>().len(); returns 1 with a server of 4 and 3 bots

#

uh

#

lemme try

tranquil drum
#

@west raptor why m.user.read().bot

#

shouldn't it be m.user.bot?

west raptor
#

No

#

Member#user had the type Arc<RwLock<User>>

#

@quartz kindle Didn't work

earnest phoenix
#

what library is this, if you don't mind me asking?

west raptor
#

serenity

tranquil drum
#

oh then do you need to unwrap() the read()

west raptor
#

I'm pretty sure not

tranquil drum
#

unwrap() after read()

west raptor
#

oh

#

wait

tranquil drum
#

since read() returns a Result

west raptor
quartz kindle
#

any way to log m.user.read().bot ?

west raptor
#

uh

quartz kindle
#

to make sure its actually returning booleans?

tranquil drum
#

wtf

west raptor
#

but the thing is members_iter.filter(|m| !m.user.read().bot).collect::<Vec<Member>>().len(); works

#

but members_iter.filter(|m| m.user.read().bot).collect::<Vec<Member>>().len(); doesnt

tranquil drum
#

when you say it works do you mean as intended

west raptor
#

yes

tranquil drum
#

oh

west raptor
#

members_iter.filter(|m| !m.user.read().bot).collect::<Vec<Member>>().len(); is 1 as it should be

quartz kindle
#

i mean, i dont know rust, never used it before, but from what i've read, .filter takes a boolean, and the only explanation i can think of is that .bot might not be returning a boolean for some reason

tranquil drum
#

what does members_iter.filter(|m| m.user.read().bot).collect::<Vec<Member>>().len(); return?

west raptor
#

0 lol

#

when 3 bots are in the server

#

@quartz kindle i dont see why it wouldnt return a bool

quartz kindle
#

idk, the library could be broken

#

hence why i asked if its possible to log it lol

west raptor
#

well considering the way rust is bot must return a bool

#

if it was returning an err rust would surely let me know

quartz kindle
#

could it be returning false for bots for some reason?

west raptor
#

if it was returning false then it would return 4

quartz kindle
#

yeah true

#

any way to check the pseudo-result of the filter function without collecting/refining/digesting/whatever it is that it does after the filter?

west raptor
#

well yes

#

I can see the return is after the collect

tranquil drum
#

could be that guild.members just doesn't have any bots in it

west raptor
#

possibly lemme log that too

shy turret
#
client.on('roleUpdate', async (oldRole, newRole) => {
  try {
    console.log(oldRole.name)
    console.log(newRole.name)
    let guild = client.guilds.get(newRole.guild.id);
    const entry = await guild.fetchAuditLogs({ type: "GUILD_ROLE_UPDATE" }).then(audit => audit.entries.first());
    let user = await guild.members.get(entry.executor.id);
    console.log(user)
    if (user == topsecretbotid) return;
    let name = newRole.name
    if (config[name] !== undefined) {
      let role = guild.roles.get(newRole.id);
      role.edit({
        data: {
          name: oldRole.name.toString()
        }
      })
    }
  } catch(err) {
    console.log(err)
  }
});

this likes to spam my console

tranquil drum
#

i mean you have 4 console.log()

quartz kindle
#

one of them being a full User object

shy turret
#

no like...

#

if i only add 1 console.log(), it keeps looping

#

let me remove console.log(user)

quartz kindle
#

well

#

you edit a role

#

during a roleUpdate

tranquil drum
#

you're editing the role in the roleUpdate

#

lol

quartz kindle
#

so your roleUpdate causes a new roleUpdate and loops infinitely

#

lmao

shy turret
#
    const entry = await guild.fetchAuditLogs({ type: "GUILD_ROLE_UPDATE" }).then(audit => audit.entries.first());
    let user = await guild.members.get(entry.executor.id);
    console.log(user)
    if (user == topsecretbotid) return;
#

if (user == topsecretbotid) return;

quartz kindle
#

is topsecretbotid the id of your bot?

shy turret
#

wait

#

no

#

im actually dumb

west raptor
#

@tranquil drum hmm you're right

#
Ok([Member { deaf: false, guild_id: GuildId(643218138506461227), joined_at: Some(2019-11-10T22:39:14.639+00:00), mute: false, nick: None, roles: [RoleId(643227058910003200)], user: RwLock { data: User { id: UserId(257521982021566464), avatar: Some("fc512e91d1c82e32024028adaa57cd81"), bot: false, discriminator: 9, name: "Dream", _nonexhaustive: () } }, _nonexhaustive: () }])```
shy turret
#

topsecretbotid is something else

#

"bot id"

#

it's a variable

west raptor
#

i dont know why though

#

is the question

shy turret
#

audit log isnt updating so im guessing it is something else

tranquil drum
#

@west raptor what if you try guild.members()

west raptor
tranquil drum
#

oh

#

there's also a members field

west raptor
#

oh?

tranquil drum
#

maybe try that then lol

west raptor
#

I only saw a method

#

im blind

tranquil drum
quartz kindle
#

so members() is basically for fetching members from api

#

interesting to have properties/fields with the same name namespace as methods lul

shy turret
#
client.on('roleUpdate', async (oldRole, newRole) => {
  try {
    let guild = client.guilds.get(newRole.guild.id);
    const entry = await guild.fetchAuditLogs({ type: "GUILD_ROLE_UPDATE" }).then(audit => audit.entries.first());
    let user = await guild.members.get(entry.executor.id);
    if (user == 645706703354068992) return;
    let oldname = oldRole.name
    let newname = newRole.name
    let role = guild.roles.get(newRole.id);
    if (config[oldname] !== undefined) {
      role.edit({
        data: {
          name: oldRole.name.toString()
        }
      })
      return;
    }
    if (config[newname] !== undefined) {
      role.edit({
        data: {
          name: oldRole.name.toString()
        }
      })
      return;
    }
  } catch(err) {
    console.log(err)
  }
});

I still don't get it... why isn't this working?

#

the moment you realize you are very dumb

west raptor
#

yeah so members as a field works

shy turret
#

wait nvm... i tried .toString()... didn't work

earnest phoenix
#

error?

shy turret
#

no errors

quartz kindle
earnest phoenix
shy turret
#

the only problem i see is that the audit log doesn't show anything new

earnest phoenix
#

Oh yes add ""

shy turret
#

but me editing the role

earnest phoenix
#

audit logs aren't guaranteed to arrive

quartz kindle
#

what is config ?

shy turret
#

const config = require("./config.json");

#

i lost too many brain cells

#

i wonder if the event even passes

#

gonna debug

#

im gonna make my code simplier

#

maybe

#

console.log() clearly shows it passed

#
Bot is ready!
276497792526974996
645714324815347713-168766548725596160-KICK_MEMBERS | lol
2
276497792526974996
lol | 645714324815347713-168766548725596160-KICK_MEMBERS
3
#

but the role doesn't edit rip

#

just gonna use role.delete()

shy turret
#

i just deleted the whole section out

#
                        message.guild.roles.create({
                          data: {
                            name: permname,
                            permissions: [permission.toString()]
                          },
                          reason: message.author.id + ' < (user id) | (command sent) > ' + message.content.toString(),
                        })
                        .then(roles => focuseduser.roles.add(roles).catch(console.error))
                        .then(roles => configSet(permname + "-id", roles.id))
                        .catch(console.error);

well why am i coding so much rn..

slender mountain
#

Lots o' spaces

shy turret
#

ikr

slender mountain
#

I just wrote a function to read the file of my code and send certain amount of lines based on my input haHAA

#

like so

#

Because why not haHAA

sudden geyser
#

cool

slender mountain
#

It's actually kinda useful if someone wants to see any of my code whilst I am away

sudden geyser
#

yeah, but will you be able to remember those lines all the time ThinkingBTTV
hold up, "whilist I am away"?

slender mountain
#

I don't know the exact position but after a few attempts I am able to find what I am looking for

shy turret
#

finally fixed

earnest phoenix
#

Why ```js

const a = bot.users.get("id");

message.channel.send(a.tag)```

Logs saying Cannot read property tag

cinder patio
#

where is this code running

#

in an event? is a null/undefined?

late hill
#

Probably Cannot read property tag of undefined

#

as bot.users would only contain cached users

#

You might not get a result

cinder patio
#

either id doesn't exist, user isn't cached or they are running the code before the bot has connected

earnest phoenix
#

use fetchUser

verbal sinew
#

@high lava @granite tartan Hi - sorry to bother but looking at using the Server screenshare but it looks like it doesn't work on tablets or mobiles - any info you could give me on working that out or does it just not work on those? Thanks if you read 🙂

earnest phoenix
#

wrong channel, or even wrong guild

#

but no, screensharing is desktop only

verbal sinew
#

Sorry I read the description for this channel and it seemed to be right

#

But thanks for responding regardless 🙂

shut fog
#

sa

granite tartan
#

Um why would u ping me LOL 😂😂😂

earnest phoenix
#

😂 😂 😂 YOU WON'T BELIEVE WHAT HAPPENED NEXT...

green kestrel
#

was there ONE SIMPLE TRICK?

#

😄

bright girder
#

Hello, someone found an invisible characters ?

earnest phoenix
#

wat

#

@bright girder for?

bright girder
#

for space channel name

earnest phoenix
#

I know one

#

Lol patched

#

­

bright girder
#

yep i know Dany

earnest phoenix
#

But easy to make

#

hold alt + 0173 on the numpad

#

RIP this is a bad caracter

#

kek

#

I have the best :)

#

there is ** ** but that ofc wont work on channels

#

Lol

#

I can use spacechannel

bright girder
#

@earnest phoenix how ?

earnest phoenix
#

Private smirk

earnest phoenix
#

there are a lot of characters that count as spaces but discord doesn't check for them

#

these will work if you input the name directly through the api, through the client they will not

white pond
#

Anyone know how to convert an image to html code?

earnest phoenix
#

Nope

#

what does that even mean

white pond
earnest phoenix
#

what

#

the screenshot you posted just uses an img tag?

#

yes a zero width space you're so talented wow

#

imagine deleting your message lul

#

The image is specified in the code....

#

@white pond

loud salmon
#

thats not nice @earnest phoenix

earnest phoenix
#

:/

loud salmon
earnest phoenix
#

Srry

white pond
#

I don't understand

earnest phoenix
#

The image is not in html it is specified in the code

#

Bruh

white pond
#

i know

twilit rapids
white pond
#

thanks

earnest phoenix
urban pollen
#

y0u LIk3 JaZZ

sudden geyser
boreal jolt
#

hey can somebody update poke cord

#

for galar mons

earnest phoenix
#

yes updating it right now

#

[=------] 7% complete

loud salmon
#

@boreal jolt i mean you can talk to @tidal parrot but he's only the pokeverse dev 😔

#

also this isnt the pokecord support server

tidal parrot
#

I actually hate you spider

grim aspen
#

fKEKWlaugh

loud salmon
#

i love you too miles

golden maple
#

could somebody un-ban me from the official pokecord server??

loud salmon
#

LULLLLL

tidal parrot
#

I quit

loud salmon
#

I LOVE YOU MILES

#

IM SORRY

tidal parrot
#

THIS IS NOT OK SPIDER

loud salmon
#

i promise

#

it wont happen again

#

😂

golden maple
#

could somebody un-ban me from the official pokecord server??

loud salmon
#

@golden maple no

grim aspen
#

@golden maple not our problem

golden maple
#

ok.

#

😥

#

Who should I ask then???

loud salmon
#

no one

#

they banned you and I dont believe they do appeals

#

sorry

#

¯_(ツ)_/¯

golden maple
#

¯_(ツ)_/¯

scenic kelp
#

What were you banned for, out of curiosity?

tidal parrot
#

@loud salmon Look at my status. This is your fault.

golden maple
#

oh well.

loud salmon
#

fuck

tidal parrot
#

@golden maple Use p!appeal to get a link to an appeal form

golden maple
#

@earnest phoenix I do not like being banned you know!!

loud salmon
#

i swear

golden maple
#

p!appeal

tidal parrot
#

holy shit

#

lmfao

loud salmon
#

good lord

quartz kindle
#

lol

tidal parrot
#

brother

loud salmon
#

-botcommands @golden maple

gilded plankBOT
#

@golden maple

Hey! Bots aren't given permissions to send responses in this channel. Please use #commands or #265156322012561408 to run commands. In addition, bots with commonly used prefixes cannot read or send messages in any channel. This is done to prevent spam and bot abuse.

golden maple
#

p!appeal

tidal parrot
#

don't bother appealing

loud salmon
#

LUL

tidal parrot
#

2 cases of server ads

loud salmon
#

oh

#

thats a yikes

tidal parrot
loud salmon
#

😔 👌

twilit rapids
#

Appeal me daddy

grim aspen
#

stop

#

no

tidal parrot
#

timo

#

this is development

#

I wonder what they develop here haha..

scenic kelp
#

to return on topic I shall ask a development question

tidal parrot
#

Probably just code and stuff 😔

earnest phoenix
#

the web

#

😏

scenic kelp
#

how do I add 2 + 2

grim aspen
#

4

earnest phoenix
#

2 * 2

tidal parrot
#

Imagine if they actually developed feelings here instead LOL 😆 xD

twilit rapids
#

You are gonna develop my ba- ok no this is to far

scenic kelp
#

thnks @earnest phoenix

earnest phoenix
#

np 👍 😄

tidal parrot
#

obviously not tho cuz ya know we're both straight guys right 🙈 😄

quartz kindle
#

Math.pow(2,2)

tidal parrot
#

unless.. DankFlushed

earnest phoenix
#

no homo bro

twilit rapids
#

Never say never :)

earnest phoenix
#

but you just sai--

twilit rapids
#

hahahahahahah xdddddddddddddddd

halcyon ember
#

I’m tryna make a bot similar to application bot on glitch can someone help me

#

Idk how to make it dm a person who ran a command

earnest phoenix
#

I think it's guild.user.ban(430117093573394442)

#

jk

halcyon ember
#

...

#

I made a bot on python but tryna use glitch to do it

grim aspen
#

@halcyon ember glitch runs only on js

loud salmon
#

also glitch isnt meant for bot hosting

halcyon ember
#

I mean

#

It’s like literally a small bot

#

For like 10 people

#

Also too lazy to get hosting cuz I’m broke

strange trout
#

You can get a vps for like $12/yr

grim aspen
#

why the hell does my bot now require the package 'm3u8stream'

lavish forge
#

Uh. Wot.

#

Do you convert stuff?

grim aspen
#

no

valid frigate
#

one of your dependencies may depend on that now

grim aspen
valid frigate
#

actual bruh moment

#

that's the only reason why

grim aspen
#

my bot should not require that

sudden geyser
#

maybe it's a sub dependency

valid frigate
#

assuming your bot has dependencies

grim aspen
#

it's fucking npm being a little shit

sudden geyser
#

or a dependency that requires another

grim aspen
#

i think ytdl core is the problem

#

FUCK

#

removing/adding packages resolves nothing

#

it's a fucking mp4 streaming package

#

imma have to be forced to take my bot down, currently no solution

hoary elm
#

Is MySQL good for simple stuff like storing and fetching IDs level ect or is there something else you guys would recommend for that

unreal cliff
#

i think its good

#

personally i use enmap as a short-term solution

hoary elm
#

Yeah I was just looking into Enmap my self cause they offer per server settings

#

But just wanted another opinion on the best option to use first

lavish forge
#

Any form of database is good for simple stuff. NoSQL, MySQL, SQLite, just find what fits what you're wanting to do.

hoary elm
#

Is there a huge difference between MySQL and SQLite or is it essentially the same

lavish forge
#

One is column/row based, the other is not.

hoary elm
#

Alright, thanks 😁

lavish forge
#

Oh wait.

#

You said SQLite not NoSQL.

hoary elm
#

Yeah lol

lavish forge
#

I've barely slept the last few days.

hoary elm
#

Lol it's all good

#

Thanks for your help

grim aspen
#

that was to my error i'm getting

hoary elm
#

@grim aspen it's rare that it happens but there could be possibilities that no one there has experienced that error

#

If you post it here im sure someone will help

hoary elm
#

Ahh what have you installed lately maybe check the NPM page for it and see if it requires that if you don't want it if that's not the issue then I personally don't know I've never heard of it requiring dependencies on its own unless something else relys on what it's requiring so 🤷🏻‍♂️

dusky marsh
#
<div class="bg-dark border-right" id="sidebar-wrapper">
    <div class="list-group list-group-flush">
        <a href="#" class="list-group-item list-group-item-action bg-dark text-light">Home</a>
        <a href="#" class="list-group-item list-group-item-action bg-dark text-light">Add to Discord</a>
        <a href="#" class="list-group-item list-group-item-action bg-dark text-light">Commands</a>
        <a href="#" class="list-group-item list-group-item-action bg-dark text-light">Premium</a>
        <a href="#" class="list-group-item list-group-item-action bg-dark text-light">Login</a>
        <a href="#" class="list-group-item list-group-item-action bg-dark text-light">Status</a>
        <a href="#" class="list-group-item list-group-item-action bg-dark text-light" id="menu-toggle">Toggle Menu</a>
    </div>
</div>

how do i make the last a tag go the bottom of the containing div

heavy void
#
    ^
Error: Cannot find module 'm3u8stream/lib/parse-time'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
    at Function.Module._load (internal/modules/cjs/loader.js:508:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/rbd/pnpm-volume/71b5ddd8-2a78-46fc-aba4-68049f14880d/node_modules/.registry.npmjs.org/ytdl-core/1.0.0/node_modules/ytdl-core/lib/info-extras.js:5:21)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)```
#

How do I fix this error?

#

I just restarted my bot and this error suddenly appeared, even I didn't changed anything

blissful scaffold
#

Creeper55k had the same problem a few hours ago, don't think he found a solution

heavy void
#

I think ytdl-core is the problem. But I already installed it

#
requireStack: [
 '/app/node_modules/ytdl-core/lib/info-extras.js',
 '/app/node_modules/ytdl-core/lib/info.js',
 '/app/node_modules/ytdl-core/lib/index.js',
'/app/node_modules/ytdl-core-discord/index.js',```
#

I saw his problem in stack overflow but still no one had answered

split lantern
#

@heavy void try npm install fent/node-ytdl-core

#

@grim aspen ^ could you try that too?

heavy void
#

Didnt work

green kestrel
#

Currently getting new icon made for my bot by a proper artist 🖌️
finally don't have to worry that as my bot grows, it's logo will piss off discord's legal team 😛

valid frigate
#

again

loud salmon
valid frigate
#

mmLol aight

prime cliff
#

Time to report you to Discords legal team before you change then dboatsMmspin

rustic pond
#

someone any idea why i need to send 2 times the same command before my bot replies 🤔

modest maple
#

Code?

green kestrel
#

@valid frigate not sure anyone would know wtf is happening in my actual dev, heres a screenshot 😄

#

im currently profiling my bot to try and figure out where i can lower its cpu use

#

it does a lot, so its like trying to pick flies out of a bucket of ice cream

slender thistle
#

What is the difference between int and signed int in C++?

#

Or, well, is there any?

empty zodiac
#

No difference between int and signed int with today's compiler. But a small one with char and signed char

quartz kindle
#

int is a representation of a number in binary

#

all bits are used for the value of the number

#

signed int takes one bit away from the number and uses it to "sign" it as positive or negative

#

so signed numbers can hold positive and negative numbers, in exchange of halving its maximum absolute value

#

a 16bit unsigned int can hold a value between 0 and 65535, a 16bit signed int can hold one between -32767 and +32767 (1 bit for the sign, 15 for the number)

#

c++ basically makes its int a 32bit signed long int by default (depending on the compiler), same as many other languages

heavy void
#
    ^
Error: Cannot find module 'm3u8stream/lib/parse-time'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
    at Function.Module._load (internal/modules/cjs/loader.js:508:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/rbd/pnpm-volume/71b5ddd8-2a78-46fc-aba4-68049f14880d/node_modules/.registry.npmjs.org/ytdl-core/1.0.0/node_modules/ytdl-core/lib/info-extras.js:5:21)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)``` Any solutions for this? I tried everything but still won't be able to get my bot up
earnest phoenix
#

how can i know on which servers my bot is added?

dapper dome
#

depends on library. with JDA you can get the jda object and then .getGuilds()

#

not sure with other libraries

earnest phoenix
#

@earnest phoenix

let serv = client.guilds.map(r => "**" + r.name + "**");
message.channel.send(serv)

And if you want

let serv = client.guilds.map(r => "**" + r.name + "** | " + r.id+ " | **" + r.memberCount+ "**");
message.channel.send(serv)
sullen yacht
#

In d.py you can loop through each guild in bot.guilds and then print guild

slender thistle
#

@dapper dome <script> is blocked for non-certified bots

dapper dome
#

whats required to get it certified?

earnest phoenix
#

@dapper dome script in html is for certified bot i think

#

Bruh

slender thistle
dapper dome
#

We are not looking for: Multipurpose bots

#

aight then no scripts

#

but i got british english, so i get some extra points OMEGALUL

earnest phoenix
#

ohh

#

thanks ^^

#

Np

small prairie
#
    throw err;
    ^
Error: Cannot find module 'snekfetch'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
    at Function.Module._load (internal/modules/cjs/loader.js:508:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/rbd/pnpm-volume/89f57bc8-9932-4d43-9864-f45b13c950de/node_modules/.registry.npmjs.org/discord.js/11.5.1/node_modules/discord.js/src/util/Util.js:1:81)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
#

i am not using this module anywhere

#

Trying To Install It

#

SnekFetch

#

Whats it for??

#

Didnt work

quartz kindle
#

@grim aspen @heavy void
if reinstalling ytdl-core doesnt fix it, go into its installation folder and copy all the files from m3u8stream/dist to m3u8stream/lib
the m3u8stream folder should be located in node_modules/ytdl-core/node_modules
ytdl's next update should properly use the dist folder once again

small prairie
#

Any Fix For Mw??\

#

me*

quartz kindle
#

@small prairie snekfetch is a library for making network requests and getting data from the internet. but it is deprecated, and not updated any more

#

so it should not be used

small prairie
#

Not Using it

#

Idk why my console asking for it

#

@quartz kindle Any fix??

#

Tried npm install

quartz kindle
#

it is still used by discord.js

small prairie
#
internal/modules/cjs/loader.js:584
    throw err;
    ^
Error: Cannot find module 'ws'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
    at Function.Module._load (internal/modules/cjs/loader.js:508:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at findWebSocket (/rbd/pnpm-volume/89f57bc8-9932-4d43-9864-f45b13c950de/node_modules/.registry.npmjs.org/discord.js/11.5.1/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:21:12)
    at Object.<anonymous> (/rbd/pnpm-volume/89f57bc8-9932-4d43-9864-f45b13c950de/node_modules/.registry.npmjs.org/discord.js/11.5.1/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:23:2)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
#

Now whats this

quartz kindle
#

also a module used by discord.js

small prairie
#

Oof

quartz kindle
#

installing discord.js should automatically install all of those

#

so try reinstalling it?

small prairie
#

Kay

#

Its on glitch if it helps

#
 WARN  discord.js@11.5.1 requires a peer of @discordjs/uws@^10.149.0 but none was installed.
 WARN  discord.js@11.5.1 requires a peer of bufferutil@^4.0.0 but none was installed.
 WARN  discord.js@11.5.1 requires a peer of erlpack@discordapp/erlpack but none was installed.
 WARN  discord.js@11.5.1 requires a peer of libsodium-wrappers@^0.7.3 but none was installed.
 WARN  discord.js@11.5.1 requires a peer of node-opus@^0.2.7 but none was installed.
 WARN  discord.js@11.5.1 requires a peer of opusscript@^0.0.6 but none was installed.
 WARN  discord.js@11.5.1 requires a peer of sodium@^2.0.3 but none was installed.
#

I will need to install these then?? @quartz kindle

quartz kindle
#

no, those are optionals

small prairie
#

Ohkay

quartz kindle
#

uws is bad anyway

small prairie
#

I am doing those anyways

#

Lemme chck after it

quartz kindle
#

bufferutil and erlpack can help using less cpu

small prairie
#

Reinstalling didnt work

quartz kindle
#

sodium and opus related are only for voice features

#

@small prairie how are you installing?

small prairie
#

Adding them in packkage.json

#

Then doing

#

npm install

quartz kindle
#

you should not be needing npm install if you add them to package.json, glitch should be doing that automatically

small prairie
#

It is

#

Still Same errors

quartz kindle
#

you're using the add package button?

#

what do you have under engines in your package.json?

small prairie
#

I uh dont have it

#

@quartz kindle

quartz kindle
#

go into the console and type enable-pnpm

small prairie
#

Glitch Used Node.js 10 By Default

#

Thanks A ton

#

It Worked

#

If you dont mind

#

What was the issue?

#

@quartz kindle

quartz kindle
#

glitch usually automatically handles things

#

but if you manually install something using npm install i think glitch disables their fully automatic thing

#

and it might break shit

small prairie
#

Ph

#

Oh*

quartz kindle
#

enable-pnpm does a full reset and puts everything back on auto

small prairie
#

Thanks Fam Will keep it in mind for future

grim aspen
#

@quartz kindle problem was is that the package 'part-time' was never installed

quartz kindle
#

it is installed but not in the lib folder

#

its in the dist folder

#

ytdl-core released an update yesterday which changed the package to look for it in the lib folder, which caused this problem

#

there is a PR in place to change it back to dist

grim aspen
#

fixed

#

@quartz kindle now i have to update my github

prime cliff
earnest phoenix
#

How can i learn any server how many boosted?

#

with code.

#

i n

#

wh i c h

#

l i b r a r y

modest maple
#

^^

earnest phoenix
#

JavaScript

#

yes but what's the library

#

nani

modest maple
#

There are multiple librarys

earnest phoenix
#

i'm out

mossy vine
#

d.js or eris or something else

modest maple
#

For js

earnest phoenix
#

discord.js

loud salmon
#

bye cry

modest maple
#

Tbf

#

So many people say help me

#

But no one says what lib or language they r

earnest phoenix
#

true

sudden geyser
#

first time?

earnest phoenix
#

Why not helping any user?

mossy vine
#

its pretty damn tough helping a user without knowing what they are having problems with

#

its like going to hospital because you have pain somewhere but not saying where the pain is

vital lark
#

@earnest phoenix I say get all members by the date and see if it's not null

valid frigate
#

so basically

#

maybe it's member.premiumSincs

#

since

grizzled raven
#

master ^

#

wait nvm

valid frigate
#

if you use an ide that can autocomplete try typing in "premium" after a member class

#

eg member.premium, which is not actually a property, but your ide might list properties with that in the name

#

not sure if vsc does that but try it out

vital lark
#

@valid frigate yea vscode will show a list of properties the class has like you described

toxic junco
#

guys

#

can someone help me on this?

#

what could I write here?

loud salmon
#

@toxic junco that part is optional

#

its not needed

toxic junco
#

what could be the issue?

#

now good

loud salmon
#

@toxic junco remove the word Fun

toxic junco
#

spider

loud salmon
#

its meant to be server ids

toxic junco
#

you can test bots?

loud salmon
#

yes

#

but it takes a week

#

there is a line

toxic junco
#

can you test mine now?

loud salmon
#

of around 300 bots

#

no

toxic junco
#

oof

#

when ur testing mine please ping me

#

because the bot goes offline sometimes

loud salmon
#

um

#

no

#

@toxic junco you need to keep your bot online for the entire week

toxic junco
#

ik

#

but sometimes it goes off for seconds

loud salmon
#

¯_(ツ)_/¯

hollow granite
#

I don't know if this is the right place to ask, but how could I create an RSS feed that sends data from my JSON file to someone else?

modest maple
#

do bots also have the same file limit size as Regular users?

amber fractal
#

I think

#

But I think it also goes up if the server is nitro boosted

#

I'd keep files under 8mb anyways

modest maple
#

yh just wondering if it keeps the 8MB file limit

#

just changes what the bot's file limit is and what users can store

amber fractal
#

Well this server is boosted, you can try to send a 100mb file here.

modest maple
#

its just for global stuff that i need

#

ill just have to limit the user's file size to 8MB

amber fractal
#

Ah then yeah 8mb is safe

modest maple
#

now to find out how df u check file size

#

xD

earnest phoenix
#

Is it possible to change a guild shard?

Guild A (shard 1) => Guild A (shard 2)

vital lark
#

@earnest phoenix not possible

earnest phoenix
#

Okay :/

quartz kindle
#

it is possible

#

just change the shard count

#

:^)

earnest phoenix
#

I have created a second server lol and he is in shard 2 but ty x)

#
message.client.shard.broadcastEval(`this.guilds.get('647154992402268160')`).then(console.log)```

```json
[ null,
  { members: {},
    channels: {},
    roles: {},
    presences: {},
    deleted: false,
    available: true,
    id: '647154992402268160',
    name: 'test(shard 2)',
    icon: null,
    splash: null,
    region: 'europe',
    memberCount: 2,
    large: false,
    features: [],
    applicationID: null,
    afkTimeout: 300,
    afkChannelID: null,
    systemChannelID: '647154992402268163',
    verificationLevel: 0,
    explicitContentFilter: 0,
    mfaLevel: 0,
    joinedTimestamp: 1574364307653,
    defaultMessageNotifications: 'ALL',
    ownerID: '615610281569026108',
    _rawVoiceStates: {},
    emojis: {} } ]

But if i want to send this in a channel

message.client.shard.broadcastEval(`this.guilds.get('647154992402268160')`).then(message.channel.send)```

(node:27871) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'client' of undefined

honest stratus
#

hi short question how can you record a voice in vc i searching but didnt found a good answer yet discord provides docs are really rare and only a few bots does offer this feature so how are they doing this

earnest phoenix
#

This is not allowed

honest stratus
#

but some bots already doing it ??

earnest phoenix
#

Send a bot with this

modest maple
#

its a certified bot dany

honest stratus
#

its only against the tos if the bot does not require these records and if i dont inform the users?

modest maple
loud salmon
#

its allowed

#

it does it with consent

modest maple
#

^

earnest phoenix
#

Hum okay

loud salmon
#

😩

honest stratus
#

yea but how the sience works

#

its so rare documentated

earnest phoenix
#

Use a stream module?

honest stratus
#

do you have any doc or tutorial for understanding

quartz kindle
#

@earnest phoenix delete your guild and create it again, if you're lucky, it will go to shard 0 lul

#

the guild id defines which shard it goes to

earnest phoenix
#

i have a problem using typecasting in c, i think?

    int i;
    char str[] ="Hell0 World";
    
    printf("str[%d] = %c", 4, str[4]);
    
    i = (int)str[4];
    
    printf("\n int i (using char) = %c", i); // why does this work print an int using %char
    printf("\n int i (using int) = %d", i); // and this doesnt? print an int with %digit 
quartz kindle
#

as for your problem Dany, you have to send the message inside the broadcastEval

earnest phoenix
#

recording in voice is literally reading the user's voice stream and storing it, its allowed @honest stratus @earnest phoenix

#

@quartz kindle the guild is in the shard 0...

quartz kindle
#

broadcastEval("this.channels.has(channelid) ? this.channels.get(id).send(message) : null")

#

something like that

honest stratus
#

@earnest phoenix the question is how

earnest phoenix
#

which lib are you using

honest stratus
#

js

earnest phoenix
#

yes but which damn library

honest stratus
#

? discord.js ?

earnest phoenix
#

No i want the guild infos in the channel

honest stratus
earnest phoenix
#

yes that's what i was about to link

honest stratus
#

but does not help me cuz i dont know how to storage

#

but ty for help

#

🙂

earnest phoenix
#

opus event and read the buffer

#

i now want to play around with recording user streams

#

seems fun

modest maple
#

Listen to their secrets

earnest phoenix
#

Lol

#

imagine if rythm lowkey recorded user streams

honest stratus
#

breh

modest maple
#

maybe they do

honest stratus
#

ooh

earnest phoenix
#

x doubt

modest maple
#

sell it to google

quartz kindle
#

how many GBs of data would that be?

honest stratus
#

oha

quartz kindle
#

or TBs

honest stratus
#

more

modest maple
#

many

#

they just send it live to google

earnest phoenix
#

yeah what i wanted to say tim

modest maple
#

where they start doing targeted adds

earnest phoenix
#

they would also double/triple their bandwidth usage

quartz kindle
#

stored as uncompressed wav files

honest stratus
#

@earnest phoenix do you want to explain how the opus things works? 😅

modest maple
#

#readthedocs

slender thistle
#

Is that why they need 9 servers for the bot

earnest phoenix
#

not home right now but what do you not get

honest stratus
#

i know theres a alternative pcm stream but that cant be simple converted to like mp3 cuz its a more dimensional strean

earnest phoenix
#

you can also use the pcm event which is easier to work with cause its one of native formats

#

yeah

#

opus is lightweight and encoded

#

so you would have to decode opus bytes

#

which is annoying

honest stratus
#

what do you suggest

earnest phoenix
#

try pcm

honest stratus
#

ok

earnest phoenix
#

for now i suggest just reading the stream and piping it back through the bot just to see if it works

honest stratus
#

woah ok i will do my best and ask if i stuck

earnest phoenix
#

@quartz kindle No i want the guild infos in the channel

quartz kindle
#

what do you mean?

earnest phoenix
#

Th infos can be console logged but not send

quartz kindle
#

i just told you how to send to a channel in a different shard

earnest phoenix
#

Yup ty x)

modest maple
#

what part of the d.py docs is it that goes over Receiving files sent from a user?

#

wait

#

nvm im fucking blind

#

missed attachements

honest stratus
#

cry?

#

are u still here?

quartz kindle
#

hes always here, he has no life, like me

honest stratus
#

oh hi i take a seat next to you no life freestyler

#

btw do you have any experiences with opusstream?

modest maple
#

so, sharding; runs a new instance of the bot correct?

#

is that the equivalent of running a another identical bot in terms of system resource usage?

short siren
#

I believe so as the servers are split between the shards

modest maple
#

uggh

#

fuck my ram bruh

late hill
#

Depends on your method of sharding

#

You can have a shared cache

quartz kindle
#

yeah, internal sharding still uses a single process/instance

modest maple
#

Probably will want to run an entire new instance as I think the webhandler will be a bit slow otherwise

earnest phoenix
#

If the bot has a dashboard we must necessarily run it independently of the bot(if the bot use sharding)

modest maple
#

Hmm?

earnest phoenix
modest maple
#

I haven't set up a dashboard yet and not sure if i will or not

#

But it's just the shear ram usage that's a problem F

earnest phoenix
#

you don't have to @earnest phoenix

#

monolithic design exists

#

@earnest phoenix 🤔

#

How?

#

pack everything into one

modest maple
#

RAM per shard for me is like 5GB per instance and 9GB usage peak

#

And oof not monolithic design again cry

earnest phoenix
#

host your bot and the web server in the same app

#

Yup i see

#

But the dashboard have to be modifier with boradcasteval etc...*

#

Modified *

#

monolithic design is fine for a small audience but if you plan on growing, avoid

#

Hmmm take notes

modest maple
#

Hasnt this been discussed before?

#

I swore this got discussed the other day or so

earnest phoenix
#

Srry

#

possible lol

#

But but me 🤔

#

Not me*

tranquil drum
#

Catch me up cause idk how you shard between servers

earnest phoenix
#

servers as in server servers or discord servers

tranquil drum
#

Server servers

earnest phoenix
#

Lol

#

you can define with which shard id you connect to the gateway

#

so you can have n independent bot processes each with a different shard id

tranquil drum
#

Yeah but what if they’re on different machines

earnest phoenix
#

still possible

modest maple
#

Same principle

tranquil drum
#

Will requests from one discord server always end up on the same shard?

earnest phoenix
#

because you're connecting to discord in all cases, where the process is located doesn't matter

#

This is possible to make sharding bot with multiple machines???

modest maple
#

Altho the size your bot has to be to make it remotely practical is extensive

earnest phoenix
#

@tranquil drum yes

modest maple
#

Yh rythm is on multiple servers

tranquil drum
#

What if a shard is down

earnest phoenix
#

Oh

modest maple
#

I think 7 seperate machines atm

earnest phoenix
#

Bruh

#

@earnest phoenix yes

#

This is hard i think

modest maple
#

If a shard dies a shard dies

quartz kindle
#

depending on what your bot does, its possible to drastically reduce its ram usage

earnest phoenix
#

it's really not hard at all

tranquil drum
#

Where do the requests meant for that shard end up

modest maple
#

We at 7GB usage boiis

tranquil drum
#

If requests from a discord server always end up on the same shard

quartz kindle
#

how many guilds in that 7gb?

earnest phoenix
#

what might be iffy is making your processes aware of each other and make them communicate

modest maple
#

600 xD

quartz kindle
#

what the fuck

earnest phoenix
#

I don't see how it's possible to do that when the machines don't really come out connected....

#

d.js for you

#

@earnest phoenix huh?

modest maple
#

What's d.js xD

earnest phoenix
#

Discord.js(javascript)

#

oh you don't use d.js

modest maple
#

Nah I use py

quartz kindle
earnest phoenix
#

how tf is that so heavy

modest maple
#

Ram usage is high cuz of how the system works

quartz kindle
#

thats 59mb fyi

earnest phoenix
#

I don't see how sharding can work with multiple machines for 1 bot

modest maple
#

Bearing in mind it's caching 2GB of locations

tranquil drum
#

So where do requests end up if the shard that was supposed to handle that discord guild is down?

modest maple
#

To then boot 12 webdrivers

earnest phoenix
#

they don't @tranquil drum

modest maple
#

And then upload all cache to webdrivers

tranquil drum
#

Will the shard manager spin up a new shard?

quartz kindle
#

@earnest phoenix inter-process communication via tcp/http

earnest phoenix
#

Who can setup sharding with multiple machines here 😭😂

modest maple
#

Why would you want to

#

Your talking massive massive server count to make it worth it

tranquil drum
#

What’s the point of sharding on the same machine?

earnest phoenix
#

@quartz kindle oh yes why not 😏 take notes

quartz kindle
#

taking advantage of multiple cpus

tranquil drum
#

Its basically just threading lol

earnest phoenix
#

No

#

i had a system where i had a parent machine which was a ws server and then just let other smaller machines connect to that ws

modest maple
#

There's a big difference between threading and using async

#

And multiprocessing aswell

tranquil drum
#

Only in python

earnest phoenix
#

no

#

everywhere lol

tranquil drum
#

I’m using Java lol

modest maple
#

Pretty sure the principals are everywhere

tranquil drum
#

There’s no multiprocessing without threads I think

modest maple
#

Just cuz u use java doesn't mean it uses all cores and all threads together

#

And there's a difference between them

#

Threading can share vars

#

Multip processing doesn't and can't exchange global vars between processes (as far as I'm aware)

tranquil drum
#

That doesn’t exist in Java though

quartz kindle
#

java or javascript?

tranquil drum
#

Like you’d have to straight up call exec and spin up a new jvm

quartz kindle
#

node.js has worker threads

tranquil drum
#

Java

earnest phoenix
modest maple
#

That is what uses multiple machines^^^

earnest phoenix
#

Yup

quartz kindle
#

and a custom library

#

or at least a heavily modified library

modest maple
#

That too

earnest phoenix
#

Hmmmm

modest maple
#

Sometimes I don't get the ram usage some times I goes upto 90% and it's always when I fucking at school with no way of checking what's up

earnest phoenix
#

Oh

quartz kindle
#

whats actually using most of the ram tho?

modest maple
#

Webdrivers

quartz kindle
#

you have a ton of shit running in there from what you said

modest maple
#

Alot of stuff yh

#

It's cuz the bot doesn't hold any data on a DB cuz of legality reasons

#

So it gathers all data live and processes with the command

earnest phoenix
#

You can use db...

modest maple
#

can't hold any data on a DB cuz of legality reasons

earnest phoenix
#

theoretically it is a database

#

Hmmmm

#

an inmemory one

modest maple
#

Technically yh

#

Altho that data changes

#

What's on memory are just the systems that create the requests and handle the temp data till a new payload comes in

quartz kindle
#

well, depending on what exactly you're doing, there are probably ways to optimize stuff

modest maple
#

Possibly

#

Doesn't help that some of the sites (the main one aswell -_-) says it's loaded before it's actually loaded any data

#

Overall it's still pretty quick

quartz kindle
#

what does it do if i may ask?

earnest phoenix
#

look into a gc

#

might help tweaking it

modest maple
#

Dndwiki

#

Some couple 5000+ thing I think overall

quartz kindle
#

and you hold stuff like images in memory?

modest maple
#

No

#

Images are temp stored as a file till it's needed

#

Try not keep any images in memory cuz of the sheer size of images sometimes

#

It's mostly the .orcbrew files that take up the memory on the pages

quartz kindle
#

how big are those files on average?

modest maple
#

Depends it's user specific

quartz kindle
#

those are the ones you cant save because of legal reasons?

modest maple
#

If the user hasn't got a custom file it's the defualt 3.5MB file

#

And the .orcbrews are similar to JSON files but they store any data the website can't store

#

So the user caches any data etc... On their browser only

#

So it becomes user 'hosted' rather than 3rd party

#

If u know cojure u can see the code for the site on the GitHub xD

quartz kindle
#

nope, i dont lul

#

im just thinking about what you could do about using stupidly huge amounts of ram

modest maple
#

Mostly just the webdrivers themselves

quartz kindle
#

if you absolutely cannot outsource some of that to disk, you could always use swap or something

modest maple
#

Maybe

#

Life would be alot easier / less ram intensive if there was a decent API for it but ¯_(ツ)_/¯

quartz kindle
#

so basically the webdrivers are used to interact with the websites because they dont have apis

modest maple
#

Yup

quartz kindle
#

are they not scrappable?

modest maple
#

What it does

quartz kindle
#

do they require going through login systems and ajax calls?

modest maple
#

No... Surprisingly

#

They just

#

Eat Ram

#

For days