#development

1 messages ยท Page 1568 of 1

umbral zealot
#

made a bunch of servers?

#

just for the bot?

spiral crag
#

he thought he was supporting my bot

fathom slate
#

1621_pink_hair_cry Why didn't anyone help me: <

spiral crag
#

by adding it to new servers

umbral zealot
#

Well let him know he's not!

smoky herald
#

hmmm, if one of my shards crashes on like an undefined variable or whatever, it just autorestarts, it doesn't really feel right to keep the app running with an error in there ๐Ÿ‘€

gilded olive
#

if that's the case you can edit the file, save it and then restart that shard manually?

smoky herald
#

not sure who is misunderstanding ๐Ÿ˜† the problem is, if the error gets to the real bot even through testing on dev version and a crash appears, it basically keeps running with that error still in code, not shutting down

gilded olive
#

tho undefined variable sounds like that would be global scale

#

if you have a real bot in prod any testing should be done on a clone

#

tho I don't understand "it basically keeps running with that error still in code, not shutting down"

cinder patio
#

you could detect when the error occurs and shut down the process (process.exit())

crimson vapor
#

so does it stop working?

#

it seems to me like instead of shutting down, it just logs the error

smoky herald
# gilded olive tho I don't understand "it basically keeps running with that error still in code...

nah, I just had a piece of commented code from past which was prepared for the future but unmodified for the principle, what I'm trying to get to know by that is how I should handle it

discordjs sharding manager makes it autorestart and keeps running it with that error, canceling all collectors in progress, if it would be a frequent error, I don't think restarting each 5 minutes would be good for users ๐Ÿ‘€

the testing is done on dev version, but what if the error gets in the prod version

crimson vapor
#

which is what is supposed to happen to stop the bot from restarting 100 times

smoky herald
#

it crashes and reboots the shard

crimson vapor
#

and you want it to not?

smoky herald
#

doesn't crash the whole app nor the specific shard

crimson vapor
#

stop

smoky herald
#

I think I should not right? restarting the shard shuts all the active collectors for all users

crimson vapor
#

you just said it reboots the shard

smoky herald
#

I'd rather deal with few hours blackout ig

crimson vapor
#

now you say it doesn't crash nor reboot

#

you can catch all errors or unhanded rejections

fathom slate
#

If I send a message containing 'name', can the bot reply 'You name Seku' ???

crimson vapor
#

if message.includes('name') message.channel.send('Your name is' + message.author.username)

gilded olive
#

yea you shouldn't restart the shard on every error

crimson vapor
#

depends on what type of error

earnest phoenix
#

!bid

crimson vapor
#

if its the ws dying, might want to restart

smoky herald
# crimson vapor now you say it doesn't crash nor reboot

I guess I formatted that incorrectly, it throws the error and reboots the shard

I think I should rather crash the whole app when that occurs, right?

my sharding manager has CLI --unhandled-rejections=warn, but undefined variable isn't a rejection, right?

crimson vapor
#

assuming you don't have a reconnection ws

crimson vapor
#

they may have unexpected side-effects though

smoky herald
#

so I could do like

process.on('unhandledException', process.exit())

to shut the whole app (all shards) when an error like that occurs?

#

as said, I don't wanna keep it running when an error other than rejection occurs

cinder patio
#

send a message to the master process, which then sends a message to all shards, and when a shard receives said message, process.exit() is called

crimson vapor
cinder patio
#

yes only the shard in which the error occured

smoky herald
#

alright, I'll give it a try, thank you ๐Ÿ˜„

snow urchin
shy turret
#
    let container = docker.getContainer(id);

    container.exec({
      AttachStdin: true,
      AttachStdout: true,
      AttachStderr: false,
      Cmd: ["-it", "echo", command]
    }).then(exec => {
      exec.start( { hijack: true, stdin: true } );
    });
#

I've been playing with dockerode, but I can't seem to find a way to execute a (Minecraft server) command using it.

#

Is there any way to send (Minecraft server) commands using dockerode?

#

command is "stop"

#

There's no errors, but it doesn't work.

#

I could start/stop/kill/view the console/list all servers with dockerode though.

spiral crag
#

guys i am in discord.py, i used guild.owner but i got none

#

does anyone know why

earnest phoenix
#

the owner isn't granted to be in cache

spiral crag
#

so is there a solutio

#

*solution

earnest phoenix
#

fetch the owner using the owner id

spiral crag
#

but that gives me the id

#

not the name

#

how would i get the name

#

@earnest phoenix

earnest phoenix
#

my internet's taking a shit so i can't browse the docs

spiral crag
#

oh

#

sorry

earnest phoenix
#

yes it gives you the id

#

that's why i said fetch the owner using the id

spiral crag
#

how do i do that

agile lance
#

see fetching owner doesnt work half the time fir me

#

message.guild.owner returns undefined as well lol

spiral crag
#

how do i fetch someone with their id

fathom slate
#

hmm

crimson vapor
#

you need to format it

dusky sundial
agile lance
quartz kindle
#

await guild.members.fetch(guild.ownerID)

agile lance
#

but without the server member intent (on my next bot being released) I can fetch guild owner np

fathom slate
crimson vapor
#
#

djs docs

#
#

js docs

#

I left it formatted wrong on purpose

fathom slate
crimson vapor
#

so you would have to understand what you were doing

agile lance
#

lol

fathom slate
#

sad

agile lance
#

Let me ask you something Seku

#

Do you know what a if statement does?

fathom slate
#

yes

agile lance
#

Ok so think of it like this in java

#

if (this happens) { this happens }

Read it as: If ( I do this) then this happened

earnest phoenix
#

reading the docs will give you more clarification

agile lance
#

Its kinda like when doing math equations you need to put ( and ) at the start and end of the statement

#

say for like

dusky sundial
#

I do recommend learning proper syntax and some basic coding before delving into making a discord bot though

agile lance
#

Date.now() - 100, You would put it like (Date.now() - 100), same thing with if statements you have to put it in parentheses

earnest phoenix
#

the latter part is

#

but you don't need parenthesis in the former example

agile lance
#

parentheses are recommended when doing the math

#

Because, Without the parentheses I get NaN alot

earnest phoenix
#

sure

fathom slate
earnest phoenix
#

for complicated operations

mellow kelp
#

ah yes

#

meth

agile lance
earnest phoenix
#

exactly

#

ergo parenthesis are obsolete in that example

#

I need some opinions.
So currently, i'm in the process of coding another bot named GameCord.
It will include an economy... Since there's nothing huge to it, in my opinion, I believe that a local SQLite file will be fine for storing the data.
Since users will only earn cash when using commands and not chatting, I don't believe concurrency should be an issue.
I don't want to have to use MongoDB or any other database since it's not really worth the effort when all I store is wallet balance and bank balance.

Can I get some opinions on this?

pale vessel
#

Sounds good

earnest phoenix
#

So it should be fine?

pale vessel
#

Yes

#

SQLite is fine

earnest phoenix
#

Okay, thank you.

pure lion
#

Especially for discord bots ^^

earnest phoenix
#

Sounded like sarcasm?

#

lol

pure lion
#

Big databases, SQL or nosql based, are generally way overkill for discord bots

#

It's realistic to store as little as possible too

earnest phoenix
#

Oh, well SQLite is super easy to implement, but tbh so is mongo, but mongo isn't really worth it

#

That's the only two db's I know how to use atm ๐Ÿ˜‚

#

Should I also make regular backups of the SQLite file?

pure lion
#

Where do you host?

quartz kindle
#

im using sqlite as well

earnest phoenix
#

Wdym?

#

Where do I host my bot?

pure lion
#

Yeah

earnest phoenix
#

Hostwinds VPS

#

Switching to GalaxyGate soon

pure lion
#

No need to back it up then

#

Assuming your provider gives free backups

earnest phoenix
#

Does it make backups itself?

#

Didn't think of that, let me check

pure lion
#

Nah but it's not like the file will just disappear

quartz kindle
#

i back it up daily

pure lion
#

It's not a JSON database, it won't corrupt as often

quartz kindle
#

and delete backups older than 5 days

earnest phoenix
#

Tbh, i'd rather back the SQLite file itself rather than everything

pure lion
#

I auto backup 3 times a day because I bash 8)

quartz kindle
#

sqlite has a built in backup function

earnest phoenix
#

What intervals do you backup at?

#

Tim

pure lion
#

Kinda redundant for nosql but who cares

quartz kindle
#

once per day

earnest phoenix
#

Any specific time?

#

Or just any time

pure lion
#

Doesn't really matter

quartz kindle
#

just any time

#

1 day starting from process start

earnest phoenix
#

Do you manually do it or do you have a script?

quartz kindle
#

i use the built in function, with extra code to delete past backups

pure lion
earnest phoenix
#

lmao

pure lion
#

The timgineer

earnest phoenix
#

lmao

quartz kindle
earnest phoenix
#

o

#

can i nab ur code? โค๏ธ

quartz kindle
#

sure

earnest phoenix
#

legend, thank you

quartz kindle
#

which npm module are you using for sqlite?

earnest phoenix
#

sqlite3

quartz kindle
#

use better-sqlite3

pure lion
#

"it's just better"

quartz kindle
#

^

earnest phoenix
#

Is it the same format or is it different?

quartz kindle
#

idk, never used sqlite3

#

the api should be different because better-sqlite3 is synchronous

#

no callbacks

old cliff
#

you can just use enmap

#

for sqlite3

earnest phoenix
#

No?

#

lol

quartz kindle
#

enmap keeps a copy of everything in memory

old cliff
#

use josh then

earnest phoenix
#

evie.codes fan lol

pure lion
#

why use a wrapper when you can get skillz

old cliff
#

it saves time

pure lion
#

get realโ„ข๏ธ

earnest phoenix
#

innitโ„ข๏ธ

old cliff
#

sometimes you should be lazy

pure lion
#

no u

quartz kindle
#

sqlite is super easy to use tho

old cliff
#

and use packages available

earnest phoenix
#

It really is lmao

#

just setup a simple CRUD operation and ur sorted

#

ran from expressjs

#

How many operations can sqlite handle at one given time, any idea?

#

queries*

quartz kindle
#

depends on the query ofc

#

but easily hundreds per second

earnest phoenix
#

So a bot which is in like 10,000 would be fine?

#

If it only gets the user from the database when they use a command

#

And not when a message is sent

quartz kindle
#

sure

#

thats what i do on mine

#

plus i cache the user for 24 hours

earnest phoenix
#

Oh damn, that's smart

quartz kindle
#

i have a db with about 27k rows

earnest phoenix
#

damn

#

How big is the file lol

quartz kindle
#

SELECT * FROM users WHERE id = 'my id here'

#

takes anywhere from 0.2ms to 0.9ms

earnest phoenix
#

Whats your bot?

quartz kindle
#

the file is about 15mb

#

bot's name is "Astrobot"

#

with lowercase b, there is another bot with the same name but uppercase B on top.gg

#

lol

earnest phoenix
#

yes

#

can anyone help

#

me wiht my bot

#

ew

#

what a nerd, copying bot names

#

me learning java currenly

#

hello

#

Learn JS, not Java ๐Ÿ™‚

pale vessel
#

no

earnest phoenix
#

java in 2021 is only useful for minecraft modding KEKW

pale vessel
#

how about neither

earnest phoenix
#

hey

#

recommend me best

quartz kindle
#

@earnest phoenix running a non-indexed LIKE %% query that matched 7k rows took 50-200ms

earnest phoenix
#

oh wow

quartz kindle
#

running count(*) takes 0.3ms - 1ms

glacial pagoda
#
    name: 'memberinfo',
    description: "COMMANDS!",
    execute(message, args, Discord) {
        const usernamemention = messagearg.username;
        const avatarmention = messagearg.avatarURL({ dynamic:true });
        const idmention = messagearg.id;
        const tagmention = messagearg.tag;
      
        const lastmessagemention = messagearg.lastMessage;
        const Statusmessagemention = messagearg.presence.status;
        const messagearg = message.mentions.members.first();

        if(messagearg){
        const infoembed = new Discord.MessageEmbed()
        .setColor('RANDOM')
        .setTitle(`**${usernamemention}'s Information**`)
        .setAuthor(`${usernamemention}`, `${avatarmention}`, `${avatarmention}`)
        .setDescription(`Every Bit Of Detail About ${messagearg}!`)
        .setThumbnail(`${avatarmention}`)
        .addFields(
            {name: '**Username:**', value: `**${usernamemention}**`, inline: true},
            {name: '**User Tag:**', value: `**${tagmention}**`, inline: true},
            {name: '**User Id:**', value: `**${idmention}**`, inline: true},
            {name: '**Status:**', value: `**${Statusmessagemention}**`, inline: true},
            {name: '**Last Message:**', value: `**${lastmessagemention}**`, inline: true},
            )
        .setImage(`.avatarmention}`)
        .setTimestamp()
        .setFooter('I Told You, Every Detail...', `${avatarmention}`);

        message.channel.send(infoembed);
        }
    }

    
}```
#

Help

#

I Want The Bot To Take The First Person Mentioned After Command And Put It In The Embed

#

I got This Error Doe

quartz kindle
glacial pagoda
#

Yeah

#

Im trying To Put The person There And The String To Get The personed mention's usename

quartz kindle
#

if you did not understand what im pointing out

#

you're trying to use messagearg before you create it, when it still doesnt exist

#

the order of variables matters

glacial pagoda
#

Oh

#

So Put It Above

quartz kindle
#

yes

glacial pagoda
#

Ok

#

I thought it didnt matter lol

quartz kindle
#

the only place where it doesnt matter is when creating functions using the function keyword

#

for everything else it matters

glacial pagoda
#

I got a new error

quartz kindle
#

message.mentions.members.first() returns a member

#

members do not have .avatarURL()

#

only users have

glacial pagoda
#

oh

quartz kindle
#

you can convert a member to a user using member.user

glacial pagoda
#

ok

crimson vapor
#

Tim do you know some ts?

#

I am trying to export an enum or something similar as part of a class

glacial pagoda
#

soconst messagearg2 = message.mentions.user.first();

#

const avatarmention = messagearg2.avatarURL({ dynamic:true });

#

That Tim?

quartz kindle
#

also possible yes

crimson vapor
#

ex. Class.x would be the enum so I can do Class.x.TRUE and get 1

glacial pagoda
#

Ok

crimson vapor
#

how should I do that @quartz kindle

quartz kindle
#

mentions.users

#

in plural

glacial pagoda
#

ok

quartz kindle
#

show call of duty

crimson vapor
#

I don't exactly have any cod

cinder patio
crimson vapor
#

hmm

#

then how can I say Class.x.TRUE and have it typed?

cinder patio
#

You should just put the enum in the same file the class is in and export it

crimson vapor
#

I need to export it as part of the classs

quartz kindle
#

something like this should work no? ```js
enum bla {
...
}
export class abc {
static x: bla
}

crimson vapor
#

I could do js this.x = { "TRUE": true, "FALSE": false } in the constructor but then its not typed

#

I would prefer to keep everything part of the main class

#

I don't think I can do that Tim

#

lemme try

cinder patio
#

then.. you'd do this:

enum Smth {
  A, 
  B,
  C
}

class A {
  x: typeof Smth
  constructor() {
      this.x = Smth;
  }
}
quartz kindle
#

ye but he wants it as a static prop

#

not on the instance

#

i think

#

you want to access MyClass.x? or a = new MyClass(); a.x?

crimson vapor
#

new

cinder patio
#

Then

enum Smth {
  A, 
  B,
  C
}

class A {
  static x = Smth;
}

crimson vapor
#

its already an instance

quartz kindle
#

ah then do google's first answer

crimson vapor
#

I think yours actually will work GoogleFeud

cinder patio
#

both of mine will work cause I tested them

#

but I just find it super unnecessary

#

just export the enum and make it const

#

100% more efficient, slightly different code

frigid warren
#

is there anyone who knows the pass array argument to the broadCastEval in discord.js

feral aspen
#
// server.mutedRole = Mute Role ID
const muterole = message.guild.roles.cache.get(server.mutedRole);
if(mutee.roles.cache.has(muterole)) {
                embedError.setDescription(`${mutee.user.username} is already muted!`);
                return message.channel.send(embedError);
            };

Not returning...

grizzled raven
mellow kelp
#

probably p was undefined by the time you assigned it to e

#

wait that doesn't make sense either

grizzled raven
#

no

mellow kelp
#

oh shit

grizzled raven
#

the weird thing is

lyric mountain
grizzled raven
#

if i press up arrow, await p and const e = await p isnt present in history

mellow kelp
#

whoa

lyric mountain
#

unfortunately I didn't find a way to load a text from another site and apply styles to it

#

all I can do is iframe it

#

which looks shit

mellow kelp
#

kekw

quartz kindle
#

if it isnt present in history it means it rever returned, it awaiting forever

mellow kelp
#

ohh yeah true

#

that

quartz kindle
#

therefore the const e also never took place

grizzled raven
#

yes, it is

#

but why

earnest phoenix
#

life is a simulation

mellow kelp
#

can you use await in the console?

#

it didn't seem to output errors but like

#

it doesn't halt the console

quartz kindle
#

the console runs with top-level async enabled

mellow kelp
#

o

#

pog

quartz kindle
#

something node has been promising to do for a while but never did lul

mellow kelp
#

kek

grizzled raven
#

den though there's deno

mellow kelp
#

ah yes, deno

earnest phoenix
#

hello

#

if anyone intrested to help me

mellow kelp
earnest phoenix
mellow kelp
#

node 15 isn't stable yet anyways

quartz kindle
#

idk about running a file, but the node repl doesnt

mellow kelp
#

latest stable version is 14.x.x

earnest phoenix
#

it's fairly stable

mellow kelp
#

hmm

earnest phoenix
#

that's the LTS version

#

can we make a bot in java

mellow kelp
earnest phoenix
#

ok

mellow kelp
#

use the JDA library

earnest phoenix
#

are you also making a bto

#

no

#

it's an AI to conquer the world

#

humanity will cease to exist

quartz kindle
#

also doesnt work in a file

earnest phoenix
#

ok

quartz kindle
fluid crown
#

So, I wrote a description in HTML for my top.gg description, but quickly realized that top.gg doesn't support HTML. Is there a way I can convert what I wrote into an equal value of CSS/Markdown, or do I just have to wait until HTML is supported?

earnest phoenix
#

it does support html

mellow kelp
#

html is supported

earnest phoenix
#

where you making the bot @quartz kindle

fluid crown
#

Not for servers gc8_cry

earnest phoenix
#

oh

#

well

#

markdown is an easy to use alternative to html so you can't really use css in markdown

#

i hate typing on mobile

fluid crown
#

The top image is a slideshow of various background images with the logo on top; there's buttons and whatnot for nav.

#

I don't think markdown supports this, but I could be super wrong.

grizzled raven
#

OH WAIT

#

im so pro

quartz kindle
#

interesting

fierce ether
#

canvas dosent work with node v14?

quartz kindle
#

it does

fierce ether
#

Error: The specified module could not be found.

#

yet its in the package file?

quartz kindle
#

what module was not found?

#

show the full error

fierce ether
#
Error: The specified module could not be found.
\\?\C:\Users\J\Desktop\Commissions\valor\node_modules\canvas\build\Release\canvas.node
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1122:18)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (C:\Users\J\Desktop\Commissions\valor\node_modules\canvas\lib\bindings.js:3:18)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (C:\Users\J\Desktop\Commissions\valor\node_modules\canvas\lib\canvas.js:9:18)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)```
quartz kindle
#

did you recently change node version?

fierce ether
#

no

#

ages ago

quartz kindle
#

did you copy/paste the node_modules folder?

fierce ether
#

nope

#

fresh

quartz kindle
#

and you just run npm install canvas?

fierce ether
#

its

#

discord-canvas

#

and yes

#

jus re-ran npm i same thing tho

quartz kindle
#

when you installed discord-canvas did it show any logs about canvas?

#

also why the fuck does discord-canvas require fortnite

fierce ether
#

nope i even tried npm i canvacord same thing

quartz kindle
#

both of them use canvas

#

and canvas is a native module

#

requires compiling

#

run npm rebuild canvas

fierce ether
#

oh may of worked

kind kayak
#

I need help

#

como hago esto

const dato1 = args[1];
const dato2= args[2];
const datos1 = ["perro","gato"];

if (dato1 no existe o no es igual a datos1 )

pale vessel
#

si si

kind kayak
#

how I do this

const data1 = args [1];
const data2 = args [2];
const datas1 = ["dog", "cat"];

if (data1 does not exist or is not equal to datas1)

pale vessel
#

const data1 const data1

tawdry yarrow
#

You said data1 twice

#

Assuming you meant data2 the second time

#

You can try this

kind kayak
#

Now

tawdry yarrow
#

if(!data1 || data1 !== data2)

#

It still says data1

kind kayak
#

I edit now

tawdry yarrow
#

"data1 does not exist or is not equal to data1"

#

I am talking about this

kind kayak
#

Reedit

tawdry yarrow
#

Ah okay

tawdry yarrow
#

if(!data1 || data1 !== datas1)

kind kayak
#

Ok i test

tawdry yarrow
#

Alright

kind kayak
#

Wait

tawdry yarrow
#

?

quartz kindle
#

you want to check if data1 exists and is perro or gato?

#

if(["perro","gato"].includes(data1.toLowerCase()))

tawdry yarrow
#

I think he just wants to see if it is not equal to datas1

quartz kindle
#

datas1 is an array

tawdry yarrow
#

Ik

quartz kindle
#

a string cannot be equal an array

tawdry yarrow
#

True

#

Maybe he didn't word it very well

#

But we should make sure he clarifies before confusing him

kind kayak
#

const nick = args[0];
const edad = args[1];
const sexo = args[2];
const generos = ['masculino', 'femenino'];

if(!nick) {
message.channel.send("Uso de Registro : \n //reg nickname edad sexo")
} else if(!edad) {message.channel.send(" โŒ | Olvidaste poner tu edad \n Debes escribir: Nick Edad Sexo \n en orden")}
else if(!sexo || sexo !== generos) {message.channel.send(" โŒ | ese genero no existe \n Debes escribir: femenino o masculino ")}
else {
message.channel.send(**Nickname: **${nick} \n **Edad: **${edad} \n **Sexo: **${sexo})

Help me where are the error?

fierce ether
#

if im correct user dosent have a roles property?

    const roles = ['Testing', 'Tester One']
    if(user.roles.indexOf(roles)) return```
mellow kelp
#

nope

#

you're probably looking for a member instead

fierce ether
#

its not reaction.message.member tho?

mellow kelp
#

not sure

mellow kelp
#

wait there's really a discord library for php

#

what the

kind kayak
#

I use js

mellow kelp
#

ik i was just saying something

pale vessel
#

Isn't it just REST though

quartz kindle
feral aspen
#
// server.mutedRole = Mute Role ID
const muterole = message.guild.roles.cache.get(server.mutedRole);
if(mutee.roles.cache.has(muterole)) {
                embedError.setDescription(`${mutee.user.username} is already muted!`);
                return message.channel.send(embedError);
            };
``` Anyone knows why it's not returning?
earnest phoenix
lyric mountain
#

are you retrieving from cache?

feral aspen
lyric mountain
#

if you are getting the count from the cache

feral aspen
#

Ah

feral aspen
#

But about my question, do you know anything about it?

lyric mountain
#

that's your answer

#

"are you retrieving from cache?"

feral aspen
#

?

earnest phoenix
#

sorry I didn't read what you were saying

lyric mountain
#

I need to know that

#

are you getting the count from the cache?

earnest phoenix
#

yes

lyric mountain
#

or iterating over each guild and storing the count in a variable?

#

oh, nvm, I thought it was hamood's question lul

lyric mountain
feral aspen
#

Ah

agile lance
#

How can I get the server count of my bot to show? client.guilds.cache.size returns "Cannot read property of โ€˜cacheโ€™ of undefined"

earnest phoenix
#

so how do i get the exact total?

lyric mountain
feral aspen
#

I will write.

lyric mountain
agile lance
#

When I log 'client' it does have a guilds property

dusky sundial
earnest phoenix
#

except that it is not the guild total but the user total

agile lance
lyric mountain
dusky sundial
# agile lance js

Never used js, but I'm assuming just client.guilds.size doesn't work?

lyric mountain
#

if you want guilds it's easier then

agile lance
earnest phoenix
#

not the total guild

lyric mountain
#

iterate over the guilds, retrieving total member count

agile lance
#

but when logging client it does look like it goes like this client => guilds => cache then I can use client.guilds.cache with a .size to get the amount

earnest phoenix
#

k

agile lance
#

I dont get it

lyric mountain
#

then we know your issue ain't inside that clause

#

check the conditional

agile lance
#

It returns undefined but it still has the property

lyric mountain
#

if you console.log "mutee.roles.cache" what does it output?

feral aspen
#

Instead the if statement or outside?

agile lance
#

How is mutee defined?

feral aspen
#

let mutee = message.guild.member(message.mentions.members.first() || message.guild.members.cache.get(args[0]));

agile lance
#

try to do this

#

message.mentions.users.first()

#

just that

feral aspen
#

Sure.

agile lance
#

Thats how I have defined it in the past and it worked np

feral aspen
#

Didn't work, it still mutes him even though he is muted.

#

ONE SECOND...

agile lance
#

redefine mute role has

#

as

feral aspen
#

nevermind, it didn't console log anything inside the if statement.

#
if(mutee.roles.cache.has(muterole)) { ... }
#

This doesn't work.

agile lance
#

let muterole = message.guild.roles.cache.get("ID")

#

and then have that stay as

pale vessel
#

has() takes an id

agile lance
#

^^

#

dang he/she beat me to saying it

lyric mountain
feral aspen
#
const muterole = message.guild.roles.cache.get(server.mutedRole);
/// server.mutedRole = The Muted Role ID
agile lance
#

remove server.mutedrole

#

redefine muterole

#

as

#

message.guild.roles.cache.get("ROLE ID")

pale vessel
#

do you even need mutedrole

feral aspen
#

Yes.

pale vessel
#

for?

lyric mountain
#

ig mutedRole is a saved config

feral aspen
#

Yes.

pale vessel
#

sorry muterole

feral aspen
#

MutedRole is the Muted role ID.

lyric mountain
#

use it then

pale vessel
#

Yes

feral aspen
#

server.mutedRole is considered as an ID

pale vessel
#

I meant muterole

lyric mountain
#

.has(server.mutedRole)

agile lance
#

see instead of server.mutedrole I wouldve done let mutedRole; mutedRole = database fetching code

#

and then it can be changed at any time with a command

pale vessel
#

hmm

feral aspen
#

Uh

agile lance
#

but thats my way of doing thi s

#

things*

feral aspen
#

it worked! ๐ŸŽ‰

lyric mountain
#

kudos to flaze

fierce ether
#
if(['Level One', 'Level Two'].some(role => member.roles.includes(role))) return```
#

what am i doing wrong?

pale vessel
#

hmm

lyric mountain
#

I have several questions

pale vessel
#

member.roles is a manager?

#

what's member?

fierce ether
#

reaction.message.member

sudden geyser
#

Does Visual Studio Code randomly open sometimes for anyone?

pale vessel
#

then use array.some(name => member.roles.cache.find(role => role.name === name)) ig

lyric mountain
#

see if vscode is there

#

or check if you didn't link vscode to text files

sudden geyser
#

I don't use Windows so I basically opened the equivalent. Visual Studio Code isn't running, but a process named "Code Helper (Renderer)" is ๐Ÿค”

#

Which has some open files/ports pointing to VSC

lyric mountain
#

idk, never seem that

fierce ether
#
 if(roles.some(name => member.roles.cache.find(role => role.name === name))) return user.send(user, noRole)``` keeps returning even if they have the role
earnest phoenix
#

how do i send videos in discord py
embed

#

you can't

#

you can only upload video files

#

๐Ÿ˜ฆ

#

looks like proxy time

uncut kernel
#

Looking for testers for my discord bot! They need to test my bot and give me feedback! Dm if interested!

#

Is it legal to post that here?

#

@lyric mountain

lyric mountain
#

no

uncut kernel
#

Ok

#

Anyway

#

Can you help me test?

lyric mountain
#

mods will tell u to check for fiverr or freelancer

uncut kernel
#

I tested myself in an alt

#

I need some other fredbac

lyric mountain
#

find some friends to help u test

uncut kernel
#

Cuz i might have missed some bugs

uncut kernel
lyric mountain
#

dot dot dot

long marsh
#

I wonder if Tim is around ๐Ÿค”

uncut kernel
#

Tim?

long marsh
#

Yeah, he usually helps out in here. I just wanted to thank him for something ๐Ÿ˜„

uncut kernel
#

Ok lol

#

@long marsh can you help me test my bot if it has any bugs

#

I already tested

long marsh
uncut kernel
#

But i might have missed some bugs

long marsh
#

What's your bot?

uncut kernel
#

Its a multipurpose bot

earnest phoenix
#

I want to start with coding and figured I'd start with a discord bot. I did some research and found out about discord.py for Python, should I start with Python? Or other languages?

uncut kernel
#

Very useful

#

@earnest phoenix python is best ig

earnest phoenix
#

Sorry for disturbing the convo pandasad

long marsh
uncut kernel
#

No problem lmao

lyric mountain
#

starting with bots is hard

#

take your time to learn the language beforehand

long marsh
#

Not necessarily

#

Starting with anything is hard ๐Ÿ˜„

lyric mountain
#

but bots just make it worse

long marsh
#

I learn best from throwing myself in the deepend and climbing my way out, haha

#

My bot just hit 1.5k servers ๐Ÿ˜„

#

๐Ÿš€ ๐Ÿš€ ๐Ÿš€

uncut kernel
earnest phoenix
#

I started learning the basics of Python, I could share the video i learned from. I don't really know how to make use of it though slonk

uncut kernel
#

1.5k

lyric mountain
#

just note that python LOOKS easier, but it's a double-edge dagger

long marsh
#

Agreed

earnest phoenix
long marsh
#

I started with DiscordPy and switched to Discord.js

#

Thanks, everyone!

uncut kernel
#

@earnest phoenix anyways can i ask you a favor?

earnest phoenix
#

Of course

lyric mountain
#

python is a siren that charms you and take you to the bottom of the ocean

long marsh
#

lmao

#

That's fairly accurate, tbh

lyric mountain
#

when you notice you're floating lifeless on a pile of code

long marsh
#

It's really easy to lose yourself in Python code ... ie. spaghetti

#

But, I guess, that's really the same for any language.

#

Python just makes it easier ๐Ÿ˜„

lyric mountain
#

the issue with python is that it's so abstracted that it charms new coders

#

there's a quote for that:

#

"easy, cheap, fast - choose 2"

#

python would be easy and cheap

earnest phoenix
#

I see

long marsh
#

Python can be fast if optimized correctly. Most new learners wouldn't know that though.

lyric mountain
#

the major bottleneck of python is that it's an interpreted lang

#

and doesn't have threads at all

#

python is good for small tasks

#

like automation, routine scripts, etc

long marsh
#

It's 'fake' multithreading ๐Ÿ˜„

lyric mountain
#

which is why it was made

long marsh
#

For example, we use it at my day job for automating CI scripts and build plans ๐Ÿ˜„

lyric mountain
#

yeah, CI scripts are really easy with python

long marsh
#

Yeppers

#

We use a combination of BASH + Python

lyric mountain
#

I use python to retrieve sound name for my stream

long marsh
#

Honestly, I've fallen in love with Javascript. I used to hate it. Once I switched from Python to it ... haven't really gone back.

lyric mountain
#

since IO with it is dirty simple

#

I can't get used to JS, like, I use it for sites and whatever but I don't really like debugging it

earnest phoenix
lyric mountain
#

idk, I'm just not made for interp langs

earnest phoenix
#

Hmm

#

What are interp langs?

uncut kernel
#

Hi

#

@earnest phoenix thanks for testing

earnest phoenix
#

No problem

lyric mountain
#

langs that aren't compiled, just run directly

#

the runtime "interprets" what you're trying to do

#

like

let a = 30;
a = "aaa";

console.log(a);

will output aaa

#

meanwhile in compiled langs it'd output

Cannot convert type String to int
earnest phoenix
#

Oh

mellow kelp
#

ts gokart_doggo

earnest phoenix
#

I think i get it

lyric mountain
#

pros:

  • less vars, less code
  • easier (is it?)

cons:

  • slower
  • howthehelldoIdebugthis
earnest phoenix
#

Lol

mellow kelp
#

easier for small scale

#

hell for medium-large scale

earnest phoenix
#

Scale? thonkku

lyric mountain
#

yeah, code size

mellow kelp
#

project size

lyric mountain
#

actually, complexity size

mellow kelp
#

o

earnest phoenix
#

Ohh

#

So basically

#

Interpreted languages for smaller projects
Non-interpreted languages (?) for bigger projects

lyric mountain
#

kinda

earnest phoenix
#

Do bots contain much code or rather less as for the size?

lyric mountain
#

depends

#

more code not necessarily means more complexity

#

some bots are really simple

#

while others have a whole cobweb regarding methods

#

the most barebones as possible bot would have about 15-20 lines

quartz kindle
#

it depends on the project, you cant really use an interpreted language for an arduino device no matter how small the project, neither can you use a compiled language for a huge project if the project is a web app

#

i mean, technically you can, but you will end up complicating everything to accomplish it

mellow kelp
#

java is like, 80% compiled and 20% interpreted right?

#

it compiles to bytecode, which is interpreted by the jvm

quartz kindle
#

something like that

#

js is also partially compiled by the JIT

mellow kelp
#

yeah

#

the compiled-just-in-time thing?

quartz kindle
#

yes

#

most interpreted languages use it because the benefits are huge

tired panther
#

A question to the reload things, since the commands a saved in a map, theoretically I could overwrite them with same function, which I use to load commands, Is this possible? @Tim#2373

quartz kindle
#

lua has luajit, python has pypy

lyric mountain
#

pypy lul

mellow kelp
#

pp for abbreviation freerealestate

quartz kindle
lyric mountain
#

idk how noone made yet a lib named papaya for python

mellow kelp
#

hm yes

quartz kindle
mellow kelp
quartz kindle
#

it will replace the existing

mellow kelp
lyric mountain
tired panther
lyric mountain
#

p-py py

quartz kindle
earnest phoenix
#

So what would you recommend me to start with?

#

In general in terms of coding

quartz kindle
#

depends, what are your goals?

mellow kelp
lyric mountain
#

I recommend java, but really depends on your goals

#

I'm a bit biased towards java tho

earnest phoenix
#

That's a good question i should've thought about what i even want to achieve

quartz kindle
#

js and python are probably easier for beginners and they have by far the biggest communities out there, which means lots of resources to learn from

#

c# is rapidly growing as one of the best balanced languages

tired panther
quartz kindle
#

java has been around from decades and has multiple ways of using it

lyric mountain
#

use C and quit programming forever

#

ptsd on demand

mellow kelp
#

use binary like a real programmer

lyric mountain
#

newbies don't need ptsd

quartz kindle
#

c/c++/rust are the most performant but harder to use correctly

#

go is also a thing

mellow kelp
#

im learning rust and it's been a blast so far

tired panther
quartz kindle
#

lua is commonly used in videogame scripting

mellow kelp
#

roblox KEKW

lyric mountain
#

^ and mouse scripting

earnest phoenix
#

How about a bot

quartz kindle
#

ruby is also popular for server development, and afaik for rpgmaker

lyric mountain
#

ain't rpgmaker java?

quartz kindle
#

last time i used it, it had ruby scripts

earnest phoenix
#

Many languages i haven't heard of, I'll have to do some more research okeh

quartz kindle
#

to build the actual content, not the engine logic

lyric mountain
#

oh, different versions use different langs

tired panther
quartz kindle
#

with js being like 80% of those

#

lmao

earnest phoenix
#

I see

slim umbra
#

rust Stonks

tired panther
lyric mountain
mellow kelp
#

im gonna try making a bot with rust later on

quartz kindle
mellow kelp
#

wonder how it will turn out pEnSiVe

quartz kindle
#

js is currently the most popular language in the world afaik

mellow kelp
#

wasn't it python or something

lyric mountain
#

make sure to take anti-tetanus shot

quartz kindle
#

oh and dont forget php

#

xD

earnest phoenix
#

I heard Python is also used in data-management or so? Please correct if it's not true MegaThonk

lyric mountain
#

kinda

#

as I said before, python excels in small/objective tasks

mellow kelp
#

it's used for data science or something i think

#

why specifically data science tho?

lyric mountain
#

objective task

earnest phoenix
#

Uhh programming is really complex

tired panther
#

When you can not decide:
make a python to js parser smart

lyric mountain
#

not at all once you get the hang to it

tired panther
quartz kindle
#

python used to be extremely popular for creating small scripts like reminders, automating excel files or download/upload/move files and folders, etc

#

but these days js can do the same with node

earnest phoenix
#

What'd be a good kind of project to get started? You know get the hang of it and so on. Or should i just study as a start?

cinder patio
#

js is also categorized as a scripting language

tired panther
#

@earnest phoenix js has the advantage, you can run it on nearly any browser

tired panther
earnest phoenix
cinder patio
#

That's not why but okฤซ

tired panther
quartz kindle
#

js has always been a scripting language, but before node it was confined to browsers

#

with node, now js can run everywhere

glacial pagoda
cinder patio
#

node.js is a javascript runtime*

earnest phoenix
#

Hmm

quartz kindle
#

for example, before you could code a python file, similarly to how you would do a complext bat or shell file

#

and then just run python file.py

#

and it would work

#

back then no other language could do that

earnest phoenix
#

So

quartz kindle
#

now you can do node file.js

tired panther
#

DIscord bot dboatsSiren

lyric mountain
#

actually, start with a "Hello World" project

mellow kelp
#

like a simple sum calculator

lyric mountain
opal plank
#

avoid starting at discord bots

#

bhad idea

tired panther
opal plank
#

discord bots are advanced projects, dont start with that

earnest phoenix
#

Node is kind of a tool to even be able to program certain things in javascript?

opal plank
#

properly learn before doing something advanced

lyric mountain
#

if you want to have sucess, start with a "Hello World"

#

all good devs start with it

quartz kindle
#

node is a program that interprets and executes javascript code in real time

tired panther
tired panther
mellow kelp
#
Welcome to the calculator!
Type a number:
6
Type another number:
12
Result: 18
tired panther
#

lol wanted to tell

lyric mountain
earnest phoenix
lyric mountain
#

and bugs will haunt your code

glacial pagoda
tired panther
lyric mountain
#

do it then

#

time's up

#

you failed

quartz kindle
#

javascript needs an engine to run on, node is one engine, browsers contain another javascript engine as well

tired panther
quartz kindle
#

there are many engines that run javascript, but the most popular one is called v8 which is used in node and in google chrome

lyric mountain
#

calculator despite being simple help learning basics

earnest phoenix
#

and then you have monstrosities such as chromium built on top of v8

lyric mountain
#

it's easy now, but I bet you couldn't do it that fast when you started

earnest phoenix
#

I did some "Hello World" and other things such as lists and uhh dunno how you call it but for example (Age: ___, you type it in and then the output is: "You are <input> years old") on Python

quartz kindle
#

so if you already have some experience with python, you can stick with it

tired panther
quartz kindle
#

unless you want to move into web development

#

web is javascript land

#

python has no business there

slim umbra
#

false

#

flask is used a ton

lyric mountain
earnest phoenix
#

And what do you mean by running in Chrome or any browser? thonkku

mellow kelp
slim umbra
#

backend is part of web dev skid

lyric mountain
#

making a snake game is also a good exercise

lyric mountain
#

it's kinda simple but involve a lot of knowledge

mellow kelp
#

people just wanna disagree with everyone KEKW

quartz kindle
earnest phoenix
quartz kindle
#

the console is a real time javascript engine

#

you can literally type js code in there and it will work in real time

tired panther
earnest phoenix
#

I pressed f12 and turned on airplane mode KEKW

quartz kindle
#

wtf

tired panther
#

then you are on the laptop probably

glacial pagoda
earnest phoenix
quartz kindle
#

if your laptop has FN keys on

earnest phoenix
#

Yup

quartz kindle
#

then you need to press fn+f12

earnest phoenix
#

Ah yes

#

Works

tired panther
#

ctrl + shift + j or this

earnest phoenix
#

Oh

#

And the code i see right there is JavaScript run on a browser?

quartz kindle
#

yup

earnest phoenix
#

And when i go to console i can type if i want

lyric mountain
#

some laps have it on by default

quartz kindle
earnest phoenix
#

Oh

#

Okay

quartz kindle
#

and you will see the code running

tired panther
earnest phoenix
#

I typer it in

lyric mountain
#

just remember that F5 will clear ur runtime

earnest phoenix
#

I see numbers in a list and it says "undefined" at the bottom

quartz kindle
#

yup, thats the result of the code

earnest phoenix
#

Oh

#

I think

quartz kindle
#

the code means "count up to 10, and each time you count, output the current number"

earnest phoenix
#

You basically said that i = 0 and to count from i to 10

quartz kindle
#

yup

earnest phoenix
#

And that was js?

quartz kindle
#

yup

earnest phoenix
#

Interesting

#

Thanks

quartz kindle
#

although something basic like a for loop exists in almost all languages

weak basin
#

One of the features on my bot is a counting channel. You can set the counting channel and then in that channel it will change the message you send into a webhook (Just the same message basically but has bot next to it) and if it isn't a number it will give a warning message and delete it etc. Would my bot get rate limited if say it was being used actively in 10 guilds and each one was counting 10-20 numbers a minute? It would then be deleting 100-200 messages a min and sending that many webhooks. Should I change it so instead all it does is delete the message if it is not a number? (This is still a test feature not public yet don't yeet my bot from top.gg pls ty)

lyric mountain
#

wtf

#

use line breaks please

weak basin
#

Me?

lyric mountain
#

yep

weak basin
#

Mb

earnest phoenix
#

Python seemed a little easier, but there's not much of a difference probably

lyric mountain
#

that one absolute wall-of-text

glacial pagoda
#

I ned help

#

I keep getting this error

quartz kindle
lyric mountain
#

your variable is undefined

weak basin
glacial pagoda
#

How do i defin it?

earnest phoenix
#

I would've shared what I have learned on Python yet but a few months ago i gave up and deleted it -_-

lyric mountain
#

and webhooks are one-way only

#

there's really no way to make a realtime counting message

weak basin
glacial pagoda
#

What Do i Put?

quartz kindle
#

because the concept is the same, just the syntax is different

lyric mountain
earnest phoenix
#

Ohh

lyric mountain
#

this is very prone to error

earnest phoenix
#

That's great

glacial pagoda
#

Oh Members instead of users

#

right?

#

@lyric mountain

cloud warren
#

giving role to the top is working but this is not working I can't give role to bot

lyric mountain
quartz kindle
#

for example this is js js mylist = [1,2,3,4,5] for(number of mylist) { console.log(number * 2) } and this is python ```py
mylist = [1,2,3,4,5]
for number in mylist
print(number * 2)

glacial pagoda
lyric mountain
#

lul

quartz kindle
#

xD

cloud warren
#
 const Discord = require('discord.js');
  const ayarlar = require("../ayarlar.json");
  exports.run = function(client, message, args) {

  if (!message.member.roles.has("806260410957299773")) return message.channel.send(`**:warning: ใƒป Bu komutu kullanmnฤฑz iรงin yetkiniz yetmiyor.**`);

    let sahip = args[0]
  let pawyon = args[1]
  let prefix = args[2]
  let sahip1 = message.guild.members.get(args[0]);
  let sahip2 = message.guild.members.get(args[1]);
  let kanal = "806247959083352145" // bot onaylama reddetme kanalฤฑ
    let furkan = "806259279036153897" // bot durum log kanalฤฑ
  let botsahipkanal = "806259279036153897" // bot sahiplerinin gรถsterileceฤŸi kanal
  let developer1 = ayarlar.developer;
  let botlist1 = ayarlar.botlistt;
    if (message.channel.id !== kanal) return message.channel.send(`**โ„น ใƒป BaลŸvuruda bulunulmuลŸ bir botu yalnฤฑzca <#${kanal}> kanalฤฑnda onaylayabilirsin.**`).then(msg => msg.delete(5000))
  if (!pawyon) return message.channel.send(`**:exclamation: ใƒป Botun idsini yazmalฤฑsฤฑn.**`).then(msg => msg.delete(5000))
  if (!sahip) return message.channel.send(`**:exclamation: ใƒป Botun sahibinin idsini yazmalฤฑsฤฑn.**.`).then(msg => msg.delete(5000))
  if (!prefix) return message.channel.send(`**:exclamation: ใƒป Botun prefixini yazmalฤฑsฤฑn.**.`).then(msg => msg.delete(5000))
  message.delete() 

  sahip1.addRole(developer1);
  sahip2.addRole(botlist1);
  let embedd = new Discord.RichEmbed().setDescription(`**:white_check_mark: ใƒป<@${pawyon}> Adlฤฑ BaลŸarฤฑyla botu onayladฤฑnฤฑz.**`);
  sahip.send(embedd);
  let embed2 = new Discord.RichEmbed()
    .setColor("#5fbf00")
    .setDescription(`<@${sahip}> **adlฤฑ geliลŸtiricinin; <@${pawyon}> adlฤฑ, __${pawyon}__ idli botu onaylandฤฑ.** \n \n __**Botu Onaylayan Yetkili :**__ ${message.author} - **${message.author.tag}**`);
  client.channels.get(furkan).send(embed2);
  
};
```
quartz kindle
#

and this is wall of text

cloud warren
#

pls help not work

lyric mountain
earnest phoenix
#

So from what I've picked up Python and Javascript are great to start with, after i learned some basics i could make simple projects to learn the language even better. If i take js or python depends on what i want to achieve later thonkku

cloud warren
#

not give a role a bot

lyric mountain
#

you need to check if there's a mention before you start getting the attributes

glacial pagoda
#

Of So Add The const in the if statement?

lyric mountain
#

no

glacial pagoda
#

Im confused

quartz kindle
#

but dont fret too much about the choice because once you learn one, moving to another is not hard

earnest phoenix
#

Okay

lyric mountain
glacial pagoda
#

Do i Put The if statement between that

earnest phoenix
#

@quartz kindle May I ask which langs you code in mostly?

lyric mountain
#

dot dot dot

glacial pagoda
#

wat

lyric mountain
#

look dude, I'm not feeling like spoonfeeding at all

#

just think a bit

glacial pagoda
#

ok

lyric mountain
#

you need to guarantee there's at least one mention

#

where do you put the check?

glacial pagoda
#

in between the two lines

lyric mountain
#

yes

earnest phoenix
#

In terms of difficulty Python and js are the same hmm

#

I think I'll get started with js then

lyric mountain
#

ah, one last tip I have

earnest phoenix
#

Yes

#

?

lyric mountain
#

Never, ever think about pressing Ctrl + C and Ctrl + V

earnest phoenix
#

:O

lyric mountain
#

if you're learning, those two combinations are forbidden

#

forget they exist

earnest phoenix
#

When would i use it anyways?

#

Like

#

It's not like I'll copy much or?

lyric mountain
#

idk, but people like to borrow code from the internet

earnest phoenix
#

Oh that's what you mean

#

Yeah

worthy bear
#

Hello

lyric mountain
#

which results in catastrophic codes

#

also, it's good to write code by hand instead of copying, even if it's your own

#

learn how to code with ctrl + space

mellow kelp
#

how about

#

copying my own code

lyric mountain
#

its the most wonderful combination ever

earnest phoenix
#

Ctrl + space?

#

Never heard of that combination

earnest phoenix
#

What does it do?

lyric mountain
mellow kelp
#

in vscode it shows auto completions

lyric mountain
#

it's basically auto-completion

earnest phoenix
#

Oh?

#

So

#

It suggest what you want to type?

lyric mountain
#

if using intellij, alt + enter is also your friend

lyric mountain
mellow kelp
#

should i use this tabnine thing

#

or is it just trash

quartz kindle
#

and my mostly i mean almost exclusively lmao

floral gate
#

hi

earnest phoenix
#

Alr, thanks

mellow kelp
#

so yesterday i was making fun of python ternary operators

#

and today im learning rust

#
let thing = if condition { something } else { somethingElse };
solemn latch
#

python ternary operators are backwards to js right?

mellow kelp
#

oof pEnSiVe

mellow kelp
#
thing = something if condition else somethingElse
glacial pagoda
solemn latch
#

yeah, kinda weird. but its probably just because i learned js first

mellow kelp
#

at least the rust one isn't inverted or anything

solemn latch
#

whats lastMessage a property of?

glacial pagoda
#

Wdym

#

const messagearg2 = message.mentions.users.first(); -> const lastmessagemention = messagearg2.lastMessage.id;

solemn latch
#

whats messagearg2 defined as ๐Ÿ‘€

glacial pagoda
#

The Mentioned User

#

After The Command

solemn latch
#

ohoh

umbral zealot
#

lastMessage can be null

solemn latch
#

i dont think users have lastmessage properties too

umbral zealot
#

it only works if the user has sent a message since the bot turned on

glacial pagoda
#

So member?

umbral zealot
#

members neither

#

it can be null whatever you take

glacial pagoda
#

Oh

solemn latch
#

oh users do have lastmessage

#

intresting

rugged cobalt
#

If anyone has experience with MongoDB, how come when I update a document it updates the updatedAt as well as the createdAt

#

should the createdAt not remain the same or is there something I have to do

solemn latch
#

are you using updateOne or update?

rugged cobalt
#

findOneAndUpdate

solemn latch
#

this is a mongoose answer, but seems to be the same issue. https://github.com/Automattic/mongoose/issues/8954
It seems this is actually intended, if you want to have a createdAt(which actually maintains the original date) it seems the correct solution is to add your own rather than letting mongodb handle it.

gilded olive
#

@opal plank Just released the presence to GH

rugged cobalt
solemn latch
#

gotta love weird undocumented quirks