#development

1 messages ยท Page 861 of 1

scenic nest
#
at MessageCreateAction.handle (/rbd/pnpm-volume/e351023a-4fe3-4f35-8806-4732f9a73518/node_modules/.registry.npmjs.org/discord.js/12.1.1/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14)
(node:857) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)```
earnest phoenix
#

Hmm i think you can use message as msg tho...

#

That error is strange...

scenic nest
#

at MessageCreateAction.handle (/rbd/pnpm-volume/e351023a-4fe3-4f35-8806-4732f9a73518/node_modules/.registry.npmjs.org/discord.js/12.1.1/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14)

#

and

#

(node:857) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)

#

uh wait lemme download gyazo

earnest phoenix
#

@scenic nest wait can i see the code as an screenshot in the glitch code editor?

scenic nest
earnest phoenix
#

Wait... Lemme get my telescope...

scenic nest
#

okie

#

xD

earnest phoenix
#

@scenic nest can you zoom on it lmao?

scenic nest
#

why the heck is chrome block everything downloaded?

mossy vine
#

congrats you managed to show literally everything but the error

blazing portal
#

He asked for the Code though and not an error waitWhat

earnest phoenix
#

@scenic nest wait you can put everything that was stored in the description without doing it like that

#

Lemme show you what i mean hold up

scenic nest
#

brb

#

why the heck is u typing so long

earnest phoenix
#

.setDescription("__**Commands list**__\n>`play`>(`play [title/url]`)\n>`Skip`, `stop`, `pause`, `resume`, `nowplaying`, `queue`")

scenic nest
#

well buddy

#

i gtg

#

see ya tommorow

earnest phoenix
#

Should have done it like that...

scenic nest
#

tomorrow*

earnest phoenix
#

Welp anyway cya then

scenic nest
#

cya

earnest phoenix
#

@scenic nest put a " before the )

scenic nest
#

k rlly gtg

#

bye

earnest phoenix
#

K cya

blazing portal
#

One advice from me, @scenic nest you might want to look into the documents and probably learn how to code in JS first. This channel is not here to code FOR you...

earnest phoenix
#

@blazing portal k buddy no need to be that pushy or mean lmao
(Ik you're not mean but he might think it as it's mean)

blazing portal
#

pushy? I wrote one line with genuine advice^^

earnest phoenix
#

Ik... I mean that line at the end
"This channel is not here to code FOR you..."

#

Basically we're mostly here to help aren't we?

true ravine
#

He's using code literally copied from youtube tho

earnest phoenix
#

So i have a question and it's:
How can i fetch the uncached users?

#

(discord.js 12.1.1)

elder vine
#

client.users.fetch("id")

#

Oh

#

Wait

earnest phoenix
#

Hmm like i have the serverinfo command and:
memberCount: 90k
Actual users: 20k
Bots: 7k

#

Hmm

elder vine
#

guild.members.fetch();

earnest phoenix
#

Anything inside that () block? @elder vine

elder vine
#

no

#

nothing

earnest phoenix
#

Hmm ok

#

Lemme try

elder vine
#

just do that forEach guild

#

or smth

earnest phoenix
#

K

golden condor
#

How to stop pm2 being really annoying and making two instances

elder vine
#

Wdym?

#

pm2 stop (id)

golden condor
#

everytime I start my bot

#

It shows as one instance

#

But is reallytwo

elder vine
#

yikes

#

Shards?

golden condor
#

Nope

west herald
#

there is another instance running outside of pm2 then most likely

elder vine
#

Yea

golden condor
#

There isn't

#

I even tried resetting the token

elder vine
#

Does it load up two?

golden condor
#

When I end pm2

#

They both go offline

west herald
#

then your code is loading up two ๐Ÿ˜‚

elder vine
#

in pm2 logs (id)

golden condor
elder vine
#

that might not be a double thingy then

#

Do u get replies doubled?

#

do u have two message events mby?

#

What is in package.json?

pale vessel
#

well how did you start the bot using pm2?

#

maybe it was running in cluster?

earnest phoenix
#

Sup what did i made wrong ?

elder vine
#

pm2 start (id)
I would have guessed

earnest phoenix
#

TypeError: Cannot read property 'createChannel' of undefined

slender thistle
#

What's your actual message variable

#

message or msg

inland cloud
slender thistle
#

That's client-side

#

Can't force Discord to do that

inland cloud
#

Darn

elder vine
#

U can store both their username#tag + userid tho

inland cloud
#

Yeah, I can .get the members just fine

#

When I copy paste the <> mention it does parse correctly

elder vine
#

mhm

inland cloud
#

Just seems like Discord doesn't want to update the mention cache client-side when it's a mention in an embed

#

This is either an issue or intended because a mention in an embed is actually not a real mention

#

I even tried forcing them into the actual mentions in the message: placeholder.mentions.users.set(data.userid, user.user);

#

But even after doing that and seeing all members in the message.mentions.users

#

Doesn't seem to parse client side until I actually mention them myself

prime cliff
#

Discord will always do that iShot there is nothing you can really do about it

inland cloud
#

Maybe if I mention them in a message above the embed

#

That forces Discord to actually cache client side (and skip the embed problem)

#

I'll try that, I'll report back

slender thistle
#

Do you really want to mention the users

inland cloud
#

It's just to be really fancy pants about it

#

Might be overkill

#

Actually it probably is

slender thistle
#

yeah.. owoMilkROFL

sullen patrol
earnest phoenix
#

@slender thistle oh my bad

elder vine
#

guildMember.createdAt

earnest phoenix
#

(node:1768) UnhandledPromiseRejectionWarning: TypeError: message.guild.createChannel is not a function

elder vine
#

djs version?

earnest phoenix
#

// Create a text channel
if (callmevalue == true && textchannelvalue == true) {
if (typeof quote == 'undefined') { message.channel.send("Please enter the channel name in Quotes."); return;}
message.guild.createChannel(quote, 'text').catch("erreur");
}
///////////////////////////////
#

C:\Users\Skynoze>node -v
v12.16.1

#

Maybe message.guild.channels.create();?

blazing portal
#

Discord.js version, not Node version

earnest phoenix
#

last one available

#

i don't have it

elder vine
#

guild.channels.create

earnest phoenix
#

but its the shitty one with .cache

#

thing

#

@earnest phoenix that's v12 lmao

#

๐Ÿคทโ€โ™‚๏ธ been a wile since i didn't coded any bot so its new for me

frail bough
#

how long does it take to verify a bot

#

ffsss

earnest phoenix
#

Yea... v12 has many changes over the v11 so it's hard to get used to if you were coding on v11 pastly @earnest phoenix

elder vine
#

They said like 5 days.

earnest phoenix
#

@earnest phoenix + the discordjs doc is fucked up

#

@earnest phoenix yea...

#

it took me 1h30 to make a foreach users

#

Not even joking

elder vine
#

...

#

It's javascript tho.

earnest phoenix
#

Discord.js docs are a little confusing now

#

@elder vine what does i change to the thing ?

#

they were always be

elder vine
#

guild.channels.create

earnest phoenix
#

an example every 15 bunch of code

#

And not a complete and easy doc like php for example

#

Uh also how can i try to create a text channel for example know if i have permissions for it ?

elder vine
#

?

#

just check if your bot has permission

earnest phoenix
#

did it changed ?

elder vine
#

no, don't think so

earnest phoenix
#

Yeah it works ๐Ÿ˜Ž

modest maple
#

That is seems amazingly tedious to type a full sentence just todo something lol

earnest phoenix
#

yeah true

#

its pointless but that's cool ๐Ÿ˜‚

true ravine
#

If you could have that in a voice channel, turn what users say to text and then have it work that would be sick

#

You could just design your server with your voice

earnest phoenix
#

@true ravine maybe could if there would be free voice recognition on nodejs

modest maple
#

lol

earnest phoenix
#

Ups

modest maple
#

pretty simple tbf todo with python

earnest phoenix
#

(node:2384) UnhandledPromiseRejectionWarning: TypeError: message.author.hasPermission is not a function

modest maple
#

give it enough audio and tensor flow and about a week of training and you can get it Recognising stuff ez

earnest phoenix
#

BUT we are talking about nodejs and not python ๐Ÿ˜‰

#

its the poinf of a language, when you talk about one, its because u want to talk about this exact language and not another one

true ravine
#

(node:2384) UnhandledPromiseRejectionWarning: TypeError: message.author.hasPermission is not a function
You can't get permissions of a user object, only guild members

#

msg.author is a user

earnest phoenix
#

(node:1256) UnhandledPromiseRejectionWarning: TypeError: message.author.hasPermission is not a function

true ravine
#

Try message.member instead of message.author

earnest phoenix
#

(node:3292) UnhandledPromiseRejectionWarning: TypeError: message.member.guild.hasPermission is not a function

#

should i remove guild ?

true ravine
#

Yeah it should be message.member.hasPermission

earnest phoenix
#

works for me

#

can u join to check if its working with no permissions ?

true ravine
#

You don't have a testing alt?

earnest phoenix
#

nah

true ravine
#

#NotARealDev

#

Jk I don't think most do

earnest phoenix
#

๐Ÿ˜ก

#

xD

#

so can u join ? oliythink

true ravine
#

Aight

earnest phoenix
#

bk4Hy8

#

^^^^^^^the code

grizzled raven
#

if else if else sunglasso

true ravine
#

Anyone here use websockets to connect botum to websitum?

#

Having troubles with SSL

sullen patrol
#

guildMember.createdAt
@elder vine that returns a time, but not in the format of x hours x minutes ago

elder vine
#

Wdym?

#

Use the moment package then

hollow raptor
#

what type of bot should I make ๐Ÿค”

small plume
#

a unique one

crimson vapor
#

a quote one

#

so you can be like !quote @x quote

#

and then is stores it in an array

true ravine
#

Make a bot that uses discord client's computers as workers for Folding@home

crimson vapor
#

lol

elder vine
#

Make a new library

true ravine
#

Make a universal library

#

Make a library for lua so we can make bots in Minecraft with the ComputerCraft mod

earnest phoenix
#

Hey
I tried making a reactionrole command, but when i used the event, it will give me the role even if i react with another emoji on another message

#
client.on("messageReactionAdd",(reaction,user)=>{
    if(reaction.emoji == args[0]);
    reaction.message.guild.member(user).addRole(role)```
cinder patio
#

you need to compare the IDs of reaction.message and the message that is used for reacting

earnest phoenix
#

i tried doing

if(reaction.emoji === args[0] && reaction.emoji.message === msg.id) ```
#

but it wont work

cinder patio
#

why wouldn't it?

#

what is msg?

#

oh

earnest phoenix
#

the message that u react on

cinder patio
#

reaction.emoji.message.id, not just message

earnest phoenix
#

oh ok

#

ill try

pallid marsh
#

what is the edit rate limit of the discord api?

#

edit message

cinder patio
#

I recommend storing the message of id that you react on to a database

earnest phoenix
#

it didnt work

#
if(reaction.emoji === args[0] && reaction.emoji.message.id === msg.id) ```
#
 let msg = await message.channel.send(reactionroleembed).then(msg => msg.react(emoji))```
#

this is the embed send

tight plinth
#

what is the edit rate limit of the discord api?
@pallid marsh 1/0.25s if I'm right

spare goblet
#

@earnest phoenix why are you mixing async code w sync code

earnest phoenix
#
    if(reaction.emoji !== args[0] && reaction.emoji.message.id !== msg.id) 
                                                            ^
TypeError: Cannot read property 'id' of undefined
#

wdym

#

oh

#

like an event

#

because i wanted to make an event to give a role

spare goblet
#

you could simply do

#

let msg = await message.channel.send(reactionroleembed)
msg.react(emoji)

earnest phoenix
#

oh ok

#

do you know how to fix the problem tho ?

spare goblet
#

reaction.emoji.message is undefined

earnest phoenix
#

.id

#

he told me to use it

spare goblet
#

they made a mistake then

earnest phoenix
#

what about reaction

#

reaction.emoji?

spare goblet
#

when in doubt, read the docsโ„ข๏ธ

cinder patio
#

yup my bad

earnest phoenix
#

actually just reaction

spare goblet
#

What

earnest phoenix
#

nvm

#

im trying it rn

#
client.on("messageReactionAdd",(reaction,user)=>{
    if(reaction === emoji && reaction.message.id === msg.id) 
    reaction.message.guild.member(user).addRole(role)```
#

it wont work

spare goblet
#

why is your code formatted so ugly

#

are you on discord js v12

earnest phoenix
#

no

spare goblet
#

which version

#

?

earnest phoenix
#

v11

spare goblet
#

reaction.message.guild.members.get(user.id).addRole(role)

earnest phoenix
#

i dont remember why

#

it was a long time ago

spare goblet
#

Oh

#

wait member() might be a thing idk

#

what "isn't working"?

earnest phoenix
#

it wont give a role

#

when reacting

spare goblet
#

Also, if your message isn't cached, it won't send the event.

#

So make sure to cache the message in ready event by either fetching it, or using raw events

earnest phoenix
#

how can i make that event work then

#

how do i "cache" it

#

i never really used it

spare goblet
#

You can cache it by fetching the message and attaching a listener to it, or by simply not sweeping it.

earnest phoenix
#

can you give an example

spare goblet
#

Of?

#

of how to fetch a message?

earnest phoenix
#

yes

languid dragon
#

@spare goblet sleep NekoHmph

spare goblet
#

<channel>.fetchMessage('id')

#

shush ken

languid dragon
spare goblet
earnest phoenix
#

so message.channel.fetchMessage(msg.id)?

spare goblet
#

yeth

earnest phoenix
#

how does it help me

spare goblet
#

It caches the message so that messageReactionAdd event fires

#

else, it will not fire.

earnest phoenix
#

let msg = message.channel.fetchMessage(msg.id)

#

so is that how i define it in event ?

spare goblet
#

I suggest you learn about raw events and in extension, why the events fire, by reading thishttps://anidiots.guide/coding-guides/raw-events

earnest phoenix
#

alright

#

so is that how i define it in event ?
@earnest phoenix

#

let msg = message.channel.fetchMessage(msg.id)

spare goblet
#

You don't define an event

earnest phoenix
#

in an event

spare goblet
#

You're supposed to cache the message so discord js fires the event for that message

#

as it only fires that event if the message is already cached

#

If it's not cached it will not fire the event

#

Hence, you need to do it on startup

earnest phoenix
#

can i do somthing like
let msg = message.channel.fetchMessage(msg.id)
and then the event

spare goblet
#

such as doing on the ready event

#

why would message.channel be defined

#

message wouldn't be defined outside of the event

#

You would have to do client.channels.get(channelid).fetchMessage(messageid)

earnest phoenix
#

client.channels.get(msg.channel).fetchMessage(msg.id)

spare goblet
#

WHY WOULD msg be defined?

earnest phoenix
#

IDK

#

IM CONFUSED

spare goblet
#

your code should look like this

earnest phoenix
#

my brain hurts
my head hurts

#

fr

spare goblet
#

const Discord = require('discord.js')
const client = new Discord.Client()
const { token } = require('./config.json') // just an example

client.on('ready', () => {
console.log('im ready')
})

// YOU SHOULD BE CACHING THE MESSAGE SOMEWHERE AROUND HERE, OR AFTER THE READY EVENT IS FIRED ABOVE ^^ 

client.on('messageReactionAdd', async (reaction, user) => {
 // you run the function here
})

client.login(token)```
#

so why would msg be defined

#

it won't be

#

does that make sense to you

earnest phoenix
#

no

spare goblet
#

What do you not understand

earnest phoenix
#

i tried using that
if(reaction === emoji && reaction.message.id === msg.id)
so if the reaction on the message is an emoji
and the message of the reaction is equal to the msg id

#

it would give a role

#

thats the only thing that makes sense to me

spare goblet
#

Your function was right

#

but

#

your

#

message

#

WAS NOT CACHED

#

so the event was not emitted

robust moth
spare goblet
#

if the event was not emitted, your function will not run

#

your function will only run if you emitted the event

twilit rapids
#

Nice js formatting

summer torrent
#

use partials or raw event @earnest phoenix

spare goblet
#

Why are you judging me timo sad

earnest phoenix
#

client.channels.get(channelid).fetchMessage(messageid)

spare goblet
#

20 messages ago

earnest phoenix
#

how can i define the channel then

#

message.channel?

summer torrent
#

๐Ÿ‘€

earnest phoenix
#

channelid*

spare goblet
#

I literally told you how to define the channel

#

You even typed it out yourself

earnest phoenix
#

channelid part
channelid = message.channel ?

spare goblet
#

client.channels.get(channelid)
^^^^^^ THIS returns a channel

#

message.channel also returns a channel

earnest phoenix
#

.id*

spare goblet
#

channelid is a channel id snowflake

#

๐Ÿ™ƒ

languid dragon
#

Imagine trying to correct when you're in a position where you're not able to correct or understand your own code โ„ข๏ธ

spare goblet
tight plinth
earnest phoenix
#

i tried correcting myself lmao

spare goblet
#

not .id

#

NOT .id

earnest phoenix
#

sorry i dont know how to CACHE a message

spare goblet
#

channelid is just a snowflake

#

I can't help you sorry I literally already handheld you and gave you all the code yet you don't understand

#

all you have to do is legit fetch the message and it will cache automatically cuz that's how discordjs works

#

you legit just have to do client.channels.get('a channel id here').fetchMessage('a message id here')

earnest phoenix
#

yeah im doing it rn

spare goblet
#

the channel id of #development is 272764566411149314
you literally do client.channels.get('272764566411149314').fetchMessage('698199721709142077')

earnest phoenix
#

it wasnt clear for me sry D:

spare goblet
#

the 698199721709142077 is a message id I sent

#

idk which part where I repeated what I said over and over again didn't make sense but ok

earnest phoenix
#

I never fetched a message or a channel before, soooo
Yeah

spare goblet
#

what's the point of programming something you already know?

earnest phoenix
#

I'm just confused

runic temple
earnest phoenix
#

yeah

#

discord bot i guess?

#

of course actually
open a hello-sqlite project

golden condor
#

Why hello-sqlite ?

#

hello-express

earnest phoenix
#

I use it
Does it matter?

golden condor
#

Lol idk

#

Just hello-express says node.js so

earnest phoenix
#

Well

#

He will choose lmao

runic temple
#

whatttttttt sorry im brain dead

earnest phoenix
#

same

#

what kind of help do you need?
open a project?
start coding?

runic temple
#

i need to know how to make a reaction role command

earnest phoenix
#

are u serious

#

i was just trying to fix mine

#

you can see up there that i couldnt

runic temple
#

oh

crimson vapor
#

In js, is there a way to create a new class that the constructor uses async and await?

topaz fjord
#

why?

#

what's the point of that

sudden geyser
#

Not possible.

earnest phoenix
#

When my bot joins a server or we leave one, once in 4 the activity of the bot is removed and come back 30 seconds later, how do I do?

sudden geyser
#

What library? Can you show the event where you join/leave a guild? I know the presence of bots "used to" (in quotes as I don't know if it still does) go away randomly.

earnest phoenix
#

discord.js

#

yes wait

#
  let ajout = new Discord.RichEmbed()
    .setDescription(`๐Ÿ”‘ J'ai rejoint un nouveau serveur:`)
    .addField("๐Ÿ“‹ __Nom du serveur__", guild.name, true)
    .addField("๐Ÿ“Š __Nombre de membres__ :", guild.memberCount, true)
    .addField("๐Ÿ›‹ __Nombre de salons__ :", guild.channels.size, true)
    .addField("๐Ÿ‘‘ __Propriรฉtaire__ :", guild.owner.user.username, true)
    .addField("๐ŸŒ __Rรฉgion du serveur__ :", guild.region, true)
    .addField("๐Ÿ“ __Identifiant du serveur__ :", guild.id, true)
    .setColor("GREEN");
  client.channels.get("620548901258133515").send(ajout);
  client.user.setActivity(`PushCount | f.help | ${client.guilds.size} serveurs.`, { type: "PLAYING" });
});

client.on("guildDelete", guild => {
  let remove = new Discord.RichEmbed()
    .setColor("RED")
    .setTitle("๐Ÿšช J'ai รฉtรฉ retirรฉ d'un serveur:")
    .addField("๐Ÿ‘‘ Propriรฉtaire: ", guild.owner.user.username, true)
    .addField("๐Ÿ“‹ Nom du serveur : ", guild.name, true)
    .addField("๐Ÿ‘ค Nombre de membres :", guild.memberCount, true)
    .setTimestamp();
  client.channels.get("620548901258133515").send(remove);
  client.user.setActivity(`PushCount  | f.help | ${client.guilds.size} serveurs.`,{ type: "PLAYING" });
}); ```
grizzled raven
#

(how) would handling raw events for fetching uncached messages and stuff affect the bot's performance?

blazing portal
#

which discord.js version @earnest phoenix ?

earnest phoenix
#

11.5.1

#

11.5.1 @blazing portal

cinder patio
#

He didn't even give an answer

earnest phoenix
#

I confused the profiles

grizzled raven
#

who ghost pinged me

crimson vapor
#

Ok, someone needs to make a bot where when someone ghost pings someone, it says who ghost pinged who

opaque eagle
#

Any suggestions to improve this site? It's just a landing page for my bot:
https://manatee.surge.sh/

true ravine
#

The large area of blue doesn't seem right

#

Either make it smaller or make use of it

#

But that's just my opnion

#

Otherwise cool

earnest phoenix
#

How would I get and compare a users highest role?

crimson vapor
#

what lib?

earnest phoenix
#

discord.js

#

V12.1.1

crimson vapor
#

so you compare 2 users or a user's role with a different role?

earnest phoenix
#

I'm trying to make it so people can't ban users above or equal to their highest role

#

and message.member.highestRole.position() isn't working for me

sudden geyser
#

position is not a function.

crimson vapor
#

I think thats 11 iirc

#

one sec

earnest phoenix
#

so would I do message.member.highestRole(position)?

sudden geyser
#

and highestRole is now roles.highest

crimson vapor
#

message.member.roles.highest

#

yeah

earnest phoenix
#

ah

#

thats why, Thanks!

crimson vapor
#

d.js 12 is so much more efficient

#

if you read through the code it actually makes so much more sense

earnest phoenix
#

but it's alot more confusing xD

crimson vapor
#

not to me tbh

earnest phoenix
#

if you're extremely used to d.js 11.5ish its pretty confusing

#

For me anyway

#

I just don't have the .cache down, or most of the new updated things

#

and I didn't see the roles.highest in the changelog

crimson vapor
#

basically it turns most things into managers

#

also

#

you need to do roles.highest.position iirc

earnest phoenix
#

oof

#

It's now saying "Cannot read property 'roles' of undefined"

crimson vapor
#

send code in code blocks

earnest phoenix
#
message.member.cache.roles.highest.position()
crimson vapor
#

message.member.roles.highest.position()

earnest phoenix
#

TypeError: message.member.roles.highest.position is not a function

crimson vapor
#

for .cache, it would be message.guild.members.cache

#

or right

#

its not a function

#

message.member.roles.highest.position

earnest phoenix
#

yep, Thanks a ton!

obtuse wind
#

I need some help, it saying that my "message.delete(5000)": it says supplied options is not an object

#

.-.

earnest phoenix
#

its message.channel.bulkDelete(ammount)

#

you can't go over 100 though

crimson vapor
#

no

obtuse wind
#

no

crimson vapor
#

message.delete(5000) should delete after 5 seconds

#

iirc

obtuse wind
#

I mean that whoever uses the command the running command should delete

earnest phoenix
#

it would just be message.delete()

crimson vapor
#

yes

#

no

#

its a function

#

well yes but no

obtuse wind
#

but it should be deleted after 5 to 10 seconds though

#

.-.

#

or is it because that I just installed the latest version of discord.js that it was deprecated?

crimson vapor
#

oh wait

#

no they changed it

obtuse wind
#

it was changed?

#

.-.

crimson vapor
#
message.delete( { timeout: 5000, reason: "Deleting command message"} )```
obtuse wind
#

damn okay

#

thanks cause the documentation does not have that.

amber fractal
#

yes it does

earnest phoenix
#

I wish I stuck on the last version XD

crimson vapor
#

The docs do

amber fractal
crimson vapor
#

Red you can npm rm discord.js then npm i discord.js@11.6.4

#

I think thats the version

earnest phoenix
#

I've already updated 99% of my bot cryIgnore

amber fractal
#

It wont work after intents are implemented most likely

crimson vapor
#

oh shit

#

that would change it u are right

dusky granite
#

not bot related but, whenever i compile c++ program and try to run it anywhere else

#

Mingw64, flags are: g++ main.cpp -o bruh.exe
Even when i add missing dll directly it doesnt work

earnest phoenix
#

do you have the missing dll in the system32 directory?

dusky granite
#

it works on main pc, where program is compiled

#

everything is in mingw folder, not in system

earnest phoenix
#

you'll need the DLL inside the system directory so it can call it

#

you're using mingw?

dusky granite
#

yes

earnest phoenix
#

add the bin path of mingw to your PATH environmental variable

#

that was the issue for me

dusky granite
#

bruh it works on main pc

#

im trying to make it work on other pc that doesnt have mingw

earnest phoenix
#

try adding the dll to the systems dll path

#

then try starting it

#

ah

#

red, you're not helping

#

stop trying to guess the problem

crimson vapor
#

yeah I do not think you know C++

earnest phoenix
#

whenever I compile a program and it does that I add it to the system directory, then it never throws that error

#

I was just trying to help from my own past mistakes

#

you cannot help if you do not know what the problem is

#

try static linking the binary, @dusky granite

#

i know you're not using haxe

dusky granite
#

sec

#

ait it works

#

tnx @earnest phoenix

earnest phoenix
#

did they change how you would use a defined var in d.js 12.1.1?

#

discord.js does not affect node.js syntax

crimson vapor
#

if you recently updated node for it, then maybe

earnest phoenix
#

I updated to v13

#

v13.12.0 to be exact

crimson vapor
#

what were you at before?

earnest phoenix
#

V11

#

i dont remember the exact version

crimson vapor
#

I am not sure if any syntax was changed

earnest phoenix
#

okie

copper cradle
#

imagine thinking that a library affects syntax

#

LMAOO

earnest phoenix
#

it's what happens when you try to sound smart

#

Imagine being a dick to someone whos trying to learn

#

soooooo cool

copper cradle
#

ikr

earnest phoenix
#

no, you're trying to sound smarter and more experienced in a field where you actually aren't

#

instead of doing that stupid shit and wasting time just directly ask about your problem

#

because when you try to sound smart you end up saying stuff that doesn't make sense

obtuse wind
#

pardon me but it also says "bot.guilds.find" is not a function either

#

did the change the bot.guilds.find as well

copper cradle
#

c a c h e

crimson vapor
#

yes

#

bot.guilds.cache is the new map for guilds

copper cradle
#

they said AdD cAcHe eVeRyWhErE

crimson vapor
#

because bot.guilds is a guild manager

#

I like 12

#

because you can delete the cache without problems

obtuse wind
#

.-.

#

so how tf am I supposed to get a guild ID

#

when I already have the guild ID mapped

#

for example let someguild = bot.guilds.find(g => g.id === "id here"\

quartz kindle
#

all collection methods have been moved to a .cache property

#

which means all functions like .get .find .reduce .map .filter etc... are now in .cache

#

bot.guilds.cache.find

obtuse wind
#

alright .-.

quartz kindle
#

the same applies to users, channels, members and guild channels

obtuse wind
#

damn why discord.js do us like that it used to be simple to just find channels, members etc

#

then again I have been using an old damn discord.js tho

quartz kindle
#

you can still use the old version if you prefer

copper cradle
#

I'm still using v11

obtuse wind
#

idk how to revert versions so I'll just program all the new stuff required

heavy marsh
#

I am using discord.js v12
I am trying to get the id of a certain guild which will or may not be on the same guild

let guild = bot.guilds.cache.get(args[1]);

How can I do it with broadcastEval()

valid gyro
fervent osprey
#

can any oe teach me how to set up a repostitory

summer torrent
#

huh?

valid gyro
#

theres instructions on github @fervent osprey

grizzled raven
#

man someone should pin the cache change and whenever someone asks just say to read the pin lmao

quartz kindle
#

@heavy marsh what part of the guild do you want?

obtuse wind
#

did the new cache thing change the discord embed as well

quartz kindle
#

v12 has MANY changes compared to v11

#

one of them is RichEmbed changed to MessageEmbed

obtuse wind
#

alrighty thx cause right now the documentation is killing my brain

#

so MessageEmbed would have options I assume right like "Rich" inside the parameter

crimson vapor
#

in discord.js 12, is there a way to get the ID of the shard running?

copper cradle
#

npm run <the script>

#

not just npm <script>

#

but still

#

why don't you just do node index.js

valid gyro
#

or even better make a process so you just have to type npm start

#

in ur package file

obtuse wind
#

for messageEmbed how would .type work

#

cause it says .type is not a function

crimson vapor
#

what is .type?

copper cradle
#

bc it's .type not .type() maybe

#

since you tried .type()

obtuse wind
#

no I tried .type(Rich)

heavy marsh
#

@quartz kindle I am just trying to get the guild id as I want to make a command that will create an invite for an x guild

copper cradle
#

@obtuse wind ...

#

@obtuse wind that's not how you're supposed to use it ๐Ÿคฆโ€โ™‚๏ธ

obtuse wind
#

yeah no shit its not a function

copper cradle
#

those are the return values it can return

#

just do .type

#

it'll return one of those values

quartz kindle
#

@heavy marsh broadcastEval("if(client.guilds.cache.has(id)) { create invite and return it }")

heavy marsh
#

ooh its that simple

#

thank you

quartz kindle
#

note that you will need to return the invite code as a string, you cant return a class or an object if not stringified

#

broadcastEval will return an array of responses form all shards in a promise, so you need to resolve the promise and then filter the array to find which element has the result

crimson vapor
#

Tim your discord.js-light, does it just remove most caching and return partials?

quartz kindle
#

mostly yes, but it does a few other things

crimson vapor
#

cool

obtuse wind
#

can someone assist me with reverting back to v11 because my "MessageEmbed" is not working with 'fields.flat" which I dont have in my damn code -.-

summer torrent
#

update node js

obtuse wind
#

node is on the latest version.

#

fields.flat is not a function

summer torrent
#

which version

obtuse wind
#

10.9

summer torrent
#

Discord.js v12 requiring node.js v12 or higher

obtuse wind
#

so what I go to node.js and download the latest version again

icy crane
#

How many servers do you think a 4gb Raspberry PI 4 could handle, cause like, i don't really wanna buy a vps

heavy marsh
#

let guild = bot.shard.broadcastEval("if(client.guilds.cache.has(args[1])) ")
@quartz kindle Can we do it like this too?

quartz kindle
#

its a promise, you need to await it

heavy marsh
#

let guild = await bot.shard.broadcastEval("if(client.guilds.cache.has(args[1])) ")

quartz kindle
#

and just the if wont return anything

heavy marsh
#
let guild = await bot.shard.broadcastEval("client.guilds.cache.has(args[1])")```
obtuse wind
#

I downloaded version 13 but it still says 10.9.0 so I'm just going to shut off my bots and stop programming them because this is bullshitting my brain to the max

heavy marsh
#

ahhh

quartz kindle
#

@heavy marsh that will return true/false if the guild exists

#

ie, if you have 3 shards, it will return [false,true,false] if the guild is in the second shard

heavy marsh
#

Then I want be able to do anything with that like this

let guild = await bot.shard.broadcastEval("client.guilds.cache.has(args[1])")

let invitechannels = guild.channels.cache.filter(c =>
      c.permissionsFor(guild.me).has('CREATE_INSTANT_INVITE')
    );

    invitechannels
      .random()
      .createInvite(options)
      .then(invite =>
        message.channel.send(
          `**Found Invite:**\nhttps://discord.gg/${invite.code}`
        )
quartz kindle
#

no, you cant do that

heavy marsh
#
bot.shard.broadcastEval("if(client.guilds.cache.has(args[1])) { 
    let invitechannels = guild.channels.cache.filter(c =>
      c.permissionsFor(guild.me).has('CREATE_INSTANT_INVITE')
    );
    if (invitechannels.size < 1)
      return [
        utils.timed_msg(
          utils.cmd_fail(
            `No Channels found with permissions to create Invites in!\n**ERRROR**`
          ),
          5000
        ),
      ];

    invitechannels
      .random()
      .createInvite(options)
      .then(invite =>
        message.channel.send(
          `**Found Invite:**\nhttps://discord.gg/${invite.code}`
        ) }")```
quartz kindle
#

you need to define guild, you need to pass args[1] as a variable, and there is no message

heavy marsh
#

Ohh ok I undestand

#

Thank you

copper cradle
#

@obtuse wind yeah, you'll have to update node

obtuse wind
#

I updated node

#

its not updating it for my goddamn bot folder

quartz kindle
#

how did you update?

obtuse wind
#

nodejs.org I downloaded the latest version -_- unless I have to do it via proxy

quartz kindle
#

are you on windows or linux?

obtuse wind
#

Windows

heavy marsh
#

Why not just npm i ...

quartz kindle
#

did you restart your pc after installing?

obtuse wind
#

Negative.

quartz kindle
#

try that

obtuse wind
#

npm i what

#

node.js

#

I did that and it said "bad argument"

quartz kindle
#

node.js requires environment variables to be set on windows, which requires a restart to be properly applied

fervent osprey
#

@valid gyro ok ta will have a look

obtuse wind
#

idk then I'll restart my PC 3 times and see if it wants to fix itself.

blazing portal
#

why 3 times?

#

๐Ÿ˜ฎ

earnest phoenix
#

node.js requires environment variables to be set on windows, which requires a restart to be properly applied
it doesn't by the way, just the underlying process that is utilising the env vars needs to be restarted

gritty bolt
#

does anyone know how to get intelliJ's highlighting to detect discord.js's methods?

obtuse wind
#

ok so i restarted 3 times and it still says "fields.flat" is not a function

blazing portal
#

maybe 10 times will do the trick pogey

obtuse wind
#

you may be rifght

#

let me do that

#

and waste more of my time on a bot

blazing portal
#

I'm kidding ๐Ÿ˜„

earnest phoenix
#

nah kidding

obtuse wind
#

where tf is a fields.flat though

#

its in my error message

quartz kindle
#

what do you get when you do node -v?

obtuse wind
#

omg

#

it did

#

not

#

update

#

here i'll do npm install node.js -s

quartz kindle
#

that probably wont work lol

obtuse wind
#

you're right cause it didnt work the first 7 times

quartz kindle
#

do to your control panel and uninstall node

knotty steeple
#

installing node on the node package manager

#

use nvm btw

obtuse wind
#

nvm install node.js

quartz kindle
#

install windows from windows update

knotty steeple
#

no

#

thats

#

not how nvm works

crimson vapor
#

install git from a git pull

obtuse wind
#

nvm is not a valid command

knotty steeple
#

well you have to get nvm

quartz kindle
#

nvm needs to be installed separately

#

nvm is node version manager

knotty steeple
#

^

pine bear
#

hey tim

obtuse wind
#

okay here I'll go to amazon and buy some NVMs

knotty steeple
#

nvm good

#

mmyes

quartz kindle
#

buy NVMEs

obtuse wind
#

do I just download the whole git

quartz kindle
#

there is installation instructions in the readme

#

read it through

crimson vapor
#

HDD > NVME change my mind

quartz kindle
#

i mean, you're not wrong in several aspects

crimson vapor
#

but in many I am

quartz kindle
#

HDDs still have many advantages

#

yup

crimson vapor
#

they are so much cheaper

#

at the 500gb - 16tb range

knotty steeple
#

ssd and hdd both thank u

blazing portal
#

@obtuse wind you were using windows, right?

obtuse wind
#

yes

knotty steeple
#

no nvm then

blazing portal
knotty steeple
#

there u go

obtuse wind
#

but I see that windows 10 needs to upgrade to windows 12

#

or newer

quartz kindle
#

wat

obtuse wind
#

in order to run node version 12 ๐Ÿ˜‚

quartz kindle
#

lmao

obtuse wind
#

wait

blazing portal
#

Let me know how updating to Win 12 works ๐Ÿ˜‰

obtuse wind
#

so I just uninstalled node for no reason

knotty steeple
#

what

valid gyro
#

more heroku issues! i fixed my previous issue, but now heroku just stops at the echo I have in my procfile. It doesnt launch my app at all

blazing portal
#

nah, get the nvm-windows i linked and install the version(s) you want from there, that should work 99%

valid gyro
#

when did they release win 12??

crimson vapor
#

win 12?

knotty steeple
#

never?

#

uh

earnest phoenix
#

it was a joke

valid gyro
#

o

knotty steeple
#

yea lul

valid gyro
#

see, im kinda an extreme idiot

knotty steeple
#

even if isnt windows 10 supposed to be updated until the universe dies

earnest phoenix
#

microsoft isn't moving from win10 for a while now, especially with the upcoming win10x

valid gyro
#

thats why im here asking for help on a issue thats proably pretty obvious

obtuse wind
#

where tf is the nvm install

valid gyro
#

npm install is a command prompt acrion

obtuse wind
#

nvm

valid gyro
#

oh nvmnd

obtuse wind
#

i cannot find that in the gitr

valid gyro
#

thought that was a typo

obtuse wind
#

i'm dumb

knotty steeple
#

well did you install nvm

obtuse wind
#

no shit I cannot find the download link

knotty steeple
#

someone literally linked you it

obtuse wind
#

I know

#

where tf is the download

#

Button

knotty steeple
#

read????

obtuse wind
#

I am

craggy cave
#

Right?

knotty steeple
#

so

craggy cave
#

That's the releases to what you need to download.

knotty steeple
#

no no no

#

you dont clone

earnest phoenix
#

jonny, that's to download the whole repo

knotty steeple
#

ye

blazing portal
#

oops

craggy cave
blazing portal
#

it's late, okay? ๐Ÿ˜„

knotty steeple
#

it also has a download on the readme

#

seems at though they didnt actually read it

earnest phoenix
#

how tf are people so incompetent to use github

knotty steeple
#

when its called a readme bloblul

blazing portal
#

maybe if you called it sudo readme ๐Ÿค”

earnest phoenix
#

what

knotty steeple
#

what

obtuse wind
#

readme is equivalent to licenses; alright. My brain is dead after seeing "fields.flat" is not a damn function

knotty steeple
#

w h a t

crimson vapor
#

^

earnest phoenix
#

no

crimson vapor
#

readme is the file you read

earnest phoenix
#

it is not?

#

what

#

lol

obtuse wind
#

nice message syncing.

knotty steeple
#

its literally

crimson vapor
#

to learn about the package

knotty steeple
#

just

#

read it

crimson vapor
#

its called read me

obtuse wind
#

I did

knotty steeple
#

and did you download nvm

valid gyro
#

would probably help people help me if i shared the git repo

knotty steeple
#

and say your problem

obtuse wind
#

and after attempting to put NVM in my bot folder cough cough

Access is denied.

earnest phoenix
#

oh no

#

oh honey no

knotty steeple
#

wait so what exactly are you doing

obtuse wind
#

dying

#

I am dying.

knotty steeple
#

hey if u dont want help it saves me brain cells

obtuse wind
#

good

#

I haven't slept in 96 hours so

#

you guys can probably comprehend stuff better

#

idfk

#

okay I installed NVM into my node program file folder thingy

earnest phoenix
#

I haven't slept in 96 hours so
@obtuse wind why?

obtuse wind
#

working

#

overtime

#

lots of overtime

#

without me wanting to have overtime

valid frigate
#

the longest a human has gone without sleep is 60 hours

copper cradle
#

quit

valid frigate
#

why the fuck u lyin

#

also isnt this the wrong channel lmao

valid gyro
#

my problem is that im running on heroku, and it gets to the web echo in my procfile, and then never launches the bot

knotty steeple
#

@valid frigate MegaThonk

valid frigate
#

heroku is funny when it comes to deploying node apps

knotty steeple
#

heroku is funny

valid frigate
#

i think you need a custom file

#

like a heroku config in your project or smth

earnest phoenix
#

what time is it?

#

ops wrong channel

copper cradle
#

@valid gyro bc you gotta use
worker: the script you wanna run

obtuse wind
#

alright I attempted to install nvm but apparently nvm.exe doesnt want

#

to open

copper cradle
#

I don't actually remember much about heroku

#

as I use a real host

obtuse wind
#

here let me restart my desktop real quick

valid gyro
#

@copper cradle did that ad it said it couldnt find the script! arggghhh

#

@valid frigate yeah thats the procfile in this case

valid frigate
#

oh right procfile

copper cradle
#

@valid gyro show the output

valid gyro
copper cradle
#

dude

#

show your index.js file

valid gyro
copper cradle
#

hmm

obtuse wind
#

ok I restarted my PC. I'll attempt nvm now

copper cradle
#

what's start /app

#

@valid gyro

valid gyro
#

i have no idea

copper cradle
#

at the very top of the log you sent

valid gyro
#

good question, theres no file named that and no file mentions it

queen violet
#

hi my botum no work hi how to get channel by id in djs

obtuse wind
#

keeps saying node version number is not installed

valid gyro
#

u probably have the wrong version listed in your package

obtuse wind
#

now nvm isn't a thing

#

or no NPM

#

node package manager is not an internal command anymore .-.

copper cradle
#

ragnork, try to run it without the start script, just plain do node index.js

valid gyro
#

tried that too already, same result

copper cradle
#

hmm

#

I don't use heroku so ยฏ_(ใƒ„)_/ยฏ

valid gyro
#

runs fine locally with npm start

copper cradle
#

I mean

#

I used to

valid gyro
#

is weird part

copper cradle
#

but not anymore

#

use a worker dyno

#

instead of process use a worker dyno

obtuse wind
copper cradle
#

who you talking to

obtuse wind
#

I'm talking to tis chat

#

ok welp I just lost about 3 years worth of Discord Bots programming just now so thats always great

crimson vapor
#

how 3 years?

obtuse wind
#

My bot has been existing since Early 2017.

crimson vapor
#

ok and how did you lose the programming?

obtuse wind
#

NVM installed and now I cannot use npm

#

and there is no installations

crimson vapor
#

but you didnt lose any data?

still lily
#

anyone know how to create a channel with discord.js

#

javascript

crimson vapor
#

message.guild.channels.create() iirc

blazing portal
#

yeah depends if from a message command or another event, but its [...]guild.channels.create()

obtuse wind
#

MILLION, didn't lose anything but node is refusing work now; I'm kind of blaming it on my actions of installing NVM

#

so is NPM cause thats not working either

blazing portal
#

If you say you haven't slept in so long, just go to sleep now and look at it with a cool head again tomorrow.

obtuse wind
#

nah to late I'm just deleting my applications and refunding the people who I made a bot for

blazing portal
#

If you think that is the appropriate action for one problem that you seem to not get around after 1 evening... Who am i to stop you, i guess?

obtuse wind
#

Its appropriate because node and npm don't work in command prompt anymore, therefore I cannot run a bot without node thus, people who I charge 15$ (annually) for 2 years should get refunded

blazing portal
#

As i said, it doesn't work for 1 what... hour? and you want to delete everything?

crimson vapor
#

are you bot hosting or developing?

valid frigate
#

he's developing

obtuse wind
#

not just 1 hour its that its not allowing me to use NVM to get node version 12 (or up) in order to fix "MessageEmbed"

I am a she, and I develop for people along with hosting them too

valid frigate
#

context is literally right there

#

what bro

#

you host bots for people where

crimson vapor
#

then reinstall node?

valid frigate
#

on your own vps or

valid gyro
#

Can't u just install the new version off the site

obtuse wind
#

I develop and host bots for people who pay me 15$ a year, yes Vysion. nice username btw.

#

and I tried that already Ragnork. again nice username

valid gyro
#

???

crimson vapor
#

windows?

obtuse wind
#

Its alright though, thanks for attempting to help a braindead person people. Especially you Million and Snailz

copper cradle
#

you shouldn't be hosting them

#

you should only develop them and then give them instructions on how to host them

crimson vapor
copper cradle
#

that'd save you a lot of time and headaches such as this

obtuse wind
#

No zSnails, it's mainly for youtubers who don't know how discord works that well.

copper cradle
#

oof

obtuse wind
#

hell some of the people who I program and host for don't even know how discord works

crimson vapor
#

they should use mee6

craggy cave
#

or dyno bot

copper cradle
#

and, do you charge them monthly, yearly, or how?

#

or you just charge them once and that's it

obtuse wind
#

Yearly

#

I am not money hungry or take things for granted I

#

just charge 15$ and thats for every year

copper cradle
#

hmm

#

that's a very low price for the work you do

obtuse wind
#

True but then again, I don't really want money

copper cradle
#

it's not being money hungry, but valuating your own work

#

if I could do that I'd charge at least $30

blazing portal
crimson vapor
#

honestly, 5 - 10 dollars a month if hosting is included

#

if the bot is good

#

but thats for a bot that will only be in 1 or 2 servers

obtuse wind
#

Yeah I'm sorry I should prolly move to different channels

copper cradle
#

hmm

#

so my bot keeps disconnecting from the websocket

#

weird

queen folio
#

Hi, I want my bot to read the attached picture, but it can't because of Error 403: Forbidden. Is there something I can do?

quartz kindle
#

where do you get that error?

queen folio
#

in the console.

#

urllib keeps reporting it, if that's what you're asking

quartz kindle
#

i mean which part of your code throws the error

#

can you show the code?

queen folio
slender thistle
#

urllib with async code...

queen folio
#

Is there another, """"approved"""" way?

copper cradle
#

aiohttp

slender thistle
#

aiohttp is async

queen folio
#

I'll look into it, thanks

copper cradle
#

urllib is sync, so you shouldn't be using a blocking lib with non blocked code

#

in this case sync with async

queen folio
#

right

#

I'll keep that in mind

zinc condor
#

how would i check if a channel exists in a discord bot by the id

#

discord.js

queen folio
#

but I don't think that's the problem

#

I can try, maybe it'll work

slender thistle
#

Magic of Python

blazing portal
#

@zinc condor do you mean if it exists in a guild?

zinc condor
#

yeah

blazing portal
#

which version of d.js?

zinc condor
#

newest

copper cradle
#

v12

blazing portal
#
if(typeof(channel_exists) !== 'undefined') // If true, channel exists, else it doesn't ```
#

Maybe something like this

quartz kindle
#

or simply if(client.channels.cache.has(channelID)) { // exists }

blazing portal
#

That would not account for uncached channels though. but then again, if you dont manually uncache channels, all guild channels should be cached

quartz kindle
#

yes

crimson vapor
#

would you fetch it if you uncache channels?

blazing portal
#

fetch is used to cache uncached channels yeah

crimson vapor
#
if(await message.guild.channels.fetch(`${ch.id}`)) {
  //code here
}```
quartz kindle
#

yes, but if channel doesnt exist or is invalid, it will throw an error

crimson vapor
#

oh

#

I guess you could do the opposite and check if the guild is the one that has the channel

if(message.guild.id == ch.guild.id) {}```
zinc condor
#

thanks

quartz kindle
#

that will still only work if the channel is cached

zinc condor
#

works, just gotta check if a channel got deleted, am making a bot that deletes other bot messages in specific channels

crimson vapor
#

well you would need the full channel object which you can get my fetching from the client channels

#

but if it was deleted it would error

zinc condor
#
guildData.channels.forEach(channel => {
        let channelExists = msg.guild.channels.cache.has(channel) 
        if (!channelExists) {
            Guilds.updateOne({ "id": msg.guild.id }, {$pull: { 'channels': channel }})
            guildData = await Guilds.findOne({ "id": msg.guild.id })
        }
    })```
queen folio
#

damn aiohttp is quite a lot harder to set up

blazing portal
#

you dont have to go through each channel and check if the channel exists again and again.

#

@zinc condor msg.guild.channels.cache.has(channel) can be done once on the guild. if its true afterwards, the channel exists in the guild, otherwise it doesn't. No need to do it inside the forEach

zinc condor
#

im providing multiple channel id's

#

not one

#

its a list

blazing portal
#

ah, i see

quartz kindle
#

hes updating his database and removing channels that were deleted from it

#

still there are better ways to do that

#

for example, ```js
let toDelete = guildData.channels.filter(channel => !msg.guild.channels.cache.has(channel));
guildData = await Guilds.updateOne(guildid, remove toDelete)

#

i dont use mongo so idk the exact syntax for that

#

but you can probably delete a list of channels at once

zinc condor
#

that would only run that once no?

quartz kindle
#

also not sure if updateOne returns the updated document or if you need to fetch it again

zinc condor
#

no it doesnt, later on i redefine guildData once the loop is finished

quartz kindle
#

it will run once yes, but it will execute with all channels that are deleted

#

instead of deleting one by one in a loop, you get a list of deleted channels and try to delete them all at once

zinc condor
#

not actually sure you can delete multiple at once out of an array so i need to look that up

quartz kindle
#

yeah not sure either, but its probably possible

zinc condor
#

lemme see

obtuse wind
#

npm and node work again but its still not listing available versions on NVM

crimson vapor
#

for mongo, you can define a variable as a doc and update the variable to what you want, then you update the doc to the variable

clever storm
#

I have the following:

                dbl.webhook.on('vote', vote => {
                    console.log('run')
                    client.users.fetch(vote.user).then((user) => {
                    client.shard.broadcastEval(`
                    const voteLogs = this.channels.cache.get('693204858068664491')
                    if (voteLogs) {
                            console.log(user)
                        voteLogs.send(${JSON.stringify({embed: new Discord.MessageEmbed()
                            .setAuthor('New Vote!', client.user.avatarURL())
                            .setDescription(`\`${user.username}#${user.discriminator}\``)
                            .setColor(0x2F3136)
                            .setTimestamp().toJSON()
                        })})
                    }
                    else {}
                    `)})
                });```

It seems that brodcast eval wont read `user` from the promise. How should i go about doing this?
#

I'm fairly new to sharding and using brodcastEval so still getting used to how everything works

crimson vapor
#

I dont know if this is your issue but you can make it `${vote.user}` to make it a string

low wasp
#

@clever storm use a better sharding manager

quartz kindle
#

you dont need to create the embed and then stringify it

clever storm
#

Has nothing to do with sharding at all

quartz kindle
#

pass the embed constructor as a string, and let the shard build it

clever storm
#

Well the manager at least

#

lmao

tulip wave
#

neither did mine :3

crimson vapor
#

xD

clever storm
#

cant with the sharding manager im usin

#

Clearly not

#

Anyway, this isnt my issue it seems @quartz kindle

crimson vapor
#

c0bra did you do what I suggested?

clever storm
#

This works fine, just for some reason var from my promise

#

not my issue @crimson vapor

quartz kindle
#

stop that dad

crimson vapor
#

@quiet rampart stop

clever storm
#

If i remove the vars it works just fine

tulip wave
#

@quiet rampart stop being useless if you aint gonna add to the conversation stay out of it

quartz kindle
#

@clever storm you didnt pass the variable to your console.log

clever storm
#

Lmao and

quartz kindle
#

if it was throwing an error, it was because of that

clever storm
#

No??

#

lmao its saying user in my desc isnt defined

quartz kindle
#

user is not defined in the evaled code

clever storm
#

Correvct

crimson vapor
#

Tim, client.users.fetch() works regardless of shard right?

clever storm
#

Yes

quartz kindle
#

yes

crimson vapor
#

so does client.channels.fetch() (if thats a thing) work

valid gyro
#

can someone explain to me how to delete a git directory

quartz kindle
#

yes

valid gyro
#

not in github but git