#development

1 messages Β· Page 1420 of 1

twilit geode
restive furnace
#

then it is?

twilit geode
#

oh

#

idk

#

it never throws an error

#
let avatarList = message.mentions.users.map(user => {
        avtEmbed.addField('\u200B',`${user.username}\'s avatar:`,false)
        avtEmbed.setURL(`${user.displayAvatarURL({format: "png", dynamic: true})}`)
    });
    
    }
earnest phoenix
#

that is mapping to nothing

#

what are you trying to do

pale vessel
#

you need title for setURL

twilit geode
#

OH

pale vessel
#

and the result embed url would only be for the last user in the map

#

what the fuck are you doing

twilit geode
#

idk

#

i think im drunk

#

i couldnt get it to work without map

pale vessel
#

you can use a for loop or forEach

earnest phoenix
#

literally a basic ass loop

#

^^

#

but avoid forEach

#

that's slow

pale vessel
#

oh

#

why is it slow

twilit geode
#

yes but i couldnt get the message.mentions.users to get me anything

earnest phoenix
#

the function you pass as the arg needs to be regenerated and re-evaluated for every single element

#

compared to a basic for loop where you're just indexing the array and whatever you're doing is statically typed

pale vessel
#

okay so for (const user of message.mentions.users.values()) {}

earnest phoenix
#

yeah

twilit geode
#

uhm

#

im new to js, dont you need to have something to determine when the loop is done...

#

@pale vessel

pale vessel
#

you can put a condition, yes

#

like for (let i = 0; i < number; i++) {}

twilit geode
#

thats what im used to

viscid gale
hollow sedge
#

Wth

twilit geode
#

ok @pale vessel your for loop worked, but why shouldnt i use map?

pale vessel
#

Because it's slow

twilit geode
#

?

tardy hornet
#

line:

if (rolesEmbed.fields[2].value.length > 1024) return message.channel.send('you got more roles than i can list. Must be 1024 or fewer in length.')

error:

TypeError: Cannot read property 'value' of undefined
pale vessel
# twilit geode ?

Map creates another array copy so you would typically use it if you want the evaluated result

#

But in your case it returns nothing

twilit geode
#

ohhhhkayyy, i should just read up on map

pale vessel
#

forEach is probably faster but it would still be slower than for loop

twilit geode
#

mk

#

ty

pale vessel
#

@tardy hornet rolesEmbed.fields[2] is undefined

#

Debug

#

console.log(rolesEmbed.fields)

tardy hornet
#

k 1s

#

here you go

pale vessel
#

well

viscid gale
#

:{

pale vessel
#

Do you know now why rolesEmbed.fields[2] is undefined

tardy hornet
#

no

#

bro the answer is probably so simple and that i am just blind

pale vessel
#

count how many elements that array has

#

rolesEmbed.fields[2] would mean that the array must have at least three elements

#

array indexes start with 0

#

If you still don't get it, I'm sorry

#

There's not much I can do

earnest phoenix
#

I'm using canvas

tardy hornet
#

@pale vessel i just fixed that, ty

tardy hornet
pale vessel
#

Nice man

hollow sedge
twilit geode
#

how would one go about storing some emote codes, then calling them up later?

#

like perhaps an entire freaking deck of cards?

viscid gale
twilit geode
#

because currently i have a shit ton of if statements determening what emote to use...

obtuse kiln
tardy hornet
#

im scared, how can i know that the URL isnt an ip graver or something like that

#

please ping me when respond, i wont click on it till

umbral zealot
#

We can't validate whether a specific website we don't own is legit or not.

#

It's not ours that's for sure.

rustic nova
#

there's a reason why DIscord puts these "do you trust this domain" warning

#

if you don't feel comfortable clicking it, then just don't

opal plank
#

you should definitively not click in links or domains you dont trust

#

ngl i just heard it and regret posting that

rustic nova
#

AH GOD FUCKING DAMNIT

#

FUCK YOU

opal plank
rustic nova
#

not clicking youtube videos anymore

tardy hornet
#

I LOVE IT

rustic nova
#

fuck that

opal plank
#

use a vps

tardy hornet
#

you changed my life for ever

#

@opal plank

opal plank
#

yw

tardy hornet
#

im hearing it in the background

opal plank
#

i need to stop posting emotes without knowing what they are, just by name

#

that looks like paimon humping someone like a dog , not paimonHug

tardy hornet
#

but bro

#

wanna see the best rick video i have ever seen

#

?

#

@opal plank

#

you wont be sorry

#

its just 28s

opal plank
tardy hornet
#

k

#

GO SEE IT NOW

twilit geode
#

how would one go about storing some emote codes, then calling them up later?

young flame
#

okay slight problems

earnest phoenix
#

uhh

livid lichen
#

const Description = Bot.commands.map(command => command.help.name).join("\n"); Anyone know how I would add a custom prefix before the command?

twilit geode
opal plank
#

i mean YOU define what emote code is

young flame
#

i tried to make it so first it sends the warning then checks to see if it sent the warning and if it did mute them

opal plank
#

you mean hash?
their id?
the picture url?
what IS code?

twilit geode
#

oh

young flame
#

but it doesn't run the mute part

livid lichen
#

I tried .join(prefix) but that put it after.

quartz kindle
young flame
twilit geode
#

like <:emote_name:emoteid> @opal plank

livid lichen
#

Thank you!

opal plank
#

database would be best for long term storage
if you dont mind losing them on restart, simply map them by id

quartz kindle
#

you are doing if(function)

young flame
#

idl

#

idk*

#

i just want it to work

twilit geode
#

@opal plank they are just a set of playing cards, so just map?

opal plank
#

yes, but you'll need to save them i assume

young flame
opal plank
#

i'd recommend storing a json file and calling them

twilit geode
#

lol

young flame
#

oH

opal plank
#

helpin @twilit geode

young flame
#

do you know how to fix it?

#

@quartz kindle

twilit geode
young flame
#

or what to change

opal plank
#

require(path)

twilit geode
#

k

#

wait

quartz kindle
#

why do you need to check if it sent the message? if the bot cant send the message because it has no perms, the user will not be muted?

opal plank
#

or fs.read, but require does the job easier for you

young flame
#

i just need to know

#

how i can get the bot to be like oh i warned them

opal plank
#

i already told you what you should do u bonk

young flame
#

i need to mute

young flame
#

work

opal plank
quartz kindle
#

lmao

twilit geode
opal plank
#

simply await the message being sent and add isWarned or some other thing on your userMap

young flame
#

how the fuck would you even save this

opal plank
#

knowing how maps and objects work would be a good start

slender thistle
#

When Erwin is yelling, I get scared

young flame
#

I-

quartz kindle
#

yeah no, im out of this one, good luck erwin :^)

young flame
#

WOOW

opal plank
#

lmao even tim quit

young flame
#

DONT ABANDON ME

#

smhh

slender thistle
#

When Tim starts being passive aggressive, I know shit's very bad

quartz kindle
#

lmao

young flame
#

lol

opal plank
slender thistle
#

When either of them quits, you know you are a lost cause

young flame
#

i'm slow smh

opal plank
#

i gave you the answer though

#

idk what you struggling with

#

await the message being sent

#

and then add a new property on their user

young flame
#

it took me 4 hours to fix one line of code

#

and 2 people had to help me

opal plank
#

i assume userMaps() is a map containing info about the user

young flame
#

mhm

opal plank
#

get the user by id

young flame
#

mhm

opal plank
#

then add isWarned = true;

young flame
#

huh

opal plank
#

then check within that code if(isWarned) {//mute}

#

if the user has already been warned before, mute them

young flame
#

what does is warned mean

opal plank
#

if not, add isWarned

young flame
#

like

opal plank
#

your bot does 2 steps, no?

#

a warn

#

and then a mute

young flame
#

yes

opal plank
#

if(isWarned) means they were already warned before

young flame
#

oH

#

do i just

#

add that

opal plank
#

so you want to mute them after

young flame
#

or

#

yes

opal plank
#

i already answered that lmao

#

twice actually

young flame
#

h

#

like

#
usersMap.isWarned
#

like that?

#

@opal plank

opal plank
#

@quartz kindle come back

#

pliz

quartz kindle
#

@_@

slender thistle
opal plank
#

you REALLY need to learn the basics before

young flame
#

i read it

opal plank
#

no u didnt

#

that time wasnt even enough to read the first paragraph

#

read the whole thing

#

you need to know maps in order to use them

#

learn it first, THEN try it on ur code

young flame
#

i read the whole thing

#

and the stupid chat at the bottum

opal plank
young flame
#

0.12 for node.js

#

if i remember

opal plank
#

how to you retrieve something from a map?

young flame
#

uh

slender thistle
#

Moon trusts turtles and therefore must not be trusted

opal plank
young flame
#

.set

pure lion
#

map.get(value)

young flame
#

i think

opal plank
#

wrong

#

like i said

young flame
#

H

opal plank
#

learn it first

young flame
#

OH

#

WAIT

pure lion
#

Well done moon

#

Well

young flame
#

IT'S LIKE QUICK.DB

pure lion
#

Done

young flame
#

HhHhhHh

slender thistle
#

Retrieve means get

young flame
#

stfu

#

why are you talking here

opal plank
#

shiv is emotional support

young flame
#

your conversation has nothing to do with development

#

fuck shivaco

#

tbh

boreal iron
pure lion
#

Shiv is so cute

opal plank
#

@slender thistle is emotional support, like i said, tim and i quit, he's the thing keeping us in chat

pure lion
crimson crow
#

what's the voting credit ?

young flame
#

._.

slender thistle
#

I'm here to add more fuel into the fire and see y'all bully Moon

opal plank
young flame
#

finna leave tbh

crimson crow
#

how to use voting credit

opal plank
young flame
slender thistle
opal plank
#

do it

#

you wont

quartz kindle
#

lol why so passive aggressive

opal plank
#

idk if you can talk much tim

young flame
#

actually

#

1 blocked

earnest phoenix
#

lets just call people morons until they leave

young flame
young flame
opal plank
#

is moon legit blocking the only person who was helping?

young flame
#

@solemn latch

#

dev senpai i have a question

opal plank
#

welp, i gave u the answer, up to you if you gonna bother someone to repeat exactly what i said though

pure lion
young flame
#

moon_ nobody blocked you homie

livid lichen
#

    const HelpEmbend = new Discord.MessageEmbed()
        .setTitle(":robot: Commands :robot:")
        .setDescription(Description)
        .setFooter(`${process.env.prefix}Help [command] to get infomation on a specific command.`, )
        .setColor("#0099ff") ``` How would I implement a category?
viscid gale
young flame
#

nice dev died

#

pog bro

earnest phoenix
#

how do i add a function to my bot where if someone votes my bot on top.gg, the bot will do something to the user? btw im using JavaScript with discord.js and im using fs

old latch
pure lion
#

It's nice to know that you're using fs

solemn latch
#

πŸ€”

#

whats the question

young flame
slender thistle
#

Python, aiohttp.web
Is there any preferred way to recreate a webserver instance?

#

The way I'm planning to achieve that is by literally closing current instance and then recreating a new one, and it seems to work decently.

#

To be clear, I'm thinking of adding a WebhookManager class to dblpy that has a recreate method, which will re-configure DBL/DSL routes to be used again (actual initialization is done manually by the user). Later, the user will have to still use webhook_manager.run() to actually run the webhook with those routes.

hollow prawn
#

how would I go on about setting up a dynamic fields in a message embed? using DJS 12.5.0
For example, a field would hold 10 entries as its value, it gets the full value amount from the guild channels size, so a guild having 20 channels would be 2 dynamic fields, if it has 50 channels it'll be 5 dynamic fields, would prefer to add that with a .addFields(), I think I could figure out liming the entries to the fields with 10, just setting up the dynamic fields would be a bit iffy for me

earnest phoenix
#

what are you talking about

#

field can't be dynamic lol

#

they display what you give them

hollow prawn
#

I know they can't be dynamic

#

however I think i've seen some discord bots having fields based be different based on entries, or do they use custom showcases?

pure lion
#

I don't use fields, I just use the description and style that how I please

hollow prawn
#

eh I need the inline feature for them

pure lion
#

I also don't use the constructor

earnest phoenix
#

however I think i've seen some discord bots having fields based be different based on entries
what are you implying by entries

hollow prawn
#

lemme code it outJS for (const [id, channel] of message.guild.channels.cache) { // check if its category, followed by separating text and voice channels } let checkedChannelsEmbed = new Discord.MessageEmbed() .addFields( { name: '1-10', value: 'here are mentioned 10 channels that don\'t have setup permissions', inline: true } // add a 2nd field if there's more entries so instead of 10 channels, be it 20 or 30, each field would hold up to 10 channels before having the next added )

earnest phoenix
#

so your question is how to split into chunks

#

that isn't dynamic fields

#

just string manipulation and basic logic

hollow prawn
#

yeah that, well i wasnt sure for the proper terminology

#

if there's a guide i could check out that you would recommend, it'll help

earnest phoenix
#

there's a fuckton of results on google on how to split an array into chunks

after you split it into chunks, loop through the array of chunks and add a field for each chunk

#

if you want to keep it O(n) just make it the part where the chunk gets added to the "master array", instead it adds a field

pure lion
#

If you're lazy just use lodash to chunky the array but then why the fuck would you do that

hasty lotus
#

Hi, i went back a bit to my code, updated it, and while trying to do an embed (code below) i've got this error :

(node:27959) UnhandledPromiseRejectionWarning: TypeError: fields.flat is not a function```

My code :
```js
channel.send(msg.author, new Discord.MessageEmbed().setDescription('Creation de votre salon de support en cours...\n\nVeuillez expliquer votre probleme :').setColor('ORANGE'))```
where channel is a discord channel.
Any idea ?
livid lichen
#

Bot.guilds.members.cache I know I am doing it wrong, but I forgot how to do it right.

hasty lotus
#

what do you want to do ?

livid lichen
#

I am trying to get the total of members in each server.

hasty lotus
#

i then recommand you a forEach loop

#

like

boreal iron
#

...cache.size

livid lichen
#

Thanks.

hasty lotus
#
<Client>.guilds.cache.forEach(guild => {
console.log(guild.members.cache.size)
})```
#

this will log the number of users of every guilds one by one

livid lichen
#

Different error: Unhandled rejection TypeError: Cannot read property 'cache' of undefined TypeError: Cannot read property 'cache' of undefined

#

Cache is undefined.

hasty lotus
#

show the code you tried to run ?

boreal iron
#

Bot dude is not your client obj

livid lichen
hasty lotus
#

with what before it ?

#

i gues you havent put console.log(...cache.size)

boreal iron
#

Scroll up

hasty lotus
#

well Bot.guilds.members is undef sure

#

Bot.guilds.cache is a collection

#

containing all your guilds

#

so you must pick one

#

or do a forEach

#

like Bot.guilds.cache.get(GUILDID).members.cache.size

#

or

boreal iron
#

Use a for loop instead, that’s faster

hasty lotus
#

also works fine

livid lichen
#

Sorry-- went afk. Thanks!

#

@hasty lotus ```var TotalMembers = 0

Bot.guilds.cache.forEach(guild => {
TotalMembers = TotalMembers + guild.members.cache.size
});``` It came out as 6, the total number of servers the bot is in.

#

I need members?

hasty lotus
#

well it's cached users

#

but i think there is a property guild.memberCount

#

or something like that

#

check the docs

livid lichen
#

It came out as undefined.

hasty lotus
livid lichen
#

I had a typo! Thanks for the help!!

hasty lotus
#

np

#

^^

jaunty surge
#

Hey can anyone help me out if I want to add the cancel option inside this code, like when the user change their mind to cancel music they will write cancel and then the command terminate, I try

                {
                    return message.channel.send("**CANCELED**")
                }``` 
before first catch error of the code, can someone help me out
earnest phoenix
#

You shouldn't use awaitMessages for this

#

Use a message collector

main trench
#

Anyone know how to check if a message has a certain word im making a blacklist command and I want to to look for words that are logged in the db and if it finds that word execute a command would it be message.content.contains(db stuff here)?

earnest phoenix
#
let passed = false;
let mainMessage = // Send the selection of songs here
let collector = message.channel.createMessageCollector(m => m.content.match(/^\d+$/) && m.author.id === message.author.id, {
max: 1,
time: 30000
});
collector.on("collect", async collectedMessage => {
if (parseInt(collectedMessage.content) < 0 || parseInt(collectedMessage.content) > 10) {
await mainMessage.delete();
return message.channel.send("Selection index must be between 1-10");
}
await mainMessage.delete();
let chosenIndex = parseInt(collectedMessage.content);
passed = true;
// Start the music here
});
collector.on("end", async () => {
if (passed) return;
await mainMessage.delete();
return message.channel.send("Took you too long to choose a song.");
});``` This is how you would go by it @jaunty surge
hollow prawn
#

@main trench message.content.includes('db word here'), thing is it can detect for example the word 'sex' from 'sextillion' as trigger word

main trench
#

Hmm

hollow prawn
#

so idk how could it be made better

main trench
#

It will work for now thanks

#

I don't think any problems would occur like that

earnest phoenix
#

Example:

["bad", "word", "moment"].some(b => message.content.toLowerCase().includes(b))```
main trench
#

Hmm I attempted .includes but it still doesn't work

earnest phoenix
#

Code?

main trench
#
    if (message.channel.type === "dm") return;

    let words = db.fetch(`wordsdb_${message.guild.id}`)

    if (message.channel.type === "dm") return;

        if(!message.member.hasPermission('ADMINISTRATOR')) {
            let user1 = message.member
    
            let badlink1 = new MessageEmbed()
            .setDescription(`You cannot say bad words in **${message.guild.name}**`)
            .setColor("RED")
     
                if (message.content.includes(words)) {
                    message.delete()
                    message.author.send(badlink1);
    
                } 
    
                let data2 = {
                    staff: `**Warn**\nModerator: @sacred glade\nReason: Bad Word\n`,
                }
    
                db.push(`logsdb_${message.guild.id}_${user1.id}`, data2)
        }
           
})```
earnest phoenix
#

What does words return?

#

Log it

main trench
#

words searches the database in that server for a certain word

#

if its in the database it will execute that code

earnest phoenix
#

No, i meant what type does it return? String? Array? Object?

main trench
#

array

earnest phoenix
#

That's what you're supposed to do

main trench
#
                staff: `**${word}**`,
            }

            db.push(`wordsdb_${message.guild.id}`, words2)``` bl.js pushes the word here
earnest phoenix
#

Umm

main trench
#

unless im fetching wrong

#

im not ok

earnest phoenix
#

The words are not even in a string type

#

They're an object

main trench
#

its to see the list

earnest phoenix
#

Just

#

console.log(words)

lucid prawn
#

my coded

message.reply(`${client.user.username} is on ${scount} servers with ${usercount} memebr/user`)
}```
my error 
cannot read property `size` of null
main trench
#

It logs it for a list here

#

While logging the word in the word db

earnest phoenix
#

Not there, log it in console

main trench
#

aight

earnest phoenix
lucid prawn
#

var scount = client.guilds.size
var usercount = client.user.size

earnest phoenix
#

Which version of discord.js are you using?

#

Do npm ls discord.js to find your discord.js version

main trench
#

ok so the issue was i was fetching it wrong

#

i needed to log the word by itself and not in a array

jaunty surge
#

@earnest phoenix what's /^\d+$/ mean

earnest phoenix
#

That's called a regex

jaunty surge
#

ohh

lucid prawn
earnest phoenix
#

Then

let scount = client.guilds.cache.size;```
#
let usercount = client.users.cache.size;```
lucid prawn
#

ok

earnest phoenix
#

i mean i got the server members intent that makes sense but what is the presence intent for?

lucid prawn
opal plank
earnest phoenix
#

oh okay

#

i mean if thats it then i got it lol, was just confused bc ive been getting mixed messages

lucid prawn
#
let usercount = client.users.cache.size;
message.reply(`${client.user.username} is on ${scount} servers with ${usercount} member/user`)
}```
it said Akamenotabot is on 0 servers with 0 member/user
but it in 11 servers and more member
#

can u help me

drifting wedge
#

how can i make text show when u hover over something? html

#

preferrably with no js

quartz kindle
livid lichen
#

const Description = Bot.commands.map(command => ``${process.env.prefix}${command.help.name} : `${command.help.description}``).join("\n"); How would I use "`" in a `` sentance?

quartz kindle
livid lichen
drifting wedge
quartz kindle
#
abc {
  something:value
}```
#

^abc is the selector

#

aka, the "what" to apply the css to

#

the :hover selector lets you define a css for when an element is hovered

drifting wedge
#

i want to like show a div

quartz kindle
#

for example

#
div {
  display:none
}

div:hover {
  display:block
}
drifting wedge
#

when u hover

lucid prawn
quartz kindle
#
// this is the program body
// everything on here is executed immediately
// in case of a discord bot, any code placed here will be executed before the bot is ready, and therefore has no access to discord information

bla.on("something", abc => {
  // this is an event
  // everything in here is only executed when the program receives something
  // in the case of a discord bot, this only happens after the bot is ready, so any code placed here is guaranteed to have access to discord information
})
``` @lucid prawn
drifting wedge
#

@quartz kindle i dont get it

#

i want to SHOW text when u hover over something

#

but when i did none on the not :hover one it broke

lucid prawn
#

the error bla is not defined @quartz kindle

quartz kindle
#

read what its written

#

dont copy

lucid prawn
#

i did read it

quartz kindle
#

what didnt you understand then

quartz kindle
#

are the divs one inside the other?

drifting wedge
#

its inside a big div

#
.invboxtext {
        display: none;
        background-color: #7289DA;
        border-radius: 20px;
        padding: 20px;
    }
    .invboxtext:hover {
        display: block;
        background-color: #7289DA;
        border-radius: 20px;
        padding: 20px;
    }

    .hide1 {
        display: none;
    }

    .hide1:hover {
        display: block;
    }```
#
.invbox {
        background-color: #7289DA;
        border-radius: 20px;
        padding: 20px;
    }

    .invbox:hover {
        background-color: #1c2024;
        border-radius: 20px;
        padding: 20px; 
    }```
#

thats my css

quartz kindle
# lucid prawn do i use this

use what? there is nothing to use there. i wrote that for you to understand how it works, now look at your own code and apply your new knowledge there

lucid prawn
#

ok

valid grotto
#

Do it like this? @drifting wedge

.invboxtext {
  display: none;
}

.theDiv:hover + .invboxtext {
  display: block;
}
quartz kindle
drifting wedge
#

yes

#

wait

#

its inside invbox

quartz kindle
#

so when you hover invboxtext you want hide to show

drifting wedge
#

shouldnt make a dif tho

quartz kindle
#

you want to sohw it when you hover invbox or invboxtext?

drifting wedge
valid grotto
#

.invbox:hover + .inboxtext

earnest phoenix
#

Can anoyone help me when i type a command the bot doesn't respond

drifting wedge
#

its not showing

#

regardless

quartz kindle
#

you want to sohw it when you hover invbox or invboxtext?

drifting wedge
#

look this is my css

#
    .invbox {
        background-color: #7289DA;
        border-radius: 20px;
        padding: 20px;
    }

    .invbox:hover {
        background-color: #1c2024;
        border-radius: 20px;
        padding: 20px; 
    }

    .hide1 {
        display: none;
    }


    .invbox:hover + .hide1 {
        display: block;
    }```
quartz kindle
#

you want to show it when you hover invbox or invboxtext?

drifting wedge
#
            <div class="invbox">
                <div class="hide1">
                    <a class="font-weight-bold" style="color: white; font-size: 12px;">text yay</a>
                </div>
                <img src="https://imgur.com/XJTB2a1.png" class="" width="120px">
            </div>```
#

i want to show on hover

#

invbox

#

invboxtext is useless

quartz kindle
#

.invbox:hover .hide1

drifting wedge
#

thanks!

#

thanks luke and knowable

#

πŸ™‚

#

tysm

#

now i can make shit invisible!

#

thankssss

earnest phoenix
#

Can someone help me?

drifting wedge
#

give more info

quartz kindle
drifting wedge
#

what lang is it in?

#

lib?

#

show code

#

ye

earnest phoenix
#

Ok

#

It my first day in coding so im kinda still learning but here is my code

quartz kindle
#

reset your token

earnest phoenix
#

Thats all?

quartz kindle
#

no

earnest phoenix
#

Hold on let me reset it

quartz kindle
#

you posted your token in a public chat

#

anyone can "hack" your bot with your token

lucid prawn
#

lol

earnest phoenix
#

oh

#

Ik

#

That

quartz kindle
earnest phoenix
#

I got that from a youtube what needs to be there?

quartz kindle
earnest phoenix
#

hmm

#

Do u know what need to go there?

quartz kindle
valid grotto
#

prefix.length

#

Too much typo

quartz kindle
#

you have a lot of spelling mistakes, not a code problem

earnest phoenix
#

Hmm

#

Ok

earnest phoenix
quartz kindle
#

.startsWith(prefix)

earnest phoenix
#

I had that

#

Someone else said to remove those

#

Ok

#

thats all i have a few others things

sharp rock
#

how to coding bot in visual studio code?

#

visual studio is editor code

livid lichen
#

  console.log(`New guild added: ${guild.name} (Id: ${guild.id})`);

  let TyEnbed = new Discord.MessageEmbed()
    .setTitle(`**Thanks for inviting me!**`)
    .setDescription(`I will ensure I do a great job assisting you. For help, do ${process.env.prefix}Help or ${process.env.prefix}Commands`)
    .setTimestamp()
    .setColor("#0099ff");

  owner.send(TyEnbed); ``` `Unhandled rejection TypeError: Cannot read property 'send' of null`. Not sure what I did wrong here.
sharp rock
#

no hosting

#

app

earnest phoenix
#

What about that

#

Anything wrong there?

sharp rock
#

hmm

livid lichen
quartz kindle
#

you need to fetch it

earnest phoenix
#

PLease help me

livid lichen
earnest phoenix
#

@quartz kindle after im finished i have a few others things also

livid lichen
earnest phoenix
valid grotto
quartz kindle
livid lichen
#

Agree.

quartz kindle
#

its like you're trying to write a book in japanese without knowing how to draw their alphabet

earnest phoenix
#

hmmm

#

Ok

#

Do u know where i can start learning at?

quartz kindle
#

there are many websites that offer free courses and lessons

#

just google "learn javascript"

livid lichen
#

I learned from Github.

quartz kindle
#

or something

earnest phoenix
#

Ok

#

Is it alot i need to know?

quartz kindle
#

yes

livid lichen
#

I mostly looked at the comments and remade their scripts by memory.

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

Do u know how long or an estimate time it will take me to learn it?

valid grotto
#

Also, @drifting wedge my bot stopped going online again after 12 hours of uptime, I've already contacted discord.. this sucks lol

quartz kindle
#

idk how smart you are or how fast you learn, could be a week, or a year

earnest phoenix
#

How long did it take u?

drifting wedge
#

its js doe so really cant help

earnest phoenix
#

Also the project im working on rn should i delete it and?

drifting wedge
#

try specifying intents

quartz kindle
#

when i started working on bots, i already had a few years experience with other projects

livid lichen
#

I've been learning for about 3 mouths now. 2 months ago I thought I was ready.

#

Same.

valid grotto
drifting wedge
#

it went ok kind

livid lichen
#

I had 3 years of Roblox's lua coding.

#

That helped big time.

drifting wedge
#

at the start nobody helped and just said learn python

earnest phoenix
#

@quartz kindle Should i delete the project im working on rn?

drifting wedge
#

but i got thru it lmao

drifting wedge
livid lichen
earnest phoenix
#

Ok

drifting wedge
#

take a break

quartz kindle
#

a lot of people are trying to make a discord bot as a first project, but discord bots are not exactly basic, they can be petty advanced

earnest phoenix
#

Well i see u guys in about a month or two when i actually learn js bye bye

drifting wedge
#

what lang is it in?

drifting wedge
#

learning programming is for nerds

earnest phoenix
drifting wedge
#

i just did it from yt tutorials

#

and i ended up fine....

quartz kindle
#

even though i already had a few years of experience, i had to learn many concepts that i didnt know about before to be able to work with bots

livid lichen
earnest phoenix
livid lichen
#

It took me 1.5 years to understand Roblox's lua and it is easy to learn.

quartz kindle
#

yes

livid lichen
#

Even so I was still bad.

#

You are not going to be done in 2/3 months if this is your first time.

earnest phoenix
#

Im very smart

#

But that should matter

quartz kindle
#

it took me about 3 months to get a working version of my first command lol, although its a very complex one

valid grotto
earnest phoenix
#

type fast

#

I like to rush alot of stuff

#

Don't ask

quartz kindle
#

its noticeable lmao

#

do you have the patience to complete the things you rush into tho?

earnest phoenix
#

Yes i have lots of patience

quartz kindle
#

good, you'll needs lots

earnest phoenix
#

But i feel like life is so short so u have to rush everything

kind thicket
#

I mean, 80 something years sounds like a lot

earnest phoenix
#

true

kind thicket
#

And taking your time will also pay off in a lot of cases

earnest phoenix
#

Well see ya maybe about 2 years

#

Cus seems as'

#

Well my friend just dmed me

#

hold on

livid lichen
quartz kindle
#

i started working on a small lib for use in my project, was supposed to take a day or two... its been over a week and its still not ready lol

livid lichen
#

lol

earnest phoenix
#

Well see ya in about ayear or two cus its seems as yall need to have 2 years of knowledge on js and then start coding bots

#

Bye bye

quartz kindle
#

and i accidentally found a pretty big performance issue in javascript in general

quartz kindle
#

ye, there seems to be an optimization bug/flaw with proxies

livid lichen
#

Wow. It's not everyday you find a bug in their proxies.

quartz kindle
livid lichen
#

Ooooooh.

earnest phoenix
#

Hey

#

I found a website and it said is only gonna take me about 30 hours to learn it

#

And im happy

quartz kindle
#

good luck

earnest phoenix
#

Look

quartz kindle
#

yes there are many of those

#

give it a try and see

earnest phoenix
#

ok

livid lichen
quartz kindle
#

let them try it anyway

livid lichen
#

Alright.

#

Just trying to help.

earnest phoenix
#

codecademy has super good courses

livid lichen
earnest phoenix
#

since the url says introduction to javascript i'm fairly certain that course is meant for absolute newbies to javascript & programming

valid grotto
quartz kindle
#

^ no

quartz kindle
#

you can cache a specific member by fetching it

#

guild.members.fetch(id)

valid grotto
#

He's looking for guild.owner

#

message.guild.owner is another way

quartz kindle
#

in case of the guild owner, you can use guild.ownerID as the id to fetch with

livid lichen
valid grotto
#

let owner = message.guild.owner

quartz kindle
#
let owner = await message.guild.members.fetch(message.guild.ownerID)
owner.send()
livid lichen
quartz kindle
#

guild.owner is a getter for guild.members.cache.get(guilld.ownerID)

#

it returns null if the owner is not in the cache

livid lichen
#

exports.run = async(Bot, guild) => {
  let owner = guild.owner;

  console.log(`New guild added: ${guild.name} (Id: ${guild.id})`);

  let TyEnbed = new Discord.MessageEmbed()
    .setTitle(`**Thanks for inviting me!**`)
    .setDescription(`I will ensure I do a great job assisting you. For help, do ${process.env.prefix}Help or ${process.env.prefix}Commands`)
    .setTimestamp()
    .setColor("#0099ff");

    owner.send(TyEnbed)
    .catch(err => {
      console.error("Failed to send message to USER. Error: ", err)
    });
}; ``` This is the full .JS.
livid lichen
valid grotto
#

That's on guildCreate?

livid lichen
#

I am using fs.readdir("./events/", (err, files) => {.

valid grotto
#

Ah okay, then try let owner = guild.members.fetch(guild.ownerID)

quartz kindle
#

i already posted the solution lol

valid grotto
#

rofl

#

brain's a bit wonky right now

final exam tickNo
going to discord tickYes

valid grotto
#

not joking though, precalc exam right now lol

queen hamlet
#

I need help.
How do I make the bot reply in multi-line messages when run a command?
Multi-Line doesn't work for me.

ivory seal
#

can i have a timeout for like 24 hrs?

queen hamlet
#

/n doesn't work.

quartz kindle
#

its \n

queen hamlet
#

Oh, thank you.

ivory seal
#

can timeout's be for more than 24 hrs+ without having a error? or is there a limit for tha

quartz kindle
#

there is no limit

#

but they only last while your bot is running

#

if your bot dies/crashes/restarts, the timeout is lost

livid lichen
#

@valid grotto owner.send is not a function?

quartz kindle
#

did you not see my answer? lmao

livid lichen
#

brain dumb

twilit geode
#

so this is probably a really dumb question, and a link to a tutorial if one would be wonderful, but in java, you can make seperate objects inside of classes, that you can call up from other classes, as long as everything is public... how do you do that in js

livid lichen
#

I don't have messsage in my event.

valid grotto
#

Remove the message then

quartz kindle
#

replace message with whatever is appropriate

livid lichen
#

I will try? Thanks.

valid grotto
#

guild is already cached

quartz kindle
#

there shouldnt be any issue doing the same

livid lichen
#

Owner.send is not a function.

twilit geode
#

so how would i go about specifying that a certain thing should be used as Class.object()

quartz kindle
livid lichen
#

Same error.

quartz kindle
#

console.log it

livid lichen
#

Log what?

quartz kindle
#

the owner

livid lichen
#

I think I am going to just scrap the whole DM idea.

quartz kindle
#

its more about how you call it than how you declare it

livid lichen
#

Thanks for the help though.

twilit geode
#

fml

#

js is so stupid lol

quartz kindle
#

lmao

livid lichen
#

hashflushed I has brain damage.

hollow sedge
#

how is that stupid tho

#

if anything that makes it easier

quartz kindle
#

you're are trying to implement interfaces? or call class methods from other classes?

valid grotto
livid lichen
twilit geode
quartz kindle
#

you can do that using .call(thisarg)

hollow sedge
livid lichen
twilit geode
#

@hollow sedge for the record i dont think your attacking me

#

i just like everything nice and understandable

hollow sedge
#

oh ok, I thought you were talking about me

livid lichen
#

One famous person has an opinion and tweets about in and the next ting you know everyone is attacking that person for it.

twilit geode
quartz kindle
#

for example ```js
class A {
abc() {}
}
class B {
xyz() {}
}

a = new A();
b = new B();
b.xyz.call(a) // calls xyz using the a instance and the "this" variable

twilit geode
#

wait do i need to call a class?

queen hamlet
#

I'm just a ✨ beginner ✨

quartz kindle
#

the call function lets you override the "this" variable

twilit geode
#

i think what we think a class is is different

quartz kindle
#

so you override it with the context from a different class instance

queen hamlet
#

Also, for some reason EMBED doesn't work for me.

livid lichen
#

Does anyone know some command ideas?

twilit geode
queen hamlet
livid lichen
opal plank
#

its not about works better

twilit geode
#

i just got berrated for using const and var...

opal plank
#

next person saying var will get slapped

queen hamlet
#

I use glitch.com cause my laptop can't download discord.js :)

twilit geode
#

ty btw @quartz kindle

quartz kindle
twilit geode
queen hamlet
#

?

twilit geode
#

glitch does not do well with bots

queen hamlet
#

I know but it was all I could do.

twilit geode
#

repl is what i use to host/test my betas

queen hamlet
#

My laptop can't download the discord.js plugin.

livid lichen
#

I researched on some free hosting. There was none.

twilit geode
#

repl is glitch but better

queen hamlet
#

Free hosting?

queen hamlet
#

There's a lot of free hosting.

#

It's just not legal

livid lichen
twilit geode
#

i never did lol

livid lichen
#

I know.

quartz kindle
#

the best free hosting is google's f1-micro compute engine

valid grotto
quartz kindle
#

but you need a credit card to register

queen hamlet
#

setInterval(async () => { await fetch('project link').then(console.log('Pinged!')) }, 240000)
I use that ^^ to keep my bot online 24/7

twilit geode
quartz kindle
#

lmao

valid grotto
#

Github student pack christmasthink

livid lichen
twilit geode
livid lichen
opal plank
#

using uptimers is against their tos iirc, but pls, keep telling me how legal free hosts are mmulu

twilit geode
livid lichen
opal plank
#

tim can i slap them?

quartz kindle
#

i saw a guy that was literally hosting his bot using github actions

opal plank
#

pls

hollow sedge
queen hamlet
twilit geode
# queen hamlet huh

i guarantee that your bot is not up 24/7, if the thread is not active at least once within a 5 min period, it stops it

opal plank
#

hosting shit on gitbug

livid lichen
#

Haha nice try.

opal plank
#

bruh

twilit geode
#

also

#

you do realize a pi zero is like 10 bucks

valid grotto
#

Massive F @livid lichen , I reapplied with a proper document though, so I'm positive I'll get accepted

twilit geode
queen hamlet
twilit geode
livid lichen
queen hamlet
#

chile anyways so

livid lichen
#

F

valid grotto
opal plank
#

please, do tell me about legal stuff

twilit geode
#

you can't be right, because if your right, that means I'm wrong; and I dont like that

opal plank
valid grotto
#

Just use replit, pretty sure they allow uptime pinging

livid lichen
#

@opal plank You need to boost them to use Glitch's services.

opal plank
#

at that point use a fucking vps

#

you already paying, pay for a proper host

queen hamlet
livid lichen
#

I just use my computer.

opal plank
#

to boost them you need money no?

twilit geode
#

i like repl, its super easy to work with the other devs, and hey, it can upload to github!

livid lichen
#

The only problem is my s wifi.

opal plank
#

did you even bother reading what i sent?

hollow sedge
queen hamlet
opal plank
#

pinging services is against glitch's tos

twilit geode
valid grotto
hollow sedge
#

oh if you're just testing then it's great

opal plank
#

wtf im reading

#

discord is a plugin?

queen hamlet
opal plank
#

bruh this chat

#

im out

livid lichen
#

Do you have Windows?

queen hamlet
hollow sedge
livid lichen
#

I cannot help then.

hollow sedge
#

maybe i gave them additional documents, i dont remember

queen hamlet
hollow sedge
#

lol

livid lichen
twilit geode
queen hamlet
twilit geode
#

LOL

livid lichen
queen hamlet
# twilit geode ewwwwwwwwwwww

I just have mac cause I do online learning and it is SO HARD on windows like, my teacher only assigns stuff that is only available on GOD DAMN MAC.

twilit geode
valid grotto
#

Have you installed node.js? @queen hamlet

quartz kindle
#

get a better teacher

queen hamlet
queen hamlet
twilit geode
#

i wish to keep my pings crispy

livid lichen
twilit geode
#

CRISPY THEY WILL BE

quartz kindle
#

ws ping or rest ping?

queen hamlet
quartz kindle
#

@oak sentinel

queen hamlet
#

Nice!

twilit geode
#

uhh

twilit geode
quartz kindle
#

they dont add new ones

#

not sure if they removed old ones

twilit geode
#

well its gonna limit to 50... so let the battle Math.random() begin

livid lichen
#

92ms. Is that good?

twilit geode
#

yea

#

anything under 150 is pretty nice

quartz kindle
#

its gonna be limited to 50?

#

lmao

livid lichen
twilit geode
vague imp
queen hamlet
#

Someone that codes discord.js help me with embeds all of the codes I tried not working.

vague imp
queen hamlet
#

Okay um so.

vague imp
#

Sue her and get money to buy mac

queen hamlet
#

Whenever I do a embed reply, it doesn't work.

twilit geode
queen hamlet
#

Embed reply just doesn't work.

livid lichen
#

All the newer devs like me are shitting their pants because they cannot get the badge. 😳

quartz kindle
#

"all codes i tried are not working" means you're trying to copy paste random code?

queen hamlet
quartz kindle
#

rip

vague imp
#

Lol

queen hamlet
#

I just type what random people type

#

And it works πŸ‘

vague imp
twilit geode
queen hamlet
#

Sometimes gives a cute bug too πŸ‘

livid lichen
#

πŸ‘

queen hamlet
vague imp
#

Seems like real and legit coder to me

twilit geode
#

that should send the embed...

#

with a ping to the user who issued the command

#

does it not???

quartz kindle
#

inb4 "embedName not defined"

queen hamlet
#

The one I "copied" is message.channel.send that uses for normal responses.

twilit geode
quartz kindle
#

built or copied?

#

xD

queen hamlet
twilit geode
#

so you have no embed?

queen hamlet
queen hamlet
twilit geode
#

mmmmm

quartz kindle
#

show the embed you tried

queen hamlet
#

Lemme just copy and paste it from a random guy again.

hollow sedge
#

bruh

quartz kindle
#

lmao

twilit geode
twilit geode
quartz kindle
#

^ heres your random guy

twilit geode
queen hamlet
#

YouTube How to make your bot reply with embed no scam no hack no fake no bug 2020

quartz kindle
#

lmao

hollow sedge
#

that's how you find the best videos though?

queen hamlet
quartz kindle
#

the best videos to laugh at

hollow sedge
queen hamlet
#

And "No clickbait"

hollow sedge
#

yeah come on are you an amateur?

queen hamlet
#

yes

twilit geode
#

@queen hamlet will you post your embed code?

queen hamlet
#

What I do is after I click on a video, I pause it, I scroll to the desc, if they do not have the code, I go to a diff.

queen hamlet
hollow sedge
#

lol

#

inb4 mod who never comes here goes like "alright this is getting off topic"

quartz kindle
#

Lol

twilit geode
quartz kindle
#

99% of the time the code they post depends on code made in other videos

#

which you dont have

hollow sedge
#

tbf you arent a great youtuber if you dont put your code in the description

quartz kindle
#

just... learn js?

#

read the docs?

twilit geode
hollow sedge
#

they dont care about that, they just want to make a discord bot

#

so it doesnt matter how they get there

quartz kindle
#

i mean

hollow sedge
quartz kindle
#

the docs literally explain everything WITH EXAMPLES

#

lmao

queen hamlet
#

I'm searching a tutorial and I find a tommyinnit video.

hollow sedge
#

yeah if you're going to copy from somewhere, why not actually copy from the docs?

twilit geode
#

lol

quartz kindle
#

you dont need pictues?

twilit geode
queen hamlet
#

The code looks like:
.setTitle
.setDescription
and sumth like that.

twilit geode
#

...

quartz kindle
#

thats correct

twilit geode
#

yes

#

sorta

queen hamlet
#

But doesn't work.

quartz kindle
#

then you did it wrong

twilit geode
queen hamlet
#

But there was no errors,

twilit geode
#

so we can see whats wrong

queen hamlet
quartz kindle
#

code is like a puzzle, you can have code that works, but if you cant fit it with the rest of your code, i wont work

twilit geode
#

@queen hamlet do you want to see an example?

quartz kindle
#

fuck its 3 am

#

i need sleep

twilit geode
quartz kindle
twilit geode
#

too small; cant read

quartz kindle
twilit geode
#

ARE YOU ON LYNUX TIM?

quartz kindle
#

no lul

twilit geode
#

fancy clock then

quartz kindle
#

its windovs

twilit geode
#

πŸ€¦β€β™‚οΈ im stupid

quartz kindle
#

windos tzen

twilit geode
#

thats how often i look at the windows calendar

#

clock thing

quartz kindle
#

ex dee

twilit geode
#

oh god

#

my furniture

#

its levetating

#

xD

quartz kindle
#

how high are you

twilit geode
#

nou

quartz kindle
#

wrong answer

twilit geode
#

sorry officer

quartz kindle
#

the only correct answer is "yes"

pale vessel
#

yes

quartz kindle
twilit geode
#

oh ik lols

quartz kindle
#

anyways i go slep, c yaa