#development

1 messages Β· Page 1552 of 1

dusky sundial
#

I'd have them do all of their assignments in notepad, no IDEs in my classroom

#

actually no, they would have to write it on paper

lusty quest
#

use wordpad mostly bcs you have no money

lyric mountain
#

teaching programming on paper is ridiculous yet it's the reality

dusky sundial
#

I can't believe some schools actually do that

#

like huh? Why? When would you ever need to?

frosty valve
#

Help, I need to minimize my code. Its a big mess on one of the commands

lusty quest
#

or be like the teacher in Africa who teached MS word on a Chalkboard

lyric mountain
#

let's compile the cellulose

dusky sundial
#

We were allowed to use google for programming exams

lusty quest
#

so 90% of the class where browsing Stackoverflow?

lyric mountain
#

just for the sake of the pun

dusky sundial
#

I guess so, yeah. Some students who failed asked me to post solutions on GitHub so that they could pretend to be googling

#

But I think the teacher overheard them cuz he said that we can't use sources posted by other students xd

lyric mountain
#

what schools mostly get wrong is that programming is not about knowing how to write code, but knowing WHAT the code is doing

#

like, programmers are just professional browsers

pliant pendant
#

But my damn fortune account it has black knight

pale vessel
#

I am sexually identified as chromium

dusky sundial
#

They seem to think it's like teaching any other spoken language. Like, if you can't write it from memory, you're not fluent in it

lyric mountain
#

if I was supposed to know how to write from memory I'd be called intellisense bruh

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

dusky sundial
#

Imagine working as a developer, but if you use google you're fired

sudden geyser
#

Using Google on a Google interview

lyric mountain
#

hao123

#

bing

#

uol

slender thistle
#

Using internet in an online exam

#

unacceptable

lyric mountain
#

what about my former college that blocked most sites, including ubuntu's?

#

once we were learning about ubuntu and our teacher had to undergo a ton of bureaucracy to unlock ubuntu site

dusky sundial
#

Well, my high school had an E-sports section. The thing is, whenever they rebooted the network, every single online video game got blocked and they had to call the network admin.

#

And they had blocked the feature to change the wallpaper on our laptops

lyric mountain
#

was the reason people setting nsfw wallpapers?

dusky sundial
#

You'd assume that kids above the age of 15 wouldn't do such things but, there's people for everything

#

so I guess, yeah

lyric mountain
#

he waited a long time for it to finish

#

ended up taking the laptop home while still on

#

some minutes later he cursed everyone on the wpp group

vernal basin
#

any guides on how to make voting rewards?

dusky sundial
#

Damn, that's evil

lyric mountain
#

then choose something nice to give to your voters

vernal basin
#

huh

fierce ether
#

how would i go about getting a message like, you are the 5th member

earnest phoenix
#

is anyone fluent with react.js?

cinder patio
#

don't ask to ask, just ask

fair axle
vernal basin
#

so how do i set up webhooks?

#

im looking at my bot's page on topgg that has the Token and Webhook information

#
const DBL = require('dblapi.js');
const dbl = new DBL(process.env.TOPGG_TOKEN, { webhookPort: 5000, webhookAuth: 'webhookAuth' });
dbl.webhook.on('ready', hook => {
  console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});
dbl.webhook.on('vote', vote => {
  console.log(`User with ID ${vote.user} just voted!`);
});

was the code in the API help on top.gg, what do i have to replace?

lyric mountain
#

the token, port and auth

earnest phoenix
#

help please
Error: let modlog = client.channels.find(gg => gg.name === "log");
^

TypeError: client.channels.find is not a function

Code

client.on("message", message => {
  if (!prefixes[message.guild.id])
    prefixes[message.guild.id] = {
      prefix: process.env.PREFIX
    };
  var prefix = prefixes[message.guild.id].prefix; // 
    if (message.content === prefix + 'unmute') {
            if(!message.channel.guild) return;
        if (message.author.bot) return;
      if (!message.member.hasPermission("MUTE_MEMBERS")) // 

 return message.channel.send(`** > Sorry But You Dont Have Perm =>  \`\`\MUTE_MEMBERS\`\`**`); 

if(!message.guild.member(client.user).hasPermission('MANAGE_ROLES')){
  
return message.channel.send(`** > Sorry But I dont Have Perm =>  \`\`\MANAGE_ROLES\`\`**`); }

      let user = message.mentions.users.first();
      let lol = message.author; // 
      let modlog = client.channels.find(gg => gg.name === "log");
      let muteRole = client.guilds
        .get(message.guild.id)
        .roles.find(gg => gg.name === "Muted");
      if (!muteRole)
return message.channel.send(`** > I Cant Find Muted Role - ❌ **`); 

      if (message.mentions.users.size < 1) 
      
       return message.channel.send(`** > Please Try  ${prefix}unmute \`\`<@user>\`\`**`); 

        if (!message.guild.member(user).roles.has(muteRole.id))

 return message.channel.send(`** > This Member isnt Muted - 🀐**`);  // 
        if (message.guild.member(user).removeRole(muteRole.id)) {
          let e = new Discord.RichEmbed()
          .setAuthor("TayFeatures")   // 
          .addField('** > UnMuted Member Name :**',`${user}`)
          .addField('** > By :**',`${lol}`) 
        message.channel.send(e) // 
        
      }
    }
  
}); 
#

help please

#

Error: let modlog = client.channels.find(gg => gg.name === "log");
^

TypeError: client.channels.find is not a function

Code

#

Damn you again?

signal estuary
#

can someone tell me how to define args right?

var args = msg.content.split(' ');

Thats my current arg definition. But the problem is, when you have 2 spaces, he thinks its 2arguments. but i want an arg when the next word startes like +mute [args1] [arg2].

trim saddle
#

@lyric mountain do you by chance now how to calculate overall member permissions

lyric mountain
#

you need to extract the flags

signal estuary
#

Ping me if you have a solution

lyric mountain
mellow kelp
#

@signal estuary use regex: split(/\s+/)

#

that matches every whitespace

fierce ether
#

const data = await Guild.find({}) how can i grab all documents message value?

signal estuary
lyric mountain
#

not s, \s

#

\s matches space characters

#

+ means "match one or more"

signal estuary
#

So can you send me your whole args definition?

lyric mountain
#

so "match one or more whitespaces"

robust blade
#

oh ok thx

odd stratus
#

@earnest phoenix cache.find

trim saddle
#

@lyric mountain from all member roles how would i calculate all permissions

lyric mountain
#

oh, that

#

idk if there's a build-in method to get all permissions, but you could iterate over all roles and flip permission bits

#

see if there's no guildmember.permissions or something

robust blade
#
    // CHANNEL PREFIX, DEFINE ARGS AND COMMAND
    if(message.author.bot) return
    if(!message.content.startsWith(prefix) || message.author.bot) return;

    // ARGS AND COMMAND
    const args = message.content.slice(prefix.length).split(/ +/g);
    const command = args.shift().toLowerCase();

someone tell me what the definition is

trim saddle
#

@lyric mountain flip permissions? like ORing all role permission bitsets?

lyric mountain
#

yep

earnest phoenix
#

I would like an API for a commands but I narrate can't you help me please

earnest phoenix
#

It's it

#

?

robust blade
#

i was asking for the definition

#

ill just find it out

#

there is no definition.

#

great

earnest phoenix
#

Ah okey

latent gull
#

Sorry in advance if this is not the best place to ask this. But how do I make a webpage for accepting POST requests for webhooks? I want to make my bot use webhooks for top.gg upvotes since I'm having too many problems making an API call everytime to handle votes

latent gull
#

Im talking about the link I need to put into top.gg for the webhook url but thanks will ask there

quartz kindle
quartz kindle
#

something like express for nodejs or sanic for python should do just fine

robust blade
latent gull
#

alright thanks. I'll take a look at sanic

swift cloak
#

hey
how can i use highlight.js in my website? if you know ping please

quartz kindle
#

include it in a script tag

swift cloak
#

like

<script src="idk what src"/>```
quartz kindle
#

have you tried... you know... the highlight.js website?

#

and have you tried clicking on the big red button that says "GET VERSION 10.5.0"?

crimson vapor
#

why would they try that Tim /s

swift cloak
ionic burrow
#

Hello, i have a question, how would i get the server list that my bot and a user shares
so i can find someone faster

earnest phoenix
#

oauth2

#

you can theoretically filter your member cache instead but you would need to have every single member in every guild cached for that

earnest phoenix
#

Guys i want make on embed user#tag
i do <@${message.author.id}>
But didnt Work
It show like this
@north locust <=== this only ex id

buoyant aspen
#

anyone know what I'm doing wrong here?

$.ajax({
    type: 'POST',
    dataType: 'json',
    url: '/backend/checkuser',
    data: { id: id },
    success: handleSuccess(res),
    error: handleError(res),
});```
swift cloak
#
<center>
  <pre> 
<code>


/* import your packages */
const DiscordJS = require('discord.js')
const ZoroUtil = require('zoro-util')
const client = new DiscordJS.Client() // Make A New Client.. Which Is The Base For The Bot
const config = require('./config.json') // This Is Where Your Token, Prefix, etc. Should Be In

new ZoroUtil.handler(client, {
commands: './commands', //This Is Where It Will Cache Your Commands And Read It
    events: './events', //This Is Where Ready, Message Events Will Be Stored.
commandtable: true /* It can be false. This Is An Example Of Table: 
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ (index) β”‚    name    β”‚ status β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚    0    β”‚ 'example'  β”‚  'βœ…'  |
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”˜  
It Is A Table Of The Commands With An ID/*
})
.setPrefix(config.prefix)
.setOwners([/*you can add muliple. for example: */ 'owner id 1', 'owner id 2 /*optional*/'])

client.login(config.token)
</code>
</pre>
  </center>```

help. it wont go in the center
lyric mountain
earnest phoenix
#

what the fuck

lyric mountain
#

also, is that copy-pasted?

swift cloak
#

no?

#

im making something fro my friends framework

lyric mountain
#

because that's no valid js code

swift cloak
#

it isn't js?

lyric mountain
#

oh ok then

swift cloak
#

its html

#

lol

swift cloak
#

OHH

#

you thought it was js

#

lol

#

its html

lyric mountain
#

I didn't think it was js

swift cloak
#

oh

lyric mountain
#

let's say I've seem "things" that'd make you pass out

earnest phoenix
#

are you sure you want to align that in center

#

it's going to make it absolutely unreadable

lyric mountain
#

if u want to align it, you need to use a <div> for the text

#

and use alignment styles

#

but as cry said, it'd become unreadable

swift cloak
#

i did

swift cloak
long hare
quartz kindle
#

i think only bots

long hare
#

Hmmmm.

mellow kelp
#

getting rate limited with the discord client kek

quartz kindle
#

autohotkey :^)

earnest phoenix
#

that seems like it's for the game sdk

#

where is that screenshot from

fierce ether
#
const members = await message.guild.members.fetch({users: [playerOneID, playerTwoID]})``` anyone know why this is fetching all members? instead of them two only?
crimson vapor
quartz kindle
crimson vapor
#

kekw

fierce ether
#

oh thanks

#

any help on this? js const sizes = [4, 6, 8] if(members.size === sizes) i tried includes idk what else to try?

earnest phoenix
#

you're comparing a number to an array

#

what do you want to do

fierce ether
#

i wanna check number is = to one of the sizes

earnest phoenix
#

use includes on sizes

fierce ether
#

members.size.includes(sizes)

#

that?

earnest phoenix
#

on sizes

fierce ether
#

or sizes.includes(member.size)

earnest phoenix
#

that

#

members.size is a number

#

it has no includes method

fierce ether
#

oh ok

earnest phoenix
#

this is why yall gotta start using ts mmLol

fierce ether
#

hmmm

#

can you help with one minor thing?

lyric mountain
#

Strong typing all the way

earnest phoenix
#

this

#

vsc works perfectly with ts

#

just hover over the method/property and you can see the return type

lyric mountain
#

Not to say the awesome creation called

D E B U G G E R

earnest phoenix
fierce ether
#
const content = collect.first().content.split(" ")
const members = await message.guild.members.fetch({user: [content[0], content[1], content[2], content[3]]})``` this only works if a user id is given, how can i change to id and mention?
quartz kindle
#

a mention is basically an id wrapped around <@> or <@!>

#

you can use regex or string matching to extract the id from the mention

#

you can also use the built in message.mentions object

earnest phoenix
#

help
const embed = new Discord.RichEmbed()
^

TypeError: Discord.RichEmbed is not a constructor

delicate zephyr
#

Discord.RichEmbed() isn't a constructor so therefore you can't use new

crimson vapor
#

use Discord.MessageEmbed()

grizzled raven
#

Discord.RichEmbed has been replaced by MessageEmbed

earnest phoenix
#

ok

crimson vapor
#

Stinky eris user @delicate zephyr

grizzled raven
#

damn keyboard won't let me type mnp_angeryMODE

delicate zephyr
#

my support still wasn't wrong

crimson vapor
#

no it just wasn't correct

delicate zephyr
#

it was, I explained the error lol

crimson vapor
#

yes but you didn't help them, that error tells them that

#

whatever

#

you did the right thing

#

but didn't know why he was asking that

earnest phoenix
#

Yea thanks it work MessageEmbed

grizzled raven
#

i take full credit

#

you're welcome

glossy spoke
#

Guys

#

I tried to change the value of a const

#

I think a rock has more IQ than me

delicate zephyr
earnest phoenix
#

const is actually mutable mmLol

delicate zephyr
#

we all gotta learn, we all start from somewhere

delicate zephyr
#

like its really hacky

#

just use var

earnest phoenix
#

it isn't hacky at all

glossy spoke
#

Or let

earnest phoenix
#
const myobj = { ur: "gay" };

myobj.ur = "not gay";
glossy spoke
#

ow

#

I learned something new today.

pale vessel
#

well

#

kinda

earnest phoenix
#

the reference of the const isn't mutable

#

the contents of the reference are

crimson vapor
#

yea you can only mutate the data of the object, not the object

earnest phoenix
#

i think you can use Object.freeze to make it truly immutable

crimson vapor
#

yea

#

but I don't think that stops you from deleting it

delicate zephyr
drowsy grail
#

do you need privileged intents to get a guild member's permissions? All my channel.permissionsFor(member) ever returns is an empty bitfield

glossy spoke
#

Idk, try turning on that intent and see what happens

livid lichen
#
const Commands = category => {
    return Bot.commands
      .filter(command => command.help.category === category)
      .map(command =>`\`${process.env.prefix}${command.help.name}\`: *${command.help.description}*`)
      .join("\n")
  };

  if (!args.length) {
    Bot.categories.map(cat => data.push(cat))
    Bot.categories.map(cat => data[cat].push((`__**${cat.toUpperCase()}**__ \n${Commands(cat)}`)))

    const HelpEmbend = new Discord.MessageEmbed()
      .setTitle("πŸ€–CommandsπŸ€–")
      .setDescription(data)
      .setThumbnail(msg.author.displayAvatarURL({ dynamic: true }))
      .setFooter(`${process.env.prefix}Help [command] to get infomation on a specific command.`, process.env.bot_logo)
      .setColor("#0099ff");
...
``` Hello devs! I was adding more commands to my bot wen I was met with the badass, 2080 chars limit for my help embed. So, I decided I would send each and every category as a single message. Unforchanitly, I have no clue how to do that. As you can see, I tried doing `data = []` and then push it in and send it that way but that didn't work. Here's my question, `How would I do this?`
lament meteor
#

rather than setting the description to data which is an array...

#

you have to loop thru each item in the data array and set the description to that

#

or u could create a reaction handler

livid lichen
#

True.

#

I am having a ton a trouble doing this.

drowsy grail
livid lichen
#

I am using Discord.js.

drowsy grail
#

be wary if you're using markdown though, because you might split up your formatting
Messge 1: **Comman
Message 2: ds**

#

for example

livid lichen
#

Basic Commands would be b Emoji

lament meteor
#

im not too sure if it still works but it should be kinda similar

drowsy grail
#

oh also typically only classes are written in UpperCase and other variables are written as camelCase

lament meteor
#

doesnt rlly matter

drowsy grail
#

ye it's just convention

livid lichen
#

Thanks

#

The page is empty...

#

Oh wait wrong oen

shy turret
#

i have a reason to not use json dbs since few days go

#

pog

gilded olive
#

why would you ever in the first place

#

JSON isn't even meant for that...

glossy spoke
#

I use a JSON db cuz i only store a little bit of data

gilded olive
#

sqlite bru

glossy spoke
#

I'll use sqlite so

rich dome
#

Does anyone know how I can make my bot respond to the defined prefix and not to the number of letters in the prefix?
Example: if I put f!help it responds
but if I put s!help it also responds

mellow kelp
#

check if the string starts with the prefix

rich dome
#

I have it in commandHandler :Β΄u
const args = message.content.slice(prefix).trim().split(/ +/g);
const command = args.shift().toLowerCase();

livid lichen
lament meteor
#

uh what do u mean @livid lichen ?

livid lichen
#

@lament meteorreactions.find is not a function

#

RIP

lament meteor
#

hmm

#

maybe it was changed

livid lichen
#

Prob.

#

It has been 2 years.

lament meteor
#

lemme see

#

where are u using reactions.find?

mellow kelp
#

reactions.cache i think

livid lichen
#
const removeReaction = async (m, msg, emoji) => {
    try { 
      m.reactions.find(r => r.emoji.name == emoji).users.remove(msg.author.id); 
    } catch(err){
      console.error(err)
    }
}
lament meteor
#

either what ElcholoGamer suggested

#

or u should consult the docs

livid lichen
#

I found!

#

cache is required.

sacred trout
earnest phoenix
#

best way to avoid this in the first place is let your bot organically grow; don't put it on bot lists until you're verified

#

or, leave low member guilds and guilds with a lot of bots instantly (until you're verified)

#

not that leaving will help you now

#

you'll have to wait

lyric mountain
#

that's a really bad way to detect suspicious growth, but it kinda works for discord

#

not that I can think of a better way to detect it

#

discord basically uses guilds-per-day metric

pseudo coyote
#

You should ask in discord developer

proven lantern
#

client.on('message', msg => {}); does the msg object have the locale of the user?

#

like en_US

rustic nova
#

that isn't shared through discords api

crimson vapor
#

It should be ngl

rustic nova
opal plank
#

could be handy to have that, specially for locate bots so they can be auto converted to native language

#

though, in fairness, i also think its not worth the hassle to send locale, wouldnt that be bad?

earnest phoenix
#

.

slender thistle
#

Did you read the error

#

and what is ctx.author_url supposed to mean?

earnest phoenix
delicate zephyr
#

oh

#

its python

#

skull

#

u do it

trim saddle
#

ok you have a lot of mispelled items

robust fern
#

Oo I can learn py from this

earnest phoenix
#

lol

robust fern
#

Nvm

earnest phoenix
robust fern
#

Lmayo

trim saddle
#

ok

#

ctx.author - user#0000
ctx.author.name - user

#

also you're using f-strings wrong

#

f"nice to meet you {ctx.author.name}!"

earnest phoenix
#

Tysm tysm

#

❀️❀️❀️❀️

robust fern
#

What's an f string

trim saddle
#

pythons equivalent to `hi nice to meet you ${msg.author.username}`

robust fern
#

I hate that

#

Thank u for deleting that

robust fern
#

Oo

lethal trout
#

pls help

delicate shore
#
      if (!msg.member.hasPermission("MANAGE_MESSAGES"))
earnest phoenix
opal plank
#

you using embed builder?

#

@earnest phoenix

earnest phoenix
#

embed.set_author(name=f"{ctx.author.name}", url=member.avatar_url)

opal plank
#

python?

earnest phoenix
#

what should i write instead of url=member.avatar_url

opal plank
#

looks like python

earnest phoenix
#

right

opal plank
#

fuck, cant help with py

#

shiv gonna bonk me if i do

signal estuary
trim saddle
#

@earnest phoenix you use icon_url

lusty quest
trim saddle
#

url just adds a link to their pfp in the text

earnest phoenix
#

u r the one who helped me a lot today

#

πŸ₯Ί

opal plank
trim saddle
#

this is mostly stuff you can learn from reading the d.py docs but np

opal plank
#

not sure they'd be inclined to do anything that would hint where you at

earnest phoenix
#

i will do that

lusty quest
opal plank
#

well yeah, of course there are use cases

#

but i dont think any of them is weighty enough to be even added

lusty quest
#

also just sending the locale string is not this big of a deal i guess. just send the client language not the system language

#

websites pull it from you anyways

opal plank
#

it would be nice, for sure, but i doubt they'll add it

lusty quest
#

but yea i think its not really on a high priority for them

opal plank
#

fuck

#

is there a class option to make it read-only except it can be modified internally?

#

protected?

tribal siren
#

if someone needs help with discord.js just ping me im bored .-.

opal plank
#

@lusty quest do you know if theres an option like that?

#

readonly will conflict with the class trying to modify it

lusty quest
#

i know how to do it in C#

opal plank
#

whats the equivalent in c#?

lusty quest
#

one sec

opal plank
#

aight

lusty quest
#
public interface IReadOnlyClass
{
    string SomeProperty { get; }
    int Foo();
}
public interface IMutableClass
{
    string SomeProperty { set; }
    void Foo( int arg );
}
#

get is read only, set is read/write

#

you can also define if you can only write within the class but only ready outside of the class

#

with {private set;}

opal plank
#

i MAY have a solution for it with getters/setters

opal plank
#

ty

lusty quest
#

good to know

opal plank
#

i have to use a different variable though

#

and protect it

#

but private allows for internals to modify it

lusty quest
#

nice

willow mirage
#

wait what is that?

#

ts or c#

#

ah ts

opal plank
#

mine is ts

willow mirage
#

wtf is that notable member ?

#

what is that mean?

lusty quest
willow mirage
#

ah ok

lusty quest
#

to appreciate them i guess

opal plank
#

i think theres less than a dozen of people

lusty quest
#

i know 3 or so with the role

opal plank
lusty quest
#

atleast ive noticed them

opal plank
#
1- Aurel#0001 [669452973755072524]
2- Xignotic#0001 [205680187394752512]
3- Not Erwin#8753 [188836645670223872]
4- alex_#9840 [293870361001328644]
5- Extreme#1000 [300438546236571658]
6- Hindsight#2020 [139412744439988224]
7- Woo#3304 [136583532972605440]
8- Eri#1000 [187316528100802560]
9- Tim#2373 [180112943612952577]
10- XiuhcoatlSlayer#7391 [311553339261321216]```
lusty quest
#

nice

#

how many of them are staff

opal plank
#

3?

#

4?

lusty quest
#

so almost 50%

opal plank
#

eri, xiuh, xignotic

#

out of all those, only tim and i arent either: staff or bot reviewers

#

so i assume our contributions is mainly/all due to support in #development

lusty quest
#

Well tim got a 3rd job here as the stackoverflow guy

opal plank
#

absolutely correct

#

i legit cannot wait for this update

earnest phoenix
#

He is a living StackOverflow

opal plank
#

but its gonna be such a pain changing a core feature of the bot like that without losing the user data

willow mirage
#

lmao

opal plank
lusty quest
#

I rewrite my bot again to use i18next with a mongodb storage. Will be annoying but worth it

opal plank
#

im dynamiciscising(thats not a word, but you get the gist) my reminders

rocky hearth
#

How can I communicate with clientside and serverside in next.js

#

does nextjs itself hv a features for this or I hv to use some package?

#

something, like a live chat project in nextjs

cinder patio
#

I should really start working on a parser but I can't stop making small edits in the interpreter 😒

earnest phoenix
#

?? raise TypeError('Callback must be a coroutine.')
TypeError: Callback must be a coroutine.

#

what

pale vessel
#

show code?

earnest phoenix
#

fixed

#

but i now have new error

opal plank
#

need a bit of a spoonfeed rq

#

anyone know a postgres query to select the only the last entries non repeats?

#

fuck, nvm, thats not gonna work out at all

tribal siren
#

how to make a change in the text?

#

like

#

if i want to enable this text

#

Hello {{member}}, have a good day in {{guild}}!

#

it will send this

#

Hello @Brace#6565, have a good day in UrgA Chamber!

lone palm
#

With .filter

rocky hearth
#

@tribal siren u could replace the text

lone palm
#

Oh replace sry.

tribal siren
#

no i mean if someone uses welcomesettings

#

or something else

#

so it automatically changes

pure lion
#

JS?

#

@tribal siren

tribal siren
#

yes

pure lion
#

Javascript template strings are what you need

opal plank
#

string.replace('a', 'b')

rocky hearth
#

welcomeSettingString.replace('{{member}}', msg.author.tag)

pure lion
#

Oh right that

#

Oh well

lone palm
#
member.send(`${messagee.replace("{username}", member.user.username).replace("{pingusername}", `<@${member.user.id}>`).replace("{usertag}", member.user.tag).replace("{members}", member.guild.memberCount).replace("{userid}", member.user.id).replace("{servername}", member.guild.name)}`)``` @tribal siren
tribal siren
#

ok thank you very mucyh

oak cliff
#

Just a reminder not to spoon feed

#

Read server rule number 8

tribal siren
#

oh

earnest phoenix
#

how do i do that in python?

rocky hearth
#

same

lone palm
#
  const DBfetch = await DBchannel.messages.fetch()
  const DB = DBfetch.first()
  message.channel.send(DB.content)
```with that code get the bot the last message that was sent in a channel, how the bot get all messages?
earnest phoenix
#

Truehosting1.1.1.1 because my code ended up like this

rocky hearth
#

u need to see how to replace a part of a string in python

knotty quartz
#

Hi

lone palm
knotty quartz
#

Does anyone know how to format

#

Using repel so I can format code easier

#

@lone palm Oh I forgot to link the dev question in sorry ;'

#

;-;

lone palm
#

xd

knotty quartz
#

I'll go to general while waiting for a response

slender thistle
earnest phoenix
#

ok

earnest phoenix
#

hi need help

#

this happening

#

token correct

pure lion
#

no idea

earnest phoenix
#

Same

cinder patio
#

Did you check if your bot is online? Do you ever call the client.login function?

earnest phoenix
#

yes

#

itss there

pure lion
#

do you ever client.on("ready", () => {})

earnest phoenix
#

client there

cinder patio
#

and your bot is offline?

earnest phoenix
#

yes

#

should i try changing token?

graceful shore
earnest phoenix
#

k

graceful shore
#

do u have any errors?

earnest phoenix
#

no

#

errors

earnest phoenix
graceful shore
#

idk

earnest phoenix
umbral skiff
#

Anyone help how to start webhook with bot?

cinder patio
#

topgg webhook?

umbral skiff
#

Yep

graceful shore
runic perch
#

umm im trying to make a bot with java language im also using intelij Idea
the problem is that it doesnt respond to anything pls help

dusky sundial
#

Wdym doesn't respond?

dusky sundial
runic perch
#

maven

dusky sundial
#

And you added the repos and dependency in pom.xml?

runic perch
#

yes

dusky sundial
#

What version of JDA did you try to add?

runic perch
#

15

#

i think

dusky sundial
#
        <dependency>
            <groupId>net.dv8tion</groupId>
            <artifactId>JDA</artifactId>
            <version>4.2.0_168</version>
        </dependency>
runic perch
#

oh bruh i have this

#

[JDA MainWS-ReadThread] INFO WebSocketClient - Connected to WebSocket

#

it says this in a console

#

but

#

never said finished loading

dusky sundial
#

So your bot doesn't go online at all?

runic perch
#

its online on discord

dusky sundial
#

Try downgrading to an earlier version in your dependency, I know later versions of jda can break sometimes

runic perch
#

oh ok

#

it works now

#

thx 4 help

rocky hearth
#

for newer react class components can I define state outside constructor?

runic perch
#

ok

lusty quest
#

did someone know if you can configure es-lint to not cry about optional chaining in node?

cinder patio
#

what's the name of the rule

#

In your eslint config add this to your "rules" object:

"nameOfRule": "off",
lusty quest
#

woud ecma version work? currently i use 17

cinder patio
#

you can disable the rule

lusty quest
#

well eslint complains about Unexpected Token, but its valid in node 14+

#

wired should be supported by eslint there where a open PR on the Github repo

#

nvm figured it out, added es2021 support to my config

earnest phoenix
#

Is it bad to log every command usage and guild join/leave to a mongo collection?

#

na not really

#

although imo, i wouldn't log the guild stuff

lusty quest
#

did you create a new document for each event or did you update certain ones (like command usage)

#

also i would maybe suggest using a time series Database like Prometheus

earnest phoenix
#
const fs = require('fs');
const { Client, MessageEmbed } = require('discord.js');
const Discord = require('discord.js');
const client = new Discord.Client();

client.once('ready', () => {
    console.log('Ready!');
});

client.on('message', message => {
    if (!message.content.startsWith(prefix) || message.author.bot) return;

const args = message.content.slice(prefix.length).trim().split(/ +/);
const command = args.shift().toLowerCase();```
#

why bot offline

#

i added client.login at end with token

solemn jolt
lusty quest
#

did you get an error?

earnest phoenix
#

no

lusty quest
#

add js client.on('debug',event)=>{console.log(event)}

solemn jolt
#

Error ne

#

In

#

Replace client.once to client.on

lusty quest
solemn jolt
#

const { prefix } = require('./config.json');
const fs = require('fs');
const { Client, MessageEmbed } = require('discord.js');
const Discord = require('discord.js');
const client = new Discord.Client();

client.once('ready', () => {
console.log('Ready!');
});

client.on('message', message => {
if (!message.content.startsWith(prefix) || message.author.bot) return;

const args = message.content.slice(prefix.length).trim().split(/ +/);
const command = args.shift().toLowerCase();

opal plank
lusty quest
#

either use Destructing or chaining

earnest phoenix
lusty quest
#

ahh yes node is fun, it errors out but still works, then you add --trace-warnings and it just ignores the flag and ask you to add --trace-warnings

delicate zephyr
#

so

#
emmiter.on('event', console.log)
opal plank
#

^^

delicate zephyr
#

as long as the callback is a function it'll work

lusty quest
#

yea also works

opal plank
#

i pass setIntervals and setTimeouts like that

lusty quest
#

but i just throwed in what i could remember

opal plank
#

much easier

delicate zephyr
#

discord pls

lusty quest
#

but i think his issue is that he got 2 Discord Clients defined

opal plank
#

he only has one

lusty quest
#

nope he got 2

opal plank
#

the uppercase one is a class

#

wheres the second one?

lusty quest
#

well but its still a hot mess

opal plank
#

no?

#

Client is a class with a constructor

#

its actually good to have inherited names like that

#

Client uppercase as constrcutor, client as constructed object

#

its proper syntax

lusty quest
#

you cant deny that the code is copy / pasted together

#

i know

opal plank
delicate zephyr
#

wait

#

Erwin

opal plank
#

sup

delicate zephyr
#

Discord isnt defined

#

I legit just realised

#

as you pointed those out

opal plank
#

oh yeah you right

#

how the heck did that not screech on his compiler?

delicate zephyr
#

I have no fucking clue

opal plank
#

where the heck is the REferenceError?

delicate zephyr
#

nodeℒ️

lusty quest
#

he got discord defined?

opal plank
#

wait it IS defined

delicate zephyr
#

wait nvm

#

you hid it

earnest phoenix
#

Guys how i change

width and height
On Embed

lusty quest
#

told you its wired ass code

opal plank
#

gave me a scare there not gonna lie

#

ogh fguck

delicate zephyr
#
const { prefix } = require('./config.json');
const fs = require('fs');
const { Client, MessageEmbed } = require('discord.js');
const Discord = require('discord.js');
const client = new Discord.Client();

client.once('ready', () => {
    console.log('Ready!');
});

client.on('message', message => {
    if (!message.content.startsWith(prefix) || message.author.bot) return;

const args = message.content.slice(prefix.length).trim().split(/ +/);
const command = args.shift().toLowerCase();

// They said they had
client.login('shitty token')
#

LMFAO

opal plank
#

there we go lmao

#

dont know why he would bring the CLient class nor MessageEmbed

#

if he already pulling Discord as *

quartz kindle
#

or why require them separately

lusty quest
#

probably a single file bot

quartz kindle
#

lul

opal plank
#

thats just requiring the same thing twice

#

makes no sense

delicate zephyr
#

I really dont wanna manually test this

lusty quest
#

told you

opal plank
#

that should work though

#

i dont see anything "wrong" there

#

i see a lot of bad things, but nothing that should prevent it from running

quartz kindle
#

well the message event is missing closure

opal plank
#

they cut the thing in half

quartz kindle
#

ah

opal plank
#

didnt even include the client.login()

lusty quest
#

node is funny

``` complains about this and i should add --trace-warnings. 
stop the pm2 process, cd into the directory and start node with the flag
node: please add --trace-warnings
delicate zephyr
opal plank
delicate zephyr
#

I just threw it into vsc

#

and noticed

opal plank
quartz kindle
opal plank
#

so yeah, working with the top half he gave us

lusty quest
#

i index a function in a seperate file

delicate zephyr
#

@earnest phoenix you know if you dont give us all the code ur working with we cant help you

opal plank
#

functions wont inherit context

delicate zephyr
#

so consider yourself stuck

lusty quest
#

they work

delicate zephyr
#

yea

opal plank
#

actually, if you bind a function to the this workspace can it reference objects outside itself?

delicate zephyr
#

the code we sent works

#

Β―_(ツ)_/Β―

delicate zephyr
#

should be easy to test tho

quartz kindle
opal plank
#
//index.ts
import { func } from 'function.ts'
func.bind(this);
let a = 1;
func()

//function.ts
export function func() {console.log(a)}
#

would that work?

quartz kindle
#

x doubt

delicate zephyr
#

same

opal plank
#

well, the compiler would screech, specially ts, that a is undefined in functions.ts

#

but i wonder if you can bind the environment to the function

lusty quest
#

ahh found the issue i think, one function calls another function.

quartz kindle
#

you're binding the global object to it

#

so it would work if you did global.a = 1, and you access this.a in the function

opal plank
#

hmmm yeah you right

earnest phoenix
#

help
Code

const figlet = require ("figlet");

Error: Error: Cannot find module 'figlet'

opal plank
#

npm i figlet ?

#

the heck is figlet though

#

if it cant find, its not there. either wrong path or you didnt install it, whatever that is

delicate zephyr
#

Yes

#

It works

earnest phoenix
opal plank
delicate zephyr
#

Yes

#

@quartz kindle well I guess that X went to waste

opal plank
#

POG

#

wait what

#

no

#

luke

delicate zephyr
#

actually

#

wait

#

hold on

opal plank
#

you're passing it to the function

#

as param

#

you gotta ignore the compile error from the function

#

but see if it works on index

#

without passing any param

#

just trying to access it from within as reference

#

functions are hoisted by defaul, so are variables, i wonder if that would play a role

#

i assume var might be use case here

#
//index.ts
import { func } from 'function.ts'
func.bind(this);
var a = 1;
func()

//function.ts
export function func() {console.log(a)}

try this luke

delicate zephyr
#

yea nvm, you have to use global

opal plank
#

frick

quartz kindle
#

lmao

delicate zephyr
#

var, let nor const work

opal plank
#

try with var though

delicate zephyr
#

I did

opal plank
#

works fine?

delicate zephyr
#

no

opal plank
#

rip

delicate zephyr
quartz kindle
#

it should work with var

delicate zephyr
opal plank
#

thats what i assumed too

quartz kindle
#

but you need to call it from this

#

console.log(this.a)

delicate zephyr
#

oh

#

nope

quartz kindle
#

arrow functions cant be bound

#

use a normal func

opal plank
#

^^

delicate zephyr
#

nope

quartz kindle
#

hmm

#

it does work for me

#

actually you dont need to bind it at all

#

since global is the default context

earnest phoenix
#

Its my again
ERROR: ```js
client.guilds.forEach(r => message.channel.send(Server Name: ${r.name} and its id ${r.id}))
^

TypeError: client.guilds.forEach is not a function```

delicate zephyr
#

its

#

client.guilds.cache

#

if you're using d.js

quartz kindle
delicate zephyr
#

its probably because im execing it from a file

quartz kindle
#

let me try without the repl then

earnest phoenix
#

there is no this context there, no?

#

that example would work in a class

delicate zephyr
#

when I log just this

quartz kindle
#

yeah it doesnt work when executing it directly

#

interesting

delicate zephyr
#

TIL

quartz kindle
#

hmm

delicate zephyr
quartz kindle
#

this is not bound to global when running the file

#

and var doesnt bind it to global either

delicate zephyr
#

node is whack

#

You have to assign it to global directly

#

so

#

global.a

quartz kindle
#

it works if you do global.a

delicate zephyr
#

yea

quartz kindle
#

and bind global

lusty quest
delicate zephyr
#

this

quartz kindle
#

actually you dont need to bind global

#

weird

opal plank
#

this refers to this, clearly, duh

delicate zephyr
#

yea, node is fucking whack

lusty quest
#

yay one thing finished for today, time to figure out what the smartest way would be to convert my existing localisation into i18next format

quartz kindle
#

what the frik

#

if you console.log this in two different files

#

only one gets logged

delicate zephyr
#

Wait

#

what

#

bruh

#

Node pls

opal plank
#

Nodeℒ️

#

how about we all move to haskell like a migrating flock of birds?

quartz kindle
#

wait now its working again

#

wt

lusty quest
#

i would switch to rust. would be a pain in the ass to do but probably worth it

delicate zephyr
#

@opal plank honestly wish I could but honestly with what little amount of time i have thats a yike

opal plank
#

agreed, already spent way too much time on this trash

quartz kindle
#

check this out

#

the first one logs {}

#

the second one logs global

delicate zephyr
#

yea

#

its fucking bizarre

cinder patio
#

yeah there's no this in the global scope

#

there's globalThis

delicate zephyr
#

bruh

lusty quest
#

lol another wired thing, my event handler loads each event one after another, exept one that loads after the client is ready. even tho the last event that gets loaded just got 3 lines of code i could make 1

earnest phoenix
#

How does one get notable member

lusty quest
quartz kindle
#

by being noticed by senpai

delicate zephyr
earnest phoenix
#

@lusty quest send code?

#

So imma ping all mods and get the role ez

lusty quest
quartz kindle
#

so the global this is {}, globalThis is global, and this inside a function is global

#

interesting

delicate zephyr
#

yep

earnest phoenix
#

Wait wtf

delicate zephyr
#

its fucking whack

earnest phoenix
#

I thought ur working with node

lusty quest
earnest phoenix
#

hello

delicate zephyr
#

@quartz kindle can we just agree that Node is fucked and next chance we get to slap the creator we do with all our might?

quartz kindle
#

if you dont like node theres always deno

#

:^)

earnest phoenix
#

Whats wrong with node

lusty quest
#

i think py got also some whacky stuff

delicate zephyr
#

Never said I didnt like node

#

just sometimes maN

lusty quest
#

node is wired

quartz kindle
#

node is indeed weird

earnest phoenix
#

Node isnt weird, you’re just bad KEKEKW

lusty quest
#

feels sometimes feels like you talk to someone with dementia

quartz kindle
#

did i show you guys what happens if you use this inside a proxied class?

cinder patio
#

That's V8 though, not node

quartz kindle
#

ye tru

#

but i happens in firefox as well

#

lmao

cinder patio
#

Then It's probably supposed to happen

quartz kindle
#

its fucking weird tho

#

like

#
this.something()

is 100x slower than ```js
something = this.something
something()

#

xDDD

cinder patio
#

wait really

delicate zephyr
#

yea

cinder patio
#

that's inside a proxied class or just in general?

earnest phoenix
#

Replace all coming to node

#

Lets gooo

quartz kindle
#

wait i have a test script you can copy and paste

delicate zephyr
#

LMFAO

#

Why does assigning a variable make it so much slower

rocky hearth
quartz kindle
#
const { performance } = require("perf_hooks");

const obj = {
    str: "a",
    test1() {
        for(let i = 0; i < 9999999; i++) {
            this.str + this.str;
        }
    },
    test2() {
        let str = this.str;
        for(let i = 0; i < 9999999; i++) {
            str + str;
        }
    }
}

let a = new Proxy(obj, {
    get(target, key, receiver) {
        return Reflect.get(target, key, receiver);
    }
})

let b = new Proxy(obj, {
    get(target, key, receiver) {
        return target[key];
    }
})

let c = new Proxy(obj, {
    get(target, key, receiver) {
        return target[key].bind(target);
    }
})

let d = new Proxy(obj, {
    get(target, key, receiver) {
        return obj[key];
    }
})

let e = new Proxy(obj, {
    get(target, key, receiver) {
        return obj[key].bind(obj);
    }
})

t = performance.now(); obj.test1(); console.log(performance.now() - t);
t = performance.now(); obj.test2(); console.log(performance.now() - t);

t = performance.now(); a.test1(); console.log(performance.now() - t);
t = performance.now(); a.test2(); console.log(performance.now() - t);

t = performance.now(); b.test1(); console.log(performance.now() - t);
t = performance.now(); b.test2(); console.log(performance.now() - t);

t = performance.now(); c.test1(); console.log(performance.now() - t);
t = performance.now(); c.test2(); console.log(performance.now() - t);

t = performance.now(); d.test1(); console.log(performance.now() - t);
t = performance.now(); d.test2(); console.log(performance.now() - t);

t = performance.now(); e.test1(); console.log(performance.now() - t);
t = performance.now(); e.test2(); console.log(performance.now() - t);
earnest phoenix
#

Who is we @rocky hearth

rocky hearth
#

we ts guyz... πŸ˜†

earnest phoenix
#

I use ts

#

Its not a thing?

rocky hearth
#

u too r included in my "we"

earnest phoenix
#

Its not a thing tho??

cinder patio
#

oh wow that's a huge difference

earnest phoenix
#

Ecma 2020 right? @rocky hearth

restive furnace
#

ESNext gang

quartz kindle
#

its weird how you can make the proxied this 10x faster by binding it

#

but if you just reassign this, then it works 100x faster

#

whats even more weird

#

the reassigned proxied this can be faster than not proxying at all

earnest phoenix
#

guys this code make my error on last line idk why

#

wheres problem

#
client.on("message",async message =>{
                if (!prefixes[message.guild.id])
                prefixes[message.guild.id] = {
                        prefix: process.env.PREFIX
                };
        var prefix = prefixes[message.guild.id].prefix;
let command = message.content.toLowerCase().split(" ")[0];
    command = command.slice(prefix.length);
if (command == "clear" || command == "Ω…Ψ³Ψ­") { 
message.delete({timeout: 0})
    if(!message.channel.guild) return message.reply(`** This Command For Servers Only**`); 
     if(!message.member.hasPermission('MANAGE_GUILD')) return message.channel.send(`> ** You don't have perms :x:**`);
     if(!message.guild.member(client.user).hasPermission('MANAGE_GUILD')) return message.channel.send(`> ** I don't have perms :x:**`);
 
    let args = message.content.split(" ").slice(1)
    let messagecount = parseInt(args);
    if (args > 100) return message.channel.send(`javascript
i cant delete more than 100 messages 
`).then(messages => messages.delete(100))///iiYeahBoy
if(!messagecount) messagecount = '50';
    message.channel.messages.fetch({limit: 100 }).then(messages => message.channel.bulkDelete(messagecount)).then(msgs => {
    message.channel.send(`js
${msgs.size} messages cleared
`).then(messages => ///iiYeahBoy
messages.delete({timeout:5000}));
    })
  }    
fs.writeFile("./prefixes.json", JSON.stringify(prefixes), err => {
        if (err) console.error(err);
});
delicate zephyr
#

the discord docs specifically stats you arennt allowed to delete over 100 messages at a time

earnest phoenix
#

so?

delicate zephyr
#

this is the issue

#

change 5000 to 100

quartz kindle
#

thats not it

delicate zephyr
#

he posted the error

#

and deleted it

#

that is it

quartz kindle
#

hes trying to delete the error message after 5 seconds

delicate zephyr
#

oh

quartz kindle
#

but delete doesnt take a number since v12

delicate zephyr
#

@earnest phoenix can you repost the console log error

quartz kindle
#

it takes an object of options

#

.delete({timeout:5000})

earnest phoenix
#

okay wait

#

Code:

client.on("message",async message =>{
                if (!prefixes[message.guild.id])
                prefixes[message.guild.id] = {
                        prefix: process.env.PREFIX
                };
        var prefix = prefixes[message.guild.id].prefix;
let command = message.content.toLowerCase().split(" ")[0];
    command = command.slice(prefix.length);
if (command == "clear" || command == "Ω…Ψ³Ψ­") { 
message.delete({timeout: 0})
    if(!message.channel.guild) return message.reply(`** This Command For Servers Only**`); 
     if(!message.member.hasPermission('MANAGE_GUILD')) return message.channel.send(`> ** You don't have perms :x:**`);
     if(!message.guild.member(client.user).hasPermission('MANAGE_GUILD')) return message.channel.send(`> ** I don't have perms :x:**`);
 
    let args = message.content.split(" ").slice(1)
    let messagecount = parseInt(args);
    if (args > 100) return message.channel.send(`javascript
i cant delete more than 100 messages 
`).then(messages => messages.delete(100))///iiYeahBoy
if(!messagecount) messagecount = '50';
    message.channel.messages.fetch({limit: 100 }).then(messages => message.channel.bulkDelete(messagecount)).then(msgs => {
    message.channel.send(`js
${msgs.size} messages cleared
`).then(messages => ///iiYeahBoy
messages.delete({timeout:5000}));
    })
  }    
fs.writeFile("./prefixes.json", JSON.stringify(prefixes), err => {
        if (err) console.error(err);
});

Error: });

SyntaxError: Unexpected end of input

quartz kindle
#

cant understand shit with such a terrible indentation, but you have either missing brackets or too many of them

cinder patio
#

Okay so I'm working on a programming language, and this:

function fn() {
    console.log("Yey!");
}

for (let i=0; i < 10; i++) {
    if (i === 9) fn();
}

Takes 0.17 ms in my language, and 5 ms in javascript... the crazy thing is that my language is written in javascript

earnest phoenix
quartz kindle
cinder patio
#

chrome and node.js are showing me 2 different results

quartz kindle
cinder patio
#

When I do the test in chrome it's around 0.15 ms when I do it in node.js it's 5 ms

#

wtf

#

Anyways, still very fast

earnest phoenix
#

Wtf, man?

cinder patio
#

you didn't provide any arguments, lmao

#

+kick do you see any arguments?

earnest phoenix
#

Lol, yes but look at line 14

cinder patio
#

oh

earnest phoenix
#

Lol

cinder patio
#

did you restart your bot

earnest phoenix
#

Several times, ima try again

#

Says the same thing

cinder patio
#

what

quartz kindle
#

well what is args[0]?

cinder patio
#

how did you restart your bot in under 1 second

quartz kindle
#

console.log(args[0])

#

and you will see why

earnest phoenix
#

I just do run lol @cinder patio

#

I have my tabs open

#

@quartz kindle Alr

quartz kindle
#

also, the error you showed is not even in that file

earnest phoenix
#

But it usually works with my other commands..

cinder patio
#

something's making me think that you're not actually restarting your bot but ok

earnest phoenix
earnest phoenix
#

Why would I lie about that

quartz kindle
#

the message "you didnt provide any arguments" is not in that file

earnest phoenix
#

Huh..

quartz kindle
#

so your bot is sending that before it even runs that code

earnest phoenix
#

I didn’t really have a file with those stuff, lemme check my index.js

#

Damn really weird, lol I found it

#

why he say

let user = message.guild.members.get(message.content.split(' ')[1]) ||
^
message.mentions.members.first();

TypeError: message.guild.members.get is not a function

lusty quest
#

members.cache.get

river thistle
#

I already tried redirect_uri param but it doesn't change anything

quartz kindle
#

you cant

#

you need oauth2 for the redirect to work

river thistle
#

oh ok thanks

regal creek
cinder patio
#

I don't think so

#

1/10th of a millisecond

quartz kindle
#

for a low level language, yes its a lot

#

for an interpreted language like js, no its not a lot

peak sedge
#

.invite

cinder patio
#

then again, js is only half interpreted. It gets compiled to bytecode which then gets executed. If a piece of bytecode gets used frequently, it gets gets compiled even further, to machine code.

#

pretty cool

#

that's why it's as fast as it is

old cliff
#

guys looks like I have a problem

#
Manager.on('shardCreate', (shard) => {
    Logger.info(`Shard[${shard.id}] has been created!`, `Shard`);
    shard.on('ready', () => {
        Logger.info(`Shard[${shard.id}] is now ready!`, `Shard`);
    });
    shard.on('death', (child) => {
        Logger.error(`Shard[${shard.id}][${child.pid}] Death`, `Shard`);
    });
    shard.on('disconnect', () => {
        Logger.error(`Shard[${shard.id}] Disconnection`, `Shard`);
    });
    shard.on('error', (err) => {
        Logger.error(`Shard[${shard.id}] Error : ${err.name}`, `Shard`);
    });
    shard.on('reconnecting', () => {
        Logger.info(`Shard[${shard.id}] reconnecting...`, `Shard`);
    });
    shard.on('spawn', (child) => {
        Logger.info(`Shard[${shard.id}][${child.pid}] has been spawned!`, `Shard`);
    });
});```
#

this is my code

#

if I set 2 shards then it says this for only 1 shard

#

if 1

#

then says 0

#

if 2 then says shard 1

#

I want it to say for each shard

#

like

#

shard 0 ready
shard 1 spawned

lusty quest
#

you know that this is intended?

quartz kindle
#

did you put that code before or after Manager.spawn()

lusty quest
#

shard 0 = 1st shard

crimson vapor
#

yea shards start at 0

old cliff
quartz kindle
#

before or after?

old cliff
#

after

quartz kindle
#

it has to be before

timber fractal
#
        let utilcommands = data.push(commands.map(command => command.name).filter(command => command.catogery === `util`).join(', '))
        var embed = new Discord.MessageEmbed()
        .setAuthor(message.author.tag, message.author.displayAvatarURL())
        .setFooter(`Block | ${message.guild.name}`)
        .setTimestamp()
        .setColor(`RANDOM`);
        if(!args.length) {
            embed.addFields(
                {name: `Utility Help`, value: `${utilcommands}`}
            );
            embed.setTitle(`Commands Menu`);
        }
        message.channel.send(embed);``` i'm trying to filter the commands per catogery but it gives error: `cannot read property catogery of undefined` How to fix?
quartz kindle
#

all event handlers must be registered before calling spawn

old cliff
#

ok thanks

lusty quest
#

nvm

timber fractal
old cliff
#

yeah now it works thanks !

lusty quest
#

yea how did you export the informations on your commands?

old cliff
#

truely a notable member @quartz kindle

quartz kindle
#

lmao

timber fractal
# lusty quest yea how did you export the informations on your commands?

this is all the code i have untill now ```js
const fetchprefix = await mongopref.fetch(client, message.guild.id);

    const data = [];

    const { commands } = message.client;
            let utilcommands = data.push(commands.map(command => command.name).filter(command => command.catogery === `util`).join(', '))
    var embed = new Discord.MessageEmbed()
    .setAuthor(message.author.tag, message.author.displayAvatarURL())
    .setFooter(`Block | ${message.guild.name}`)
    .setTimestamp()
    .setColor(`RANDOM`);
    if(!args.length) {
        embed.addFields(
            {name: `Utility Help`, value: `${utilcommands}`}
        );
        embed.setTitle(`Commands Menu`);
    }
    message.channel.send(embed);```
lusty quest
#

yea commands it not a property of message.client

old cliff
#

where did you set it ?

timber fractal
#

@lusty quest how do i need to define { command } than?

lusty quest
#

where did you load your commands?

timber fractal
#

in index.js

#

and this is help.js

lusty quest
#

code?

timber fractal
quartz kindle
#

one of your commands has no name

timber fractal
tribal siren
#

hello development chat

quartz kindle
#

and your filter function is trying to do command.name.category

#

or... "catogery"...

lusty quest
#

your code seems to be valid, but as tim said probably missing values in a command

timber fractal
#

@quartz kindle can also the problem be that i only have catogery: defined in 2 files because i was testing LOL

#

hmm

#

than can i fix it lol

quartz kindle
#

remove the map

timber fractal
#

why?

quartz kindle
#

you're mapping it to name

timber fractal
#

oh

#

and then?

quartz kindle
#

so your filter is trying to do command.name.category

#

instead of command.category

timber fractal
#

ok

quartz kindle
#

do the map after the filter

timber fractal
#

ok

#

@quartz kindle this?
let utilcommands = data.push(commands(command => command.name).filter(command => command.catogery === `util`).map().join(', '))

quartz kindle
#

wat

#

that makes no sense

timber fractal
#

oh

#

where than?

quartz kindle
#

commands is not a function

timber fractal
#

ok but wich to remove then?

quartz kindle
#

isnt it obvious

timber fractal
#

no

#

not for me

quartz kindle
#

how do functions work in js?

timber fractal
#

im just a little newbie

quartz kindle
#

if you put () after a name, that means that name represents a function

#

commands is not a function

#

you cannot do commands()

#

the function is map

#

not commands

timber fractal
#

ok

#

so what now? im just a little noobie

quartz kindle
#

this is the map function

#

if you want to move this function

#

you need to move all of that

timber fractal
#

uhm @quartz kindle i did this let utilcommands = data.push(commands => (command => command.name).filter(command => command.catogery === `util`).join(', ')) and now it gives 1

quartz kindle
#

not just the name map

timber fractal
#

@quartz kindle if i do this let utilcommands = data.push(commands.filter(command => command.catogery === `util`).map(command => command.name).join(', ')) it just returns 1

quartz kindle
#

remove data and data.push

#

you dont need it

timber fractal
#

ok

quartz kindle
#

let utilcommands = commands.filter(...).map(...).join(...)

timber fractal
#

finnaly thank you so much

earnest phoenix
#

Why are my commands not working?

cinder patio
#

if (message.content.startsWith(""))

#

That's unnecessary... there's so much weird shit in your code

earnest phoenix
#

True, lol

#

@cinder patio aww thank you man you’re a savior lol

#

I removed that line, and it worked like 🧈

earnest phoenix
quartz kindle
#

didnt i tell you to remove that line ages ago? lmao

lusty quest
#

you imply that people actual read stuff and not just skim over text and copy / paste codeblocks without context?