#development

1 messages · Page 1649 of 1

slender wagon
#

oh

quartz kindle
#

meaning message is probably not an actual message

#

how did you define message?

slender wagon
#

right

#

callback: async (message, args) => {

unreal estuary
#

how about on the message event

quartz kindle
#

and how do you call this callback

#

perhaps you're passing it wrong arguments

slender wagon
#

probably, it's been awhile without working on this one

#

i'll check real quick the whole thing is a big mess

drifting wedge
#

@slender thistle how can i replace a thingy in a dict?

#

so its kinda complicated but like i have a dict

#

and i have a nested dict inside

river panther
#
message.mentions.users.first()
drifting wedge
#

wait

#

no i didnt explain it well

river panther
#

^

slender thistle
#

Any example you can provide?

drifting wedge
#

okay so lemme get it up

#

yes 1 sec

#

i want to make another "role" in it, that copies whichever role has the default tag as True

#

with another name

unreal estuary
river panther
quartz kindle
slender wagon
river panther
#

oh yes, sorry

#

sorry

slender wagon
#

lol

unreal estuary
#

haha

slender thistle
#

If this can wait like 30 minutes I can help

#

Look into dict comprehensions

drifting wedge
#

alr

#

yep i got all the time in the world

#

take ur time lol

#

alr just ping me or dm me whenever u can

#

cuz its some pretty bigbrain stuff

slender wagon
#

i think the problem is with me not having message defined properly

#

ohhh fff

#

i forgot i am using a command handler that's not mine

#
// this not like this
 callback: async (message, args)
// this like this
callback: async ({ message, args })
#

forgot that this project is outdated as hell

unreal estuary
#

lol

sick fable
#

Well, I moved to discord.js and am facing some errors

#

Whenever i type node .

#

It shows CANNOT FIND MODULE

#

Can someone help mw?

#

Me?*

west agate
#

wut AI?

earnest phoenix
#

@earnest phoenix I used your own code to code the nuker lol and yes I know it was from you give me 1 day

slender wagon
#

uhmm this is the wrong place for that

quartz kindle
earnest phoenix
quartz kindle
#

ah yes, use pip in node.js

#

@_@

slender wagon
#

lmao

sick fable
quartz kindle
#

what

sick fable
earnest phoenix
sick fable
#

Bro

#

I moved to js

quartz kindle
#

you just said you're using discord.js and node

sick fable
#

Wtf

sick fable
earnest phoenix
#

yep

slender wagon
quartz kindle
earnest phoenix
#

wtf

sick fable
earnest phoenix
#

he probably uses them both lol

quartz kindle
#

lmao

sick fable
#

Its discord.js

#

Lmaoo

quartz kindle
#

then install it

slender wagon
#

npm i discord.js

earnest phoenix
#

ohh ye

slender wagon
#

that's how u install modules in node

lusty quest
slender wagon
#

u say it as if it was the easiest thing

earnest phoenix
#

@earnest phoenix @client.command()
async def ban(ctx):
for member in client.get_all_members():
await member.ban(reason=.)
await ctx.send(Banned All)

west agate
#

i dont know how to do that ;-;

#

wait brb

earnest phoenix
#

Does using $push in mongodb create an array if it doesn't exist?

misty sigil
#

try it and see

lusty quest
#

if you use mongoose, you have to define an array in your model first

vast ingot
#

i want to start a bot

lusty quest
#

read the docs for the Bot from where you downloaded it (if you wrote it yourself, most good docs tell you how to start a bot)

misty sigil
#

@vast ingot write some code

vast ingot
#

i mean

#

create a new one

misty sigil
#

yes, you need to write code

#

@vast ingot ^^

vast ingot
#

thanks

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

misty sigil
#

apparently aye

sage bobcat
#

One message removed from a suspended account.

unreal estuary
#

lol

#

where

tired panther
#

I have class with static async functions, How can I acess a function in the class, which is in the class
Ex:

class test{
static async hello(){}

static async bye(){
hello()
}
}
#

can I access hello in the class?

cinder patio
#

test.hello()

tired panther
crimson vapor
#

this is really sad, I scroll down the channel and see tim with a green name

crimson vapor
#

green is green

#

I prefer tim being aqua

quartz kindle
#

xd

frigid schooner
#

Are you not able to change the background color with HTML?
It works in preview but when I save it doesn't apply.

quartz kindle
#

you can

#

check with the dev tools if there is anything overriding your background

tired panther
#

How can I export my client in a file without passing client in a fuction?

#

can I do const {client} = require("./bot.js")?

crimson vapor
#

just export it?

#

module.exports = new Client()

#

is that what you mean?

tired panther
tired panther
viscid gale
#

lawl im l8

crimson vapor
viscid gale
tired panther
crimson vapor
#

the "plugin" is just a function?

#

idk much about your structure, sorry

tired panther
#

I found another solution

slender thistle
#

Markdown

rustic nova
#

ls

#

ah fuck

#

not terminal

slender thistle
#

kill

rustic nova
#

pain when you have 2 pcs and 2 different keyboards KEKW

crimson vapor
#

this seems like terminal to me

viscid gale
#

index

const {Client}=require('discord.js')
const commands=require('./commands.js')
//do things
client.on('message',(msg)=>{
  //do things
  if(howeverYouPlayWithText===someValidCommand){
    commands(commandArgHoweverYouDo,Client)
  }
})

commands.js

//now you don't need to require Client here
function commandHandle({prefix,text},Client){
  //do your stuff here(Client would be the Client of your index.js)
}
module.exports=commandHandle
tired panther
#

Yours Truly typing..... | Since 5 minutes lol

west agate
#

do you guys have any recommendations on documents on how to make a discord.js ai?

crimson vapor
#

that wouldn't work

#

wait

viscid gale
#

it would though

crimson vapor
#

its pseudocode

viscid gale
#

try it

tired panther
viscid gale
crimson vapor
#

I would just load your plugins dynamically in your index

viscid gale
crimson vapor
#

I mean mine is pretty simple

viscid gale
crimson vapor
#

no I don't think so

#
import TeranoWorker from '../lib/TeranoWorker';

export default (worker: TeranoWorker) => {
  worker.on('READY', () => {
  // code here
  });
  worker.on('SHARD_READY', (shard) => {
  // core here
  });
};
#

this is what I do for events

#

just pass the workers

#

I need to change it to more of a ```js
export default {
event: "READY",
exec: () => {

}
}```

viscid gale
#

ooh typescript

crimson vapor
#

ye

lusty quest
#

but AI stuff is not really easy,

viscid gale
#

and "AI" is vague

crimson vapor
#

should I export a function and use the file name? or should I do what I was saying

lusty quest
#

if you want a filter you could use Regex

crimson vapor
#

ex.

// READY.ts
export default () => {}```
lusty quest
#

also if you use a "Free" host they wont allow you to run Tensorflow on it

west agate
lusty quest
#

regex is possible, and way easyer

viscid gale
#

bruh you basically said you wanna build a vehicle.. and ur asking us how as though it's so specific

#

either that or im misunderstanding what u mean by "ai"

solemn leaf
#

Dude you type so sloww

viscid gale
#

what of it

west agate
lusty quest
#

he wants to use an AI to detect bad words. it works, did it myself, but if you have no idea how to use js better use simpler stuff

solemn leaf
#

No

lusty quest
#

you can bypass everything if someone is bored enough

solemn leaf
#

Regex wont work here well

viscid gale
#

you can do an imperative approach

solemn leaf
#

As you need to find play on words: fuc k f ck fuuck

lusty quest
#

and regex allows this, but is probably a pain to setup

solemn leaf
#

Regex is strict

viscid gale
#

the imperative approach isn't strict but it will probably cost u 50 lines

lusty quest
#

you can set ranges

viscid gale
#

and braincells

west agate
#

im just stupid-

viscid gale
#

there is no way im just hard coding an imperative approach on picking up cursewords

#

it's possible.. just think through the patterns

#

the logic of how it seems on a string

#

you can even make it array like and examine that way

tired panther
west agate
#

so i should make a regex which detects these patterns?

tired panther
#

then you do not need a regex

solemn leaf
#

That wouldnt be good

viscid gale
solemn leaf
#

I can stil do fu ck

viscid gale
#

ok.. if you split the text and filter off anything that isn't a letter you can pick it up

#

^^method 1

solemn leaf
#

I had one for java

viscid gale
#

method 2: you can check for repeats.. like fuuuuckkk

#

take out repeating letters

solemn leaf
#

It chopped the letters

viscid gale
#

and u get back the curseword

solemn leaf
#

Yeah like that

#

And changed numbers to what it could be

viscid gale
#

also number one thing before these steps.. text.toLowerCase()

west agate
lusty quest
#

you could also use some bad word detection API, but this will get you rate limited rather quickly with a Discord bot

viscid gale
#

you can use a similar letter basis

#

like someone can say f()ck

solemn leaf
#

Make your own api

viscid gale
solemn leaf
#

Either works

west agate
#

rn im just removing all symbols and cases and detecting if the word is bad words

#

but "fu ck" can bypass it

lusty quest
#

ive made myself an AI Powered API for detecting bad behavior, its possible

viscid gale
#

remove all spaces then too

west agate
#

like "son i got ..." gets censored

viscid gale
solemn leaf
#

I split at each letter with regex

west agate
#

grass = ass

#

even glass

solemn leaf
#

Then added them into many differnt combinations and then checked them

viscid gale
#

there's a game called toontown

#

and they had a unique approach

solemn leaf
#

That uses custom chat

viscid gale
#

any word that doesn't belong in their dictionary is censored

west agate
#

but theres a lot of non bad words-

viscid gale
#

it's so good you can't curse

#

i mea

#

u can say for fox ache

#

or mike oxlong

#

but any variation of any curseword

#

aint happening

west agate
#

interesting..

viscid gale
#

but it's discord

#

and toontown's a child friendly game

lusty quest
#

like i mentioned earlyer the fastest aproach with a low amount of needed coding would be an API for detecting bad words with the Downside of rate limits,
the other way would be making yourself a dictionary of blocked words and check against it.

viscid gale
#

the other way is tedious and not as result bearing

west agate
lusty quest
#

idk like i said ive made my own

west agate
#

lemme research some stuff rq

viscid gale
#

an api is a link to communication between to processes.. like a server connecting a database to a user.. im not sure what you made but high chance it's a module(or depending on how much things there are.. a library)

small tangle
#
for (File file : folder.listFiles()) {
     final String jsonString = Files.readString(Path.of(file.getPath()));
     final JSONArray array = new JSONArray(jsonString);

     jsonFiles.put(file.getName().split("\\.")[0], array);
}

Is this a good way to read multiple JSON files, im not sure about that FeelsSmartMan (is Java)

earnest phoenix
#

hi

shy turret
#

Does the npm keyv protect against sql injections?

modest maple
#

Almost 100% no

#

because the SQL injection prevention is the job of the database using it's placeholder and string literal system rather than anything you npm

shy turret
#

wdym

earnest phoenix
#

hey guys do any of you know how to make your own bot reward users for voting your server ? i'm trying to make it so it gives other roles the more they vote

#

so if they vote 2 times they get etc role if they vote 4 times they get etc other role

shy turret
#

Is there any npm that has sqlite that does the protection for you?

#

(Checking in the npm itself)

modest maple
#

no because thats your responsibility?

#

unless you're using an ORM that should auto generate the queries with placeholders

#

looking at keyv 's docs it's a key value pair so i assume it's going to use pre-defined queries with placeholders

lusty quest
#

if i ever find a Bot with open eval command i guess i will try and see if they use quickdb and dont protect it

modest maple
#

but i would check shrug

shy turret
#

no idea what that means but ok (i dont know how sql works that well)

shy turret
#

add the quotes maybe

#

include "name"

snow urchin
shy turret
#

include("name")

river panther
#

@rustic nova why this happening?

rustic nova
#

-verifiedbot

#

-verifybot

gilded plankBOT
#

Hi! It seems like you are looking for information on how to get your bot verified.

Once your bot reaches 75 servers or more, you are eligible for bot verification. On October 7, 2020, bots with 100 servers or more that are not verified will not be able to be invited to any more servers. You verify your bot on your bot's application page, under the "Bot" section in the sidebar.

If you need more information, check out this article written by Discord about The Future of Bots on Discord and you can ask questions in the Discord Developer Server.

We cannot provide support on how to get your bot verified.

river panther
lyric mountain
#

not that kind of verification

#

if you're using a privileged gateway intent you need to also be verified for them if you didn't request it during bot verification

river panther
#

ig kadybat verified my bot

snow urchin
lyric mountain
#

almost as lengthy as normal verification

river panther
#

oh no

lyric mountain
#

you can, however, disable them and try to work without member caching/presences for the mean time

snow urchin
lyric mountain
#

use ./

snow urchin
#

i tried that -.-

lyric mountain
#

but anyway, you didn't say what's wrong at all

#

actually

#

your path is very wrong

#

dist is two folders above

#

not in the same dir

snow urchin
#

smh

#

are u

lyric mountain
#

so ../../dist

river panther
#

i have disabled the presence one

snow urchin
lyric mountain
river panther
#

how?

lyric mountain
#

code

river panther
#

-.- ok

snow urchin
lyric mountain
#

give. the. error

#

no error = no solution

snow urchin
#

use

#

ur

#

brain

#

why would i want src/front/styles

#

inside

#

styles

proven lantern
snow urchin
#

copy files

proven lantern
#

and folders it seems

#

do you have the source of copyfiles

lyric mountain
exotic galleon
#

my discord bot doesn't return commands

lyric mountain
#

are u executing commands correctly?

exotic galleon
#

yes

lyric mountain
#

show code regarding the code you're trying to run

exotic galleon
lyric mountain
#

the whole bot is not running?

exotic galleon
lyric mountain
#

any errors?

exotic galleon
#

no

exotic galleon
earnest phoenix
#

Does somebody use Discord-passport ?

lyric mountain
exotic galleon
lyric mountain
#

so how is the bot not working if u could execute the code?

exotic galleon
#

ı don't know

deft lark
#

hi

exotic galleon
deft lark
#

ok bro @exotic galleon

exotic galleon
lyric mountain
exotic galleon
lyric mountain
#

so, you want help about a code that you know nothing about nor have any error?

exotic galleon
lyric mountain
#

no

#

if the bot doesn't work then the code doesn't work

#

unless it's a permission issue

#

can't help u, ask for the code owner to ask for help please

exotic galleon
#

but I am not like that either

#

There is no problem with the code I made, I am not getting an error.

lyric mountain
#

like that what?

#

dude

exotic galleon
#

but i can't run the bot's help command

lyric mountain
#

so the code have an issue

#

simple

#

also, you're contradicting yourself

#

the code, is yours or not?

exotic galleon
#

I made the code myself, you have a hard time understanding my friend

lyric mountain
#

so the code is yours, correctly?

exotic galleon
#

yes

lyric mountain
#

show the code regarding help command

exotic galleon
#

wait

lyric mountain
#

wtf is that description?

exotic galleon
#

does not work on all other commands, not just help

lyric mountain
#

I don't even know where to start with

exotic galleon
#

ok

#

Thank you very much. You helped a lot.
LOL

lyric mountain
#

dude

#

like

#

that whole code

#

is wicked

small tangle
#

im coding in java with JDA and is there a way to edit a message to remove an embed? right now im suppressing it, but this action requires the manage messages permission and id like to get rid of that

zenith terrace
lyric mountain
#

I don't mean the text actually

crimson vapor
#

@quartz kindle is it possible to fetch all of the guilds that a bot is in at the same time?

#

hello @opal plank

opal plank
#

hai

crimson vapor
#

goodbye @opal plank

opal plank
#

i saw it wasnt detritus

#

so i left

crimson vapor
#

bruh

opal plank
#

legit

crimson vapor
opal plank
#

at least try it on a test bot

#

no regerts

#

im telling ya

crimson vapor
#

if you join stream

opal plank
#

telling you bro

crimson vapor
#

lol

cinder patio
#

You get all guilds when you connect to the gateway, there's no way to get all guild objects via REST

opal plank
crimson vapor
opal plank
#

spend like 20 minutes on it

#

and see how much easier it is

#

npm i ts-lib

#

npm i typescript

crimson vapor
#

whats ts-lib?

#

learning time

opal plank
#

npm i ts-node --dev

crimson vapor
#

ok but what is ts-lib?

opal plank
#

copy paste

crimson vapor
#

huh?

opal plank
#

copy the whole snippet

#

for commandClient

#

use cluster option if you want sharding

crimson vapor
#

hmm

opal plank
#

useClusterClient: true,

earnest phoenix
#

Does somebody use Discord-passport ?

opal plank
#

is the equivalent of shards: 'auto' for djs

tired panther
tired panther
crimson vapor
#

because it makes more than 1 process

cinder patio
#

cause it uses the clusters api

opal plank
tired panther
crimson vapor
#

what the fuck are these docs

tired panther
#

lol

opal plank
#

commandClient.commands

#

here

tired panther
opal plank
crimson vapor
#

what the fuck is the learning curve on this lib?

opal plank
#

my bad

#

wrong person

#

lets see

opal plank
#

guilds.get

#

cache.get

#

users.get

#

commandClient instead of client.commands

#

message.channel.createMessage() instead of message.channel.send()

#

its very small things

tired panther
tired panther
opal plank
#

@tired panther

cinder patio
opal plank
#

^^

unreal estuary
#

weirdsip whats the main purpose of typescript

opal plank
#

also

#

if you REALLY want to make it d.js like

opal plank
#

like

#

REALLLLLLLLYYYYY want it

unreal estuary
tired panther
opal plank
#
  async run(payload: Context, __args: ParsedArgs) {
    const message = payload.message;
    const cc = message?.client.commandClient;
    if (!message || !cc || !message.channel) return;
    let args: string[] = __args[this.name].split(/ +/g);```
@tired panther use this as your base command
#

and continue after that

#

ignore genshin

#

thats mine

#

but the rest is the same you're used to

#

message

#

client

#

args

#

thats all

crimson vapor
#

but like

#

discord-rose is cool

tired panther
opal plank
#

cant be cooler than detritus

crimson vapor
#

im confused

#

why not work

tired panther
opal plank
#

i think so yeah

tired panther
opal plank
#

@tired panther check stream

crimson vapor
#

I was missing a semicolon

#

shit

tired panther
#

another question: chn.permissionsFor(message.guild.me)
this gives me a bitfield. But I want to check if it has send embeds link......

opal plank
#
export interface ShardClientCacheOptions {
    applications?: ApplicationsOptions;
    channels?: ChannelsOptions;
    connectedAccounts?: ConnectedAccountsOptions;
    emojis?: EmojisOptions;
    guilds?: GuildsOptions;
    members?: MembersOptions;
    messages?: MessagesOptions;
    notes?: NotesOptions;
    presences?: PresencesOptions;
    relationships?: RelationshipsOptions;
    roles?: RolesOptions;
    sessions?: SessionsOptions;
    typings?: TypingOptions;
    users?: UsersOptions;
    voiceCalls?: VoiceCallsOptions;
    voiceConnections?: VoiceConnectionsOptions;
    voiceStates?: VoiceStatesOptions;
}```
#

thesea re your oiptions for caching

cinder patio
tired panther
opal plank
#

discord crashed

#

amazing

tired panther
opal plank
#

i keep fucking telling everyone

#

and they keep meming me

tired panther
crimson vapor
#

what in the fuck how do I even get my user's name?

opal plank
crimson vapor
#

bots

tired panther
#

How much ram does your bot use @opal plank ?

opal plank
#

client.user

opal plank
crimson vapor
#

cringe

opal plank
#

not commandClient

#

ShardClient

#

(commandClient.client as ShardClient).user

#

commandClient.client can be either Shard(if you dont have sharding) or ClusterClient(if you enabled sharding)

small tangle
#

what would be the best way to check permissions? an interface method which returns a list of permissions which contains the permissions the bot needs for the specific command? (java)

opal plank
#

payload.client should give you always the ShardClient

tired panther
opal plank
#

click me

#

update realtime

tired panther
#

lol

crimson vapor
#

how do I even make a shard client

#

this is a command client

opal plank
#

commandClient IS the shardclient or clusterclient

#

its the master per se

crimson vapor
#

soo how do I get the user?

opal plank
#

commandClient.client => either gives you a shardClient or a ClusterClient

#

which user?

#

did you enable sharding?

#

if not, its the same as discord.js

#

<ShardClient>.users.cache.get(<user>)

tired panther
opal plank
#

i do

tired panther
#

ah thats way it is so high

opal plank
#

800mb from 4gb?

#

this is a 1 to 1 comparison btw

#

i did not disable caching on detritus when comparing

tired panther
opal plank
#

this is just d.js cummulative caching

#

caching edits

#

presences

#

roles

tired panther
#

now just 700 mb discord.js-light

opal plank
#

unlimited

#

i need a bunch of cache, though not most of it

#

roles

#

emojis

#

presences

#

edits

#

i dont need any of that crap

crimson vapor
#

Erwin

#

I have a question

#

why is this code using 200mb?

opal plank
#

which?

crimson vapor
#

my stream

#

down to 175

opal plank
#

how many guilds is it in?

crimson vapor
#

2

#

3?

opal plank
#

the startup is always lenghty

crimson vapor
#

1-4

#

thats all I can say

opal plank
#

you said 4 different anwers

crimson vapor
#

well im not sure

opal plank
#

use ur bots token and check the performance hit

crimson vapor
#

ok

opal plank
#

it doesnt have any commands

#

so it wont interefere

crimson vapor
#

im gonna wait for the rss to lower

#

then ill send here

opal plank
#

aight

#

how many guilds is that in again?

crimson vapor
#

79

#
{
  rss: '171.3MB',
  heapTotal: '104.3MB',
  heapUsed: '101.2MB',
  external: '2.0MB',
  arrayBuffers: '0.0MB'
}```
opal plank
#

less actually now that it settled down

crimson vapor
#

discord-rose test now

finite lotus
#

?

tired panther
crimson vapor
#

nope

opal plank
#

@crimson vapor now try this if you wanna give d.jslight a test

crimson vapor
#

yeah I will test different libs rn pog

#
{
  rss: '173.7MB',
  heapTotal: '103.3MB',
  heapUsed: '100.9MB',
  external: '2.0MB',
  arrayBuffers: '0.1MB'
}```
#

test token 1-4 servers

opal plank
#

which options you have for disabling cache on ur bot?

#

if you have d.jslight with stuff disabled, make sure to disbale on detritus too

#

actually

#

@quartz kindle

#

oye

crimson vapor
#
  const master = new Master(path.resolve(__dirname, './bot/worker.js'), {
    token: config.discord.token,
    log: (...args: any) => { logger.debug(...args); },
    shards: SHARDS,
    // intents: ['GUILDS', 'GUILD_MESSAGES'],
    cacheControl: {
      guilds: ['name', 'description', 'preferred_locale', 'unavailable', 'icon', 'owner_id'],
      members: ['nick', 'user'],
      channels: ['nsfw', 'permission_overwrites'],
      roles: ['permissions']
    }
  });```
opal plank
#

come defend your lib

crimson vapor
#

this is discord-rose

opal plank
#

benchmark detritus vs djs-light

crimson vapor
#

yes

opal plank
tired panther
#

wow you can control what to cache, cool

crimson vapor
#

@opal plank send

opal plank
#

send what?

#

i did

opal plank
#

tim

#

benchmark fight

tired panther
#

lol

crimson vapor
#

no like configure it for me

#

idk how

#

LOL

opal plank
#

detritus vs djs vs eris vs djslight

#

3 big js bois

tired panther
crimson vapor
#

unlikely

tired panther
#

where you can choose, what to cache

opal plank
#

that would make typescript a hell

#

cuz everything would be optional

sour flame
#

I would going to continue on my EconomyBot if I haven't lost it

#

on my fils

crimson vapor
#

no

opal plank
#

you cant have dynamic types based on what you set for your client

pale vessel
crimson vapor
#

yeah just don't lol

opal plank
#

writing in rose is a shitshow from what i understand

sour flame
tired panther
#

can anybody send me a list of channel perm ?

opal plank
#

or this

#

idk why you even bothering with rose million

#

rose isnt a fullfledged library, much less a finished one

#

@crimson vapor

crimson vapor
#

it almost is

opal plank
#

its not out

crimson vapor
#

almost

#

lol

opal plank
#

its a WIP lib

crimson vapor
#

no

opal plank
#

it is

crimson vapor
#

release very soon

pale vessel
#

where is voice support

crimson vapor
#

next update is release

#

fuck voice

pale vessel
#

fullbruh \

opal plank
pale vessel
#

then it's not "finished"

opal plank
#

^^

tired panther
opal plank
#

also the wiki is 3 pages

#

even the generated garbage docs from detritus is better

crimson vapor
#

its 6

#

iirc

opal plank
#

its 3 from what i can see

#

the basics

#

the npm

#

and the commandhandler

#

thats all

#

theres 3 pages with 50 lines each

crimson vapor
#

yea true

opal plank
#

the commandHandler wqith roughly 100

#

theres no docs at all

#

just examples

#

detritus is the opposite

#

its all docs

#

and few example

#

d.js has both, hence why its liked

crimson vapor
#

ehh

#

djs docs are pog

#

ngl

#

so easy to read

opal plank
#

oye

#

you didnt disable any caching on detritus

#

yet you disabled all that on rose

crimson vapor
#

u right

#

idk how

#

LOL

opal plank
crimson vapor
#

im still working on setup

#

LOL

opal plank
#

wdym, i sent you how

crimson vapor
#

yes but like

#

could you configure it for me?

opal plank
#

the image is an example

crimson vapor
#

hmmm

opal plank
#

the reply is all the options you have

crimson vapor
#

ok

opal plank
#

@quartz kindle you're leggaly required to benchmakr this

#

d.js vs djs-light vs eris vs detritus

#

dont you dare run away

#

benchmarking is your job, and you know it

crimson vapor
#

bruh

#

shame you don't add discord-rose

opal plank
#

its not out

#

doesnt count

crimson vapor
#

bruh

#

cringe

opal plank
#

plenty of half baked libs out there

#

not only is rose unfinished, its also too small

crimson vapor
#

how is it too small?

opal plank
#

how is it NOT small?

#

its not even out

#

theres probably 20 people using it at best

#

and most of them cuz they're here hearing about it

crimson vapor
#

oh you mean small by people using it

#

fair yes

opal plank
#

well yeah

crimson vapor
#

I thought you meant small as in like capabilities

opal plank
#

i dont keep up with rose development, so i cant comment on it

crimson vapor
#

lmao

opal plank
#

@crimson vapor .default*

#

or use require()

crimson vapor
#

right

opal plank
#

or isntall types

#

npm i @types/eris

#

eris.js

#

whatever the fuck that is

lament rock
#

does eris seriously not have bundled types

crimson vapor
#

it should

#

idk ive never used eris

quartz kindle
#

lol

opal plank
#

tim

#

go benchmark

quartz kindle
#

nu

opal plank
#

back to the basement you go

crimson vapor
#

I got you tim

#

dw

opal plank
#

benchmark moke

clever wolf
#

Hi

quartz kindle
#

detritus should win anyway

lament rock
#

You're going to Brazil

opal plank
#

wait rlly?

quartz kindle
#

with equal caches yes

opal plank
quartz kindle
#

if they are really more efficient at storing

opal plank
#

thats why im telling you

#

benchmakr it

quartz kindle
#

djsl just makes caching optional, doesnt make it more efficient

crimson vapor
#
{
  rss: '135.2MB',
  heapTotal: '85.4MB',
  heapUsed: '83.2MB',
  external: '2.0MB',
  arrayBuffers: '0.0MB'
}``` eris
opal plank
#

garbage collectors are finicky

crimson vapor
#

bruh

opal plank
#

specially when the bot starts

crimson vapor
#

ok

opal plank
#

it caches a lot of stuff

crimson vapor
#

I wait for the initial gc

sour flame
#
const { Client, Collection } = require('discord.js')
class EconomyClient extends Client {
    constructor() {
        super();
        this.discord = require('discord.js');
        this.fs = require('fs')
        this.path = require('path')
        this.mongoose = require('mongoose')
        this.commands = new Collection();
        this.timeouts = new Collection();
        this.config = {
            prefix: 'e!'
        }
    }
    commandHandler(path) {
        this.fs.readdirSync(this.path.normalize(path)).map((f) => {
            const File = require(this.path.join(__dirname, `..`))
        })
    }
};
module.exports = EconomyClient
#

My code so far in my economybot

crimson vapor
#

please don't do this like this

opal plank
#

imagine not using detritus

crimson vapor
#

use imports correctly

opal plank
#

doesnt look like ts btw

crimson vapor
#

its js

opal plank
#

so either way you wouldnt be getting intellisense

crimson vapor
#

what js has intelliense

opal plank
#

but yeah, you could use import/export for es6

#

you wouldnt be able to call the economy class

lament rock
#

vscode supports JSDoc annotated code

opal plank
#

jsDoc

sudden geyser
#

@sour flame why are you saving require calls to properties?

opal plank
#

yes

crimson vapor
#

erwin

#

ive got an issue

opal plank
#

not autoimports from classes

lament rock
#

which is TS light™️

crimson vapor
#

look at my screen

#

40 rss

sudden geyser
#

That doesn't have anything to do with the class. You should require it at the top of the file instead.

opal plank
#

ik, try the others aftera while

crimson vapor
#

on DJS

opal plank
#

also

#

you testing on the low bot right?

crimson vapor
#

yes

opal plank
#

it'd be best to test on larger tokens

crimson vapor
#

ok bruh

#

sec

#

slide token

opal plank
#

the commandClient will clearly be heavier than the other packages, but it should put up a fight fairly easily with the other ones

sour flame
opal plank
#

since the commandClient is heavier than the other libs since it supports a LOT more features

sudden geyser
#

You can require it at the top of your files: ```js
const Discord = require("discord.js");

class A extends B {
// stuff
}

opal plank
#

yikes

#

missing permissions

crimson vapor
#

how did that happen

opal plank
#

console log guildcount too btw

sour flame
#

//stuff does what?

crimson vapor
#

cringe

opal plank
sudden geyser
#

It's just a comment (only for readability).

sour flame
opal plank
#

how many guilds million?

crimson vapor
#

79

opal plank
#

reply with the lib

#

alongside with the ping

crimson vapor
#

sec

#

I should add real stuffs

opal plank
#

also

#

send me your detritus code

crimson vapor
#

can you make me the example client?

opal plank
#

send me what you got

swift cloak
#
(node:63493) UnhandledPromiseRejectionWarning: Error: > Couldn't find a `pages` directory. Please create one under the project root```
#

this is next.js

opal plank
#

@crimson vapor ```ts
import { CommandClient } from 'detritus-client';

const commandClient = new CommandClient(token, {
shardCount: 1,
prefix: '?',
});

commandClient.add({
name: 'ping',
run: context => {
return context.reply({
embed: {
title: 'Pong! DETRITUS',
description: ${Object.entries(process.memoryUsage()).reduce( (T, [K, V]) => ((T[K] = (V / 1024 ** 2).toFixed(1) + 'MB'), T), {} as any, )},
},
});
},
});
commandClient.run();

setInterval(() => {
console.log(
Object.entries(process.memoryUsage()).reduce(
(T, [K, V]) => ((T[K] = (V / 1024 ** 2).toFixed(1) + 'MB'), T),
{} as any,
),
);
}, 1000);

sour flame
#

Says it only takes 1-3 mins this is taking a entire year to finish

opal plank
#

all cache btw

#

if you want no cache

swift cloak
crimson vapor
#

I should test with deafult cache?

swift cloak
#

i need help

#

with that error

small meteor
tired panther
opal plank
#

@crimson vapor use this to see how well it handles with the minimum cache, members, channel, guilds

#
import { CommandClient } from 'detritus-client';

const commandClient = new CommandClient(token, {
  cache: {
    applications: { enabled: false },
    connectedAccounts: { enabled: false },
    emojis: { enabled: false },
    members: { enabled: false },
    messages: { enabled: false },
    notes: { enabled: false },
    presences: { enabled: false },
    relationships: { enabled: false },
    roles: { enabled: false },
    sessions: { enabled: false },
    typings: { enabled: false },
    users: { enabled: false },
    voiceCalls: { enabled: false },
    voiceConnections: { enabled: false },
    voiceStates: { enabled: false },
  },
  shardCount: 1,
  prefix: '?',
});

commandClient.add({
  name: 'ping',
  run: context => {
    return context.reply({
      embed: {
        title: 'Pong! DETRITUS',
        description: `${Object.entries(process.memoryUsage()).reduce(
          (T, [K, V]) => ((T[K] = (V / 1024 ** 2).toFixed(1) + 'MB'), T),
          {} as any,
        )}`,
      },
    });
  },
});
commandClient.run();

setInterval(() => {
  console.log(
    Object.entries(process.memoryUsage()).reduce(
      (T, [K, V]) => ((T[K] = (V / 1024 ** 2).toFixed(1) + 'MB'), T),
      {} as any,
    ),
  );
}, 1000);
crimson vapor
#

ok soon

#

LOLL

opal plank
#

JSON.stringify() btw

crimson vapor
#

inspect

opal plank
#

wont work

#

newline

quaint wasp
#

how do I make an animated emoji?

#

like.

#

How do I send it?

opal plank
#

now it will

swift cloak
#

<a:emoji:id> @quaint wasp

opal plank
#

^^

quaint wasp
#

I tryed :this:

#

,,

#

oh

swift cloak
#

<a:emoji:id> is for animated emojis only

#

regular is <:emoji:id>

quaint wasp
#

oh

#

thanks

#

wait

#

so for animated emojis

#

do u still include id?

opal plank
#

@crimson vapor also add on the console log which branch that it

swift cloak
#

yes

opal plank
quaint wasp
#

I tryed it didnt work.

tired panther
crimson vapor
#

DJS | DJSL | DROSE | IDK HOW TO SPELL | ERIS

quaint wasp
#

the server its sent in has the emoji named checkmark.

opal plank
#

so

opal plank
#

detritus lower than d.js and rose

swift cloak
#

id is the ID of the emoji

opal plank
tired panther
quaint wasp
#

oh

#

name should be id?

#

like litilary

swift cloak
quaint wasp
#

?

#

o

tired panther
#

like this Agree

opal plank
#

lmao

swift cloak
crimson vapor
#

no

opal plank
#

d.js and djs failed

crimson vapor
#

no

#

they didn't

opal plank
#

and eris

crimson vapor
#

eris failed

#

djs doesn't have shit

#

sec

swift cloak
tired panther
#

Agree for animated

swift cloak
#

yes

crimson vapor
#

there is no eris bot running

opal plank
#

get rekt

crimson vapor
#

sec

#

eris is strange wtf

opal plank
#

¯_(ツ)_/¯

#

probably Client

#

const Eris = require(eris)

#

do the same as the docs

earnest phoenix
opal plank
#

yup

crimson vapor
#

for a client

#

user

#

bruh

#

what is wrong with eris

earnest phoenix
#

Isn't it for other users?

crimson vapor
#

im dumb

opal plank
#

dunno

#

check their server lul

#

i havce no clue what those things are for

#

might as well ask the dev directly

crimson vapor
#

wait djs light disables some cache by default?

#

is Tim cheating wtf?

opal plank
crimson vapor
#

on startup

opal plank
#

@quartz kindle come defend ur lib

#

coward

lyric mountain
#

nono, to call @quartz kindle you gotta say:

#

Timotei

crimson vapor
#
1. discord.js-light
2. discord-rose
3. eris
4. idk how to spell
5. discord.js```
quartz kindle
#

lmao

lyric mountain
#

see?

opal plank
#

timmy is better

crimson vapor
#

Erwin

#

explain

opal plank
#

but i think of hortons when i say that

sour flame
#

I'm guessing my bot's working

opal plank
#

explain what?

crimson vapor
#

detritus is last

opal plank
#

on startup

crimson vapor
#

other than djs

opal plank
#

show console

quartz kindle
#

these kind of comparisons are not fair at all lul

opal plank
#

^^

crimson vapor
#

shhhh

quartz kindle
#

you're comparing cache vs no cache

opal plank
#

thats why i was telling tim to benchmakr it

crimson vapor
#

no default shit for all libs

#

LOL

opal plank
#

but he ran away

quartz kindle
#

and even with cache, different libs cache different things

opal plank
crimson vapor
#

exactly

#

im not testing a configured client

opal plank
#

tim you like benchmarking

quartz kindle
#

like discord rose, caches only a few things, its not a fully featured lib yet

crimson vapor
#

otherwise I could turn off cache and drose would win because there are no classes

opal plank
#

benchmakr them

crimson vapor
#

yeah

quartz kindle
#

if you wanna benchmark cache efficiency

#

get 100k member objects

#

and cache them in different libs

#

using their native member object constructors

#

lmao

opal plank
#

i got 560k

crimson vapor
#

so a object for drose

#

LOL

opal plank
#

that might be worth a shot

#

actually

#

oye

#

@earnest phoenix

crimson vapor
#

Erwin

#

1 min in

opal plank
#

you got ur bot here

#

VX something

#

try the benchmakr with the users here

misty sigil
#

@royal knoll

opal plank
#

that or whatever

#

or better yet

#

xet probably gonna hit me in the head for that one

#

@woeful pike

misty sigil
#

I’ll benchmark

opal plank
#

would you mind helping benchmark libraries with a bot ONLY on this server?

crimson vapor
#
1. discord.js-light
2. discord-rose
3. eris
4. discord.js
5. idk how to spell```
opal plank
#

the hekc u on about million

#

look at rss

crimson vapor
#

I don't have guild members or presenses but my bot is here ¯_(ツ)_/¯

misty sigil
#

same

earnest phoenix
crimson vapor
#

rss doesn't matter early on imo

misty sigil
#

hi voltrex what’s lua

opal plank
#

i call bs

crimson vapor
#

yeah

#

this is bs

quartz kindle
#

tbh heapUsed is a fairer indicator

crimson vapor
#

thats what im using

opal plank
#

rss is the majority of your used ram

quartz kindle
#

because you're measuring just js data

misty sigil
#

heapUsed is 14-26mb for me

#

that’s on djs light

crimson vapor
#

do you have guild members?

earnest phoenix
misty sigil
opal plank
#

im calling xet for this one

crimson vapor
#

yeah same

quartz kindle
#

you can compare for rss as an indicator of memory leaks on the websocket decompression lol

woeful pike
#

what benchmark

quartz kindle
#

but the js heap is the actual cache data

opal plank
#

to see if xet can get a test bot here to benchmark every js lib

#

a single bot

#

no permissions

#

here

misty sigil
#

just a bot

woeful pike
#

why do you need me for this? 😩

opal plank
#

having a bot in a single guild will make it a fair comparison

crimson vapor
#

you're admin

misty sigil
#

because you’re cool

opal plank
#

cuz only you can add bots here