#development

1 messages · Page 1642 of 1

opal plank
#

no need to split

#

check

#

regex

#

or cooldowns

#

or permission check

#

none of that, it does it by itself

#

detritus pog

sudden geyser
#

why would it do that tho

opal plank
#

why would it not?

#

its providing support for literally everything you would need for a discord bot

sudden geyser
#

oh you mean features the library supports

opal plank
#

yeah

sudden geyser
#

was thinking like why it would all be baked into that single function

opal plank
#

i think ive sent before, sorry if its beating a dead horse

#

but here

#

almost everything you would want for a discord bot it has already internally

#

also

#

1 line

#

this scans command folder and auto imports all your commands

#

and to reload? well, thats a bit harder

#

its 2 lines then mmulu

sudden geyser
#

is it possible to reload a specific command

opal plank
#

yeah

sudden geyser
#

nice

opal plank
#

commandClient.commands is an array

#

simple remove that and commandClient.add(command)

earnest phoenix
#

ree

river panther
opal plank
earnest phoenix
#

what's the requirements for submitting a bot

river panther
solemn latch
#

to submit? have a bot, be in this server.

river panther
solemn latch
earnest phoenix
#

alr

solemn latch
earnest phoenix
#

I'm making a bot so I'm gonna submit it

opal plank
#

woo

#

since you getting mod

solemn latch
#

erwin

river panther
opal plank
#

tel em to giv me bot role mmulu

solemn latch
#

i have give role perms 👀

opal plank
#

wink wink

#

hey qt, you come here everyday?

solemn latch
#

👀

#

the real question is, will luca notice if i give you muted role?

earnest phoenix
#

can anyone send quotations I can copy

#

my computer is glitching

solemn latch
#

quotation

#

oh like

#

"

#

?

lyric mountain
#

''

earnest phoenix
#

thanks

opal plank
earnest phoenix
#

like tf is that quotation

opal plank
#

"

#

this?

earnest phoenix
#

ya when I type that it makes it smaller

#

so i needed u to send 1

#

lol

opal plank
#

why you using quotation marks in urls?

runic plaza
#

you using a chromebook? keyboard layout may have changed from US to international

earnest phoenix
#

bru

opal plank
#

if you didnt buy a barbie plastic laptop for $30, any computer/laptop you buy will have quotation marks

earnest phoenix
#

it's like 200$

lyric mountain
#

ç

solemn latch
#

lol

#

thats rude erwin 👀

#

barbie plastic laptops are great

earnest phoenix
#

ikr

proud oracle
#

io

opal plank
solemn latch
lyric mountain
#

wtf is that letter after L?

solemn latch
#

n

#

but with a fancy squiggly

lyric mountain
#

ççççç

opal plank
#

thats HUEHUEHU keyboard

lyric mountain
#

well, at least that barbie book is stereo

opal plank
#

im amazed no one stared that for the fact that i, for some reason, knew that barbie keyboards didnt have quotation marks

nimble kiln
lyric mountain
#

lul

nimble kiln
lyric mountain
#

literally

earnest phoenix
#

kuu

opal plank
earnest phoenix
#

[''] for a gif?

nimble kiln
lyric mountain
nimble kiln
#

Everyone who thought "Nah, why would we need this" is seriously F'd now if this takes longer

opal plank
#

we sure hope you have insurrance level of sass

lyric mountain
#

you need to learn how jsons work, then learn how apis work

#

there's no shortcut

earnest phoenix
#

bru

#

I've tried img gif image

#

got it

#

it's link

#

['link']

#

thanks lmao

#

figured it out

#

lmao

blissful coral
#

Ima ask this here

#

Since I am not getting a response lul

sudden geyser
#

You probably can't without passing a parameter.

blissful coral
#

Yeah was just making sure lul

sudden geyser
#

Though, why would you want to do that?

blissful coral
#

I don't think I can but it was worth a try to see if it was somewhere inside of class

#

It is a npm package

#

so

#

The files it needs to read aren't in the dir as it would do it in so

#

Actually wait if I do a function it would execute the directory path inside of the class where the class file is or where it was executed at?

sudden geyser
#

The class file, not where it was executed.

blissful coral
#

Yeahh

#

hmmm

sudden geyser
#

You could always pass a parameter like __dirname or __filename since Node.js makes those global

blissful coral
#

yeah I am doing that instead

#

Just gonna pass a process.cwd() and then use path

#

or dirname

#

idk yet I am figuring it out still KEKW

earnest phoenix
#

@lyric mountain I figured it out

sudden geyser
#

I recommend one of the two examples I pointed out

#

I can't confirm but process.cwd probably makes a system call, but who knows

blissful coral
#

Idk

#

I figured it out now lmao

river panther
#
message.channel.me.hasPermission(command.permission)

whats wrong in this?

opal plank
#

@river panther werent you using detritus?

pale vessel
#

lol he dipped out

river panther
#

^

#

it confusing

#

and no docs

pale vessel
#

because the docs is bad right now

river panther
#

^

solemn latch
opal plank
#

in detritus its just .can()

#

it doesnt

#

channel does not include members

pale vessel
#

btw it's channel.permissionsFor(guild.me).has()

river panther
pale vessel
#

sure

#

that works too

opal plank
#

that works

#

message.guild better tho

pale vessel
#

guild.me.permissionsIn(channel).has()

opal plank
#

^^

#

frick too fast

#

detritrus is just can()

#

it resolves on both

solemn latch
#

wait i messed up

#

whatever

opal plank
#

<member>.can(PERMISSION)

pale vessel
#

interesting

river panther
#

make*

opal plank
#

i already explained the perks of detritus lul, its worth it on the long run

#

actually, bullshit, its worth on the short run too

#

fuck writing unecessary code

solemn latch
#

👀

#

what does detritus do better?

opal plank
#

everything lmao

river panther
#

no

#

fuck breh

#

now erwin will not stop for 12 hours

opal plank
#

command Handler is shipped in internally, caching is customizable like d.js-light, its lighter, its typescript lib, literally everything

solemn latch
#

caching customizable is a huge one when comparing to djs 👀

pale vessel
#

here we go again

solemn latch
#

oh pog

pale vessel
#

googlefeud, feel my pain

opal plank
#

i aint stopping, and im well aware im just annoying

river panther
#

no, i am the one who heard erwin the most in past 3-4 days

pale vessel
#

detritus is fine and all but what about discord rose mmlul

opal plank
#

im simping for detritus, its good, period

river panther
#

i even started detrutus

opal plank
#

imagine mentioning a lib thats not even out

pale vessel
#

you can control caching, interact with the raw API and only cache needed properties

river panther
#

see

pale vessel
#

aw cake is so nice

river panther
#

and i gave up after writing 3 lines

opal plank
river panther
#

because i got an error in the third line

opal plank
#

We do not recommend creating a production bot with the library just yet.

#

imagine recommending this

river panther
#

then why have they given people the lib?

opal plank
#

dunno, ask flaz

#

he's the one advertising it

#

im at least adveritising a fully fledged lib

pale vessel
#

woah advertising?

solemn latch
pale vessel
#

i never even tried their boilerplate code, just from the front it looks interesting

pale vessel
#

i'm still using discord.js-light mmmlul

river panther
#

do you have the code of the server printed in your brain?

pale vessel
#

yes he did

opal plank
#

i sent you a fully working example lmao

pale vessel
#

meant discord rose

opal plank
#

o

pale vessel
#

it's not even v1 yet so

solemn latch
#

honestly, even i am not that interested in a lib with so few downloads weekly.
even djs light is cutting it close, and i know the dev of it 👀

#

with how fast new discord api versions come out

pale vessel
#

yeah exactly why I still use d.js light for my typescript rewrite

#

It just works and it uses less memory than eris

river panther
#

hmm

opal plank
solemn latch
#

and if the dev team bolts?

opal plank
#

the only thing detritus loses against d.js is in downloads

solemn latch
#

next api version comes out and your dead in the water

opal plank
#

thats literally it

#

just an fyi woo

pale vessel
#

For detritus, I might migrate IF they have a good lavalink wrapper (might also just fork shoukaku and make it work with detritus)

opal plank
river panther
#

i am just waiting for detritus' good docs

opal plank
#

they have been an official lib on Discord APi for a while now

river panther
#

or at least a youtube tutorial

opal plank
#

its not a small thing to get it there

pale vessel
#

I know detritus since last year when using Jacher's Assyst bot

#

He got banned unfortunately

river panther
#

what it a good bot?

solemn latch
pale vessel
#

but it was crazy light and I bet it still is

opal plank
#

NotSoBot is using detritus btw

pale vessel
#

yea

solemn latch
#

notsobot isnt dead? 👀

pale vessel
#

my question is how in the world did berry's bot crash when running detritus

#

What did he do wrong

river panther
#

hmm

solemn latch
#

👀

cinder patio
#

I'm pretty sure notsobot's getting rewritten

opal plank
#

it already is

#

in detritus

river panther
opal plank
#

was?

#

still is

#

just search notsobot discord

solemn latch
#

i didnt like notso 👀

cinder patio
#

Are you sure cause notsobot has 100+ commands but the repo doesn't include that many

opal plank
#

the point of the repo is to give a framework for people

#

you could very well fork it and add your own commands ontop

stone ermine
#

is there a way in discord.py to still have the bot respond if a valid command was used, but a check failed?

like, I want to tell a user that the reason the command did nothing was because they don't have the permissions to use it.

cinder patio
#

that's dumb

stone ermine
#

nevermind - found it. it's just a matter of using on_command_error

autumn dust
#

nvm

#

i fixed ir

crystal wigeon
#

anyone know about csrf?

#

how do i hide a field from the request payload?

rancid breach
#

my bot is not responding to commands?

tired panther
rancid breach
#

my server code?

#

818914079719817246

tired panther
rancid breach
#

lol sorry i dont understand

rustic nova
#

Did you make your bot yourself?

steel pumice
rustic nova
#

true

tired panther
restive furnace
drifting shell
#

need some help with laravel
When trying to run composer install, I get an error which just says "Class <class name> does not exist" even tho I have the dependency and I can see it in /vendor

earnest phoenix
opal plank
#

the old one, yes

#

new one is using detritus

earnest phoenix
#

oh

#

umatrix can you fucking not break sites

serene wagon
#

hey has anyone made a dashboard here?
im looking into making one that uses oauth but im trying to figure out how some other bots have their oauth token not show up on the url
im using angular 😄

modest maple
#

You dont use the secret in the redirect url

modest maple
earnest phoenix
#

welp already left

serene wagon
modest maple
#

It's just taken away by the server on the redirect

#

Login - > redirect callback - > redirect back to site

#

Code only makes it to the first redirect when the user data can be fetched

opal plank
#

hmmm ts really bending me over now

slender thistle
#

Can I be the TS there

serene wagon
opal plank
modest maple
#

Th3 code itself tells you nothing

serene wagon
modest maple
#

002_shrug litterally doesnt matter and cant be done sanely

serene wagon
night coral
#

Hey hello

#

How to I set up dank helper bot in my server pls say

green kestrel
#

its not opening for me, i want to know if its a local issue or if chargebee are having issues, because their service status page says theyre fine

sleek orchid
earnest phoenix
rustic nova
#

that's why

green kestrel
#

@earnest phoenix thanks, its just me - local problem

#

@sleek orchid This isnt a #support issue though

sleek orchid
earnest phoenix
#

Why this error?

#

Access to XMLHttpRequest at 'https://top.gg/api/bots/722557087221153853' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

cosmic yarrow
#

hi guys. which discord bot hosting do you recommend for a budget at around 5 dollars? i also want to connect to github for version control

quartz finch
#

hmm tired waiting

cosmic yarrow
#

?

quartz finch
#

for acception

#

almost week gonna over

cosmic yarrow
#

is that an answer to my question? it doesnt seem like it 😂

warm marsh
#

Who says it was an answer?

cosmic yarrow
#

i was just confused

#

sooo which one should i choose for a discord bot (hosting)?

warm marsh
#

What is that?

#

"Virtual Private Servers"

#

It's the last entry in the first group.

cosmic yarrow
#

lol im actually dumb in thes topics

earnest phoenix
#

which color should i choose for the forms?

tired panther
#

how can I make the font darker?

earnest phoenix
#

color:black or for bold font-weight:bold

spiral tinsel
cosmic yarrow
#

@spiral tinsel yes im not really knowledgable about it at all

green kestrel
#

Today i learned: Merging a branch via git commandline thats part of a pull request on github automatically closes that pull request

#

which is kinda neat

#

😄

slender thistle
#

Wew

earnest phoenix
#

Yup

#

but how to fix that

#

i tried using mode : 'no-cors'

slender thistle
#

No 'Access-Control-Allow-Origin' header is present on the requested resource.

earnest phoenix
#

but it didn't work

earnest phoenix
#

it says requested resource..

slender thistle
modest maple
#

You litterally cant fix that

#

Its top.gg not allowing your request via cors so your browser wont accept the response unless you're on the same host name

#

You're on localhost

earnest phoenix
#

Uhh

#

i was trying to make a website for my bot using top.gg api.

#

👀

modest maple
#

So just grt your server to send the requests and use ss rendering or a wrapping api

earnest phoenix
#

hmm i can use top.gg's api on react

#

wait

#

let me test

modest maple
#

Again, you cant use anything client side that doesnt implement cors or match the same host name

earnest phoenix
#

why it isn't working?

#

@rustic nova i need a advice.I have coded 2 bot,which has different commands but same feature. So the bot i applied works with commands. My other Bot works with the dashboard(already on top.gg). But since the dash will be offline for more then 1 week.I want to the add the commands only temp to my other Bot. But the problem now is that both bot has same commands and top.gg would decline. Sorry really complicated.

rustic nova
#

BongoCat bit confused what you mean

quartz kindle
earnest phoenix
#

uh

#

then how?

zenith terrace
#

I forgot this was my note for tim

quartz kindle
#

if(isNaN(text here))

earnest phoenix
#

thank you :D

quartz kindle
river panther
#

is it your birthday?

#

\🍰

#

<@&330168063729074177>

#

oh no

#

does this work

#

?

wet dove
#

why

quartz kindle
#

it does

#

lmao

wet dove
#

lol

river panther
#

sorry

#

i am really sorry

#

why are you guys yellow?

opal plank
#

why are yuo guys white?

river panther
#

because top gg declined my bot ;-;

#

i wish i knew about detritus before

opal plank
#

its their birthday

river panther
#

ooooh, niceeeeeeeeee

opal plank
#

make sure to spread the word of our god and svaiour

quartz kindle
#

god and saviour cake

opal plank
#

you get donuts supposedly every 10 members you bring

river panther
wet dove
#

thank you

river panther
quartz kindle
#

the cake role is a subliminal ad for detritus

opal plank
#

imagine giving tafina a cake role but not tim

opal plank
river panther
opal plank
river panther
river panther
lusty quest
#

doesnt mean anything

#

cry a user here is quite active on the Discord Developers discord

#

and iirc he doesnt got the bade

river panther
#

wot?

lusty quest
#

but knows some languages

river panther
#

the only active people i see on the dev server are advaith and mooosh

#

oh wait, i don't go outside the slash commands

lusty quest
#

ohh sorry not discord developers, it where discord API server

opal plank
#

dapi is a weird place

#

a REALYL weird place

#

you would think its a place to talk about API

#

how wrong you'd be to believe that

river panther
#

^

#

detritus is the real server

static sinew
#

hi,
I need help that how can i show leaderbaords using quick.db latest version
i think it will use db.all() function
pls give me full code as im not pro dev only learned through YT tutorials

opal plank
#

lmao ngl that server could get some more activity

lusty quest
#

deterius got already a channel on the API server nice

opal plank
#

been like that for a couple months

#

a lot of users on dapi already moved to detritus

river panther
#

are people even alive there?

lusty quest
#

i look on the server maybe once in the blue moon

earnest phoenix
#

How can i check if args.join(' ').includes(letter)?

opal plank
#

exactly like you said it

river panther
earnest phoenix
opal plank
river panther
earnest phoenix
#

letter needs to be a string

river panther
#

breh, ofc

opal plank
#

probably better to use .test() depending on what you're doing

#

but regex

earnest phoenix
#

how can i check all letter

opal plank
#

wdym all letter

river panther
#

make an array

earnest phoenix
#

jk jk

opal plank
#

a letter is a letter

river panther
#

run a loop

opal plank
#

dont

river panther
#

then?

opal plank
#

tell exactly what you want @earnest phoenix

earnest phoenix
opal plank
#

full context

earnest phoenix
#

abcdefghijklmnopqrstuvwxyz

river panther
#

ig he wants to check for the blacklisted words

earnest phoenix
#

nop

opal plank
#

i can offer a bunch of options, but just checking if a letter is in a string, indexOf() or includes()

river panther
#

oh, then what you want?

opal plank
#

thats why i need more context

earnest phoenix
#

like: !poll 2 3 1 4 3

opal plank
#

wouldnt a poll command use reactions?

earnest phoenix
#

sorting*

opal plank
#

huh?

#

okay

#

explain better my dude

river panther
#

wot?

opal plank
#

whole thing, be clear about what you're trying to do

river panther
#

i understoodn't

earnest phoenix
#

nvm

opal plank
#

welp, cant help if you dont explain

tired panther
bitter badger
#

Does anyone know the specifics of the premiumSince or premiumSinceTimestamp in Discord.js?
Will that value be defined once the boost runs out and the user is no longer boosting?

misty sigil
#

no it wont

bitter badger
#

So I can depend on it being defined to check if they're a booster and if it's undefined then I know they aren't a booster currently?

pale vessel
#

Yes, it'll be null if they're not a server booster

bitter badger
#

Awesome. Thanks!

thorny arch
#

how do i fix this

bitter badger
#

I think you're calling await without being inside an async function

thorny arch
#

hmm

#

ok

modest maple
#

Yikes

earnest phoenix
#

yess

spare cosmos
earnest phoenix
#

i can finally speak

sour flame
#

How it looking

umbral zealot
#

too white

sour flame
#

lol

cinder patio
#

why is it inside node_modules

sour flame
#

no it inside structures

umbral zealot
#

no it's inside node_modules/ms

sour flame
#

I see

umbral zealot
#

why.....

sour flame
#

because I forgot to just leave it in the folder

umbral zealot
#

Well It... looks like a class-based bot, though to be honest lines 5 through 9 should not be there

sour flame
umbral zealot
#

Good, so anyways, now you have a class with things it shouldn't have, and nothing else.

#

kk

sour flame
#

ik

#

Also it suppose to be an economy bot tho

umbral zealot
#

Ok but it's just a class with nothing else, not a bot.

#

Keep working at it I guess

#

You're about... 5% there!

sour flame
#

ik

#

that

dusky lagoon
#

Im trying to center the word command butcss .entity-announcement__title{ border-radius: 20px;; background-color: rgba(224, 161, 180); text-align: center; } doesnt work does anyone maybe know how

cold ruin
#

is snipe against the rules ?

umbral zealot
dusky lagoon
#

sorry i pasted the wrong code look now

umbral zealot
#

Alriht

#

try adding width: 100% , it's probably centered but not full width

dusky lagoon
#

heyy thank you so much

#

it worked

umbral zealot
tough agate
#

Hey

#

How can I solve this error

sour flame
#

Did I go wrong? Somewhere?

umbral zealot
#

yeah you didn't write any bot code

#

all you have is a class

#

Where's the other 90% of the bot?

tribal siren
#

ouch my eyes

#

i just got flashbanged

tired panther
tribal siren
tough agate
tribal siren
# tough agate

it says: Shard 0's Client took too long to become ready

#

your first shard takes too long to get to work

tough agate
#

Yeh I got it but how can I fix this error

tribal siren
#

why do you even shard in the first place

#

you got no bot over 2500 guilds

umbral zealot
#

Strangely, whenever this error comes up, either no one responds or it's someone on like 50 servers "just preparing themselves" but not needing to shard at all

#

If you want to shard, just put shards: 'auto' in your discord client options and be done with it

#

that's literally all you need to do

tribal siren
#

idk

tribal siren
umbral zealot
#

¯_(ツ)_/¯

earnest phoenix
#

did you got pinged with this $pingprevious ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​?

#

someone send a message pls

nimble kiln
#

a message

earnest phoenix
#

$pingprevious ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​

nimble kiln
#

$pingprevious

#

?

earnest phoenix
#

wait asec

nimble kiln
#

aRe yOu UsInG a SelFBOt?!

tired panther
#

obviously, it should ping somebody

earnest phoenix
#

see it pings me

nimble kiln
#

wat

earnest phoenix
#

no i am not lol

nimble kiln
#

didnt ping me

earnest phoenix
#

yes quite weird

tired panther
#

I just wonder pepe_wow

nimble kiln
#

Client modifications?!

earnest phoenix
#

C:\Users\emir\Videos\Movavi Screen Recorder\patch\sarah+\node_modules\node-fetch\lib\index.js:1461
reject(new FetchError(request to ${request.url} failed, reason: ${err.message}, 'system', err));
^
FetchError: request to https://odiesoose.zpeedtr.repl.co/db/fetch failed, reason: read ECONNRESET
at ClientRequest.<anonymous> (C:\Users\emir\Videos\Movavi Screen Recorder\patch\sarah+\node_modules\node-fetch\lib\index.js:1461:11)
at ClientRequest.emit (node:events:376:20)
at TLSSocket.socketErrorListener (node:_http_client:474:9)
at TLSSocket.emit (node:events:376:20)
at emitErrorNT (node:internal/streams/destroy:188:8)
at emitErrorCloseNT (node:internal/streams/destroy:153:3)
at processTicksAndRejections (node:internal/process/task_queues:80:21) {
type: 'system',
errno: 'ECONNRESET',
code: 'ECONNRESET'
}

#

Hey, I have a question:

#

developpent is the channel name

#

272764566411149314 is the channel id

#

so

#

in javascript

crimson vapor
#

a channel class

#

client.channels.cache.get("ID") iirc?

earnest phoenix
#

no bit

#

I know:

#

but for this

#

channel.?

cinder patio
#

it's an object

earnest phoenix
#

oh

#

but

#

if a member put this

#

how to bot can catch the id?

cinder patio
#

catch? Like get the channel with the ID the member put?

earnest phoenix
#

no euhhhh

#

let me explain

#

if me

#

for a command setlogs

river panther
#

$pingprevious

#

did you ping?

earnest phoenix
#

How the bot can catch 272764566411149314

#

the id of the channel

cinder patio
#

like, get the ID from the mention?

earnest phoenix
#

euhhh yes too I think

cinder patio
#

message.mentions.channels is a collection of channel objects, do message.mentions.channels.first() to get the first mention

earnest phoenix
#

the args[0] is same?

cinder patio
#

args[0] returns a string that can be anything. message.mentions.channels.first() returns the first mentioned channel object

earnest phoenix
cinder patio
#

uhm, no? That doesn't make any sense

earnest phoenix
#

oh

cinder patio
#

message.mentions.channels.first() is already your channel object

earnest phoenix
#

😮

#

so how can I do the line?

#

the args[0]

#

I can catch the id

#

if I declare what is the args[0]

cinder patio
#

Why do you need the args0?

const channel = message.mentions.channels.first();
// channel is now the #development channel object
river panther
cinder patio
#

You should really read more about javascript because it looks like you don't know what you're doing

earnest phoenix
earnest phoenix
cinder patio
#

yes

earnest phoenix
#

oki thx

#

xD discord.js.guide

#

but just

cinder patio
#

those string literals are also pointless

earnest phoenix
#

If I have more args

#

the const channel2

#

will be args[1]?

cinder patio
#

Depends on what channel2 is

earnest phoenix
#

another channel

cinder patio
#

what's your end goal?

earnest phoenix
earnest phoenix
#

just use .second

cinder patio
#

and... what do you do with those channels

#

.second is not a thing]

tired panther
tired panther
tired panther
earnest phoenix
#

channel id is cached

earnest phoenix
tired panther
#

thats very spammy, to post logs in 4 channels, but when they all have different purpose its okay

earnest phoenix
#
  • moderation
  • message
  • vc
  • server
#

one channel per theme

slender thistle
#

Why not just one channel with different message layouts

earnest phoenix
#

I can but its better one channel for one theme

#

but so

#

its possible?

tired panther
earnest phoenix
#

like the message.mentions.channels.first

#

its like args[0]

tired panther
earnest phoenix
#

no

#

I will explain

#

I'm not dumb O_O

tired panther
river panther
#

its been 8 mins and i am waiting for explaination

snow ravine
#

does anyone know of a free bot hosting service?

river panther
#

its a myth that it exists

umbral zealot
#

Check the 📌

snow ravine
#

oki

earnest phoenix
#

or heroku with cc

snow ravine
#

im dumb turns out my mc hosting service can host bots and i bought the paid version

cedar birch
#

.d

earnest phoenix
#

but just

tired panther
earnest phoenix
#
const { MessageEmbed } = require('discord.js');
module.exports = {
  name: 'servers',
  description: `Affiche les serveurs où se trouve le bot.`,
  usage: 'servers',
  async run(message, args, prefix) {
                const servers = message.client.guilds.cache.array().map(guild => {
                let invite = servers.createInvite({
                maxAge: 0,
                maxUses: 0,
                })
                return `\`${guild.id}\` - **${guild.name}** - \`${guild.members.cache.size}\` membres [Rejoindre](invite)`;
            });

            const embed = new MessageEmbed()
                .setTitle('Voici la liste des serveurs où se trouve Synapse !')
                .setFooter(message.member.displayName, message.author.displayAvatarURL({ dynamic: true }))
                .setTimestamp()
                .setColor(message.guild.me.displayHexColor);

            if (servers.length <= 10) {
                const range = (servers.length == 1) ? '[1]' : `[1 - ${servers.length}]`;
                message.channel.send(embed.setTitle(`Server List ${range}`).setDescription(servers.join('\n')));
            }
  }
}

cannot access "servers" before initilization at let invite = servers.createInvite({

earnest phoenix
thick bolt
#

what do I do I don‘t get this

small tangle
#

Right now im doing final User botCreator = ctx.getJDA().getUserById(Config.get("DEV_ID")); to get me as an user, because i like to put my name in the footer of an embed, but thats duplicate code in a couple commands, is there a better way?

tired panther
#
const servers = message.client.guilds.cache.array().map(guild => {
                let invite = guild.createInvite({
                maxAge: 0,
                maxUses: 0,
                })
                return `\`${guild.id}\` - **${guild.name}** - \`${guild.members.cache.size}\` membres [Rejoindre](invite)`;
            });
#

@earnest phoenix

earnest phoenix
#

yes

#

oh

#

wait

#

@tired panther guild.createInvite({ is not a function

tired panther
earnest phoenix
#

yes

#

every guilds

#

oof

tired panther
earnest phoenix
#

I see how servers have my bot

#

and if member want to join his servers

wide wharf
#

I want to set my bot so that if I am offline and someone tags me, it will react to the tag with 🔴 and if I am online 🟢 how can I do this? (I have no idea how lol)

#

@modern sable why can't I change my nickname?

tired panther
visual stream
#

Bots can't change the nick of the owner

#

Unless you mean in this server

cinder patio
#

Only nitro boosters can

#

change their nick

wide wharf
modern sable
wide wharf
#

Could you change it back to normal

#

(reset)

modern sable
#

done

wide wharf
#

thx

tired panther
#

lol

earnest phoenix
tired panther
earnest phoenix
#

oh

wide wharf
tired panther
wide wharf
tired panther
#

the easiest way is to pay someone here, they will do it 🤣

wide wharf
#

what tutorial do u recommend me

tired panther
wide wharf
visual stream
#

Discord.js docs

tired panther
#

Discord.js guide

wide wharf
#

k

visual stream
#

Imo docs help me more than a guide

tired panther
visual stream
#

I started with the docs

earnest phoenix
visual stream
#
tired panther
#

like this

earnest phoenix
#

yes but

#

I can't do with one command?

lament rock
#

Array.from(message.mentions.channels.values()) // returns an Array<GuildChannel>
Then you access normally like arr[0], arr[1]

tired panther
earnest phoenix
#

oh

#

I will start with 4 commands

river panther
#

ping

visual stream
#

Pong

tired panther
#

peng pepeShoot

wide wharf
#

Could someone turn this: :regional_indicator_p::regional_indicator_i::regional_indicator_n::regional_indicator_g: into emojis?

#

send them using `` please

fleet plinth
#

pls 🇵🇮🇳🇬

solemn latch
#

🇵 🇳 🇬

tired panther
#

\🇵 \🇮 \🇳 \🇬

wide wharf
#

the G

solemn latch
#

Oh I missed the i

#

Kek

wide wharf
#

lol

wide wharf
tired panther
#

🇵 🇮 🇳 🇬

#

lol

#

I am a kek

zenith terrace
#

🇵🇮🇳🇬

#

aw

#

uh what

#

:regional_indicator_p: :regional_indicator_i: :regional_indicator_n: :regional_indicator_g:

fleet plinth
#

🇵🇮🇳🇬

zenith terrace
#

fek

#

I give up

wide wharf
#

Lol

#

Discord is so annoying

#

Why do they turn them into text within two ":"

fleet plinth
#

(-_-)

#

🇵🇮🇳🇬

tired panther
wide wharf
#
  if(message.channel.type == 'dm') return;
  if(message.author.bot) return;
  if (message.bot) return;
  if (message.content.toLowerCase().startsWith('@Its_IsmailZ#8826')) {
    message.react('🇵');
    message.react('🇮');
    message.react('🇳');
    message.react('🇬');
  }
``` doesn't work for some reason ![waitWhat](https://cdn.discordapp.com/emojis/622740549673418782.webp?size=128 "waitWhat")
tired panther
wide wharf
#

with id?

#

< @ 643091174243958814 >

tired panther
#
  if(message.channel.type == 'dm') return;
  if(message.author.bot) return;
  if (message.bot) return;
  if (message.content.toLowerCase().startsWith('@wide wharf')) {
    message.react('🇵');
    message.react('🇮');
    message.react('🇳');
    message.react('🇬');
  }
```here u go
wide wharf
#

thx

#

aren't these the same?

  if(message.author.bot) return;
  if (message.bot) return;
tired panther
#

message.bot does not exist

wide wharf
#

k

tired panther
wide wharf
#

,,s,s?

boreal iron
#

as long as you wanna check if the message starts with a ping, use message.mentions

tired panther
boreal iron
#

if(message.mentions.users.first() && message.mentions.users.first().id === <client>.user.id) { <client>.destroy(); };

boreal iron
#

changed as u wanna return I see

tired panther
#

else it will give a error

boreal iron
#

he doesn't wan't a return

#

my previous (unchanged) version was right lmao

#

there we go

wide wharf
#

but how to do it that it will react also if the tag is at the end or in the message and not starts with the tag?

#

wait nvm

#

where can I test my bot?

#

nvm

boreal iron
#

create a Discord server

#

bots won't get invited in here (anymore) if I remember right

stuck pike
#

i wanna report a guy

#

asking for codes

umbral zealot
#

You'd have to report half the server here

stuck pike
#

also using my exact bot name even its symbol

stuck pike
slender thistle
#

If you don't own the copyrights to it you can't do anything

umbral zealot
#

ok then block 'em

slender thistle
#

How can you what

stuck pike
#

how can i copyright it?

#

any idea

umbral zealot
#

Talk to a lawyer 😄

boreal iron
# wide wharf but how to do it that it will react also if the tag is at the end or *in* the me...

well validate the whole content to return messages you're not searching for

if(message.author.bot || !message.guild) return;  //return messages from bots or in dm

const data = message.content.trim().split(/ +/g);

if(!data[1]) return;  //return messages without arguments
if(data[0].toLowerCase() != my_prefix && !message.mentions.users.first()) return;  //return messages without your prefix and without any mentions
if(message.mentions.users.first() && message.mentions.users.first().id !== bot.user.id) return;  //return messages with (multiple or wrong) mentions (not including your bot user id)```
etc.
stuck pike
small tangle
#
final String botName = ctx.getJDA().getSelfUser().getName();
ctx.getChannel().sendMessage(":GreenTick: " + botName + " is shutting down...").complete();

Would you consider this a good codestyle? im mean im saving the bots username in a variable, although im using it only once, because the codeline is shorter with it. would you write it directly in the message or like the way i did?

opal plank
thick nexus
#

lao still dont know how to make it work oof

opal plank
#


const data = message.content.trim().split(/ +/g);

if(!data[1] || (data[0].toLowerCase() != my_prefix && !message.mentions.users.first()) || message.author.bot || !message.guild || (message.mentions.users.first() && message.mentions.users.first().id !== bot.user.id)) return;  ```
#

FuckReadability™️

#

also im fairly certain it would be faster to use users.size instead of bringing back the whole object since its unused in the first statmenet

#

not like anyone is a performance freak like me to even care about that

cinder patio
#

store the mentioned user in a variable

opal plank
#

that too

cinder patio
#

Hey Erwin I'm gonna use the lib you always talk about for my next bot

pale sapphire
#

Hey do i need NSFW feature for a ship Command (love score command)

cinder patio
#

If there isn't any porn/gore shown then it's not nsfw

pale sapphire
#

Okie so it means my bot will be accepted if i don't do it nsfw
Thanks for help

boreal iron
opal plank
#

tell cake mister lerwin sent you KekDog i get comission per user

misty sigil
#

sup erwin

opal plank
#

sup chicken

boreal iron
#

and you're statement doesn't make sense anyways regarding speed

misty sigil
#

i got grafana workin

#

and looking half decent

opal plank
#

every if starts it own check

boreal iron
#

At first you would for message.author.bot || !message.guild moving on with the rest after

opal plank
#

merging them makes it so it fails in cascade

#

rather than start a new if everytime

boreal iron
#

shhh

opal plank
#

well yeah, but my point is to merge into one if

#

the order can be arranjed

#

and as feud said, assign the first() to a variable

boreal iron
#

sorting conditions saves you ... I'm sure a few mili-micro-seconds

opal plank
#

its faster than calling the method 3 times

boreal iron
opal plank
#

welllll

#

it IS tied to message

#

which stacks easily

#

next to message, presence is probably the biggest killer when it comes to payload traffic

#

on 3k servers

opal plank
#

microseconds stacked on those rates can make a difference overtime

misty sigil
#

uuh

#

lemme just move shit about

opal plank
#

aight

boreal iron
#

ok let's stick to the result everyone has is own coding style...

opal plank
#

i said, probably nobody is a performance freak

#

but i have to deal with that shit

#

which is quite a hassle, but also good

#

improves some overall coding practices

boreal iron
#

and anyways, I tried to explain him how to check things

opal plank
#

and its a challenge too, which gives me something to do

#

ik, i pointed it out

boreal iron
#

aye

cinder patio
#

slash commands greatly reduce gateway traffic oldEyes

opal plank
#

too bad i need presence intents

#

cuz that shit is a killer

boreal iron
# opal plank ,

let's say I was totally right and you're wrong. I could live with that

opal plank
#

78 million presences parsed within 19h

#

i had gotten that to 1 billion before in a week

#

thats 1 billion objects recieved via gateway

cinder patio
#

jesus

opal plank
#

it can stack up quickly for network usage lul

#

while message payload is larger overall, its still a staggering amount of data per minute

boreal iron
#

well I'm not aiming to cache all the crap anyways

opal plank
#

im not caching either

boreal iron
#

That's your issue, Sir!

opal plank
#

caching presences is beyond retarded

boreal iron
#

lmao

opal plank
#

just picture it

#

every minute

#

theres 54 thousand objects recieved

#

every MINUTE

#

out of curiosity

#

900 objects per second

#

and it only goes up

boreal iron
#

well I'm a Discord browser only user, don't even know how to set a status lmao

opal plank
#

regardless

#

its not only status as in presence

#

its also DND, ONLINE, AWAY

#

etc

boreal iron
#

oh lol yeah forgot these, aye

opal plank
opal plank
#

this is only half a million users

#

i cant even fathom what it would be on uber scale bots

#

you'd probably be looking at 500k + per minute

#

if not more

#

couple million users would probably destroy a normal bot

earnest phoenix
#

Okay erwin

opal plank
#

hey zoro

earnest phoenix
#

turns out I suck at writing queries. and the docs for clickhouse suck. so this is a struggle

#

I WILL LEARN. cause I really wanna have a huge dashboard

opal plank
#

if only someone used postgres and prom like i suggested

earnest phoenix
#

nah

opal plank
#

there's still salvation for you child

#

come to the overkill side of the dark force

earnest phoenix
#

I can always just switch to postgres

opal plank
#

join me luke

#

join the dark side with me

misty sigil
#

postgres is cool

earnest phoenix
#

I might switch to postgres

#

I'm doing it

opal plank
#

eeeeeey

#

high five

misty sigil
#

yeeee

opal plank
#

actually

earnest phoenix
#

mainly cause ch lib is fat.

opal plank
#

i might work RN on the shards

#

i got some time before i get back to work

#

fuck it

#

doing it

#

gonna come back in 5 with another graph

earnest phoenix
#

lmk how it goes qt

quartz kindle
#

phat

opal plank
#

thicc*

earnest phoenix
#

YO Happy birthday Tim

opal plank
#

will do zoro

#

zoro

#

you're ex staff

#

go screech at marco for not giving special cake role to tim

#

said something along the lines of hUh DuH oNlY sTafF gEtS cuStoM CakE RolE

#

tis blasphemy against tim

quartz kindle
#

thank :)

misty sigil
#

erwin what else do i graph

#

need more graphs

opal plank
#

erm

#

dunno

misty sigil
#

lmao

opal plank
#

up to what you use tbh

#

brb gonna go probe my database's butt with queries

restive furnace
#

graph your events received

#

epm

opal plank
#

i already do

boreal iron
#

almost lost the whole context, Erwin

opal plank
#

remind count borked af

#

but whatever

#

commands used also borked as fuck

#

it should be on 100k mark or something

quartz kindle
#

you are borked as fuck

opal plank
nocturne dagger
#

So I was going though some bot code that a friend of mine did and I was trying to get the prefix from a mongodb it is stored in a schema does anyone know how to fetch a value from that using mongoose?

#

I am not exactly sure how to use mongoDB so if anyone knows that would be helpful.

onyx trellis
#

Anyone Here Electrical Engineer

river panther
quartz kindle
#

thank

restive furnace
#

mongodb + types (ts) > mongoose schemas

#

even if not types still mongodb driver is better than mongoose

#

imagine wasting time on schemas :))

quartz kindle
#

doesnt schemas defeat the purpose of mongodb?

#

its supposed to be a dynamic database with no fixed structure

#

schemas just try to turn it onto something more similar to relational databases for no reason

solemn latch
#

happy birthday tim pogey

quartz kindle
#

tyty

grizzled raven
#

forgot tim had a birthday

#

i mean

#

hAPPY BIRTHDAY

cinder patio
#

robots don't have birthdays

quartz kindle
#

they do actually

#

i mean, we do actually

tired panther
grizzled raven
#

nothing wrong with using stuff that do all the dirty work for you

#

plus, you don't even have to use schemas to use mongoose, you can still update with custom fields and whatever

#

they're mainly useful for caching documents

opal plank
#

@quartz kindle

#

you looked at this thouroughly

#

hashing shit

#

need something quick

#

generating md5 hashes

tired panther
modest maple
#

sha1™️

livid socket
#

hi

shy plover
#

Hi

livid socket
#

You can help me solve my problem in a private message.

#

@modest maple

modest maple
#

no, im not gonna do DMs

livid socket
solemn latch
#

its almost always better to ask questions here

thick nexus
sour flame
#

This good for a economy what blanked off is database

earnest phoenix
umbral zealot
#

If it works, it's good. if it doesn't, it's not good.

#

simple as that

sour flame
#

kk

crimson vapor
#

can we not disregard the fact that you are making functions in the constructor

solemn latch
#

👀

#

intresting

#

do they even work if you do that

umbral zealot
#

I`m not disregarding that most of this code is pretty bad in the first place

#

like this.fs = require("fs")

#

(Which I did note in #development message but clearly Draconic doesn't really want to hear ideas, they just want to show us they're writing code)

crimson vapor
#

LOL

pale vessel
#

this.
this.
this.
this.
this.
this.
this.

crimson vapor
#

@sour flame please learn how to use a constructor

#

actually