#development

1 messages ยท Page 1798 of 1

gaunt ermine
#

U talking to me?

lucid prawn
gaunt ermine
#

Ok so yes

#

I am

#

Can u help

lucid prawn
#

umm

earnest phoenix
#
app.get("/route", (req, res) => {
// Calculate leaderboard data
// After you're done send the data:
res.set("Content-Type", "text/html");
res.send(`
<div>
Leaderboard data
</div>
`);
});
earnest phoenix
#

sorry but i cannot explain better

gaunt ermine
#

Ok np

lucid prawn
#

Why not do a db like when the user votes fetch the user then add a point then fetch the highest to lowest vote like 10 people each page

gaunt ermine
#

Is there anything on yt?

earnest phoenix
#

@lucid prawn that is exactly what he's doing but anyone can steal api keys on the website so the server should do it

earnest phoenix
tight trail
#

is it possible to give a bot a custom tag?

earnest phoenix
#

nope

tight trail
#

or like a about me section

earnest phoenix
#

not sure about that tho

tight trail
#

ok

#

that would be nice

#

displaying the invite link and a discord link

lucid prawn
gaunt ermine
#

Replit

lucid prawn
#

oh

gaunt ermine
#

Yes

earnest phoenix
#

The server that sends your bot website can also be the one calculating the leaderboard data

gaunt ermine
#

Ok leave the api key

lucid prawn
#

then use import

gaunt ermine
#

I will hide it

earnest phoenix
#

Please

#

Dont put api keys in javascript that the user can see

gaunt ermine
lucid prawn
#

System environment varia

gaunt ermine
#

Ok

#

Can u pls help with the code

#

Pls

near stratus
lucid prawn
earnest phoenix
#

How is server side rendering so hard?

gaunt ermine
#

Not*

near stratus
lucid prawn
earnest phoenix
#

Exactly what i said

lucid prawn
#

on replit

gaunt ermine
#

For this

gaunt ermine
earnest phoenix
#

But he's not using react

#

afaik

near stratus
gaunt ermine
#

Can someone help me withthe code for this

hushed adder
#

So I've never made a bot before and I'm trying to learn for a friend. He wants me to make a bot for his discord server so when he streams a game we all can play it. Like if I type "up" in his channel, it will send that input to his pc and emulator. Namely we want to do this so we can play pokemon together. But like all on his device when he streams it. Is this something that's even possible?

wary flame
#

It's possible

#

But hard

earnest phoenix
#

Not possible with bots but it's possible with the game sdk

lucid prawn
wary flame
#

It is possible with bots

hushed adder
#

sdk? Isn't that only for android games?

wary flame
#

Nodejs is able to send system input

near stratus
#
- create a webhook
- save data on vote in a db
- make an api to send top 10 with queries or something
- Render it in html in client side
wary flame
near stratus
near stratus
gaunt ermine
#

Cuz i told u that i am new

wary flame
near stratus
lucid prawn
#

can someone help me waits

near stratus
#

how ?

lucid prawn
#

^

gaunt ermine
lucid prawn
gaunt ermine
#

No

wary flame
#

You need to use member.roles.add(role) not message.member.roles.add(role) since you're assigning the first mentioned server member to let member wich does not change the member property of message

lucid prawn
wary flame
#

what error

near stratus
#

does both 'role' and 'member' exist ?
like try

if(!member){ return false }
if(!role){ return false }
gaunt ermine
#

@wary flame Hi can u help me also

wary flame
#

@gaunt ermine Don't ping people asking for help

#

Just send your problem and see if someone helps you

near stratus
wary flame
#

It's a framework iirc

lucid prawn
# wary flame what error

(node:25) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'add' of undefined

gaunt ermine
wary flame
gaunt ermine
#

With this

wary flame
#

Try checking if message.mentions.members.first() exists before trying to add roles

austere laurel
#

hello i have a question

#

do you know where to get these

austere laurel
#

SUPER_PROPS, AUTHORIZATION, USER_AGENT, REFERER, COOKIE, CHANNEL ID

pale vessel
#

Your member is most likely a user

wary flame
#

@near stratus you were faster then me lol

pale vessel
#

Change from users.first() to members.first()

near stratus
#

....

wary flame
#

ehm

near stratus
gaunt ermine
#

Helloooo

near stratus
#

Also I don't like SAO
bad anime

austere laurel
austere laurel
wary flame
near stratus
near stratus
gaunt ermine
austere laurel
gaunt ermine
#

New

lucid prawn
wary flame
# gaunt ermine New

That you're new doesn't mean your incapable of googling basic issues or being able to follow simple steps

earnest phoenix
#

They cant understand the spoonfeeded express code too

near stratus
# austere laurel a discord bot

Authorization is a header you send in request
for bots it's in this format Bot BOT_TOKEN
User_Agent: Also a header. Defines what agent the user is using (Mozila, Edge, Chrome etc)
Referer Cookie: If someone refers you and forwards a cookie (Mostly Google)
Channel Id: The id of the channel eg: 16376359301726535378

gaunt ermine
earnest phoenix
#

You wont understand the yt tutorial cuz youre new

solid tide
earnest phoenix
#

So 69 year old yt tutorials are better than us?

solid tide
#

Idk css or html

near stratus
gaunt ermine
#

No

#

I won't

near stratus
gaunt ermine
#

OK do you have it or no ?

solid tide
#

Alright thanks

near stratus
earnest phoenix
near stratus
gaunt ermine
#

OK

earnest phoenix
#

Beware security problems from yt tutorials

vital void
#

guys anyone help ? how to increase the MaxListerner limit in node.js ?

lucid prawn
lucid prawn
#

How do I store that member roles I removed

solemn jolt
#

Who tag me in every channel's ๐Ÿ˜’

manic valve
#

Has anyone had their bot be disabled by Discord before without any explanation? And a note saying that you should contact support to figure out why?

#

This is the second time it has happened to me, and they (Discord support) are very slow with responding

#

It's been a week since I filed a ticket but haven't had a word on what my bot is doing wrong

#

Previous time they took two weeks and then my bot magically got enabled again, and they didn't bother telling me what it did wrong aside from saying that it violated the terms

quaint wasp
#

I got this:

        let muteRole = message.guild.roles.cache.find(x => x.name === "Muted");
    ```
But it gives me error saying it cant read property of 'roles' or undefined, meaning it doesnt know what guild means...
#

(Ping if helping.)

lusty quest
manic valve
#

I think I might've hit the cloudflare limit yeah

#

Might need to keep track of the amount of requests I'm doing to make sure I'm not going over

#

My bot is in 7000-ish servers and sends messages to many of them if a specific event occurs. I thought I put in an artificial delay anyway but I probably didn't

lusty quest
#

i suggest to add cooldowns to stuff like commands, and start caching frequently used stuff

#

so you will lower the amount of requests that go to the API

manic valve
#

Yeah. Just realized that if 1% of servers does a command then I'm already reaching the global rate limit

earnest phoenix
tulip heart
#

hmm

rugged condor
#

;s

feral aspen
#

Hello!!

#
const work = { jobs: [ { points: 2 }, { points: 5 }, { points: 3 } ] };

console.log(work.jobs.map((x, total) => total += x.points))

Did I do this wrong?

#

I'm trying to add all values of points.

#

.. or am I supposed to use a for loop?

pale vessel
#

+= doesn't return the object

#

You have to return the object back after incrementing the points

feral aspen
#

I want it to return a number which is the total of all the points:

pale vessel
#

Also, total is the index

#

You meant to use reduce?

feral aspen
#

I think reduce would work..

pale vessel
#

Yes

feral aspen
#

.. but is really hard to understand.

#

I barely understood it. ๐Ÿ˜

#

Every time I use it, I have 10k questions in my mind on why this and that is needed.

pale vessel
#
array.reduce(
    (
        accumulatedValue, // The accumulated value, you'll define this as 0 and it will increase as it traverses the array
        currentValue // The current value, which is the current element or object from the array
    ) => accumulatedValue += currentValue.points, // Add current value (the object)'s points to accumulatedValue. variable += number already returns the sum so you don't need to return accumulatedValue again
    0 // Starting value for accuumulated value
);```
feral aspen
#

Alright.. I tried this multiple times...

#

It works.

earnest phoenix
#

Bots can send stickers now?

#

Or i need to wait

pale vessel
#

God that profile picture

quaint wasp
pale vessel
#

Id est

#

Which means "that is", "which is"

deft lotus
#

how to team mambers in Creator

clear marlin
#

?

deft lotus
#

how to add team mambers in Creator

clear marlin
deft lotus
lofty cedar
#

?

austere laurel
#

how to get super props

quartz kindle
#

what super props?

feral aspen
#

Heyo.

#
work.points += jobs.find((val) => val.id.toLowerCase() === jobToWork).pointsSallary;
work.cooldown = Date.now();

work.jobs.find((val) => val.id.toLowerCase() === jobToWork).points += 1;
work.jobs.find((val) => val.id.toLowerCase() === jobToWork).coins += 500;
work.jobs.find((val) => val.id.toLowerCase() === jobToWork).hours += 1;

work.save().catch(err => console.log(err));
Work.findOneAndUpdate({
    userID: message.author.id
}, work);
#

I'm having this code of me saving values in an object. I'll show you how the object looks like.

#

Somehow.. points and cooldown are changed in the main object but the values inside the object inside the array are not being changed.. ๐Ÿ˜

#

I did work.save() to save the points: and cooldown:, but the properties inside the array of objects aren't changing saving.

main mist
#

Hey everyone?

pale vessel
#

Did you log work and made sure that everything inside the array changed?

feral aspen
#

Let me check

#

I'll log it before saving, right?

pale vessel
#

Sure

feral aspen
#

I've logged it, it changes.

#

.. it looks like it's not saving.

pale vessel
#

The cooldown doesn't seem to have changed either?

feral aspen
#

It does.. but this is a picture before any of the code above takes place.

#

Here is the updated document.

#

Logged to console before saving..

{
  jobs: [ { id: 'member', points: 1, coins: 500, hours: 1 } ],
  _id: 60dd892628262830d8143090,
  userID: '528256079101034506',
  job: 'member',
  points: 1,
  cooldown: 1625134468382,
  changeCooldown: 0,
  __v: 1
}
pale vessel
#

Try providing everything directly ```js
work.jobs.find().points += 1;
...

Work.updateOne({
points: work.points + ...,
cooldown: Date.now(),
jobs: work.jobs
});```

feral aspen
#

What's updateOne?

#

I never use that, I use findOneAndUpdate

pale vessel
#

fineOneAndUpdate() returns the previous document

#

You don't need that if you're not assigning it to anything

#

Both works ig

feral aspen
#

I usually use that when updating objects in a document.

#

.. not sure why it doesn't work when it's an array of objects, instead.

pale vessel
#

Array of objects?

#

You need to use updateMany() instead

feral aspen
#

No.

#

For example...

feral aspen
#

.. and I wanted to update x, I would use findOneAndUpdate.

#

.. but

lmao: [ lmao2: { x: 0 } ]

.. findOneAndUpdate, doesn't work in this case, idk why.

pale vessel
#

updateOne(filter, { "lmao.$.lmao2.x": newValue }) should work iirc

feral aspen
#

That's gonna suck.

#

Let me try.

pale vessel
#

Hmm, naw

feral aspen
pale vessel
#

You can do that

frozen topaz
#

anyone here use botghost? just wondering...

feral aspen
spare badger
#

There are plenty of people who use botghost @frozen topaz

pale vessel
#

updateOne({ "lmao.lmao2.x": 0 }, { "lmao.$.lmao2.x": newValue })
You'd have to know the value

feral aspen
#

ohh.

frozen topaz
pale vessel
#

lmao is the array and lmao2 is an object inside

spare badger
#

I don't have any experience with it myself, but I think it's an easy way for you to build your own bot if you don't have any technical skills.

pale vessel
#

lmao.$ refers to the index of object inside lmao

feral aspen
#

Could you show me an example if I would want to change the coins but applying the find() method to find the object that has an id of "member"

#

Example.

#
find((val) => val.id.toLowerCase() === "member")
pale vessel
#

I've got no clue how your structure looks like, but this is how I did it for my tags

slender thistle
#

Rust, egui
What's the optimal way to add an Area widget to my screen? If I add it in the update function, my area acts in an eerie manner whenever I move the mouse around. https://puu.sh/HT5Tm/8ca399e81f.mp4

Is this behavior an issue with egui or the way I implemented it?

Attached is my entire app.rs that I use in my main.rs.

pale vessel
feral aspen
#

.. to be honest dude, I just want to modify them using the original way like in the code I wrote then use findOneAndUpdate, but it's not working.

#

.. save(), won't work, since we are modifying objects, not properties only.

feral aspen
#

.. updateOne, I can use this, but I'm trying to figure out how to use the find method as well.

feral aspen
#

Could you show me an example on how to add the find method?

#

Example.

#
work.jobs.find((val) => val.id.toLowerCase() === jobToWork).points += 1;
work.jobs.find((val) => val.id.toLowerCase() === jobToWork).coins += 500;
work.jobs.find((val) => val.id.toLowerCase() === jobToWork).hours += 1;
pale vessel
#

You weren't supposed to copy paste that. My point is provide everything to the update field instead of modifying the original object (except for jobs)

#

Instead ofjs obj.points = 10; updateOne(filter, obj);Dojs updateOne(filter, { points: 10 })

#

Except for work.jobs. You use your find methods to modify the array and provide it as js updateOne(filter, { jobs: work.jobs });

sacred aurora
#

you forgot the $set

pale vessel
#

OR you can use replaceOne() instead. That replaces the whole document

feral aspen
#

.. wait, we're not trying to modify all the documents, aren't we?

pale vessel
#

Only one?

feral aspen
#

updateOne does it for all.

#

Wait

#

Sorry

pale vessel
#

No, that's updateMany.

feral aspen
#

My bad.

pale vessel
#

Okay try this

#

This should be easier. Simply change findOneAndUpdate to replaceOne

#

That replaces the whole document. You already have the complete object so you only need to modify it and replace the old one with the new one

#

updateOne/findOneAndUpdate() in mongoose uses $set internally

sacred aurora
#

oh i thought it was the original mongodb driver

pale vessel
#

Well we're only trying this since updateOne doesn't work with arrays (for some reason)

#

So try to replace the whole document instead

feral aspen
#

Alright? .. no replacing though.. since I should increment values.

boreal iron
#

@latent heron Just another example of, leave the PC, take a break and come get back later if you're stuck.

RewriteEngine On
RewriteRule ^/?(.*) /index.php?lookup=$1 [PT,QSA]

Instead of doing things complicated I'm just appending the query string to the request URI with QSA
Which solved the issue...

pale vessel
#

Just change findOneAndUpdate to replaceOne

#

work is already the full object so you don't have to worry about missing properties

boreal iron
#

If you're still stuck with your RewriteRule just let me know.

feral aspen
#

Didn't work yet...

#

I'm not trying to replace but update.

pale vessel
#

work is the object returned by findOne() right?

pale vessel
pale vessel
#

The problem right now is that it just doesn't want to update the jobs array even if you modified the original document

feral aspen
#

No replacing, but updating, just like incrementing, and such.

pale vessel
#

Let's try #development message again. Your code should look something like this ```js
work.points += jobs.find((val) => val.id.toLowerCase() === jobToWork).pointsSallary;
work.cooldown = Date.now();

work.jobs.find((val) => val.id.toLowerCase() === jobToWork).points += 1;
work.jobs.find((val) => val.id.toLowerCase() === jobToWork).coins += 500;
work.jobs.find((val) => val.id.toLowerCase() === jobToWork).hours += 1;

Work.findOneAndUpdate({
userID: message.author.id
}, { points: work.points, cooldown: Date.now(), jobs: work.jobs });```

slender thistle
pale vessel
#

Notice how it's { points: work.points, cooldown: Date.now(), jobs: work.jobs } instead of work

#

and save() isn't needed since you already have findOneAndUpdate. That updates the properties already

feral aspen
#

I'll try.

pale vessel
#

If this doesn't work, then I'm not sure what's wrong

feral aspen
#

Still replacing, so didn't work. ๐Ÿ˜

#

I appreciate your help dude. ๐Ÿ™

#

I'm reading the docs as well.

pale vessel
#

Ah, you mean jobs?

#

I asked if you wanted to use queries but you said no and you wanted to use array.find() instead

feral aspen
#

Yes..

pale vessel
#

You could try something like this js Work.updateOne({ userID: message.author.id, "jobs.id": jobToWork }, { points: work.points + jobs.find((val) => val.id.toLowerCase() === jobToWork).pointsSallary, cooldown: Date.now(), $inc: { "jobs.$.points": 1, "jobs.$.coins": 500, "jobs.$.hours": 1, } });

#

That doesn't need array.find() or any modification to the document you got from findOne()

feral aspen
#

I'll be trying that, I'll stop for a bit and update you once I'm back.

boreal iron
#

@rustic nova

rustic nova
#

welp

#

rip a bot dev

boreal iron
#

god thanks

#

we got too much

sudden geyser
#

Why are you banning them though?

#

Aren't their accounts getting hacked?

boreal iron
#

Imagine sharing .ru URLS as trustful KEKW

vivid fulcrum
#

you can't really hack accounts anymore

#

brute forcing will get you ip banned instantly

#

they're just dumb and click random links

#

and sign into fake discord replicas

boreal iron
#

don't abuse my name

sudden geyser
#

Ah, understandable.

tight trail
#

How could I make a command that is for users that are in a discord server only?

vivid fulcrum
#

in which library

pale vessel
#

My school library

tight trail
#

discord.js

pale vessel
#

Check the guild ID of the member

vivid fulcrum
#

well

tight trail
#

ok

pale vessel
#

If you want it to work for other servers, access cache

vivid fulcrum
#

check if Message#member is defined

#

because if the command is in a dm, member won't be defined

#

accessing the guild id will throw

#

but same idea

pale vessel
#

Oh I thought they meant if the member is in a specific discord server

#

Yeah check the channel type or if message.guild is null

tight trail
#

so i want to make is so only people can use some other commands if they are in the main discord server

pale vessel
#

Main discord server?

tight trail
#

yea

#

like a support server

pale vessel
#

Check the guild where the message was sent

tight trail
#

for example

#

the bot idleminer

#

you can do the command ;supporter

#

if you are in their server

pale vessel
#

Yeah

#

message has the guild property

#

Make sure message.guild exists and compare message.guild.id with your support server ID

#

If it matches, allow the command usage, else don't

tight trail
#

ok

#

ty

#

let guildA = client.guilds.cache.get("GUILD ID");

let requiredRole = guildA.roles.cache.get("ROLE ID");

let member = guildA.members.cache.get(message.author.id);

if (member.roles.cache.has(requiredRole.id)) {
message.channel.send("You have the required role.");
} else {
message.channel.send("You do not have the required role");
};

so what that sort of thing work

#

and ill give my member a member role

brittle spire
#

const EventEmitter = require('events')

EventEmitter.defaultMaxListeners = 20

#

i added this but i still get the error

#

MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 21 message

opal plank
#

thats now how it works

#

you need to modify the eventEmitter instance thats throwing the error

brittle spire
#

ooh

limber mica
#

Bruh my message handler is too damn long

#

Does anyone know of a way to check if a category exists?

mild agate
#

Yes.

tulip ledge
#

yo dude, there's an IP in there

drowsy epoch
#

there is

#

@rustic nova delete that image it has an ip

drowsy matrix
#

๐Ÿ‘

lethal trout
#

no errs

vivid fulcrum
#

what the fuck is that handler

#

and why are you copypasting so much code

lethal trout
solemn latch
#

๐Ÿ‘€

if (!message.member.hasPermission('MANAGE_MESSAGES')) return message.channel.send(`**You missing required permisison __ADMINISTRATOR__**`)

checking for manage messages, asking for admin

inner fulcrum
#

why does my meme commadn takes years to send

vivid fulcrum
#

it's your code, you tell us

inner fulcrum
#
const https = require('https');
const Discord = require('discord.js');
const url = 'https://www.reddit.com/r/meme/hot/.json?limit=100'

module.exports = {
    name: 'meme',
    description: 'sends meme',
    execute(message, args) {
        https.get(url, (result) => {
            var body = ''
            result.on('data', (chunk) => {
                body += chunk
            })
            result.on('end', () => {
                var response = JSON.parse(body)
                var index = response.data.children[Math.floor(Math.random() * 99) + 1].data
                var image = index.preview.images[0].source.url.replace('&amp;', '&')
                var title = index.title

                const imageembed = new Discord.MessageEmbed()
                    .setTitle(`${title}`)
                    .setImage(image)
                    .setColor(000000)
                message.channel.send(imageembed)
           
            }).on('error', function (e) {
                console.log('Got an error: ', e)
            })
        })
    },
}
#

is there something extra in this

#

or my bot is just dum

#

no errors but its

#

monke

lethal trout
summer torrent
#

imagine using https lib

inner fulcrum
#

shhh

#

anyways

#

help me

#

im dum

cinder patio
earnest phoenix
#

Does Button get supported by discord mobile?

inner fulcrum
#

can u tell what is the problem ;-;

wooden kindle
#

ima add some more commands

#

any1 got suggestions

clear marlin
#

nope

wooden kindle
#

u think its good

clear marlin
#

why is your embeds so messy

#

just make em one full embed

#

rather than stacks

wooden kindle
#

1 sec

#

ill show u

#

its like this with the help

#

i just sent all of them to show commands

#

yk

lusty quest
clear marlin
#

the api aside, it actually looks very messy

#

like one embed or maybe a button menu

#

could work

wooden kindle
#

gonna add buttons

solemn latch
#

honestly, your code is such a mess its very hard to read, so its hard to help.

latent heron
#

hate to be rude but i'm gonna have to agree with Woo

#

it's really messy

#

I can't really distinguish what's going on here

solemn latch
#

like, what is going on here?

let first = args[1];
                let user = db.get(`1suggest_${first}_user`)
                let ededembed = new Discord.MessageEmbed()
                    .setAuthor(client.users.cache.get(user).username, client.users.cache.get(user).displayAvatarURL())

you are getting a user from an arg, to get it from a database, to get it from cache, to get its username? the user may not even be cached, since it doesnt seem to be a mention

woeful pike
inner fulcrum
#

ah\

woeful pike
#

wait actually no, that's an html entity not an encoded uri char

signal estuary
#

Does anyone know how I can loop trough all users in a guild?

    await msg.guild.members.fetch().then(users => {
        users.forEach(user =>{
            console.log(user.username)
        })
    })

This does not work

subtle fern
#

Hi

solemn latch
#

not sure about the fetch stuff, but your current loop will log a bunch of undefined's assuming it fetches them like that

signal estuary
solemn latch
#

nickname can be null

#

not all users have nicknames

signal estuary
#

But username does exist

solemn latch
#

hmm, weird

signal estuary
solemn latch
#

because in your code, your logging a members username, which doesnt exist.

#

you just named a member object as a user

signal estuary
solemn latch
#

how are you getting that user?

signal estuary
#

await msg.guild.members.fetch().then(users => {}

#
    await msg.guild.members.fetch().then(users => {
        users.forEach(user =>{
            console.log(user)
        })
    })
solemn latch
#

ok, try changing
console.log(user.username)
to
console.log(user.user.username)

#

i think you may just be reading the user properties inside of the member object.

solemn latch
#

i think my point was just being missed ๐Ÿ‘€

signal estuary
#

because username is a property of user

solemn latch
#

yeah

signal estuary
#

Does anybody know how I can track errors better. I am logging erros into a database so I can look into this later. But the error doesnt show the line of code where it is caused so idk how to find it

#

Thats how I log the error:

Does anybody know how I can track errors better. I am logging erros into a database so I can look into this later. But the error doesnt show the line of code where it is caused so idk how to find it
Thats how I log the message:

module.exports.logError = function logError(e) {
    try {
        const mysql = require('mysql')
        let con = mysql.createConnection({
            host: "hoist",
            database: "bot",
            user: "bot",
            password: "wefwwf"

            charset: 'utf8mb4'
        })
        console.log("Error: " + e.message + "\nPath: " +  e.path + "\nStack: " + e.stack)
        con.query('INSERT into exceptions ( message, stack, path, httpstatuscode) VALUES(?,?,?,?)', [e.message, e.stack, e.path, e.httpstatuscode])
        con.end();
    } catch (e) {
        console.log(e);
    }
}
summer torrent
earnest phoenix
#

do i have a typo here?

sly sierra
#

to ../commands/${dir}/${file}

on line 19

earnest phoenix
#

that wont work

sly sierra
#

just add ../ for all your readdir lmao

lusty quest
quaint wasp
#

Why doesn't this shorten the link?

modest maple
#

because you did that backwards

sly sierra
vivid fulcrum
#

hyperlinks only work in field values and descriptions

#

also that

quaint wasp
#

oh

sudden geyser
last tapir
#

hello

#

i've recently modified an object that is inside an array in mongoose.
i've modified that object, but .save() isn't working

tulip ledge
#

anyone knows why my visual studio code isn't autocompleting brackets anymore?
Example I used to be able to type ( and it'd become () but now it just doesn't work anymore

last tapir
#

i cant seem to save that object that is inside the array

feral aspen
tulip ledge
#

but that zooms in

#

and doesn't open the settings

tulip ledge
#

enabled this

#

still doesn't close

feral aspen
#

I'm not sure..

sudden geyser
#

Are you using an extension?

tulip ledge
#

I have a bracket colorizer extension

#

this one

feral aspen
#

Try removing that...

tulip ledge
#

idk it happened after I installed github copilot

tulip ledge
#

ok

#

I managed to fix it

#

github copilot turned this to never

    "[javascript]": {
        

        "editor.autoClosingBrackets": "always"
    }
quaint wasp
#

still doesnt work

tulip ledge
#

its

quaint wasp
#

oh wait wait

tulip ledge
quaint wasp
#

text first..

#

ok

modest maple
feral aspen
#

Ladies and gentlemen.
I present to you the idiot who forgot to add await to his method who finally wasted a fuking 12 hours of his day trying to figure out why.

#

Me.

modest maple
zinc wharf
#

Visual studio code is now a dating platform for developers

quaint wasp
#

mm

#

interesting

modest maple
#

if you run into that issue and dont get a bunch of errors or warnings screaming at you with what ever language you're using, you're concurrency structure is shit and should probably be redesigned and / or stop silencing your errors and warnings

quaint wasp
#

what the heck..

quaint wasp
sudden geyser
#

other way around

quaint wasp
#

doesnt work.

#

I tried it

opal plank
sudden geyser
#

[text](url), not (text)[url]

lyric mountain
quaint wasp
#

o right

lyric mountain
#

() = link

modest maple
#

man

lusty quest
quaint wasp
#

the only option i didnt try

opal plank
#

imma work now on the collector for u btw @lusty quest

#

shouldnt take long

feral aspen
#

.. i had to do the second one.

#

. I made SO MUCH RESEARCH.

#

I FORGOT THE AWAIT

opal plank
#

typescript

#

cough cough

last tapir
#

damn dude, that solved my issue as well, thanks ๐Ÿ˜‚

feral aspen
#

Lmfao.

quaint wasp
#

yo the heck is this

#

it just send an embed when joining a new guild in one of its firsts channels.

latent heron
#

error says exactly what it means

opal plank
#

^^

latent heron
#

you're trying to access discord before the initialization point

feral aspen
#

Don't use Discord. before the const Discord = ...

opal plank
#

and if you read whats AFTER, it should show u exatcly the line too

quaint wasp
#

ya but the discord const is my 4 line and embed is my 59th.

lyric mountain
#

are you by chance using var?

proven lantern
#

hoisting

#

the best feature of old js

craggy pine
quaint wasp
#

no i am not

lyric mountain
quaint wasp
#

I just simply do const Discord = require('discord.js')

lyric mountain
#

for the embed I mean

quaint wasp
#

no

proven lantern
#

hoister is hoisting the var

quaint wasp
#

ye

#

no

#

I am not even sure waht hoister is

lyric mountain
#

doesn't the error contain the line?

craggy pine
#

Probably should share the code so were not guessing

quaint wasp
#

its just that I think veld randomly gave me the nick when i got on his stream channel and started streaming

proven lantern
#

Veld gave me my name too

quaint wasp
#
client.on("guildCreate", guild => {
  console.log(`New guild joined: ${guild.name} (id: ${guild.id}). \n This guild has ${guild.memberCount} members!`);

      const introOnJoinE = new Discord.MessageEmbed()
      .setTitle('Hey, thanks for adding me!')
      .setDescription('If you need any support, please run ++support command!')
      .setColor('BLUE')
      .addField('Prefix', prefix)
      .addField('Bugs', 'The bot is always in development, so new features are added all the time, very often. If you find any bugs, please use ++report (bug) and then after the bug list as much info on how you caused it.')
      .addField('Your my..', `${client.guilds.cache.size}th server!`)
      .addField('Help and list of commands', 'To get that you will need to run ++help. You will get that, and most likly answer your question. If you still have it, please tell us about it in our support server.')
    const channels = guild.channels.cache.filter(channel => channel.type == "text");
  

    channels.first().send(introOnJoinE).catch(e => console.log(e));

  const newC = config.newC
  
  const Discord = require('discord.js')
  const newE = new Discord.MessageEmbed()
    .setColor('#27FF00')
    .setTitle('NEW SERVER JOINED')
    .addField('MEMBERS', guild.memberCount)
    .addField('NAME', guild.name)
    .addField(`ID:`, guild.id)
    .addField(`GUILD OWNER:`, guild.owner)
    .setFooter('Time joined', client.user.displayAvatarURL())
    .setTimestamp();
    client.channels.cache.get(newC).send(newE)
});
#

my const Discord is wayyy up

craggy pine
#

You made the embed way before the const discord thing

earnest phoenix
#

yep discord definetely defined on line 4

#

totally not redefined above newE

proven lantern
#

hoist this const Discord = require('discord.js')

craggy pine
#

Introjoin embed is like 100000 lines above const discord require discord

quaint wasp
#

oh wait lol

#

that kinda there for some reason...

opal plank
#

bruh what IDE are u using

#

it shoul'dve told u

#

wtf

proven lantern
#

atom?

quaint wasp
#

uhh

opal plank
#

doubt atom wouldnt catch that

#

either you really overlooked it, or atom is not setup for js coding

earnest phoenix
#

Atom doesn't have built in typescript

quaint wasp
#

ya i am not home so I cant really use VSC... so I use pebblehost code editor as my code editor..

opal plank
#

big yikes

#

any decent editor would've told you that

#

for CODING, at least

earnest phoenix
#

And the community one it has always crashes my ubuntu

opal plank
#

notepad wouldnt mmulu

quaint wasp
#

wait should const discord even be there or should I get rid of it?

#

or put it somewhere up

#

like above the intro message embed

opal plank
#

u have 2 Discord from what i can see

#

but they are shadowed

earnest phoenix
opal plank
#

cuz u use it twice

#

so it wont pull from the first one

#

it'll try from the second cuz its inside the function

earnest phoenix
#

Nothing other than command files should be imported anywhere other than the top

opal plank
#

@quaint wasp

proven lantern
#

put all require stuff at the top

opal plank
#

a, as you can see, should be highlighted

quaint wasp
#

oh

opal plank
#

like i said, any IDE should've given u that error before u event ran ur bot

#

i'd recommend switching if whatever u using isnt doing at the very least, this

quaint wasp
#

ye..

proven lantern
#

if you have a student email you can get a free version of intellij ultimate

opal plank
#

just get vsc

#

popular, works, light, and has a shitton of extensions

limber mica
opal plank
#

i really hope that was sarcastic

#

like, really hope

limber mica
#

It was

opal plank
#

good

limber mica
#

Lol

opal plank
#

gotta make sure, some people here do that

proven lantern
#

reassigning variables is a code smell

opal plank
#

scope blocked variable declaration is the term i think

#

or shadowing a variable

#

cuz it makes it inacessible

#

you'll never be able to acces the first "a" from inside the function

limber mica
#

But erwin why are you reassigning the variable like 10000 times

proven lantern
#

mutation in general is a code smell

opal plank
#

imma bonk u

proven lantern
earnest phoenix
proven lantern
#

they didn't know about all the issue around "mutantation" back then

earnest phoenix
proven lantern
#

there were some real FP languages before that so i guess they knew already, but didn't care

modest maple
quartz kindle
opal plank
#

@lusty quest i got good news and bad news

#

good news is that i managed to do what i wanted

#

bad news is that i cannot find a way to implement it in ts

#

intellisence, at least

#

the moment i extend and re-declare it, it doesnt like it

#

but the usage is still there

#

it just doesnt like the way im extending it

proven lantern
#

oop much?

opal plank
#

and implements keyword fucks up the declaration

#

cant seem to merge it

proven lantern
#

composition over inheritance

opal plank
#

what?

proven lantern
#

dont build inheritance structures

opal plank
#

y not?

proven lantern
#

less flexible

opal plank
#

thats exactly what i need

proven lantern
#

less flexibility?

opal plank
#

i need something that works

#

it compiles fine

#

its just on IDE that its screeching

proven lantern
#

Composition over inheritance (or composite reuse principle) in object-oriented programming (OOP) is the principle that classes should achieve polymorphic behavior and code reuse by their composition (by containing instances of other classes that implement the desired functionality) rather than inheritance from a base or parent class. This is an ...

opal plank
#

not even ts-ignore gets rid of that

#

im not doing that tho

#

lib exports a class.
i redeclare it so everywhere else u have the new types
however i need to modify its prototypes to add the actual logic/function

#

thats it

#

i already do that quite a bit tbh

proven lantern
#

that's tricky

opal plank
#

but this case is a bit finicky

proven lantern
#

like programming on quicksand

sudden geyser
#

basically value interfaces and abstractions over inheritance

opal plank
#

i need inheritence

#

im not the dev of the lib

#

i'd like to avoid modifying other people's stuff

sudden geyser
#

you probably don't

opal plank
#

im extending it

#

thats it

#

both in the declarations and its logic

sudden geyser
#

but inheritance and composition are just two different ways of modeling

#

so pick either one

opal plank
#

im still confused tbh

lyric mountain
#

inheritance is fine in some cases

proven lantern
#

here's a youtube video about it

opal plank
#

//lib code//
declare class Message extends Base{
  a:number;
}


//my code
<Message>.b = 2;
#

thats literally what i need

#

without casting it everytime

#

i already do that

#

but i need to modify the constructor itself

#

not only add a property in it

#

so everytime the native constructor is called, it has what i need

#

aka b

#
//index.ts

export class customMessage extends Message {
  clap() {
    console.log('clap');
  }
}

function mixin(target: any) {
  const parent = Reflect.getPrototypeOf(target);
  for (const key of Reflect.ownKeys(target.prototype).slice(1)) {
    //@ts-ignore
    parent.prototype[key] = target.prototype[key];
  }
}

mixin(customMessage);

//overrides.d.ts
declare module 'detritus-client/lib/structures' {
  interface Message {
    clap: () => void;
  }
}


//usage command.ts
message.clap(); 
#

if i choose not to use extends, and instead use implements, the declaration wont properly work

proven lantern
#

just use maps and arrays. no classes

#

ez

lyric mountain
#

sometimes you just need to add logic to classes' methods, that's where inheritance comes in

opal plank
#

thats the thing, its on the contructor

#

i cant modify it without adding its proptypes

lyric mountain
#

like, I have a list where a value gets assigned to every object added to it

opal plank
#

best i could do is call super() and implement my own, but thats janky as fuck

lyric mountain
#

all I had to do was extend the ArrayList class and modify add methods

opal plank
#

ah fuck it, im adding a helper rather than doing this shit

#

import the helper and use it instead

proven lantern
#

why are you making your own classes?

opal plank
#

why would i not make my own classes?

lyric mountain
opal plank
#

thats what the extension is for

#

i dont think so

proven lantern
opal plank
#

we still going on the "less flexible" route, but im looking for a solution here

#

not improvements

proven lantern
#

use a helper class

opal plank
lyric mountain
#
export class Custom extends OtherClass {
  let customParam;

  constructor(a, b, c, custom) {
    super(a, b, c);
    customParam = custom;
  }
}
proven lantern
#

but the helper class should have no member functions

lyric mountain
#

doesn't js have something like this?

proven lantern
#

only real functions

opal plank
#

it'd be best to actually change the original constructor

lyric mountain
#

just do the super way

#

it basically overwrites constructor

opal plank
#

kinda afraid fo fucking that tbh

#

yolo, doing my way with a helper outside this whole mess

#

too much shit in this already

proven lantern
opal plank
#

its just a ts thing

#

like i said, it compiles fine

#

cuz it imports the ref

lyric mountain
#

nah, oop is very clean

proven lantern
#

dont use the bad parts of ts

opal plank
#

this does the trick for me on transpile

#

cuz it pulls the Message

#

its just on the IDE side that u get an error

#

but it compiles just fine

#

but that annoyance is bothering me too much

proven lantern
lyric mountain
#

not really

opal plank
#

shit code exists everywhere

lyric mountain
#

if you call a function twice you'll get the same result twice UNLESS you're modifying variables

proven lantern
#

if you make an object and then set the state of that object and then call a function on that object that depends on the state then you messed up

lyric mountain
#

well, that's how real objects work

#

if you make a hole in a hardwood plank it'll still have a hole if you try again

proven lantern
#

why reuse the hardwood? just get a new piece and do the same operation

#

then you get the same answer always

lyric mountain
#

what if you want to fill the hole with epoxy?

proven lantern
#
const holeFilled = fillHole(woodWithHole)```
lyric mountain
#
const plankWithResin = makeHole(woodWithoutHole).fillHole();
proven lantern
#

vs

fillHole(woodWithoutHole)```
#

fillHole(woodWithoutHole) at this point woodWithoutHole actually has a hole

lyric mountain
#

yes

proven lantern
#

broken

cinder patio
#

So you're suggesting to basically make everything immutable and change values by cloning

lyric mountain
#

why have twice the variables when you could make sequential modifications?

#

like, imagine building a car

proven lantern
#

functional programming rules for 99% of the code

lyric mountain
#

but you buy a new piece for every operation

proven lantern
#

then the imperative shell can mutate stuff

proven lantern
#

that's fine

lyric mountain
#

it'd result in a huge code with a shitton of variables

#

each holding a reference until gc runs

cinder patio
#

Even worse, wouldn't it create a bigger memory footprint

#

especially in langs which aren't optimized for this

proven lantern
#

you can do this too const woodWithHoleFilled = fillHole(makeHole(woodWithoutHole));

lyric mountain
#

that's...what I said

lyric mountain
proven lantern
#

they can run on multiple processors since they dont share state

#

easier to run in parallel

#

or concurrently

sudden geyser
#

I think the issue here is you're trying to fight against the language's native paradigms. You probably wouldn't be writing software utilizing concurrency in JavaScript in the first place.

proven lantern
#

the main thing is that it make code easier to reason about

lyric mountain
#

now, let's step up a bit: ```js
const hardWoodTable = makeHole(woodWithoutHole)
.setColor("Royal blue")
.fillHole()
.addLegs(4)
.paint();

sudden geyser
#

The builder pattern sucks anyway

proven lantern
#

does paint() rely on there being legs added first?

lyric mountain
#

yes

proven lantern
#

broken again

#

have fun making a change to that

lyric mountain
#

non-builder pattern

lyric mountain
#

or use methods to modify the state

sudden geyser
cinder patio
#

that's still the builder pattern tho

proven lantern
#

and update the paint method to forget about the legs

latent heron
#

Type interference languages pepeMeltdown

lyric mountain
#

I'm not building anything there

#

I'm just modifying the state with ops

proven lantern
#

hardWoodTable.convertToMetalTable()

sudden geyser
#

Too many builders imo have required fields that they don't require you to set when initializing the builder.

proven lantern
#

now hardWoodTable is actually a metal table

sudden geyser
#

So when you call .build() you instead get an error

#

plus it's imperative

lyric mountain
#

that's a bad thing

#

builders are nice for many optional configs

proven lantern
#

imperative bad, declarative good

sudden geyser
#

In that case yeah

lyric mountain
sudden geyser
#

You can still be declarative while using a "builder" design.

#

e.g. SwiftUI & Jetpack Compose

proven lantern
# lyric mountain yes, what about it?

that's the problem with mutations. you start off with something and then change it a bunch. the order in which you change it matters so it ends up being really confusing to reason about

cinder patio
#

You can still use imperative programming and avoid that problem though.

#

I don't really get what the issue is

lyric mountain
proven lantern
#

logic doesn't have that issue

lament rock
#

Why does writing a thread pool implementation suck

sudden geyser
#

because you're using threads

proven lantern
#

logic is math and math follows the rules of FP

#

f(x) = x

sudden geyser
#

identity!

lament rock
#

threads aren't that bad. Not needing the threads to send arbitrary ops to the parent or vice versa is good and easy to implement

proven lantern
#

you cant do f(x) = x and then say actually f(x) = z now

lyric mountain
#

I mean, if you went the way you were saying, you'd have:```js
const woodWithHole = makeHole(woodWithoutHole);
const WoodWithColoredHole = setColor(woodWithHole, "Royal blue");
const woodWithBlueHole = fillHole(coloredWoodWithHole );
const woodWithLegs = addLegs(woodWithBlueHole , 4);
const hardWoodTable = paint(woodWithLegs );

#

that screams spaghetti

proven lantern
#

put that in a function in it's own file. rule of thumb to not have the line numbers go past 150-200

lyric mountain
#

you still have a shitton of variables

#

one for each mutation

lament rock
#

logic is quite arbitrary

proven lantern
#

i'm talking about set and logic

#

the one that follows the rules of math

lyric mountain
#

I'm talking about coding logic

proven lantern
#

that's sets and logic

lament rock
#

pseudo-random number generation somewhat breaks set and logic since you theoretically can predict the logic, but it's not guaranteed to follow a shallow expectation

#

coding logic isn't exactly set and logic. Plus, protocols change

proven lantern
#

a fp random number generator takes a seed value to work off of. it'll always produce the same random numbers with the same seed

lament rock
#

that's why I was saying you could predict the output, but I'm sure no one bothers to try to predict it

proven lantern
#

hackers do

#

bad random number generators can make a vulnerability in the system

lament rock
#

their methods don't exactly follow prediction, but brute forcing

proven lantern
#

they observe the patterns after gathering enough of the output

#

computers are not good at actually being random

lyric mountain
#

actually, true random doesn't exist

proven lantern
sudden geyser
#

Not perhaps.

lyric mountain
#

no, it really doesnt

sudden geyser
#

It's fact.

lyric mountain
#

everything is reversable

frozen topaz
#

depends on the source of randomness

sudden geyser
#

There is no such thing as true randomness.

frozen topaz
#

and the general guessability of a number

lyric mountain
#

say a source that is truly random

frozen topaz
#

the important metric isn't really "randomness" but more "guessability"

lament rock
#

of course pseudo-random generators follow specific logic which can be "static", that doesn't mean logic has to be described as static because variance still occurs.
By your logic, we cannot be random because our environment as well as our hormones affect our behaviors.

proven lantern
lyric mountain
#

entropy is reversable

#

like, not necessarily possible to achieve

#

but is reversable

frozen topaz
#

once again, randomness isn't really the metric here...its guessability

proven lantern
#

like after all energy has been used it'll collapse and then to another big bang?

frozen topaz
#

"how hard would it be for [xx malicious party] to guess this number?"

#

thats really all that matters, not randomness...those things happen to be very similar but the difference is that hard-to-guess-ability is achievable, randomness....well its a lot harder

lyric mountain
#

since it is time-dependant

proven lantern
#

but going back in time is not a thing

lyric mountain
#

also entropy goes backward on negative kelvins

lyric mountain
lament rock
#

I think this is getting a bit de-railed from "development"

lyric mountain
#

it IS reversable, just not achievable

sudden geyser
#

It's still development-related, but better discussions could take place

frozen topaz
#

as are the security implications of improper number generation

lament rock
#

it seems to no longer be such

proven lantern
lyric mountain
#

not being achievable doesn't make something impossible

proven lantern
lyric mountain
#

former implies that it's not possible to do something with current technology/knowledge

proven lantern
#

after something hasn't happened it's impossible for that thing to have happened because it didn't happen

frozen topaz
# proven lantern what the difference?

not achievable - we currently can't do it but eventually we might be able to (ex a quantum computer in your pocket)
impossible - laws of the universe, etc. (ex surpassing speed of light)

proven lantern
#

it's only possible before the time passes

lyric mountain
#

quantum tunneling as data transfer is an example of non-achievable but possible thing

proven lantern
#

unless it did happen

frozen topaz
#

i'd say that currently, truly random numbers are not achievable...but the alternative (the randomness apis built into your OS) is good enough for anything that anyone in a discord bot development server would be making

sudden geyser
#

os threads or discord threads

frozen topaz
#

it seems that the universe has sources of randomness (positions of parts of certain particles can appear/disperse rapidly and in random positions that show no short or long term patterns and can't (as far as we can tell) be influenced by outside sources....but that won't be built into your phone anytime soon

frozen topaz
#

they're pretty good

#

going to be a massive pain in the ass but ya know, pretty cool

opal plank
#

need a thread bot here tbh. When something is getting too heated, just do !thread, if 5x people do it within x time, open a thread for them to clean chat off their shit.

(i want royalties if u stealing this idea)

frozen topaz
#

also going to kill basically all ticket bots lol

sudden geyser
#

yeah they would be nice

lyric mountain
sudden geyser
#

I plan on using them in a server of mine for spoiler-oriented discussions so chat won't look like a classified CIA document

lyric mountain
#

a true random thing would have to be something that isn't influenced by anything other than itself

frozen topaz
lyric mountain
#

not even time (as in, if you reverse time that "thing" wouldn't be there anymore even at the same moment it appeared before)

opal plank
#

hence the need for a bot, otherwise people would just spam open them

frozen topaz
lyric mountain
#

sadly, time does influence it

frozen topaz
lament rock
#

Threads have been available in select guilds previously

opal plank
frozen topaz
frozen topaz
modest maple
#

no...

lament rock
modest maple
#

they've only be fully available for anyone to opt in in the last 4 days

frozen topaz
#

sure they released for their special beta guilds a while back, but not platform-wide

modest maple
#

in the same way select buttons have been around for about a month and have only just released them to the public

frozen topaz
#

the opt-in thing is now platform-wide for those of us who can't manipulate random number generation lmao

lament rock
#

it wasn't even just for official guilds

opal plank
#

i was in whitelist way before they were out my dude

#

they released them for libdevs

#

and big bot devs

opal plank
frozen topaz
#

good for you?

opal plank
#

so dont call me out then

frozen topaz
#

you are 1 person with early access

#

the public has had it for 4 days or whatever (I think its more like 2)

opal plank
#

what does publicity have to do with what i said?

frozen topaz
#

maybe there were 100 people with early access, i'm assuming all the big lib devs got it

modest maple
#

man, i would just give in and admit you were incorrect at trying to call him out on it lol

frozen topaz
lament rock
#

?

opal plank
#

i said u need permission to open a thread, so instead of giving everyone permission, just use a bot when its out

#

it ahs nothing to do with how it works

#

being public or not

#

it requires permissions

#

period

lyric mountain
#

normally discord does the so called "thanos beta" where half the ids get it and half doesn't

opal plank
#

i never even stated the fact that it was public or not

frozen topaz
#

what do you want me to say? sorry I didn't know about some niche early access program where a tiny select group of people had access to it?

opal plank
#

that does not change the fact of what i said

lyric mountain
#

plus some special individuals like famous streamers and big devs

#

threads are already a thing since official docs were released

lament rock
#

the docs for threads have been out for a long time

frozen topaz
#

I was unaware anyone had access to them since the docs dropped

opal plank
#

then what does it ebing public or not change the fact that it requires a permission?

lyric mountain
#

no, like, the final docs

frozen topaz
#

I figured they were putting the docs out in advance before they had a final-ish UI out

modest maple
proven lantern
frozen topaz
frozen topaz
modest maple
proven lantern
frozen topaz
opal plank
#

i was commenting on the fact a bot could be used to prevent having to add @ everyone with permissions to open threads. then out of nowhere u implied that it wasnt out. like it changes what i said tho

frozen topaz
#

I could care less about the permissions lol

modest maple
#

thats grammatically incorrect

#

im sorry but grammar trigger right there

opal plank
#

how does that change the fact tho?

modest maple
#

it's couldn't* care less

opal plank
#

i added dropdowns an hour after it was out

frozen topaz
#

but yeah I agree very annoying

#

i've learned to just accept it ๐Ÿ˜›

lyric mountain
frozen topaz
opal plank
frozen topaz
frozen topaz
opal plank
#

you could've stopped anytime

opal plank
#

and then goes on to post that

fresh verge
#

What is this?

limber mica
#

Is there a way to check if a channel exists at all?

earnest phoenix
earnest phoenix
limber mica
earnest phoenix
fresh verge
earnest phoenix
limber mica
earnest phoenix
rocky hearth
#

for music bots, ytdl-core is good or ytdl-core-discord?

earnest phoenix
earnest phoenix
# fresh verge

Not sure, are you using the top.gg's autoposter? If so what version of it are you using?

rocky hearth
#

but that says, ytdl-core-discord will improve perfomance greatly

earnest phoenix
#

It won't

rocky hearth
#

does ytdl-core, takes opus streams by default? from youtube?

earnest phoenix
#

yes, basically just takes a YouTube URL and downloads it and converts it to a readable stream

#

I mean you could use ytdl-core-discord if you want as its made by the owner of discord.js, but not sure if it actually improves performance

#

You could compare their efficiency and performance by trying both I guess

limber mica
#

Now im having even more errors, so if a user does NOT ping a channel it just crashes because how can you find the id of undefined?

#

So can i check if the user actually pinged a channel

fresh verge
earnest phoenix
limber mica
#

durr

earnest phoenix
#
const channel = ...;

if (!channel) { ... }

...
limber mica
#

yep

rocky hearth
#

also can u tell me, what sodium is used for?

limber mica
#

thats it

lyric mountain
limber mica
earnest phoenix
rocky hearth
#

Oops, i mean in discord bots

limber mica
lyric mountain
#

hmm interesting

earnest phoenix
lyric mountain
#

ah, like salt (as in "salting the hash")