#development

1 messages · Page 1136 of 1

solemn latch
#

a json

tranquil marlin
#

any suggestions

solemn latch
#

what lib mitron

tranquil marlin
#

djs

sick cloud
#

so i have some code thing that checks for words in a message
and i'm trying to check for rent
but it always triggers on others like different
how do i fix that

tranquil marlin
#

ik that but problem is different

#

i want to limit user permission

#

not role permission

solemn latch
#

permissionOverwrites can be members

sick cloud
#

^

#

just set the id as a user

solemn latch
#

using regex?

tranquil marlin
#

ait ill try something

drifting wedge
#

parsing doesnt work

#

i mean it might

#

i couldnt find ho

solemn latch
#

whatcha mean cant find how?

sick cloud
#

@solemn latch could you give me an example then

drifting wedge
#

i mean i can find how to patse

#

but how do i send the parsed info?

solemn latch
#

send(parsedinfo)

drifting wedge
#

wait so

tranquil marlin
#

does @everyone have an id

sick cloud
#

@tranquil marlin yes

solemn latch
#

the guilds id

drifting wedge
#

@everyone

#

has_role('everyone')

misty sigil
#

its the guild ID

tranquil marlin
#

oh

misty sigil
#

<@&264445053596991498> = <@&264445053596991498>

solemn latch
sick cloud
#

okay

drifting wedge
#

but like

sick cloud
#

and i assume i can't use template literals in regex right

solemn latch
#

\b is the word boundry

#

dont think so

drifting wedge
#
async def on_member_join(member):
    with open('wchannel.json', 'r') as f:
        wc = json.load(f)
    with open('welcome.json', 'r') as f:
        welcomemsg = json.load(f)
        channel = 'wc'
    await client.get_channel(741842774223224894).send(f"{welcomemsg}")```
#

i would not send it

#

?/

#

im hella confused

#

thats my code

sick cloud
#

yeah i tried

drifting wedge
#

right, how can I send only the one i want

solemn latch
#

as everyone said earlier, you will be confused the entire time if you dont learn python before making bots

drifting wedge
#

and the same goes for the channel

#

I WILL

#

just not for a bit

solemn latch
#

well, this is not a python teaching channel

thick gull
#

???? just not for a bit

drifting wedge
#

hm

#

ok buddy...

#

jk

solemn latch
#

if you cannot reasonably debug issues yourself, i cant really help you pandasad

sick cloud
#

well, does anyone know how to use variables in regex then

solemn latch
#

js right?

sick cloud
#

yea

#

latest

solemn latch
#

you might be able to use new RegExp(``)

#

i think that might actually work, but i really cant be sure

sick cloud
#

and to check for a match, i do regex.match(string) right?

solemn latch
#

would be string.match(regex)

sick cloud
#

ah

solemn latch
#

match does return an array of all matches.

sick cloud
#

so new RegExp('b', stringToCheckFor, 'b') maybe

#

wait new RegExp doesn't accept b @solemn latch

opaque eagle
#

Hey... I'm pretty good with Discord bots and programming in general but I'm clueless when it comes to voice bots... what's lavalink about

misty sigil
#

music bot

opaque eagle
#

Yeah I know that much

#

but what's the difference between lavalink and regular ffmpeg

misty sigil
#

holy mother of pogging

sick cloud
#

it's a java server that handles music

#

just more work

subtle kiln
opaque eagle
#

oh

misty sigil
#

i just realised i have a /112 block of ipv6 ips

honest perch
#

Lavalink has much higher quality

opaque eagle
#

so not worth it?

misty sigil
#

can i make a music bot now

subtle kiln
honest perch
#

Jeremy

#

Dms

sick cloud
#

i still want help with regex mmLol

obtuse jolt
#
import time
from random import *
waittime = randint(3, 30)

input('Press enter when you are ready to begin!\n')

print('Get ready!')

time.sleep(waittime)

start_time = time.time()
input('\n -- PRESS ENTER NOW --  \n')
end_time = time.time()

t = (end_time - start_time) * 1000

time = str(t)

if(t < 250):
    print("Stop hacking! You did it in " + time + "ms!")
else:
    if(t < 500):
        print("Slow down there cheatah! You did it in " + time + "ms!")
    else:
        if(t > 501):
            print("Lookin' a bit slow there! You did it in " + time + "ms!")
        else:
            print("Better luck next time! You did it in " + time + "ms!")

here do this i got 365.28682708740234ms

amber fractal
#

@sick cloud what are you trying to do?

opaque eagle
#

I wish I could understand all of the nuances of regex

amber fractal
#

It's fucky

opaque eagle
#

but rn I know enough to do what i need to do so meh

amber fractal
#

It's really useful though

opaque eagle
#

yeah

amber fractal
#

not too performant tho lmao

opaque eagle
#

It's super handy for find and replace when i use vim

#

when editing config files and stuff u can remove the comments really easily and what not

amber fractal
#

yep, just search for \/\/(.*) lol

sick cloud
#

see ^

solemn latch
#

\b works fine in js,
im just not sure how to do
\b${name}\b\

sick cloud
#

it doesnt like it

amber fractal
#

\W(${word})\W should work shouldnt it?

solemn latch
#

\b is just a word boundry

sick cloud
#

oh like that

#

so b${ar}b

solemn latch
amber fractal
#

yeah /\brent\b/g

#

so new RegExp(`\b${word}\b`, "g") I just add g, not sure if you need it

warm marsh
#

Depends on what you're doing.

amber fractal
#

That's why I said idk if he needs it

warm marsh
#

oh yeah.

amber fractal
#

idk what he's doing mmLol

warm marsh
#

mb

sick cloud
#

well i wanna match the first set only tbh

amber fractal
#

oh then yeah you dont even need the global tag

summer torrent
sick cloud
#

like if the word is pine i want it to match on
isn't that a nice pineapple, it looks very pineapple-y
only the first

#

and also how do i actually check to see if it's matched

#
const matches = msg.content.toLowerCase().match(new RegExp(`b${x.name}b`));
warm marsh
#

Using match will return an array or undefined iirc

#

null*

amber fractal
#

do you want the matches?

warm marsh
#

if not matches return or something

sick cloud
#

i only need to know a true/false if the word was found in there

#

as its in a .find block

amber fractal
#

Then I'd use <RegExp>.test(string)

#

It's a little more performant because it only returns a boolean

sick cloud
#
docs.find((x) => {
  return new RegExp(`b${x.name.toLowerCase()}b`).test(msg.content.toLowerCase());
});```
#

looks good for me

amber fractal
#

Yeah, did the backslashes get removed on copy paste?

#

you want to escape the b with a backslash to create a word boundary

sick cloud
#

oh

#

so add /

amber fractal
#

backslash

#

\

#

\b

sick cloud
#

ah

#

js is awesome isnt it

#

'pin/'

#

doesn't work?

amber fractal
#

Let me try it

#

double escape it

#

\\b

solemn latch
#

ay

amber fractal
#

It's stupid, but the backslash is escaping the b and you need a \b to show in the regex

solemn latch
#

i couldnt figure it out

amber fractal
#

\b is some different thing probably

solemn latch
#

i have like 2 pages of console commands in devtools

amber fractal
#

lol

solemn latch
#

trying to figure it out

amber fractal
#

I remember that happened to me once

sick cloud
#

ay cool ty

amber fractal
#

👍

sick cloud
#

one more question

#

how do i sort an array of objects by the character length of a property

#

specifically name

solemn latch
#

sort

sick cloud
#

so 1 character ones like a come first, then longer ones like apple last

sick cloud
#

but how in sort

warm marsh
#

Doing it how you'd normally do it but instead do something like a.prop -b.prop

sick cloud
#

does that take special chars into account

solemn latch
#

you can make the compare function as complex as you need

#

if its just length, it will count each special character as one

#

iirc

amber fractal
#

doesnt sort use length of strings in its example?

#

Oh, no they do something else

solemn latch
#

yeah, its kinda weird the demo

amber fractal
#

< 0 first element passed goes in front > 0 second element passed goes first

solemn latch
#

🤔

amber fractal
#

a - b results in ascending order, b - a results in descending

#

It's weird because of how it runs through the array

stray pecan
#

Hola cuánto tiempo tengo que espera a que mi bot sea oficial?

solemn latch
#

yeah, interesting stuff

amber fractal
#

like if you log the element too

stray pecan
#

How long do I have to wait for my bot to be official?

amber fractal
#

rn it's 3 weeks+

stray pecan
#

That's a lot D:

sick cloud
#

my bot is bout 75 servers off a new milestone 😎

solemn latch
#

hype

strange trout
#

Epic

solemn latch
#

ive been on 41 servers for awhile

strange trout
#

My useless bot is about to hit 1000 servers

solemn latch
#

probably doesnt help ive not worked on anything in like 4 weeks

sick cloud
#

if i get 75 more, i'll hit 50,000

#

50k a big milestone

#

😎

#

its at 49,932 rn

amber fractal
#

when you hit 69,420 stop accepting new servers

solemn latch
#

^

quartz kindle
#

congrats tony :3

amber fractal
#

if(guilds > 69420) guild.leave()

sick cloud
#

lmfao

#

awesome

#

but ty

#

now to go for 100k

strange trout
#

My bot has 3 commands

solemn latch
#

everyone always wanting more

#

oo

strange trout
#

It just scrapes a website for random conversation topics

sick cloud
#

lmao i want less servers please

#

then i can devote more of it's server to my web project

amber fractal
#

your bot gets youtube info and lyrics right?

sick cloud
#

@amber fractal more than that rn

quartz kindle
#

yeah it gets to that point where you want people to stop adding your bot

sick cloud
#

it also sends a msg when a channel uploads

quartz kindle
#

because it uses too much resources and becomes a pain to maintain lmao

amber fractal
#

Tim how many servers is your bot in now?

sick cloud
#

fun fact, i've had 8 people ask if they can pay me to add more channels

#

lmao

quartz kindle
#

idk like 4k

amber fractal
#

pubhubsubbub

sick cloud
#

the hard limit is set as 10 yt channel notifiers per server but some guy wanted like 10,000

amber fractal
#

Linking my bot to that was actually retarded

quartz kindle
#

4443 guilds lol

sick cloud
#

pubsub is bad

#

someone should come redesign ours, its a turd

amber fractal
#

how else do you do it?

#

I looked so desperately

sick cloud
#

pubsub is the only way google offers officially

#

then there's also scraping possibly

quartz kindle
#

like your bot notifies when someone uploads a new vid?

amber fractal
#

Lemme see if I can get the details on my webhook

sick cloud
#

yeah that's what it does

#

it's what kicked off a lot more invites

quartz kindle
#

so basically that dude wanted his entire subscriptions list on discord lmao

sick cloud
#

yep

faint prism
#

Does top.gg really get you into thousands of guilds?

solemn latch
#

it can

sick cloud
#

i get only a few invs from dbl

quartz kindle
#

you know what you could do tho? you could have an option for people to use their own google api keys for such personal things

sick cloud
#

like only 100-200 per month

#

yeah true

#

we have a huge key we use with 500k quota

#

thing is

#

if they use their key

#

and it spams

#

they block our IP

quartz kindle
#

ye but its still your bot using it, you control the requests

sick cloud
#

possibly

quartz kindle
#

its just load taken off of your main key

amber fractal
#

also I have no idea what any of this does anymore

#

like why incoming[0] == "sha1" I'll never know

#

also fastify because

sick cloud
quartz kindle
#

xD

#

my api is also a huge mess

#

using restana instead of fastify

#

but i wanna try nanoexpress

amber fractal
#

I dont like that I need to reverify it every day

#

but it's whatever

#

Now wanna see the mess of a twitch webhook?

quartz kindle
#

sure

amber fractal
#

It'll take 2 images I think

#

Have to do git stuff 1 sec

#

Why is github being stupid

#

it's saying I dont have access to my private repo when I have it open in my other monitor

misty sigil
#

development memes

amber fractal
#

will it embed 4?

#

Lmao jfc

#

I feel like it looks like a lot less not as images

#

I never did anything with oauth before so my code to get a token is so dumb

quartz kindle
#

i dont like those elses

#

gives me claustrophobia

#

lmao

amber fractal
#

shhh shhh it'll all be over soon

long hare
#

is there a maxim volume for the music?

amber fractal
#

Depends on how good your cpu is (if you're boosting it not through discord)

long hare
#

I know you need a good CPU, but is there a limit who discord wrote?

#

or said everywhere

amber fractal
#

there's no hard cap on the decibels a user could potentially output I dont think

long hare
#

ok

solemn latch
#

i would presume the limit would be determined by the users sound card

misty sigil
#

until the discord servers blow up

long hare
#

yeah

amber fractal
#

well they blow up on a regular basis, so it's just expected

solemn latch
#

ah, we found the cause of discords issues

#

too high volume

drifting wedge
#

what is like the easiest python database to use?

#

i mean like SUPER EASY

solemn latch
sick cloud
#

some dude's bot setting volume: Infinity

#

discord: whoa

quartz kindle
#

lmao

amber fractal
#

I wonder what would happen

quartz kindle
#

it will just ruin the sound

amber fractal
#

I'm curious if you could break someone's sound card lmao

misty sigil
#
try{
send packet
}catch(erroir){
explod
}```
drifting wedge
#

is json slow?

quartz kindle
#

it likely wont go past some hard limit

drifting wedge
#

or just un secure?

misty sigil
#

json has to be slow

solemn latch
#

its not intended to be a database

misty sigil
#

if its fast u get corruption

amber fractal
#

neither of those are the reasons people dont use them

misty sigil
#

json is bad for database

#

good for config files ig

faint prism
#

^

solemn latch
#

databases are for storing data, json is for communicating data

amber fractal
#

Great for static data

drifting wedge
#

i mean would i be able to use it for a small while?

quartz kindle
#

json is good if you know how to use it :^)

misty sigil
#

change asap

faint prism
#

I used JSON as a DB and when it serialized wrong, it rekt itself

misty sigil
#

json is good if you know how to use it :^)
@quartz kindle thats just mongodb with extra steps

drifting wedge
#

i mean ill use it short term

solemn latch
#

we have had this conversation all day

#

🤔

drifting wedge
#

I KNOW

solemn latch
#

litterally the past 8 hours

drifting wedge
#

but databases are frikin hard

solemn latch
#

you coulda learned all about databases in an hour

#

🤔

faint prism
#

It honestly isn't that hard to migrate to a proper db,

quartz kindle
#

my bot was using a json database until it hit 2500 servers

solemn latch
#

^ ok tim

drifting wedge
#

I am like very new to coding

solemn latch
#

you live on the edge

misty sigil
#

oh no

drifting wedge
#

LIKE less than 1 week

faint prism
#

but databases are frikin hard
@drifting wedge Not really. It's basically a dictionary collection

drifting wedge
#

caps

#

im a noob

sick cloud
#

just use Enmap if you're that dumb

misty sigil
#

ok so

amber fractal
misty sigil
#

basically, databases are quite easy

quartz kindle
#

doesnt enmap have memory leaks lul

sick cloud
#

meh

#

it works

#

so

solemn latch
#

python

sick cloud
#

i dont use it

misty sigil
#

they're using py you dingus /s

midnight blaze
#

@quartz kindle gg, one of bot uses json as db as well. I have never had problems with it.

sick cloud
#

makes sense

drifting wedge
#

i mean for storing prefixes, and welcome messages i dont care if its not secure

amber fractal
#

you dont need to use a db for stuff that doesnt change

misty sigil
#

afaik enmap isn't persistant

sick cloud
#

port Enmap to py

misty sigil
#

right

sick cloud
#

and no it is

amber fractal
#

it is

sick cloud
#

you just need to add sqlite

misty sigil
#

what the hell

#

it is

#

my life is a lie

quartz kindle
#

the problem is, you need to be careful when you save stuff to your json files, because if anything goes wrong, the entire file is erased/lost/broken

sick cloud
#

install better-sqlite3 and set persistent: true

amber fractal
#

backup before every write mmLol

misty sigil
#

backup-38238128739821739821.json

quartz kindle
#

so with that in mind, using a proper database might be easier than setting up a json file correctly with all necessary safety checks

amber fractal
#

the dbs basically handle that for you

#

and less stuff corrupts them mmLol

#

I've seen someone's json die because of unsupported characters

sick cloud
#

i had a dumb idea to make a json wrapper for simple projects that included safety, mainly back ups every x minutes, as well as a read write queue so only one action happens at a time

quartz kindle
#

for instance, you should never directly write to a json file, you should always write to a temporary file, then overwrite the original by renaming the temporary file

midnight blaze
#

If it is corrupt you will know tho, aint a big problem. Simply restart it and find why it got corrupt => correct it.

misty sigil
#

json databases aren't something you wanna do

amber fractal
#

or use a regular db => dont have the issue

misty sigil
#

Yea

sick cloud
#

^

misty sigil
#

Using a regular db is actually simpler than rigging up a proper json database

sick cloud
#

there's no way to make json 100% safe

amber fractal
#

Not to mention if you dont have a backup, it is a big problem

midnight blaze
#

mongoose is good to start with

sick cloud
#

mongoose is a nightmare

midnight blaze
#

how so?

sick cloud
#

the actual mongodb module is good

misty sigil
#

no way to make reg databases 100% safe

#

the actual mongodb module is good
@sick cloud aye, mongoose confuses me

sick cloud
#

^^

faint prism
#

List<object> MyDatabaseLol

sick cloud
#

i started with mongoose and got nowhere, moved to mongodb and had it working in 10 minutes

misty sigil
#

and mangodb module works well enough

amber fractal
#

I prefer the official driver over mongoose imo

sick cloud
#

even made my own wrapper for it

#

could someone help me come up with a good name/acronym of "persistent storage/store"

misty sigil
#

pise

sick cloud
#

nice

amber fractal
#

persistent integrated storage elements

eternal flame
#

how can i find the uptime for my bots in ms

misty sigil
#

client.uptime

amber fractal
#

A lot of people dont like that

#

I forgot why tho

sick cloud
#

i just go based off a global date set when i run the first file

#

first line of index: global.startedAt = Date.now()

eternal flame
#

also,

sleek gull
#

localStorage.clear()(

#

;*

eternal flame
#

what are cached users?

solemn latch
#

users in memory

eternal flame
#

how do they get cached\

solemn latch
#

if a user sends a message, that user will now be in memory

sleek gull
#

would cookies be stored in localStorage??

eternal flame
#

oh

solemn latch
#

stuff like that

eternal flame
#

do they stay there permanently?

solemn latch
#

if you dont clear them, yes

eternal flame
#

hm

solemn latch
#

that can be a good thing, and a bad thing

eternal flame
#

im trying to store cached users to put into my api

sleek gull
#

javascript:eval(prompt('Enter Code'));

#

code injection thing

#

but first,

#

you’d need to inject that code

#

so it’s basically useless

#

but it can still be used for things

eternal flame
#

how would i store cached users and clear them, and when would i need to clear?

sleek gull
#

idk

#

.clear(); or something

solemn latch
#

when you say store them, do you mean store them in a database?

eternal flame
#

im not sure

solemn latch
#

cached users are already in the cache, you dont really need to store them again unless your looking for long term storage.

#

or another layer of cache

eternal flame
#

so

#

how do i find out how many cached users there are

amber fractal
#

in d.js, client.users.cache.size

eternal flame
#

oh

sleek gull
#

I thought you wanted to clear the cached users

solemn latch
#

djs doesnt really provide an easy(maybe any) way to clear cached user iirc.

amber fractal
#

it's a collection...

sleek gull
#

is eval overused in js these days?

amber fractal
#

client.users.cache.clear() would work

solemn latch
#

if you wanted to have more control over caching, djs light

#

that would clear every user, which is generally undesired i would think

drifting wedge
#

how many lines of code is mee6?
just wondering

solemn latch
#

unknown

amber fractal
#

then client.users.cache.delete(id)

drifting wedge
#

i mean the bot devs dont say anything?

amber fractal
#

a collection is just an extended map

misty sigil
#

we literally

#

WHY WOULD WE KNOW

solemn latch
#

typically, you want to clear things that are not used from cache

sick cloud
#

using fs/path, how do i define a data dir like ./data that's always in the root folder of the project no matter where the code is running from

#

since this code is going in a module of sorts

eternal flame
#

I thought you wanted to clear the cached users
@sleek gull im not sure if i need to or not

amber fractal
#

I thought __dirname worked

eternal flame
#

im storing them in an api

#

bot stats

sick cloud
#

well ok

#

and with fs how do you make a folder/make a file if it doesn't exist

#

otherwise open it

#

and also that means i can do __dirname + '/data' right

amber fractal
#

use existsSync(path) to check if it exists, then open it accordingly, and mkdirSync(path) or writeFile(path, data)

#

that should work, idk if you need to use path or not

sick cloud
#

okay

solemn latch
#

the specific bot stats will have different requirements for getting/storing @eternal flame

supple sail
amber fractal
#

__dirname works for me without path

#

you cant get a shard id like that anymore. Afaik the only way to get a shard id on v12 is to look at a guild in the cache

solemn latch
#

for example, getting the total number of commands run would require storing in a database of some type.
getting current user count will not

amber fractal
eternal flame
#

the specific bot stats will have different requirements for getting/storing @eternal flame
@solemn latch ???

sick cloud
#

ok so i ran the new folder code from src/Store.js and then ran it from tests/index.js but it made the /data folder in src/data

#

how do i fix it so it makes it from the code dir, /tests

#

or the root dir itself /

amber fractal
#

well __dirname is the current directory the parent process is executed from I believe

sick cloud
solemn latch
#

that link looks pretty good for explaining __dirname and some of its alternatives

sick cloud
#

oh so should i use process.cwd()

#

yea that works better

#

ty

quartz kindle
#

yes ^

sick cloud
#

can you use typeof val === array to check if something is an array

solemn latch
#

Arrays are considered objects i think

sick cloud
#

so how can i distinguish the two

earnest phoenix
solemn latch
#

.isArray I think

#

007 o yeah

earnest phoenix
#

Oh wait its because I'm a moron, I know what I did wrong

#

Mehh

#

Too lazy to fix

#

Bad code stays in

quartz kindle
#

Array.isArray(array)

sick cloud
#

okay

#

else it should be an object technically

quartz kindle
#

yes

#

although objects could still be other things

#

such as class instances

sick cloud
#

i only want actual objects to get through

#

otherwise it errors/should error

quartz kindle
#

its a bit more complicated to check if something is a regular object

#

since literally anything can be an object, even null is an object

sick cloud
#

fair point

quartz kindle
#

one of the most popular ways to check is using this: (!!obj) && (obj.constructor === Object);

#

another way would be Object.prototype.toString.call(obj) === '[object Object]'

#

the second method still returns true for class instances, the first method doesnt

eternal flame
#

how do i loop?

#

one sec ill show you what im tryna do

acoustic depot
#

What language

sick cloud
#

so use the first?

eternal flame
#

d.js

acoustic depot
#

ew

quartz kindle
#

yes i prefer using the first

acoustic depot
#

you can do for loops or while loops

sick cloud
#

d.js is not a language

eternal flame
#

ik

#

its a library

#

but d.js shows both libr and lang

sick cloud
#

should work right

#

@eternal flame node.js/javascript is the language, discord.js is the library

#

learn your terms, they help

eternal flame
#

yeas

#

i know

#

yes*

#

i said

#

saying discord.js

#

shows both the libr and the lang

quartz kindle
#

the if should be the other way around i guess

eternal flame
#

.js

sick cloud
#

wdym tim

quartz kindle
#

you want to throw an error if its not an object right?

sick cloud
#

yeah so my func only gets a plain object

#

with at least 1 key in it

quartz kindle
#

that will throw an error if it is an object

sick cloud
#

oh lmao

#

what do i need to change

quartz kindle
#

you can reverse it to if(!obj || obj.constructor !== Object)

sick cloud
#
            if (!val || val.constructor !== Object)
            throw new TypeError('Value must be an object');```
#

so like that

quartz kindle
#

ye

sick cloud
#

also TypeError is the right one for that iirc

#

i hope

#

cool though ty

quartz kindle
#

yeah i think so

#

i just use Error for everything

#

lmao

torn ravine
golden condor
#

You can use the "STREAMING" status and you need to set a twitch URL in your libs setStatus equivalent

torn ravine
#
    status: 'streaming',
    activity: {
        name: `Lo-Fi with ${client.users.cache.size} Users => gwhelp for help`,
        type: 'STREAMING',
        url: 'https://if6-dev.tk'
    }
})```
sick cloud
#

does fs.readFileSync use cache?

torn ravine
#

this is what I have so far

golden condor
#

Iirc no @sick cloud

sick cloud
#

i've written to a json file then read it again but it's exactly the same as when i read it before

#

hm

torn ravine
#

but the watch button doesn't appear

golden condor
#

But it might so if you clear the cache then it could walk

#

*work

#

@torn ravine you need to use a twitch link

#

Not any link

torn ravine
#

also pulse has it redirect to rick astley

golden condor
#

That's their twitch

torn ravine
#

on youtube

golden condor
#

Yes

#

They have their twitch redirect to it

sick cloud
#

feels like my code is going too fast

torn ravine
#

thats strange how do I do that

sick cloud
#

its adding the first key to the json, but then it's overwriting it as the code doesnt know that's already there

golden condor
#

I'm not sure but you might be able to use a a YouTube link

sick cloud
#

nvm fixed it sweet

golden condor
#

Ok

torn ravine
#

yep youtube links work

#

thanks callum

golden condor
#

:+1:

eternal flame
#

someone give me reinforcement on what a listener as in js MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 ready listeners added to [Client]. Use emitter.setMaxListeners() to increase limit means

#

ah nvm

#

fixed it

earnest phoenix
#

imagine if the runtime warnings like that wouldn't exist

eternal flame
earnest phoenix
#

people who never took CS would have a dedi to run a 100 guild bot 💀

eternal flame
golden condor
#

Lol

eternal flame
#

whats better for an emergencystop command, process.abort() or exit

#

i want it to like

#

immediately bring the bot offline

golden condor
#

exit

#

because it cleanly exits the code

eternal flame
#

alr

regal jacinth
#

hey so if i want to make a dashboard do i need to learn nodejs and Javascript ?

eternal flame
#

uh

#

yes

golden condor
#

No

eternal flame
#

wait

#

what

regal jacinth
#

?

sick cloud
#

and use exit(0) @eternal flame unless you want it to error

#

afaik

regal jacinth
#

which one

golden condor
#

It can be done in other languages.

sick cloud
#

do you use pm2

eternal flame
#

who

#

what when where and why

regal jacinth
#

so i can use python in my website?

golden condor
#

But if you want to use node.js then yes you should have a basic understanding of js first

#

Yes

eternal flame
#

oh python boy

#

cool

#

i need to elarn py

golden condor
#

You can use something like flask

eternal flame
#

learn*

golden condor
#

Iirc

regal jacinth
#

oh

#

nice

#

wait python boy? me?

winter basalt
#

perhaps

sick cloud
#

whats better for an emergencystop command, process.abort() or exit
i want it to like
immediately bring the bot offline

if you use pm2 or another program that restarts your bot if it dies, using process.exit(0) will make it reboot - process.exit(any other kind of number like 1, 2 etc) will kill it and stop it from rebooting afaik

#

i forget how it works

regal jacinth
#

lol

sick cloud
#

optionally call your libraries disconnect()

golden condor
#

You can do js or py whichever you prefer but whichever you go with, you should understand the basics first

sick cloud
#

much better option as it makes sure the bot instantly changes to offline

golden condor
#

in d.js it's client.destroy() afaik

regal jacinth
#

yeah i understand the basics of python already

sick cloud
#

used to be disconnect, my bad

regal jacinth
#

i have been on it for 5 months :'3

golden condor
#

Does Eris have that method?

sick cloud
#

afaik

#

lemme see

golden condor
#

Nah it's fine Tony we got what you meant :)

ancient falcon
#

y'all know an alternative to asyncio.Lock in pyhton?

sick cloud
#

eris has disconnect

golden condor
#

ah ok

#

So if I do

#

client.disconnect(true) it will reconnect?

sick cloud
#

yes

golden condor
#

Great

sick cloud
#

<client>.disconnect(false) on Eris would 100% kill it and then destroy the process

golden condor
#

Alr

sick cloud
#

the issue usually is pm2 or other process mans

#

they usually reboot or restart processes that die

#

i know that if you tell the process to exit with a code 0 or something (which is a non error exit) it won't

#

or something

golden condor
#

I think it restarts if an error is thrown

#

Which caused my bot to rate limited over night once

#

Like I couldn't connect to the gateway for a whole day

sick cloud
#

nice

#

just write {} to it

golden condor
#

Pretty ez

#

Or you could just delete the file and remake it with {} for no reason at all

#

Well actually not no reason

#

It could stop corruption ig

sick cloud
#

in what way Thinkeng

#

i have a queue to make sure only one action happens at a time

karmic compass
#

can anyone tell me which one i should use considering that i am looking for easiest to use/cheapest to use:
mysql vs mongodb

earnest phoenix
#

does node allow you to access kernel apis

karmic compass
#

suggest*

sick cloud
#

dunno if it does

earnest phoenix
#

cause if so you can make that so much more faster by writing 0 bytes at kernel level

sick cloud
#

also @karmic compass both are free lol

karmic compass
#

damn i can't find the download for mysql

earnest phoenix
#

damn look harder

karmic compass
#

lmfao

golden condor
#

There are many different ones

karmic compass
#

which is easier to use?

golden condor
#

Mongo

karmic compass
#

alr

earnest phoenix
#

if you're going for sql i would avoid anything and everything made by oracle

golden condor
#

Oh god oracle

ocean violet
#

Why not oracle

golden condor
#

They ask you for every single piece of info you have

#

In their sign up

earnest phoenix
#

their team is a bunch of amateurs underqualified for their job, they're money hungry and want your data

golden condor
#

I was stupid enough to sign up because I used to think oracle was the only place to install java

summer torrent
#

which one should I install (grafana) enterprise or oss

earnest phoenix
#

I've heard lots of good stuff about Grafana, never anything about OSS though

#

¯_(ツ)_/¯

#

isnt that just a distribution type

#

lol

#

OSS stands for open source

eternal flame
#

im having a problem, my bots status wont load, let me get the screenshots

sudden geyser
#

where is the second s in open source

earnest phoenix
#

open source software

sudden geyser
#

ah

eternal flame
#

the 2nd is wher eit calls it in the index file

#

the first is the actual stat file itself

earnest phoenix
#

require doesn't fdo anything on it's own

golden condor
#

Is it a function

earnest phoenix
#

do*

#

and are you subscribing to the event again in the other file 💀

eternal flame
#

wdym

golden condor
#

And bot isn't defined in that file

eternal flame
#

it is

earnest phoenix
#

oh yikes

#

that's an infrastructure mess

golden condor
#

Where

earnest phoenix
#

who are you copypasting from

golden condor
#

Don't tell me

#

You made a new bot

#

And logged in

eternal flame
#

wait are you taliing to me

golden condor
#

Everything about this code is wrong

eternal flame
#

talking

earnest phoenix
#

well certainly not god

#

so yes

eternal flame
#

im confused now

#

whats happening

golden condor
#

Who else am I talking to? Cry, who's code this isn't.

eternal flame
#

god ill figure it out by myself, sheesh

earnest phoenix
#

both of us are referring to you

golden condor
#

We are trying to help

#

But you aren't providing much

earnest phoenix
#

we are happy to help but you need to have an understanding of the basics, we can tell you what to do but we cannot understand it for you

eternal flame
#

the status screenshot were the only 2 lines in the file, besides the bot and client thing

#

if they werent i would have shown the whole thing

golden condor
#

You are nesting event listeners. You are requiring files without functions. You are leaving vars undefined.

#

You are not even defining bot in your status file

#

And it's not getting triggered anyway

#

You should make it a function

eternal flame
golden condor
#

And call that function in the ready event

#

But you aren't providing much
@golden condor

#

That wasn't in your screenshot

eternal flame
#

you expect me to be dumb enough to not define bot?

golden condor
#

Why can't you just do the status stuff in the main file

eternal flame
#

lets stop, we cant argue ehre anyways

#

here*

golden condor
#

It's 1 line

#

I didn't say that

#

You just didn't provide in the ss where you defined it

eternal flame
#

You are not even defining bot in your status file
@golden condor

golden condor
#

So I am going by what I can see.

earnest phoenix
golden condor
#

Did I call you dumb?

eternal flame
#

no

golden condor
#

Precisely

eternal flame
#

like i said can we please stop

golden condor
#

Can you

#

Copy that line

#

That you set the status with

#

And replace

#

require("./statusstuffs")

#

With it

#

Because you are making your code longer and more complicated unnecessarily

earnest phoenix
#

what you were doing is microservice architecture which is perfectly valid and encouraged in the industry, but you did it incorrectly

vestal drift
#

I was told I could get help here

earnest phoenix
#

Time to help peep

vestal drift
#

I am trying to make a bot

#

It says I haven't provided the correct client ID

solemn latch
#

Client id? Or token

vestal drift
#

Client id

solemn latch
#

What language/lib

vestal drift
#

English

solemn latch
#

English isn't a programming language

vestal drift
#

I thought u meant what my language is

#

Lol

#

Or eris

#

Oh

solemn latch
#

Can we get the whole error?

vestal drift
#

Unable to fetch application. Make sure you've provided the correct Client ID and that the application has a bot account.

solemn latch
#

Oh, your submitting a bot?

vestal drift
#

Yes

earnest phoenix
#

lol

solemn latch
#

This is for developing bots

vestal drift
#

I want there and they said to come here

solemn latch
#

Lol, ok

faint prism
#

Link?

solemn latch
#

Well, im not sure how to solve that issue, typically mods help with that stuff

vestal drift
#

Ok thanks for you help anyway

earnest phoenix
#

because you said you were making a bot, not submitting one. you misinformed someone and got misinformation in return 🤷

vestal drift
#

Oh

solemn latch
#

You need to make a bot before submitting typically

#

programming it, have stuff working

vestal drift
#

Well how do I do that then

solemn latch
earnest phoenix
solemn latch
vestal drift
#

I am pretty sure I made the bot already

earnest phoenix
#

see the image for a TLDR

faint prism
#

Pretty sure?

vestal drift
#

Most likely not

sonic lodge
#

why aren't you sure

solemn latch
#

I spent weeks on my bot

#

I'm not sure how you wouldn't be sure

#

🤔

faint prism
#

I'm still a month into development.

vestal drift
#

Well I made the bot account

faint prism
#

That's the first step to getting the token

vestal drift
#

Dunno how to add the commands and stuff

eternal flame
#

what you were doing is microservice architecture which is perfectly valid and encouraged in the industry, but you did it incorrectly
@earnest phoenix then what is the correct way

earnest phoenix
#

microservice architecture is something that cant really be easily explained over discord lol

#

do research on it

eternal flame
#

well fuck

earnest phoenix
#

it's a style you learn in CS but considering most people asking for help here aren't even old enough to have the ability to take CS i doubt you covered that

vestal drift
#

Tbh i have zero clue how to make a bot so I'm at a loss

faint prism
#

Lol truth

sonic lodge
faint prism
#

Learn a language first. Bots are intermediate level

eternal flame
#

yeah

#

if you dont wanna learn a language i suggest paying 15 bucks for discord bot maker on steam

#

it does it for ya

#

how dare you auger

vestal drift
#

I kinda just picked a random one

eternal flame
#

study up on it

#

i made the grave mistake of going in an now its hard to figure out languages because you think its easy because youve done it before

faint prism
#

I'm upvoting your post mmLol

eternal flame
#

its not

crisp geyser
#

I have 1900+ guilds, is it normal that sometimes I have 1 shard and sometimes 2?

silent berry
#

If I post my bot code. Could someone be able to identify what npm packages I don't need.

eternal flame
#

2k guilds wont let you log in without sharding

#

i think-

solemn latch
#

Its 2500

vestal drift
#

Ye thanks for the help but my brain has still gained no brain cells

eternal flame
#

o

faint prism
#

I find that if you learn one language, it makes it easier to learn about in the same paradigm

crisp geyser
#

I'm using sharding, that's not the issue

earnest phoenix
#

gold many bot "developers" did that in here unfortunately, stuck with a certain coding style claiming they know how to code but if you give them a logical problem they wouldn't know how to solve it :/

eternal flame
#

@vestal drift learn javascript is my suggestiong

#

yeah

crisp geyser
#

I'm just saying that sometimes when I restart my bot 1 shard is launched and sometimes they are 2 @eternal flame

faint prism
#

Or python

eternal flame
#

you think its really easy because youve done it before

#

it is not easy

#

no

vestal drift
#

By language do you mean English or the lib

faint prism
#

Programming language

earnest phoenix
#

a programming language

faint prism
#

Lol

crisp geyser
#

Just wanted to know if that's a normal thing

eternal flame
#

if you think it is easy i will back hand you into the next generation

solemn latch
#

The lib is something else

faint prism
#

A high-level programming language

solemn latch
#

That you also have to learn

vestal drift
#

I'm an idiot compared to yall

sonic lodge
#

libraries are written in programming languages

eternal flame
#

dat, do you have any form of programming experience?

faint prism
#

A lib is a set of functions and code someone else made so you can do something without reinventing the wheel

vestal drift
#

I'm just trying make a simple funny bot

eternal flame
#

bot ghost go brrr

earnest phoenix
#

you should delve into the world of CS first, trust me you're going to get a much better grasp at everything if you cover CS basics (binary, logic gates, memory etc)

eternal flame
#

if you want to make a custom bot then learn javascript

vestal drift
#

Im losing brain cells

faint prism
#

There are so many YouTube tutorials

#

No, your gaining some

earnest phoenix
#

advising not to use youtube tutorials

eternal flame
faint prism
#

advising not to use youtube tutorials
@earnest phoenix what about IAmTimCorey?? I learned SOLID from him

vestal drift
#

Trust me me having no clue what any of this means is making my brain hurt

karmic compass
#

does anyone know how to get the mongo shell? i'm looking at the tutorial but can't find the archive

eternal flame
#

@faint prism i watched a dude named coding train

#

hes very good

#

and he helped me on an api

earnest phoenix
#

never heard of @faint prism

faint prism
#

He's a bit quick for me

eternal flame
#

hes actually entertaining

faint prism
#

never heard of @faint prism
@earnest phoenix check out his SOLID playlist. It's incredible

vestal drift
#

Yes

earnest phoenix
#

but i do guess youtube tutorials have two categories, copy & paste or actually educational ones

karmic compass
#

aaa

silent berry
#

If I post my bot code. Could someone be able to identify what npm packages I don't need.

vestal drift
#

This is what it says when I try to submit my bot

faint prism
#

What ever libs you aren't referencing

vestal drift
#

Unable to fetch application. Make sure you've provided the correct Client ID and that the application has a bot account.

karmic compass
#

where is the archive in mongo

earnest phoenix
vestal drift
#

But I've done both

eternal flame
#

anyways i still need some help, im making it to where every 10 minutes my bot changes status to how many server to how man users total, i have the server and user count down just not that status part

faint prism
karmic compass
#

how do i get access to running in the mongo shell? i can't find anything that actually helps

faint prism
#

10/10 software dev tutorials for dotnet right there

earnest phoenix
#

yeah see those are actually educational tutorials

vestal drift
#

Do I submit the bit last

#

Bot

solemn latch
#

Don't submit till you've made a bot

earnest phoenix
#

and then you have "uhm so code in description just copy & paste then code do run 🤤 "

vestal drift
#

My bot won't go in the Api so I cant do anything

solemn latch
#

You're trying to submit before you have made anything

vestal drift
#

Where do I make it

solemn latch
#

In a code editor

earnest phoenix
#

top.gg is to submit already established bots that are ready to be used across mass servers, if you don't have that foundation set do not submit it

vestal drift
#

I made the profile

solemn latch
#

That doesn't really mean anything

vestal drift
#

But where do I add commands

earnest phoenix
solemn latch
#

In a code editor

vestal drift
#

I didnt ignore i just don't understand it I'm dumb

silent berry
#

@vestal drift you have to make the file on your computer

earnest phoenix
#

then it's probably a sign you shouldn't be making a bot

vestal drift
#

Dont have one

earnest phoenix
#

use a bot maker that does the code part for you or pay someone to do it

silent berry
#

Time to ask my questionagain

vestal drift
#

Well i have one but it runs like a ps1

faint prism
#

There ps1 was awesome

silent berry
#

If I post my bot code. Could someone be able to identify what npm packages I don't need.

Discord.js v12

#

I need to know

earnest phoenix
#

couldn't you just do that yourself

vestal drift
#

So laggy and glitchy

earnest phoenix
#

You mean, you want to know what packages u need to rove from package.json? @silent berry

#

Remove*

solemn latch
#

If you have a test bot, you can just remove them one by one

silent berry
#

@earnest phoenix I need to know what to remove from the const

solemn latch
#

If it breaks after removing, you need it

#

If you give us your code, its what we would probably do

vestal drift
#

Oh i lost my bot profile

solemn latch
#

F

faint prism
#

F

silent berry
#

Well time to have my server flagged by the host for high mem and CPU use

vestal drift
#

I dunno how i made it aswell

#

🙃

solemn latch
#

What kinda host flags you for high cpu usage for a few minutes

silent berry
#

@solemn latch one that has a server jump to 60% on startup

earnest phoenix
#

you don't get pity points here

solemn latch
#

Oof

earnest phoenix
#

Hmm
@silent berry i agree with Woo
You should do this in test bot first to prevent any errors in main bot

solemn latch
#

Id move hosts asap

vestal drift
#

I just wanna make a bot that says things depending on what you say

silent berry
#

@solemn latch my host is a good host

faint prism
#

Or self-host until you stop accidentally writing malware

silent berry
#

@faint prism I don't write malware

faint prism
#

It's a joke

earnest phoenix
#

that sir, was sarcasm

silent berry
#

I'm sorry

vestal drift
#

I'm just gonna sit in the corner in shame

solemn latch
earnest phoenix
#

we told you already what your options are

#

we will not write the bot for you unless you pay someone to do it

vestal drift
#

So what you are saying is you will write me a code if I pay some random guy an tenner or something

#

Ye not doin it

earnest phoenix
solemn latch
#

Developers cost money

sonic lodge
#

then you can create a bot yourself

vestal drift
#

Course but thats something I don't have

earnest phoenix
#

welcome to capitalism. want something? give money in exchange

oak cliff
#

-needdev @vestal drift

gilded plankBOT
#

@vestal drift

DBL is not a place to find developers for jobs. You can try and put a request on Fiverr or Freelancer. Please do not post the request again. Doing so may result in punishment.

earnest phoenix
#

No one going to waste their previous time for making a bot by which they getting nothing.
It takes many days to create a bot

vestal drift
#

@sonic lodge Idiots can't make bots

solemn latch
#

Oh thats not true

sonic lodge
#

why do you keep calling yourself an idiot

#

do you want to be one?

solemn latch
#

Lots of the verified devs are dumb

vestal drift
#

I'm not trying to buy a developer

earnest phoenix
#

what's the point in your messages, we told you what you can do and we surely can't take action for you

oak cliff
#

So what you are saying is you will write me a code if I pay some random guy an tenner or something

#

sounds like trying to buy a dev

vestal drift
#

That's what he said

oak cliff
#

yeah, nobody is going to do it here for free, so if you want a dev, you have to pay for it, and you cant look for devs here

vestal drift
#

Or she idk

oak cliff
#

im informing you

vestal drift
#

I don't wanna buy a dev

#

Even if I had some spare money I still wouldn't

solemn latch
#

Theres not much we can do for you here

vestal drift
#

I know but you did the most you could which I appreciate

faint prism
#

:)

#

Just learn how to write some simple projects in a programming language like JavaScript, or python. Maybe write your own calculator app or something to get familiar with data types and functions

thin otter
#

Were do i find the bots ?

faint prism
#

Then try revising a discord bot tutorial and you might be more familiar with the concepts

solemn latch
earnest phoenix
#

not here

summer torrent
winter basalt
faint prism
#

^^^

vestal drift
#

The only coding I've done is on that scratch app lol

faint prism
#

Well that does something ig

vestal drift
#

Which I wouldn't really count as coding

cloud hollow
#

that ain't coding that's drag and drop

earnest phoenix
#

sometimes i forget that not all people are in STEM

cloud hollow
#

🙈

solemn latch
#

Scratch won't teach you syntax. But it can teach some basic logic.
Which is more than some people here, belive it or not.

cloud hollow
#

lmao

#

not wrong

vestal drift
#

So true

cloud hollow
#

scratch would be considered scripting

vestal drift
#

I would consider torture that weird cat

cloud hollow
#

i

winter basalt
#

i

vestal drift
#

What scratch is weird

winter basalt
#

it's actually pretty nice for learning

vestal drift
#

Ye i know

thick gull
#

I get frustrated with ads and classes that say “learn to code” and then it’s fucking drag and drop without any language it’s just drag and drop like move up

cloud hollow
#

what would happen if I added a botghost botwtfthonk honestly I'd prob get ipbanned from using the site

thick gull
#

and it’s not targeted towards kids

winter basalt
#

botghost are allowed

vestal drift
#

But i mainly just torture scratch

winter basalt
#

if you modify it

cloud hollow
#

makes since

#

sense*

#

you gotta at least do SOMETHING

earnest phoenix
#

@vestal drift Yeah sure buddy, let me work for you.. For free