#development

1 messages · Page 673 of 1

cinder patio
#

yea

earnest phoenix
#

okay

#

okay

#

why are you using json as a database in the first place

#

cause first time making bot

#

thats not an excuse but ok

lusty dew
#

Oof

#

@cinder patio Was that a yes to me or thwn

#

Them*

cinder patio
#

yes

lusty dew
#

Okay

#

I'll let you know if anything goes wrong

#

Something went wrong 😬

earnest phoenix
#

ouch

opaque eagle
#

what app is that even

lusty dew
#

Terminus

opaque eagle
#

r u seriously coding on iOS

lusty dew
#

No

#

Android

opaque eagle
#

aww man

lusty dew
#

Terminus is just for checking logs

opaque eagle
#

coding on ios is rather fun

lusty dew
#

It is but idk any coding apps that will allow me to access the server SFTP

earnest phoenix
#

i did it yay

lusty dew
#

I'm using Turbo on Android

#

But iOS doesn't have turbo

little falcon
#

hello .... I'm looking for some tournament bot

lusty dew
#

And check out DBL

#

Website you'll find something like it maybe

quartz kindle
#

you cant see if they voted for other bots besides yours

#

but what you can do is track votes in a database and have each bot access each other's databases, or have a single database shared by all bots

lusty dew
#

I think what he is saying ia

quartz kindle
#

you can only access votes for the dbl token you provide

lusty dew
#

If you make two bots and want to see if the other bot got voted on store those votes from that one bot and have the other bot read those votes

#

But I could be wrong

#

👀

quartz kindle
#

another option is to use multiple tokens to get votes for all your bots

#

so only one bot?

#

when you said "bots" i assumed multiple lol

lusty dew
#

Webhooks is an option

quartz kindle
#

then yeah, use the dbl api

lusty dew
#

Or the hasVoted method in DBL api

earnest phoenix
#

okay my bots not online for some reason

#

you're being too vague

#

what have you done - what have you tried - which lib are you using

small prairie
#

hey quick question

#

is firebase good?? to use as a database

mossy vine
#

firestore?

small prairie
#

@mossy vine

pallid zinc
#

Firebase is good

small prairie
#

is i fast??

#

will i get any delay or something

pallid zinc
#

But anyone can access with url

#

Nah

small prairie
#

wdym??

#

what can anyone access??

#

the database??

pallid zinc
#

Yup

#

So don't add token there

mossy vine
#

bruh

pallid zinc
#

Firebase is good and free plus fast

mossy vine
#

the free plan doesnt offer too much

small prairie
#

AH ANYONE CAN ACCESS MY PROJECT IF THEY GET THE URL

#

oops caps

inner jewel
#

or you can configure it to block access

pallid zinc
#

Yup

mossy vine
#

no

small prairie
#

oh

#

i wanna set it up for my bot

mossy vine
#

what database are you using

pallid zinc
#

I figured out this when my token was leaking many time

small prairie
#

@mossy vine you really dont wanna know

mossy vine
#

json?

small prairie
#

yup

#

lmao

inner jewel
pallid zinc
#

I use quick.db

#

I am smart

#

Nah

small prairie
#

ah nice

pallid zinc
#

Even if u work on lock mode

mossy vine
#
I am smart```
![mmLol](https://cdn.discordapp.com/emojis/356831697385422848.webp?size=128 "mmLol")
small prairie
#

can someone help me out??

pallid zinc
#

Add token in json file

mossy vine
#

anyways, if you are interested in using Firebase i highly reccommend you check out the Fireship youtube channel

pallid zinc
#

And all would be good

mossy vine
#

he makes a lot of great videos about Firebase

pallid zinc
#

Just tell me disadvantages of quick.db

small prairie
#

woah i think firbase is good

#

is it free?? forever

pallid zinc
#

U are right

#

Yup

#

But data limit

small prairie
#

what?

mossy vine
#

yes but free plan doesnt offer too much

small prairie
#

is the limit

pallid zinc
#

Idk

mossy vine
pallid zinc
#

I don't use it

small prairie
#

thats insane i wont like ver complete that storage

lusty dew
pallid zinc
#

Mobile

small prairie
#

20k writer i dont htink will ever get complete

inner jewel
#
{
  "rules": {
        ".read": "auth.uid === 'abcdef'",
        ".write": "auth.uid  === 'abcdef'"
  }
}```
#

this is enough to protect the firebase realtime db

small prairie
#

if my bot even gets famous i obviously will get monei

inner jewel
#

replacing the hardcoded uid with something more secure

lusty dew
#

Hi Natan

small prairie
#

@inner jewel how can i make rules that just my bot will able to access it?? am noob

pallid zinc
#

Explain

mossy vine
#

change the uid to something secure

pallid zinc
#

Natan u use firebase

inner jewel
#

no

#

but i can read docs

pallid zinc
#

Lol

small prairie
#

and i can watch yt

pallid zinc
#

Omg

lusty dew
#

Then watch it

small prairie
#

lmao

opaque eagle
#

Ooh Firebase

abstract crow
#

So when I hit submit I need the HTML to run a JS file to send over information via a WS server... The thing is, is that I THINK I need node for that. How can I do that?

lusty dew
#

Can anyone help me with a mongodb problem I'm still having

#
  1. It's not writing user data to the db
  2. It returns a cycling dependcie error
abstract crow
#

Code is very useful.

lusty dew
#
const { MessageEmbed } = require('discord.js')
const db = require('./db_connections.js')
module.exports = (client) => {
    client.checkUserExist = async function (id, cb) {
    try {
      let data = await db.loadUserData(id)
      if (!data) {
        data = await db.writeUserData(id, {
          id,
          bal: client.settings.starting_balance,
          xp: client.settings.startingXP,
          xpMultiplier: 1,
          coinMultiplier: 1
        })
      }
      return cb ? void cb(null, data) : data
    } catch (e) {
      return cb ? void cb(e) : Promise.reject(e)
    }
    client.log('User entry created')
  }

}
#

I was providing that now give ms a sec

#

Me*

#
writeUserData(id, obj, cb) {
      if (typeof id !== "string")
          throw new TypeError("ID must be a string")
      console.log('Write User Data')
      return this.db.collection("users").updateOne(
      {id},
      { $set: obj },
      {upsert: true},
      cb
    )
  }
mossy vine
#

the stacktrace only seems to show mongo

lusty dew
#

But the error is occurring when writing user data

#

So I’m assuming it comes from that file

#

It’s the only file rn that deals with user data other then the file that creates the function to write user data

quartz kindle
#

console log obj in your writeUserData function

#

before calling mongo

lusty dew
#

Okay

quartz kindle
#

also, i dont see anything in the mongo docs suggesting updateOne accepts a callback in the 4th parameter

#

you should probably remove the callback all together

lusty dew
#

Okay

#

@quartz kindle it didn't log anything

#

Maybe I'm logging it wrong?

#

Or I've been looking at the wrong function for 2 weeks

#

🤦

quartz kindle
#

welp, you can try logging the beginning of your checkuserexists function

lusty dew
#
loadUserData(id, cb) {
    console.log('Its me boi')
    return this.db.collection("users").findOne({id}, cb)
  }
#

This is the real function that's causing problems

quartz kindle
#

the second argument of findOne is an object of mongo options. you're giving it a cb containing a function

#

remove all your cb's, they are not needed anywhere

lusty dew
#

Okay

#

Something about the function or the way I use it is still wrong

quartz kindle
#

wait, i need to read the mongodb npm module docs, not the actual mongo docs

#

lol

lusty dew
#

Lol

#

Ye

#

Mongodb requires callbacks iirc

quartz kindle
#

well you can promisify them

lusty dew
#

Therr ya go

#

There*

quartz kindle
#

ok so if i were you i'd probably promisify them instead of using callbacks

opaque eagle
#

If mongodb requires callback functions in the format of: (error, value) => {}, then you can do:

#
const { promisify } = require("util");
promisify(functionName)```
quartz kindle
#
return new Promise((resolve,reject) => {
    db.findOne({},function(err,results) {
        if(!err) resolve(results);
    })
})```
#

or the above, which is basically an automated version of the below

lusty dew
#

So basically using the above

#

I could do

#
const { promisify } = require("util");
const db = require('./db_connections.js')
let data = promisify(db.loadUserData(id))
#

Or something like that?

opaque eagle
#

no, promisify takes a function, so it'll have to be promisify(db.loadUserData)(id)

lusty dew
#

Ahhh okay

opaque eagle
#

And that'll return a Promise, so you can either use async/await or .then()

lusty dew
#

Ah mk

#

Thankss

opaque eagle
#

np

lusty dew
#

I'll see if that works

#

:3

#
2|clap  |     at loadUserData (/home/panda/Clap Bot/library/db_connections.js:33:17)
inner jewel
#

promisify(db.loadUserData)(id) wont work

lusty dew
#

Huh

inner jewel
#

you need to bind the function to the db

#

promisify(db.loadUserData.bind(db))(id) would

lusty dew
#

Oh

#

Just to learn something new

#

Why do I have to bind it?

inner jewel
#

because it wouldn't have access to this otherwise

#

this would be undefined

lusty dew
#

Ahh okay

#

So binding it allows it to access this?

#

Hmph cycle decencies error is still showing up

#

@inner jewel Do you know what could be the problem?

lusty dew
#

What db should I use mongodb is being a bitch

#

Lol

earnest phoenix
#

sql?

topaz fjord
#

mongodb

#

its only a bitch if you don't know how to use it :^)

lusty dew
#

I know how to use it for the most part @topaz fjord

#

It's just unexpectedly being weird

topaz fjord
#

what is it doing

lusty dew
#

Causing cycle dependency errors

quartz kindle
#

i mean, 99% of the times the problem is giving mongo an object it doesnt know how to resolve

#

for example, objects containing functions or other non-primitives

lusty dew
#

I don’t think I’m doing any of that

quartz kindle
#

so log your objects and make sure they only contain strings/numbers

lusty dew
#

Okay

topaz fjord
#

or the specified type in the schemas

lusty dew
#

Honestly though Tim

#

I was planning on switching dbs anyway

#

So why not now?

quartz kindle
#

sure lol

#

im using sqlite for all my bots

lusty dew
#

Can you run it with the bot?

quartz kindle
#

it does a great job as long as you only need a single machine

lusty dew
#

I’m looking for a db you can run with the bot

quartz kindle
#

yeah sqlite runs with the bot

lusty dew
#

Without having to use something like mongodb server

quartz kindle
#

then sqlite is your choice

lusty dew
#

SQLite is basically like sql right?

#

Same syntax?

quartz kindle
#

mostly yes, there are a few differences

#

but should be 90% identical

lusty dew
#

So learn sql first?

quartz kindle
#

yeah, its an option

#

but you can start with reading guides specific for sqlite

lusty dew
#

Okay

quartz kindle
#

and sql is not hard, its kinda like html

lusty dew
#

Html was easy asf to understand

quartz kindle
#

in complexity

lusty dew
#

Pretty simple let

#

Lel *

#

Though I don’t know everything about html I know the basics if not a bit more

topaz fjord
#

as long as you protect against sql injections

lusty dew
#

Who’d want to sql inject a bot

#

Still gonna do it cause of security reasons

quartz kindle
#

all those script kiddies looking for bot tokens?

#

xD

lusty dew
#

Ah true

#

Gotta remember the script kiddies

quartz kindle
#

well, prepared statements are pretty much the "normal" way to do things anyway, and they are injection-proof

lusty dew
#

I wish there was a way to reset your token if the bot sensed any kind of sql injection

quartz kindle
#

nobody directly uses queries anymore

lusty dew
#

What if they do?

#

👀

quartz kindle
#

then they are stoopid

#

but anyway, in a discord bot, the only possible injection route would be through a command

lusty dew
#

Ye

quartz kindle
#

so unless you're stupid and make a command directly feed an sql statement

#

the chances of something bad happening are basically 0

lusty dew
#

Yikes I may be stupid

#

😂

quartz kindle
#

lmao

lusty dew
#

That’s how I am at times

quartz kindle
#

anyway just use prepared statements, every single sql implementation should have them

lusty dew
#

any suggested guides to read?

quartz kindle
#

a prepared statement is basically something like (example using better-sqlite3)```
query(SELECT ${variable} FROM table).run() //direct query
query(SELECT ? FROM table).run(variable) //prepared statement

lusty dew
#

Ahhh okay

quartz kindle
#

you build a query using placeholders instead of data

lusty dew
#

So don’t do direct query

quartz kindle
#

aka "prepare" it

#

yes

lusty dew
#

Got it

#

I won’t be dumb

#

Hopefully

#

Any suggested guides?

quartz kindle
#

better-sqlite3 is a good choice for an sqlite package

#

look it up on npm/github

lusty dew
#

Okay

#

Thanks!

#

Hm I can’t find a tutorial @quartz kindle

#

Oh nvm

#

Oh nvm

#

I was looking at a tutorial the whole time

#

😂

#

Hmmm

quartz kindle
#

where is your bot hosted?

onyx summit
#

Weird, all my bots use sqlite for prefixes

lusty dew
#

Chy4e

onyx summit
#

on my server

lusty dew
#

Yep

onyx summit
#

I know why

#

Cuzz u bish have a space in the folder name

lusty dew
#

Sorry...

quartz kindle
#

npm cant handle names with spaces? wut

onyx summit
#

trust me, I have seen this error many times

#

It can't cd into it

#

Just lemme, uhhh

#

Rename it

broken shale
#

use a -

lusty dew
#

There is two folders whattt

#

Renamed it

shy turret
#

I'm making a website, but I don't want people to view-source: aka Ctrl-U. Is there a way to disable it? (ping me on answer)

quartz kindle
#

no

onyx summit
#

Try installing it again

shy turret
#

no to me?

quartz kindle
#

yes

onyx summit
#

Yes, you can never disable it

quartz kindle
#

there is no way to hide client-side code

onyx summit
#

You can only make the JavaScript unreadable ugly

lusty dew
#

They can only see the current page source code

#

Nothing in like databases or anything

quartz kindle
#

why do you want to hide it tho?

onyx summit
#

Transmitting data kek

quartz kindle
#

bitcoin miner

onyx summit
#

Or some of those people who think their code is unbelievable hard and special, so everyone will steal it

quartz kindle
#

i hide my code because i dont want people to see how unbelievably bad it is

#

lmao

onyx summit
lusty dew
onyx summit
#

My biggest motivation for my bot rewrite is because it's bad code

lusty dew
#

I hope this isn’t bad

onyx summit
#

Nope

quartz kindle
#

thi is normal

lusty dew
#

Okay

quartz kindle
#

its compiling

lusty dew
#

Ahhhh okay

onyx summit
#

Just warnings, happens everytime

#

Btw, afaik npm can handle spaces, but the thingy compiling that stuff cant

lusty dew
#

Okay thought I was doing something wrong zoomeyes

#

God the lag with that msg

#

Question

#

Cause I can set it to something like guildID or whatever

onyx summit
#

wdym

#

you can name columns how you want

lusty dew
#

Like in the schema

#

Or that

earnest phoenix
lusty dew
#

Idk what it’s called

#

I don’t have to Seinfeld guildID several times

#

Only once?

onyx summit
#

@earnest phoenix yes, define files

lusty dew
earnest phoenix
#

hmm what

lusty dew
#

To know which guild to pull data from the db

onyx summit
#

files is undefined

earnest phoenix
#

so how do i defie it i mean i have amny files

onyx summit
#

yes, you have to do that too, you have to select the guild you want by its id @lusty dew

#

how did you define files?

lusty dew
#

Oof

earnest phoenix
lusty dew
#

Idk how to get guild ID outside a message event

onyx summit
#

There is no folder events, so there are no files

#

@lusty dew well, in what event do you need it? I don't get what your problem is

lusty dew
#

Your folder is called event

#

I have my command handler and stuff in a separate file

earnest phoenix
#

thank you

lusty dew
#

And it doesn’t have a message event and I heard having two causes problems

onyx summit
#

Not really problems

earnest phoenix
#

i know

onyx summit
#

Having 2 is not a problem

earnest phoenix
#

i was so blind

onyx summit
#

btw, you can do

if (err) throw err;

inside the callback
To actually get an error

lusty dew
#

Hm so I can have two message events?

amber fractal
#

you can

#

but it's gonna cause problems

#

like memory problems

lusty dew
#

Hmph

amber fractal
#

You'll get a memory leak so fast

lusty dew
#

Ugh

#

I’m just trying to make customizable prefixes why is it this hard

amber fractal
#

why would you need two message events for that?

lusty dew
#

Here we go again

#

I’m using SQLite

#

So to get data per guild

#

I need to access that data with the guild Id to get the right guilds data

amber fractal
#

yeah

lusty dew
#

And I’ve been told no way to get the current guild I’d without doing message.guild.id

amber fractal
#

yep

lusty dew
#

But my command handler and other things are in a separate file without the message event

amber fractal
#

wait, so you dont pass the message in your command handler?

#

I'm guessing you just pass args?

quartz kindle
#

all your events should be in the main file

lusty dew
#

My command handler no

quartz kindle
#

and your command handler should watch the event and pass the message to commands if the message matches a command

lusty dew
#

Three things inside the file

broken shale
#

Im abt to dump my events externally then require them

#

¯_(ツ)_/¯

quartz kindle
#

lol ok

lusty dew
#

Everything inside clap_functions.js

#

Related to the topic

quartz kindle
#

well, that checks if its a valid command

#

but how to you handle the event?

lusty dew
#

Wym

quartz kindle
#

where's your .on("message")

lusty dew
#

That’s in main file

#

Lol

quartz kindle
#

ok, so thats good

#

what do you do with the message when it comes?

lusty dew
#
client.on('message', async (message) => {
    if (message.author.bot) return;
    const split = message.content.split(/\s+/g);
    const args = split.slice(1);
    client.checkUserExist(message)
    if (client.isValidCommand(message) == false) return
    if (client.commandExist(message) == false) return
    client.commands[message.content.split(' ')[0].replace(client.settings.prefix, '')].run(message, args)
})
quartz kindle
#

ok, so you run the command and provide message and args

lusty dew
#

Ye

quartz kindle
#

so use that message inside the command to get your guild.id

lusty dew
#

Not the problem here

quartz kindle
#

so what is the problem?

lusty dew
#

Trying to load guild data in here to get the customizable prefix

quartz kindle
#

pass message to commandExists and isValidCommand

#

and inside those functions, call the database

lusty dew
#

But to do that need to use message.guild.id to get data for the right guild

#

Okay

#

I was hoping for a way to do them both at the same time

#

But separately is fine as well

quartz kindle
#

you can set up a cache

#

or something

lusty dew
#

Uhhh

quartz kindle
#

or simply join those functions

lusty dew
#

I would ask how but I don’t have the time to learn rn

#

Oof laggg

quartz kindle
#

make a commandExistsAndIsValid

#

lmao

lusty dew
#

😬

#

Okay

quartz kindle
#

anyway its a good idea to cache prefixes to avoid hitting the database on every single message

#

you can do that with a simple object or map

lusty dew
#

Oh?

quartz kindle
#
cache = {};

.on("message" m => {
    let prefix = cache[message.guild.id] || cache[message.guild.id] = functionToGetPrefixFromDatabase();
 })```
lusty dew
#

How would I join the two funcs together?

quartz kindle
lusty dew
#

I’m confused lol

quartz kindle
#

well, you have two separate functions that return the same thing

#

so you can do both things under the same function

lusty dew
#

Hm

#

So basically convert it into one function

quartz kindle
#
    client.commandExistsAndIsValid = (message,args) => {
        if (message.content.split(' ')[0].replace(client.settings.prefix, '').replace(/[<@!>]/g, '') == client.user.id) message.content = message.content.split(' ').splice(1).join(' ');
        if (client.commands[message.content.split(' ')[0].replace(client.settings.prefix, '')]) {
            if (arg.content.startsWith(client.settings.prefix) || arg.content.replace(/[<@!>]/g, '').startsWith(`${client.user.id}`)) {
                return true;
            } else {
                return false;
            }
        } else {
            return false;
        }
    };```
#

or something similar lol

lusty dew
#

Okay I’ll ping mention if I have any problems

quartz kindle
#

if you want you can also throw the getting the prefix from the db in there too

#

you can also keep your cache in that file instead of the main file

lusty dew
#

So basically do everything in that one file

#

And call it from the main file

quartz kindle
#

yeah

lusty dew
#

Seems easy enough hopefully

#

😂

onyx summit
#

@amber fractal just because I'm interested: why would two listeners cause a memory leak?

quartz kindle
#

i dont think two listeners would

onyx summit
#

but he said so

quartz kindle
#

but listening to the same event two times means executing two functions per event

onyx summit
#

but thats not a freacking memory leak

quartz kindle
#

d.js by itself is a memory leak

onyx summit
#

thats correct, but events have nothing to do with d.js

quartz kindle
#

im trolling at this point

onyx summit
#

no, honestly, d.js ram usage is crazy

lusty dew
#
3|clap  |     at Client.client.commandExistsAndIsValid (/home/panda/ClapBot/library/clap_functions.js:31:22)
#
if (args.content.startsWith(client.settings.prefix) || args.content.replace(/[<@!>]/g, '').startsWith(`${client.user.id}`))
topaz fjord
#

is args an array

onyx summit
#

no its undefined

lusty dew
#

I used the prefix not the mention

#

Why is it returning undefined?

#

Cause I didn’t use mention?

onyx summit
#

no

topaz fjord
#

log args and see what it is

onyx summit
#

undefined

lusty dew
#

Lol

onyx summit
#
 if (client.commandExistsAndIsValid(message) == false) return;

you are not passing any second argument, so the second argument (args) is undefined

lusty dew
#

Ahhh

#

Forgot about that

#

Smh

onyx summit
#

never add two listeners on the message event guys

quartz kindle
#

no numbers, so your argument is invalid

lusty dew
#
3|clap  |     at Client.client.commandExistsAndIsValid (/home/panda/ClapBot/library/clap_functions.js:30:28)
#

The fuck is Luca

quartz kindle
#

Lol

trim wind
#

luca is god

lusty dew
#

That’s no where in my code lmao

trim wind
#

all hail luca

onyx summit
#

yes it is

quartz kindle
#

it says clap_functions.js line 30

lusty dew
#

I don’t see Luca in my code at line 30

quartz kindle
#

whats in line 30?

onyx summit
#

well, you didnt write out luca

lusty dew
#
if (client.commands[message.content.split(' ')[0].replace(client.settings.prefix, '')])
``` do you?
#

Cause if you do I’m extremely blind

onyx summit
#

well, you didnt write out luca

#

someObject['theProperty'] is the same as someObject.theProperty

quartz kindle
#

your code is haunted

#

the only way i can see that happening would be if message.content.split(' ')[0].replace(client.settings.prefix, '') resolves to "Luca", but then anyway it would mean client.commands is undefined

onyx summit
#

client.commands is not defined, and you are trying to read luca from it, probably because athis

trim wind
#

sorry i just came to find out how to add the discord libs to visual studio. tired of coding blind.

onyx summit
#

I don't get what you want

#

panda: did the error happen when the bot started?

lusty dew
#
3|clap  | TypeError: Cannot read property 'startsWith' of undefined
3|clap  |     at Client.client.commandExistsAndIsValid (/home/panda/ClapBot/library/clap_functions.js:32:30)

Console logged args

#

Ye it happened on startup

trim wind
#

i want visual studio to recognize discord api key words.

#

my intelisence is whack

lusty dew
#

Someone was probably talking about Luca

onyx summit
#

yeah then the message event fired before you did client.commands = {}

#

@trim wind well, it should, but it won't work across files

lusty dew
#

Why is args empty now

#

Hmph

#

This is weirddd

#

Trying to condense two functions down to one is causing more problems

onyx summit
#

@quartz kindle by the way my "numbers"
it rised about 100MB, then gone back down 50MB
so +50MB for that second message event

lusty dew
#

Hmmmm why is args empty

#

Can anyone tell me

#

I don’t see a reason why it would be

onyx summit
#

shouldnt be empty

#

regex is fine

lusty dew
#
3|clap  | TypeError: Cannot read property 'startsWith' of undefined
3|clap  |     at Client.client.commandExistsAndIsValid (/home/panda/ClapBot/library/clap_functions.js:32:30)

Console logged args

onyx summit
earnest phoenix
#

@bitter sundial

hollow saddle
#

Pinging staff individually for such things is generally not a good idea

#

And tbh that looks like a message id

#

Not a client id

#

Double check that’s it’s your bot’s CLIENT ID on the discord Dev page for it

west spoke
#

Lemme see if its correct

#

6096318198471721169

#

@earnest phoenix that's not a valid bot ID

lethal sun
#

A bit of a weird question, how do I get a permanent link to a raw GitHub file?

tulip wave
#

anyone know why id get Error [TOKEN_INVALID]: An invalid token was provided. when i just got a fresh bot token? (d.js)

mossy vine
#

are you 100% sure its the bot token and not the client secret

#

it happened to me a few times

tulip wave
#

yes im sure

#

i also tried my main bots token

#

(which is online currently)

lethal sun
#

A bit of a weird question, how do I get a permanent link to a raw GitHub file?
Anyone?

tulip wave
#

okay so if anyone has a bot running rn you probs shouldn't restart it

#

seems like there is a api issue preventing bots from logging in

naive gull
tulip wave
#

Looks correct

naive gull
#

oh

topaz fjord
#

formatting 100

naive gull
#

then.. how do i get like the ytapi from it?

topaz fjord
#

Import the json file

naive gull
#

no shit

topaz fjord
#

<json file name>.tokens.ytapi

naive gull
#

hmm

topaz fjord
#

Wait

#

why make it an array

tulip wave
#

Just require the .json file

naive gull
#

it says this then discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.events' raised an error: AttributeError: 'list' object has no attribute 'discordbotsorg'

topaz fjord
#

Remove the array around the object

naive gull
#

oh

#

Thanks!

earnest phoenix
#

d.js
i have .forEach loop, how do i exit it? return doesn't do it

#

actually, when it caches error, it will spam messages instead of ending it with 1 return message

hollow saddle
#

I think break;

#

I don't remember entirely though

stone dust
#

break doesn’t work inside of a .forEach unfortunately

#

afaik you just have to use a standard “for” loop

#

you could possibly work something funny with array.every and maintain similar syntax

wooden prawn
#

I'm trying to do a survey on the best language to write a discord bot in, in your opinion, if you like it'd be great to get some answers: https://www.strawpoll.me/18468597

flint trellis
#

All my bot tokens just started refreshing themself non stop
Discord does not actually store any tokens in their database. Whenever you visit the page for your bot it will generate a new token for you to use. However, unless you press the "generate new token" button all of the tokens will be valid. It's completely normal and you need not be concerned.

#

^^ For anyone having problems connecting to the API rn.

tulip wave
#

@flint trellis discord.js?

flint trellis
#

not sure, everyone in dapi is talking about it

#

^ official server, pls no ban

tulip wave
#

Oh yeah nvm

flint trellis
#

lol

tulip wave
#

Discord.js isn't handling logging in properly thanks to the new API ban system

#

Gotta wait for a fix

flint trellis
#

fantastic

tulip wave
#

Yeah

#

Bots already logged in aren't affected

#

Only ones trying to log in

winged thorn
#

Great

#

Just how we like it

wooden lance
#

Might be a weird question, but how do I make my bot (js) check a link on virustotal when someone sends it and if it is deemed as malicious, remove it?

flint trellis
mossy vine
#

@tulip wave my bot using d.js logs in properly

#

idk whats going on

#

¯_(ツ)_/¯

wooden lance
#

@flint trellis okay, thanks!

flint trellis
#

@mossy vine does it log in properly or is it currently still logged in

mossy vine
#

log in properly

onyx summit
#

all same library, but the test bot who is doing no api calls (because still in development) doesnt login

mossy vine
onyx summit
#

I think they just fucked up some authentication servers

#

because literally, my bot is on 5 guilds doing no api calls, and gets banned while my 2 bots with together 2.7K guilds are working fine

tulip wave
#

@mossy vine mine doesn't log in for some reason

onyx summit
#

half of d.js can't login their bots mmLol

tulip wave
#

^

abstract crow
#

https://vinniehat.is-inside.me/KX4bnehb.png Yeah fuck... I ordered from them and I wanted a refund as support wasn't getting back to me and I also had ordered a 2nd one, (thinking the first order never went through) and so this happens...

mossy vine
#

weird

tulip wave
#

@mossy vine what version of d.js u using

abstract crow
#

And they deleted my account. lol

mossy vine
#

stable

tulip wave
#

I'm on 12-dev

flint trellis
#

Discord.js INVALID_TOKEN Error

The Discord.js developers are investigating.
It's not a problem with API tokens themselves because you can make requests via postman.

tulip wave
#

Ik

#

It's related to the new API ban system they have

earnest phoenix
#

@tulip wave my friend having trouble logging in too

tulip wave
#

@earnest phoenix yeah it's a d.js issue

earnest phoenix
#

is it only affecting master? or stable too?

tulip wave
#

Idk

#

I haven't tested stable

onyx summit
#

Still nobody can explain to me how my 600 Guilds bot can login, but my 5 Guilds bot can't MmmYes

#

Same library

tulip wave
#

@onyx summit is it d.js?

onyx summit
#

Yes

tulip wave
#

Stable or master

onyx summit
#

Stable, but better Airhorn is master

#

Lemme restart it too

tulip wave
#

Is airhorn the 6 guild one?

#

5*

onyx summit
#

2.2

tulip wave
#

Nvm

onyx summit
#

k

tulip wave
#

It seems to be affecting certain people

#

Some ain't affected

onyx summit
#

Okay nvm

#

Seems like it only affects master

#

Lmao

tulip wave
#

Yeah

#

Time to rewrite my bot back into stable omegakek

onyx summit
#

nah

#

need internal sharding eyesFlipped

#

Aw shit man

#

I wanted to sleep early tonight

valid frigate
#

is internal sharding actually good

#

that's the problem

#

i'm seeing mixed sides here

#

can i have some opinions/thoughts

onyx summit
#

I think its good

valid frigate
#

im told it's only good if your bot is between like 2.5-5k guilds then running it on one process becomes a challenge

#

cant verify this statement

onyx summit
#

Probably depends what it's doing

#

But I can't confirm, I only have 2.2k guilds

flint trellis
#

so the problem was for master branch only

#

people on stable are perfectly fine

#

@onyx summit stop flexing, nobody cares

valid frigate
#

it's not flexing lmao

#

he's just giving information

severe socket
#

you can do internal sharding for more guilds

#

at least with eris

topaz fjord
#

How is he flexing

severe socket
#

5k guild is like 4 shards lol

topaz fjord
#

You can do internal sharding on d.js as well

severe socket
#

yes i know

#

but idk how it performs

#

it's only in master afaik

tulip wave
#

I'm not gonna have fun with sharding once I need it

onyx summit
#

Flexing?

#

Dafuq

valid frigate
#

so big question

#

is internal shardings performance around the same as just regular sharding

tulip wave
#

Discord.js v12 did not prefix the token with Bot in the auth header like it is supposed to
Discord must have started checking and enforcing this in their recent update for api abuse handling.
The commit fixing this issue just landed on the v12.0.0-dev branch, please update your dependencies.
Stable (v11) bots are not affected.

amber fractal
#

lol they enforce token prefix now?

severe socket
#

it's different Vysion. You are in one process only so it will obviously be kind of less performant. But you don't have to go full overhead with IPC or whatnot

valid frigate
#

that's true

severe socket
#

if everything is in one process, you get one cache

#

so it's much easier to deal with

valid frigate
#

1 process vs multiple child processes is dependent on what you're doing?

#

oh yeah definitely

#

no more dealing with a shardingmanager etc

severe socket
#

i don't get your first question

#

yeah

valid frigate
#

actually ignore my qeuestion lol

#

im tired

severe socket
#

obviously as you scale at one point you won't be able to keep up with internal sharding

#

but for 5k guild internal sharding is fine

#

I don't remember the stat but some bot in eris used internal sharding with a looot more than that

onyx summit
#

Okay am I completely retarded or isn't it npm update discordjs/discord.js

valid frigate
#

cant you just run npm install discordjs/discord.js

#

that would automatically update it to latest

onyx summit
#

Sigh

#

I don't know why but it's not doing what it's supposed to do

#

||probably just me being retarded||

amber fractal
#

well 503

onyx summit
#

Ye it's dbl's failing backend

#

Just funny

#

I thought

amber fractal
#

not much you can do about that

onyx summit
#

I was really scared for a second

flint trellis
#

[discord.js][v12] UnhandledPromiseRejectionWarning: Error [TOKEN_INVALID]: An invalid token was provided.?
Discord.js v12 did not prefix the token with Bot in the auth header like it is supposed to
Discord must have started checking and enforcing this in their recent update for api abuse handling.
The commit fixing this issue just landed on the v12.0.0-dev branch, please update your dependencies.
Stable (v11) bots are not affected.

onyx summit
#

I have like 10 uncommited changes on my bot HAhaa

#

structure is for pussys

valid frigate
#

lol my djs package is locked at an earlier version

#

if i update it now it'll be fixed, just never noticed the error

little topaz
#

i am waiting on lucas 😄

earnest phoenix
#

@tulip wave wym you're not gonna have fun with sharding? are you on master?

tulip wave
#

I'm on master

#

But I'm lazy

earnest phoenix
#
const client = new Client({ shardCount: "auto" });
#

sharding, done

slim heart
#

what if i wanted to replace everything that's /__.+__/ but i want to replace it with the content between the __'s. essentially getting rid of the __'s but only if there are two sets of __ with stuff in between (regex)

tulip wave
#

I'm still lazy

#

That takes like 5 sec if effort

earnest phoenix
#

😫 ikr

tulip wave
#

Anyway I'm off to bed

earnest phoenix
#

tbh people make sharding sound difficult (it might be on other languages and stable), but yeah I was surprised when the other dev on my team shown me that in master

#

goodnight

tulip wave
#

Tbh stable sharding wasnt that hard

#

Just a bit of effort

earnest phoenix
#

master 😎

tulip wave
#

Anyway gn

earnest phoenix
#

goodnight

#

are you allowed to remove the Created by in your bot profile?

#

@coral trellis ^

coral trellis
#

Yeah should be alright

sullen sapphire
earnest phoenix
#

doesn't that return a new string

sullen sapphire
#

just with test.replace... isnt it working too

#

@earnest phoenix

sullen sapphire
#

ok i just have to put test = befor replacing

south lantern
#

Hi

abstract crow
#

How do I check the count of all guilds my bot is on? I forgot since I haven't done that in a while lol

#

Discord.JS

opaque eagle
#

client.guilds.size

abstract crow
#

I did that

#

But it comes up 0

opaque eagle
#

Are u sure ur using the right token

earnest phoenix
#

do it after or in the ready event

topaz fjord
#

^

lofty hamlet
#

Good evening, how can I remove in a array all items that I have several times and leave just one example : my array : "MyArray":"One", "Two", "Five", "One", "One", "T" and finally with my command i have : "MyArray":"One", "Two", "Five", "T"

mossy vine
topaz fjord
lofty hamlet
#

And i can get how many i have remove ?

mossy vine
#

@topaz fjord i just linked top google search result. took less than 30 seconds on a phone lol

topaz fjord
#

just compare the lengths of the array before and after

mossy vine
#

or uh

lofty hamlet
#

🤔

mossy vine
#

thats better

topaz fjord
#

length of pre filtered array

#

length of post filtered array

#

subtract post from pre

#

and you get how many you removed

lofty hamlet
#

Ok thx u i go test

#

😃

#
            function onlyUnique(value, index, self) {
                return self.indexOf(value) === index;
            }

            var unique = Dresseur.Sac.filter(onlyUnique);
            var nombre = Dresseur.Sac.length - unique.length
            Dresseur.Potion += nombre
            message.channel.send("Nombre de Pokemon(s) supprimé(s) : " + nombre)
            break;```

It work but when i save my BDD Dresseur.Sac.filter(onlyUnique) replace or i do make : `Dresseur.Sac = unique` ?
#

@topaz fjord sorry for ping christmasthink

maiden mauve
#

Hmm, why would this code fail being run on server (cannot read fetchUser of undefined), but then work without an error when calling the function through a command prompt?

dailyReset: async function(bot) {
        console.log("DAILY RESET!");
        let player, name;
        const players = mongoose.model("players", playerSchema);

        await players.deleteMany({level: 1, exp: 0, rLevel: 0});

        const popArray = await players.find();//.sort({ level: -1});

        for(let i=0; i<popArray.length; i++) {
            
            player = popArray[i];
            name = await bot.fetchUser(player.flake, true);

            player.name = name.username;

            player.hasDAILY = false;
            player.hvLimit = (player.inventory.CoffeeMug)?12:10;
            player.expCap = 1200;

            await player.save();
        }

    },
#

hm?

topaz fjord
#

d.js master or stable

#

v12 or v11

#

if your on v12

#

its <Client>.users.fetch(<id>)

maiden mauve
#

ah

#

so the server might be on different djs than my pc?

topaz fjord
#

probably

maiden mauve
#

I'm guessing not

#

I just hate pushing console checks to server but ill investigate ty

#

how do you find that out? It doesn't appear to be in the documentation in node folder

idle basalt
#

check the package.json

maiden mauve
#

_id?

#

11.5.1

#

so its possible I'm testing my program on v11, and the server npm updated it to 12?

idle basalt
#

yes but its unlikely

maiden mauve
#

it just sucks because this function is very important to the "tempo" of things

#

I guess I can just comment block the actual effect

#

until its displaying the right IDs

idle basalt
#

it says cant read fetchuser of undefined so the problem is with your bot object, not the d.js version

#

are you sure youre passing the correct property into that function

maiden mauve
#

yeah, I thought of that

#

the only difference is

#

its called via setTimeout at "midnight" passing bot object, to a function which passes bot again

#

versus testing, it calls it directly from bot.on

idle basalt
#

as long as youre passing the correct object it shouldnt matter

maiden mauve
#

c.midnightRecursive();

#

clearly I am passing the bot object correctly

#

any rookie could see that

#

because it's written right there

#

🔫

#

thanks for dumb thinking for me 😄

idle basalt
#

passing nothing into the function could probably explain why its undefined lol

#

ye np man stupid mistakes happen all the time

sick cloud
#

so i have this

const active = '<%= active %>';

$.each($('.item'), () => {
    if (this.id == `active:${active}`) {
        
        $(`#${this.id}`).addClass('active');
    }
});``` but it doesn't add any class
opaque eagle
#

Is that jQuery :(

sick cloud
#

yes it is

earnest phoenix
#
[2019-08-13 00:58:32] Uncaught Promise Error:
[2019-08-13 00:58:32] Error [TOKEN_INVALID]: An invalid token was provided.
[2019-08-13 00:58:32]     at WebSocketManager.connect (/var/www/airi.moe/airi/node_modules/discord.js/src/client/websocket/WebSocketManager.js:132:26)
[2019-08-13 00:58:32]     at AiriClient.login (/var/www/airi.moe/airi/node_modules/discord.js/src/client/Client.js:210:21)
[2019-08-13 00:58:32]     at processTicksAndRejections (internal/process/task_queues.js:85:5)
#

?

opaque eagle
#

Provide the proper token

#

Oh

earnest phoenix
#

So, what's the fix?

opaque eagle
#

LOL how dumb

earnest phoenix
#

what the fuck

opaque eagle
#

Technically Discord API wants bot tokens to be sent as "Bot <your-token>"

#

Discord.js was like nah kid and added it in for u

#

While other non-JS libraries like discord.go make you put it in manually

#

but in v12 apparently they forgot

earnest phoenix
#

sooooo what do i have to do, re-code the bot or just change something? I'm using Klasa

opaque eagle
#

ooh klasa

earnest phoenix
modern sable
opaque eagle
#

To fix it, do this:js new Client(/* etc etc etc */).login(`Bot ${what-your-token-normally-was}`)

slim cobalt
#

my
bot
five declined

#

😦

earnest phoenix
#

Oh yeah

#

that fixed it @opaque eagle tho my sharding broke

#

lol

#

yeet

#

so

#

it worked like 10 secs before and then dc had blackout and bam

#

bot awae

#

Hmm, @opaque eagle even though i'm using this now

new AiriClient(config).login(`Bot ${token}`);

It just threw me the same error again

#

Yea

#

Yeah that's what i did

#

still giving me same error though

#

kk i'll try

zealous veldt
#

What

earnest phoenix
#

bots love mass DMing today dont they

#

copy and paste the text

#

Regarding Rate Limits

A new system has been deployed that auto ip-bans IP addresses that send the API too many invalid requests. Today, that is considered to be requests that result in a 401, 403 or 429 HTTP status code as a response. This is in response to some pathologically bad bots spamming our API with said invalid requests.

I've raised the threshold for this auto-ban to be pretty high, and only action on the most pathological cases. The current limit as of Aug 11, 9 am PDT is 25,000 requests per 10 minutes, or 41.6/sec for 10 minutes. The limit is planned to be lowered to 10,000/10 minutes in 30 days. The auto-ban lasts 1 hour. If you are auto-banned, there is no way for us to remove the ban, so you'll have to wait it out.

This means that you need to send 25,000 requests in 10 minutes that result in a 401, 403 or 429 in order to be auto-banned.

If your bot is running into issues, I'd consider adding logging to see exactly what you are spamming our API with that's caused you to get banned.

I've written a bit more about it here as well: https://www.reddit.com/r/discordapp/comments/couffh/is_discord_going_to_undo_the_recent_api_change/ewmd8f0?utm_source=share&utm_medium=web2x

#

Ok i got the fix for it @earnest phoenix
After you add the Bot <token> just update discordjs and then run the bot again with the new client login

#

lol

#

i'm getting another error

#

it's klasa though

#

weird

valid frigate
#

lmao im looking at the issues rn

opaque eagle
#

why does discord right-align messages in that squiggly language

earnest phoenix
#

because that language reads from right to left

opaque eagle
#

oh

sudden geyser
#

nice

quasi lynx
#

how do i do an nsfw command?

#

i want to make my bot search for the images

opaque eagle
#

Use an NSFW api or scrape NSFW sites like PonyHub or r/nsfw

quasi lynx
#

ty ty ty

#

wait wait

#

any name of an api of nsfw?

#

idk any

opaque eagle
#

Me neither

quasi lynx
#

t.t

opaque eagle
#

Maybe take pictures of yourself and put them in a folder

quasi lynx
#

no thanks

vestal crystal
#

lol

flint trellis
#

boob bot

#

its $15 a month

#

same one dank memer uses

warm marsh
#

Nekobot has a free api I think?

#

Or had.

lyric belfry
#

someone know a warn bot ? please dm me if yes

earnest phoenix
#

@earnest phoenix ciao

lyric belfry
#

Ok sorry

lusty dew
#

I know it’s not the best choice but I really gotta get some work done and my pc broke. Does anyone know any code editors for iOS

#

I’d use my phone but it got stolen today so oof

earnest phoenix
#

hey i have a problem with the discord.js@12.0.0--dev token thing

#

i prefixed it with bot

#

and it still doesnt work ,-,

lusty dew
#

Trouble connecting?

earnest phoenix
#

it says invalid token provided

lusty dew
#

Wait you’re talking about master right

earnest phoenix
#

wat

lusty dew
#

D.js master right

earnest phoenix
#

and no

lusty dew
#

Oh

#

That’s not how you do it

earnest phoenix
lusty dew
#

That isn’t how you do it at all

earnest phoenix
#

ok

#

so how

lusty dew
#

How do you have a developer role but don’t know how to login your bot

earnest phoenix
#

inhales

#

so basicially

#

i just began to use v12

#

so

#

nO

lusty dew
#

It’s the same either way?

earnest phoenix
#

lol?

lusty dew
#

You just put the token in

earnest phoenix
#

it worked perfectly before

lusty dew
#

That’s it

earnest phoenix
mossy vine
#

@earnest phoenix iirc v12has an issue with the new api changes thats preventing bots from logging in

earnest phoenix
#

ok?

#

so i should use something lower

south lantern
#

Can I invite my bot to this server?

earnest phoenix
#

nop

#

if its accepted it gets added

south lantern
#

I got it

#

I'm waiting for admin accept my bot

earnest phoenix
south lantern
earnest phoenix
warm marsh
#

@earnest phoenix You know you can just do client.login(token);

earnest phoenix
#

yes i know dat

warm marsh
#

Yeah

earnest phoenix
#

but

#

it

#

no work

#

and i checked the token

warm marsh
#

What's the error?

lusty dew
#

Did you provide the correct token

warm marsh
#

Incorrect details.

mossy vine
#

go back to your original way of logging in. that is correct. it is d.js that is having issues with that

lusty dew
#

Or did you provide a client secret

earnest phoenix
#

ok i was stupid

#

i provided token

lusty dew
#

@mossy vine since when was that original?

earnest phoenix
#

but i didnt update the token in my config ,-,

#

so

lusty dew
#

I never had to do that tf

earnest phoenix
#

yeet

mossy vine
#

@lusty dew original as in first way he did it

lusty dew
#

How is that normal?

mossy vine
#

i dont use v12, but from what i know, it did not prefix the token in hte header with Bot, so you had to specify it manually

lusty dew
#

You don’t anymore do you?

mossy vine
#

according to that message, no

#

(if you update)

lusty dew
#

Okay

#

Oh yea I’m dumb I did update

#

Boutta say idk why it’s working for me then lel

earnest phoenix
#

Can someone tell me what is “-“ in regex?

#

I am trying to remove - from strings js

real helm
#

Hello

earnest phoenix
#

sa

warm marsh
#

/-/

#
string.replace(/-+/, '');
opaque eagle
#

or a dirtier approach: js str.split("-").join("");

lusty dew
#

I know it’s not the best choice but I really gotta get some work done and my pc broke. Does anyone know any code editors for iOS

drowsy sentinel
#

Coda?

lusty dew
#

Preferably something free

#

I don’t have the money rn

opaque eagle
#

maybe run code-server on ur VPS and connect to it

lusty dew
#

I’ll have to ask the server owner first lel

unreal cape
#

i wonder if you can create a kahoot or skribbl lobby through a bot

opaque eagle
#

you could

unreal cape
#

i might actually try

earnest phoenix
#

kahoot yes, skribbl still yes but practically unusable

#

it's weird

#

i tried network inspecting skribbl once it's really weird

opaque eagle
#

i was thinking of that one npm package that let u emulate chrome or smth

earnest phoenix
#

fixed already owo

lusty dew
#

@earnest phoenix huh

earnest phoenix
#

@earnest phoenix ur right i dont deserve bot dev role

lusty dew
#

Okay what does that have to do with pinned messages

earnest phoenix
#

npm i https://github.com/discordjs/discord.js#master

#

^ new ver

lusty dew
#

Or why not just do npm i discordjs/discord.js

earnest phoenix
#

because usually it installs v 11.4.idk then

lusty dew
#

Huh

earnest phoenix
#

11.5.1

lusty dew
#

That’s master version

#

Wym

earnest phoenix
#

so i ran it and installed dc.js@11.5.1

lusty dew
#

It would install 12.0.0

earnest phoenix
#

it doesnt lmao

lusty dew
#

It does mmLol

#

I used it

earnest phoenix
#

ok

lusty dew
#

It installed 12.0.0

abstract crow
quartz kindle
#

npm doesnt jump versions to prevent breaking your code

#

if you have version 5.x.x of something installed, running the install command with never upgrade it to 6.x.x, it will always stay on 5

#

unless you completely uninstall the package, then it will get the actual latest version

stray garnet
#

at item.request.gen.end (/rbd/pnpm-volume/cec94d0a-3656-4969-903d-51a1b2f51f8f/node_modules/discord.js/src/client/rest/RequestHandlers/Sequential.js:85:15)6:27 PM

at then (/rbd/pnpm-volume/cec94d0a-3656-4969-903d-51a1b2f51f8f/node_modules/discord.js/node_modules/snekfetch/src/index.js:215:21)6:27 PM

at process._tickCallback (internal/process/next_tick.js:68:7)6:27 PM

(node:5060) 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(). (rejection id: 10)6:27 PM

3 ; 126:28 PM

What does that Error mean

quartz kindle
#

DiscordAPIError: Missing Permissions

earnest phoenix
#

client didnt become ready in time error. seems to be an issue with sharding.
first time trying to boot on discord.js master version and i get this.

i added client.on('debug', console.log) and now i get the following:


[WS => Shard 0] Didn't receive a heartbeat ack last time, assuming zombie connection. Destroying and reconnecting.
[WS => Shard 0] Clearing the heartbeat interval.```
quartz kindle
#

when did you install master?

#

they had an emergency update to fix a connection issue like 1-2 days ago

earnest phoenix
#

Today

quartz kindle
#

does it connect if you dont shard?

split hazel
#

well it was installed around yesterday and updated using npm i discordjs/discord.js

#

and i'll try that

#
      URL: wss://gateway.discord.gg
      Recommended Shards: 3
[WS => Manager] Session Limit Information
      Total: 1000
      Remaining: 978
[WS => Manager] Spawning shards: 0
[WS => Shard 0] Trying to connect to wss://gateway.discord.gg/, version 6
[WS => Shard 0] Setting a HELLO timeout for 20s.
[WS => Shard 0] Opened a connection to the gateway successfully.
[WS => Shard 0] Clearing the HELLO timeout.
[WS => Shard 0] Setting a heartbeat interval for 41250ms.
[WS => Shard 0] Identifying as a new session. Shard 0/1
[WS => Shard 0] WebSocket was closed.
      Event Code: 4011
      Clean: true
      Reason: Sharding required.
[WS => Shard 0] Clearing the heartbeat interval.
[WS => Shard 0] SHARDING_REQUIRED
[WS => Manager] Manager was destroyed. Called by:
Error: MANAGER_DESTROYED```
#

@quartz kindle

real helm
#

Hello

#

The NSFW bots are allowed?

quartz kindle
#

@split hazel try with 2 shards

real helm
#

The NSFW bots are allowed?

split hazel
#

mk i'll try 2 shards

amber fractal
#

NSFW cant be the main function

#

And you cant list nsfw commands on the site

split hazel
#

same thing happened with 2

quartz kindle
#

sharding required?

#

then do it with 3

split hazel
#

oh no

#

and i have some news

#

i set the timeout to 999999999 and shard 0 managed to login

quartz kindle
#

wtf

#

you mean spawnTimeout in .spawn()?

#

did you set it to something low before? or was it the default 30 secs?

split hazel
#

yes

#

shard 0 and 1 logged in but 2 seemed to be terminated, on those servers where its online, it doesnt respond

#

hold on some decided to try restart

#

on each shard the zombie connection log comes up and the shard restarts again

terse plinth
#

hey