#development

1 messages · Page 1356 of 1

pale vessel
#

hm

carmine summit
#

then why can i turn it on last time?

pale vessel
#

i have no idea, it should be greyed out only if your bot is verified and not whitelisted for the intent

earnest phoenix
#

I just made a neural network that learns how to round numbers

lament meteor
#

but why

#

@earnest phoenix every language has a rounding function

earnest phoenix
#

yeah but it's funn

sudden geyser
#

Is Python's threading module useful, considering GIL makes concurrency effectively useless.

earnest phoenix
#

wait you can have "string smh" as the names of properties in normal JS objects (not JSON)?

hollow sedge
#

That moment when you make a neural network in 90 lines of code

#

That's cool though

earnest phoenix
#

That moment when you make a neural network in 90 lines of code
That's cool though
@hollow sedge thanks 2610_hughug

quartz kindle
#

yes you can have spaces in property names

earnest phoenix
#

but that's a string which is JSON syntax

quartz kindle
#

you can use almost anything as a property name

earnest phoenix
#

and yet it's a normal JS object

quartz kindle
#

JSON is a simplified version of a JS object designed to be transfered as a string to other processes or devices

earnest phoenix
#

yes

#

but how is it allowing me to put the character " in the property name

quartz kindle
#

why not?

earnest phoenix
quartz kindle
earnest phoenix
quartz kindle
earnest phoenix
#

what the fuck

cinder patio
#

All object keys are strings, so any value that can be turned into a string is accepted

earnest phoenix
#

now i see why Maps exists

hexed wind
#

Okay so I'm looking for an api which returns random subreddit images in json format

earnest phoenix
#

Okay so I'm looking for an api which returns random subreddit images in json format
@hexed wind you're looking for kamar taj reddit API
||ye ik weird doctor strange reference||

hexed wind
#

Kamar taj?

#

What's that?

#

Api?

earnest phoenix
#

read da spoiler

#

lmao do you know doctor strange

cinder patio
#

You can use the reddit api

hot crest
#

let me style the vote page

sudden geyser
#

use css

#

oh

hot crest
#

you can only style the main bot page not the vote page

#

kinda weirdchamp if you ask me

umbral zealot
#

ThATs UnPrOfeSsIoNaL

sudden geyser
#

You could make a suggestion on their GitHub suggestions repo or something

#

but I doubt it'll happen

hot crest
#

oops

umbral zealot
#

Expecting a website to cater to your special CSS needs is kinda weirdchamp

#

Imagine if everyone could custom-style their google search results.

faint prism
#

imagine if it allowed JS tho

umbral zealot
#

Or throw CSS at a youtube channel page.

hot crest
#

that would be epicgames

sudden geyser
#

tbh I don't like how the site even supports css. It brings a ton of inconsistency (and if anything changes)

hot crest
#

without css kinda bad

#

css hot

#

everywhere

solemn latch
#

the vote page has css already

hot crest
#

i want it to be purty like me

#

its ugly

hollow sedge
#

you're expecting too much from what is supposed to be a simple voting system

hot crest
#

im just askin

#

chill dude

#

or woman

hollow sedge
#

you're the one who called it ugly

hot crest
#

i mean its a joke? lmao

obtuse jolt
#

:D

woven sundial
#

Hi, I would like to get the username of all the users that are in a json. I tried with that code :

exports.run = (client, message, args) => {
  var Discord = require("discord.js");
  let data = require("./giveaway.json").list;
data.forEach(element => {
let name = client.users.cache.get(element).username;
console.log(element +"~"+name)
})

}```
but it returns me : 
```TypeError: Cannot read property 'username' of undefined```
Can someone help me ?

lib : discord.js 12.3
number of ID in the json : 70
full mortar
#

if im right there was some way to see al the client users, right?

sudden geyser
#

client.users.cache.get(...) couldn't find the user by its ID, so it returned undefined.

woven sundial
#

why

sudden geyser
#

You should check if the user is cached beforehand.

woven sundial
#

how ? 🤔

sudden geyser
#

Save the result of what I said above, check if it's not equal to undefined, and use .username if it's there.

#

Your cache may also depend on what intents you have enabled.

#

If you don't have guild member intents, you probably can't rely on the cache.

woven sundial
#

I don't have any intents

full mortar
#

what intents do you need to see all users?

sudden geyser
#

guild member list

quartz kindle
#

@woven sundial name = (await client.users.fetch(element)).username

full mortar
#

that also allows to see members from another servers of the one that the command was triggered?

woven sundial
#

SyntaxError: Unexpected identifier

#

Tim

#
  var Discord = require("discord.js");
  let data = require("./giveaway.json").list;
data.forEach(element => {
let name = (await client.users.fetch(element)).username;
console.log(element +"~"+name)
})

}```
quartz kindle
#

it needs to be an async function

#

async element => {

valid frigate
#

could anyone point me to the different between a pointer to a slice (*[]T) vs a slice of pointers ([]*T) in le golang trollthinking

#

cant find anything on le interwebs

midnight blaze
#

Tim stop spoon feeding everyone, we get fat

quartz kindle
#

i spoon feed raw food

#

up to you to cook it

midnight blaze
#

xD yeah, true

full mortar
#

bruh

woven sundial
#

it works Tim, thanks a lot, you saved my life lol

quartz kindle
#

if only i got a dollar everytime someone said that to me

#

lmao

midnight blaze
#

@woven sundial that is Tim for you, he saved everyones life

#

at least once

hot crest
#

is this a spoonfeeding channel?

pale vessel
#

yes

#

but actually no

hot crest
faint prism
#

you'll see
eventually

hot crest
#

hmm okay

faint prism
#

just search this channel for "spoonfeeding"

hot crest
#

477 result

solemn latch
#
  1. Be especially courteous and respectful to new members and beginners with regards to Discord or development overall. We’re here to help and support them.
    a. Do not spoon-feed developers

#rules-and-info

faint prism
#

Help explain, don't send solutions

misty sigil
#

up to you to cook it
@quartz kindle cook the spaghetti

quartz kindle
#

i cookada

earnest phoenix
#

what permissions does the client need to use Channel#startTyping()?

pale vessel
#

send messages, i guess

earnest phoenix
#

is there a way to change all embeds sent by my bot have the color changed to a certain color?

pale vessel
#

yes but that would be api abuse

#

just leave them

midnight blaze
#

would that be api abuse aswell: bot posts in all possible channels in all of his guilds a comment at the same time?

sudden geyser
#

Yes.

#

Rule of thumb: if you need to spam to get something done, it's likely API abuse.

#

Use other workarounds, such as only posting in one channel, or having a command to post what should be said.

earnest phoenix
#

can't you tell that discord wants you to abuse their api KEKW

#

with the intents change and slash command integration they want to remove gateway out of the picture and make bots REST only

quartz kindle
#

remember when discord updated their rate limits and introduced the 1 hour ban?

#

they said there was a bot sending them 300k invalid requests per hour

#

or something like that

earnest phoenix
#

yeah

#

that's correct

#

some weeb bot and its users were spamming the shit out of it

quartz kindle
#

wasnt it stuck in a loop?

earnest phoenix
#

yeah i'm pretty sure

#

it borked

quartz kindle
#

for(abc) { bla.send().catch(nope => {}) }

#

xD

earnest phoenix
#

then the users stormed DAPI complaining how discord broke their sweet hentai bot

#

general had to be locked

#

lol

quartz kindle
#

lmao

earnest phoenix
#

but yeah with recent changes discord's implying that you should use REST only (slash commands) over gateway

#

you get information from the slash command and you can fill out the rest with a couple of api calls

#

they're trying way too hard to be slack

waxen tinsel
#

Bruh removing gateway would be small brain

earnest phoenix
#

well they aren't going to remove it

#

they're cutting features from it so that you get more benefits from being REST only

quartz kindle
#

they always wanted to make the gateway for sending and rest for receiving, but some things are difficult to achieve by rest only

earnest phoenix
#

their plans are hot garbage

#

every article discord pushes out has contradicting information with the previous one KEKW

#

Should I learn react or C#?

#

uh

#

those are two entirely different things

drifting wedge
#

how do i add an embed field

#

as in another embed "square"

#

in the same message?

quartz kindle
#

"hey there, we just implemented some hot new tech that will make the platform blazing fast"
"hey there, we just implemented some hot new tech thats much faster than the previous one and fixes a lot of issues the previous one had"

drifting wedge
#

dpy

earnest phoenix
#

pretty much tim lol

#

they keep misinforming people about intents and the guild limit for privileged intents (without being whitelisted)

#

those are two entirely different things
@earnest phoenix both are pretty interesting so what do i go for first

#

whatever you want

#

react is an SPA framework

#

c# is a language

#

making games in unity using C# or grinding out sometime with react

#

well

#

game developing requires good knowledge of trig and trig functions

#

but those are two entirely different paths so pick what you enjoy more

#

game developing requires good knowledge of trig and trig functions
@earnest phoenix trick and treat functions?

#

trigonometry topkek

hollow sedge
#

you dont really need trig for the games you would (probably) make

earnest phoenix
#

you dont really need trig for the games you would (probably) make
@hollow sedge tic tac toe AI

hollow sedge
#

you need trig for a tic tac toe AI?

#

doubt but ok

earnest phoenix
#

I'm asking if i do lol

#

you don't

#

that's just creating an alg

placid iron
#

Trig is needed for movement most of the time

#

Distances do be funky 😩

quartz kindle
#

movement, hitboxes, collisions

hollow sedge
#

a lot of that stuff is already handled by unity

slender wagon
#
#{guild.owner.user.tag}
#

Cannot read property 'user' of null

earnest phoenix
#

owner isn't in cache

#

or discord sent you garbage data

#

or discord sent you garbage data
@earnest phoenix tell me smth new

prisma oriole
#

lmao

earnest phoenix
#

How can I get online members on the server with Discord.js?

vocal sluice
gleaming dove
#

Hi. I wrote a code to get Bot Statistics but this is not working code

quartz kindle
#

bot.guilds.cache.reduce

gleaming dove
#

thanks

earnest phoenix
#

With Discord.js, I can no longer register the number of members online.

#

@gleaming dove please learn javascript before trying to make a bot

#

that looks like copy pasted code ngl

sudden geyser
#

With Discord.js, I can no longer register the number of members online.
@earnest phoenix do you have intents?

#

And you can

#

Just use <Guild>.memberCount

#

It's more reliable than relying on a cache.

earnest phoenix
#

message.guild.members.cache.filter @sudden geyser

#

don't working 😦

sudden geyser
#

oh the number of users online

earnest phoenix
#

vxcevrimici ${message.guild.members.cache.filter(el => el.presence.status == "online" && el.user.bot == false).size}

umbral zealot
#

The only way to get online vs offline members is to request both privileged intents, then fetchAllMembers in discord.js

gleaming dove
#

that looks like copy pasted code ngl
@earnest phoenix const db = require('quick.db');

#

Dude, Shouldn't It Be Hard To Say This?

umbral zealot
#

@gleaming dove it is very hard because not one knows wtf db is supposed to be.

#

But good for you to figure it out 👍

gleaming dove
#

Screenshot Throwed But

umbral zealot
#

Your screenshot didn't show it was supposed to be quick.db and no one would know it was quick.db.

sudden geyser
#

There are other ways too. Like, if you have an invite object, I think there's a property for getting the number of users online, but that:

  • Includes all statuses except offline (online, idle, dnd).
  • Doesn't filter out bots.
umbral zealot
#

It's not the only db out there that has a fetch method.

gleaming dove
#

didn't find the db there.

#

anyways

umbral zealot
#

I'm saying your problem couldn't be solved by someone else guessing what db you were using, friend.

#

So being angry at people for not reading your mind serves no purpose.

gleaming dove
#

I understood: D

kind nexus
boreal iron
#

@thin bison Looks like it tries to fetch a message which doesn't exist anymore.

kind nexus
#

Every bot that I have that displays a member in an embed just comes up with the id's

#

and some messages that have to get certain information from the guild just don't send

solemn latch
#

intents are now enforced so you wont have all users by default anymore.

kind nexus
#

ah

#

Intentions?

solemn latch
#

intents

kind nexus
#

Do you mind explaining further?

#

Or are you able to link me to more information

kind nexus
#

Thank you

solemn latch
#

intents are just the things you get

thin bison
#

@thin bison Looks like it tries to fetch a message which doesn't exist anymore.
@boreal iron thanks i figure out wat was the problem

obtuse jolt
#

what's a good time to message ration for an anti spam

boreal iron
#

Alright

queen marsh
#

Is a rasberry pi worth it, I dont like pm2 runtime as im having issues with it

earnest phoenix
#

depends on what you're going to use the rpi for and pm2 is unrelated to an rpi

boreal iron
#

Is a rasberry pi worth it

The pi itself it not necessary needed, u're good to go with pi OS, too

#

if u have the possibility to host a VM in your LAN

#

however, network wide ad blocking is just a must have in 2020, but probably it's the wrong discord and channel to discuss about this

astral yoke
#

i would go into a VPS rather then a pi for long term

stable eagle
#

WRONG CHANNEL

#

oops

astral yoke
#

lmao

hollow sedge
#

imo raspberry pis are not worth it unless you are working with hardware too

#

i have one and i never use it

astral yoke
#

i'd only use it to host small client bots

#

if its needed its 50 bucks for one

willow mirage
rancid dove
#

Hello, I want the Invoice code to be added to my bat. Can anyone help me?

willow mirage
#

@swift umbra nvm

buoyant aspen
#

how can I add a role to someone? member.roles.add(role); doesn't work (discord.js v12)

haughty mirage
#

@buoyant aspen guild members have roles

#

What is 'member'

buoyant aspen
#

message.author

#

sorry

#

@haughty mirage

haughty mirage
buoyant aspen
#

ah my bad

#

member, not author

vocal sluice
#

does anyone know if a user reacted to a message it would just remove it right after?

earnest phoenix
#

I get this error when trying to fetch server count

haughty mirage
#

Code??@earnest phoenix

earnest phoenix
#
const dbl = new DBL('my topgg token', client);
dbl.on('posted', () => {
  console.log('Server count posted!');
})
rancid dove
#

@rancid dove you mean the code to invite your bot to a server?
@swift umbra
I do not want the code to count the number of people who are added to the server Like a plasma bot

earnest phoenix
#

@haughty mirage ^

haughty mirage
earnest phoenix
#

ah ok

rancid dove
#

@rancid dove the server count for your bot is public.
@swift umbra
Yes, I want a bot that can count inside the server Sorry poor English

drifting wedge
#

how can i add a reaction to a message

#

and run code if the AUTHOR reacted to it

#

dpy

rancid dove
#

what do you mean count inside the server?
@swift umbra
Count those who become new members of the server

#

js

#

Thanks

woven sundial
vernal rivet
#

Manage Channels

#

you are the only one that can answer that question. it is your bot, its how you want to do it.

sacred cypress
#

hey

#

I think

vernal rivet
#

happy_boy your doing a switch case for your commands

sacred cypress
#

nevermind

vernal rivet
#

^^^^^^^^

fallow steppe
#

Is it possible to make aliases to a command without having to duplicate the file and rename?

vocal sluice
#

aliases = ['alias here']

fallow steppe
#

Where do I add this, at the beginning of the code?

vocal sluice
#

show your code

fallow steppe
#

On it

vocal sluice
#

put it in a pastebin or something

fallow steppe
#

Gimme a minute

vocal sluice
#

put it under ur description

#

and make sure ther is a , after it

fallow steppe
#

Kk

vocal sluice
#

wait

#

im stupid

static nexus
#

hey guys

vocal sluice
#

uh

static nexus
#

i'm gonna ask one thing

#

it's non discord related

#

but rather

#

twitter bot

#
trends_result = api.trends_place(23424975)
trends = trends_result[0]['trends']
print(trends)
trends = filter(itemgetter("tweet_volume"), trends)
sorted_trends = sorted(trends, key=itemgetter("tweet_volume"), reverse=True)
trend_names = '\n'.join(trend['name'] for trend in sorted_trends[:4])
print(trend_names)
currentrends = trend_names

#

this code only gives me the trends after number 10 or 11

fallow steppe
#

Not sure if this is the right place to ask for development with non discord bots

dusk merlin
fallow steppe
#

👍

static nexus
#

it's development of anyhing

modest smelt
#

I need help

#

I added DSL to my server

#

but it doesnt show up here

#

pls help

waxen tinsel
#

1, wrong channel. 2, #support pins @modest smelt

drifting wedge
#

is it possible to like get ratelimited from mongo?

#

mongo atlas

#

and what about mongo that you host?

proven lantern
#

if you install mongo on the same machine as your code then there will be no rate limit

#

i dont think atlas is going to rate limit you though

drifting wedge
#

how do i check if a message is in dms?

#

dpy

sweet sand
#

how do i check if a message is in dms?
@drifting wedge js if(message.channel.type === "dm") { //something }

drifting wedge
#

dpy

#

proceeds so show djs

sweet sand
#

Srry

#

lol

drifting wedge
#

np lol

#

i get the jist

#

thanks

#

gist?

#

or jist?

hollow sedge
#

that moment when your default user is changed because you didnt use a deepcopy 😦

tired nimbus
#

you do that?

hollow sedge
#

do what?

tired nimbus
#

nvm

#

you can just rewrite your code to update the existing user's data

#

based on the object

hollow sedge
#

no i realize that

#

the problem is when i first insert that user's data into the db

tired nimbus
#

you can get every user's data then check if it matches the format of the default object

hollow sedge
#

but i dont have any data for that user. I'll elaborate:

  1. user calls command
  2. checks if user exists in db
  3. if user doesn't exist, insert default_user, else get their data from the db
  4. change user object based on what the command is supposed to do
  5. update user data based on that user object
tired nimbus
#

so you overwrited previous data?

#

you should create a function that checks the data before setting for undefined and impossible values or decreasing values

hollow sedge
#

well, yes i overwrote previous data, but i never set undefined or impossible values

tired nimbus
#

you should check if the value of something that only increases is smaller than previous data

#

or make a value that increments every time you update data

hollow sedge
#

I could, but that would be harder than making a deepcopy of it

tired nimbus
#

or actually use a test database

hollow sedge
#

this happened in my real database with real users

#

i didnt find it in my test database cause i have no friends to test with

tired nimbus
#

you should test it before publishing code

faint prism
#

or actually use a test database
@tired nimbus like in memory db

tired nimbus
#

some dbs have test databases

#

or have backup data auto generated

hollow sedge
#

i always test, I just didn't find this bug because it only happens when there is more than one person using the bot

faint prism
#

Just make a sqlite db or even a dictionary object in memory to test with

hollow sedge
#

eh

#

ill probably just add a testdb to mongodb atlas

#

makes it easier to visualize the data

faint prism
#

Or that I suppose

tired nimbus
#

for a test database you could just use a json or use a variable

faint prism
#

Although quite slow

hollow sedge
#

atlas isnt slow in my experience

faint prism
#

No to json,
Yes to variable/in memory object

#

atlas isnt slow in my experience
@hollow sedge it'd be slow in terms of unit tests

hollow sedge
#

ah ok

faint prism
#

Since those are typically only 1ms or so per test. A network call would add a ton of relative test time

hollow sedge
#

speaking of unit tests
i should probably add those in 🥴

faint prism
#

Yeah lol definitely

#

And couple that with a ci/cd pipeline, gating master branch, and you're set

drifting wedge
#

how do i check if a message is in dms?
dpy

#

discord python

faint prism
#

It's a property of the message

#

Or check if guild property is null ig

#

Idk how py does it's objects

hollow sedge
#

i guess..i would have to write custom unittest functions

drifting wedge
#

hmm

#

prob would do if guild == none

#

also should commands be accessible thrud,s?

#

like non guild related commands

faint prism
#

i guess..i would have to write custom unittest functions 😦
@hollow sedge that's how it works, yeah

hollow sedge
#

oh

#

sorry ive never used it lol

faint prism
#

Idk how js unit tests go, but I've heard Jest is a good framework

hollow sedge
#

im actually using python

faint prism
#

Hm I have even less experience with their packages

#

I'm sure there are some though

hollow sedge
#

yeah they have a standard unittest module

faint prism
earnest phoenix
#

I'm coding a discord bot in python how can I change my bots status??

#

Using python code

hollow sedge
#

oops

#

@earnest phoenix

faint prism
#

Well Grayson, you'll use the change presence

earnest phoenix
#

How do you know my name?

#

I need to know.

sudden geyser
#

Check your connected accounts

waxen tinsel
earnest phoenix
#

Oops

waxen tinsel
faint prism
#

Sleepy Joe told me

bright bane
#

yo guys

earnest phoenix
#

-Oop

bright bane
#

can someone help me test a gibeaway bot

faint prism
#

No

waxen tinsel
#

No

midnight blaze
#

N0

hollow sedge
#

why would you need help testing a giveaway bot of all things

faint prism
#

Just do unit tests or test on your own server

hollow sedge
#

that certainly can be done with only one person

earnest phoenix
#

I would help you but..

#

It is a giveaway bot.

bright bane
#

why would you need help testing a giveaway bot of all things
@hollow sedge Believe it or not, you cant test a random selector with 1 person

#

😂

faint prism
#

It's a bait bot* ftfy

sudden geyser
#

writing unit tests for commands is one thing I'll never understand how to do

waxen tinsel
#

Grayson here isn't very technically proficient qlaugh qlaugh

midnight blaze
#

I would help you, but you know the thing

#

@earnest phoenix

hollow sedge
#

@bright bane guess what

earnest phoenix
#

What?

hollow sedge
#

you can make a second discord account

bright bane
#

nah

#

i cant

hollow sedge
#

😮

bright bane
#

as soon as i make one

#

with my ip atleast

#

it says i need to verify

#

as soon as i make one

faint prism
#

No?

bright bane
#

yes?

midnight blaze
#

Mutant Pls stop

bright bane
#

do you live here

#

no

faint prism
#

Then use a VPN

#

Or a proxy

earnest phoenix
#

Grayson here isn't very technically proficient :qlaugh: :qlaugh:
@waxen tinsel Actually, I am.. I am a web designer etc

#

@bright bane stop please

bright bane
#

u guys keep going

#

just end it

#

stop

#

stop

#

sotp

waxen tinsel
#

Speaking of people who are not technically proficient..

bright bane
#

please

waxen tinsel
#

@bright bane

earnest phoenix
#

how about this @bright bane ill give you my vpn so you can make another account

midnight blaze
#

Css designer

faint prism
#

I feel like you're baiting by asking people to test some thing apparently enticing like a giveaway bot

split hazel
#

for fuck sake

#

take the hint

faint prism
#

It's sus

waxen tinsel
#

Lol

hollow sedge
earnest phoenix
#

O

midnight blaze
#

Joe Biden, come on man

waxen tinsel
#

@earnest phoenix was just harassing you for the username

midnight blaze
#

That username is 2 hood

waxen tinsel
#

Still right tho

earnest phoenix
#

-I

waxen tinsel
#

No

earnest phoenix
#

I watch the video. And Biden says if you dig in a mine you can program..

midnight blaze
#

Yeah

#

You guys saw that video

waxen tinsel
hollow sedge
#

what is that website

earnest phoenix
#

wrong channel sorry

hollow sedge
#

why that website

midnight blaze
#

Why that webpage

#

Ffs

earnest phoenix
#

I kinda want to help him just for entertainment tbh

waxen tinsel
#

Why would he do any of that

earnest phoenix
#

@bright bane I'll help 🙂

waxen tinsel
#

When he can just

earnest phoenix
#

@earnest phoenix Joe Biden also says you arent black if you dont vote for him

waxen tinsel
#

Make another account

hollow sedge
#

hes helping you in return for your vote

waxen tinsel
#

By discord or..

earnest phoenix
#

O

midnight blaze
faint prism
#

@earnest phoenix Ovpn can contain credentials btw. Be careful sharing those

midnight blaze
#

Here

earnest phoenix
#

mine doesnt

waxen tinsel
#

Well thats incorrect

earnest phoenix
#

its a pritunl setup

hollow sedge
#

@earnest phoenix can you maybe type faster, like why are just saying "O" or "-I"

waxen tinsel
#

Unless this only happens in certain countries

earnest phoenix
#

its a public vpn i give to people

waxen tinsel
#

Ive made 3 accounts from same IP no vpn and no issues

earnest phoenix
#

@earnest phoenix can you maybe type faster, like why are just saying "O" or "-I"
@hollow sedge Because, Why not

faint prism
#

I've made 2

waxen tinsel
#

Bruh

hollow sedge
#

@hollow sedge Because, Why not
@earnest phoenix classic biden, the troll

waxen tinsel
#

Discord hates scotland apparently

midnight blaze
#

Biden say come on man

#

Or malarki

#

Otherwise it's not authentic

waxen tinsel
#

Biden Bingo words essentially

earnest phoenix
#

🙂

midnight blaze
#

Or

#

Look fat

hollow sedge
#

@earnest phoenix do you know how to code? or go mining for coal?

waxen tinsel
#

Both

midnight blaze
#

Mining for coal is more complicated than coding

earnest phoenix
#

Yes, both

waxen tinsel
#

at the same time

midnight blaze
#

For sure

waxen tinsel
#

True

hollow sedge
#

at the same time
@waxen tinsel joe biden the chad

faint prism
#

Is this still development?

midnight blaze
#

Yes

#

It's about coals

faint prism
#

Lol

waxen tinsel
#

Oh shoot this is dev?

#

Had no idea ngl

#

How did we get here

midnight blaze
#

No clue

hollow sedge
#

blame it on @earnest phoenix

waxen tinsel
earnest phoenix
#

Wow

hollow sedge
#

this guy with the one word responses
sometimes one letter

earnest phoenix
#

Yup

#

O is a abbreviation for "Oh"you pronounce O and Oh the same way.

midnight blaze
#

Well, let's just bring Joe Biden on starboard

sudden geyser
#

a => ah => ahh => ahhh => ...

waxen tinsel
earnest phoenix
#

I can't react to my own message 🙂

waxen tinsel
#

Not w/ stars

sinful belfry
#

none of you will even be able to talk if you continue like this

faint prism
dusky garden
#

lol

#

ah

#

they kicked cyd

sinful belfry
#

why are you continuing

dusky garden
#

cuase he was offline

#

nice

dense patio
#

i keep getting this error (discord.js v12):
UnhandledPromiseRejectionWarning: DiscordAPIError: Unknown Message
only started happening after that new change the other day, and i don't know what is causing it

sudden geyser
#

Yeah, those errors can be hard to debug as the stacktrace isn't useful.

#

You should try experimenting, stepping in and out of your code until you can reach what block of code is causing it to throw that error message.

#

The error is self-explanatory though: Discord couldn't find the message. That usually occurs when you do something like message.channel.messages.fetch(...)

dense patio
#

yeah that's what i was thinking, but there's only 1 place where it ever fetches messages and no one has ran that command recently

#

i'll play with it and see what happens

weak grotto
#

Hello, my bot's page has problems with the page's CSS
And the truth looks pretty bad ..
Does anyone know how to fix it?

dense patio
#

well what's wrong with it

weak grotto
dense patio
#

check your position properties?

weak grotto
#

Friend I think you misunderstand me, in the PREVIEW it looks like this, in my c:/ it also looks like this, when I give submit the page it looks horrible

hollow sedge
#

t/hack seems legit

weak grotto
#

fixed :/

hollow sedge
#

What was the problem @weak grotto

weak grotto
#

I put 2 articles to make a CSS GRID, so I only put it in 1 article, it already looks better but I won't be able to do CSS GRID

hollow sedge
#

I see

#

Btw

#

Why are you using <p> in your css

weak grotto
#

Why am I making a paragraph?

hollow sedge
#
img { max-width: 50%; }<p>h1:hover {text-shadow: 0px 2px 1px #333333, 0px 0px 4px #70b231;}</p><p>.contenedor-tyra {width: 95%;max-width: 1200px;margin: 0 auto;text-align: center;</p><p>}</p><p>.entrada-blog a {display: inline-block;background-color: #2196F3;color: white;padding: 10px 20px;text-decoration: none;font-weight: bold;text-transform: uppercase;}</p><p>@media (min-width:480px) {.dos-columnas {display: flex;justify-content: space-between;}.entrada-blog {flex-basis: calc(50% - 1rem);}}```
#

Oops

#

You get the point though

modern latch
indigo flax
#
const client = new Discord.Client()

const config = require('./config.json')
const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));

client.on('ready', () => {
  console.log('The client is ready!')

client.login(config.token)```
#

is that correct

modern latch
#

No

indigo flax
#

.

#

wdym

modern latch
#

It's not good enough

#

more

hollow sedge
#

<@&304313580025544704> this guy is trolling

dusky garden
#

lol

indigo flax
#

it works tho right?

modern latch
#

Bye

dusky garden
#

austin is fine

#

itll work

sinful belfry
#

-atmods @hollow sedge

gilded plankBOT
#

@hollow sedge

Please do not mention (ping) more than one or two moderators for help, unless there is an emergency.

Here are some examples of emergencies:

  • Raids / Multiple members mass spamming.
  • Severe disruption of Discord's ToS (NSFW content, etc)
  • Anything that requires more than 2 moderators to handle.
split hazel
#

why

modern latch
#

Is nto trolling ❤️

hollow sedge
#

Oops I should've @ one person

#

Mb

indigo flax
#

im not trolling..

modern latch
#

who trolls

hollow sedge
#

I'm talking about Table

modern latch
#

thats messed up

#

no your not

sinful belfry
#

don't care, keep the beef outta here

modern latch
#

whats beef

indigo flax
#

can i change const commandFiles to const commands

lost berry
#

-atm- 3fast5me

hollow sedge
#

😫

modern latch
#

Excuse me i can't eat beef

sinful belfry
#

😩 drama

hollow sedge
#

I guess table stays here

dusky garden
#

chill

indigo flax
#

GUYS WRONG CHANNEL

modern latch
#

I'm vegan

indigo flax
#

OK

#

GO TO

sinful belfry
#

@modern latch now you're just being a clown

indigo flax
#

NOT HERE

#

STOP

#

anyways

modern latch
#

@modern latch now you're just being a clown
@sinful belfry No am not am vegan

sinful belfry
indigo flax
#

as i was saying

#

const commandFiles

modern latch
#

ok

indigo flax
#

can i change it to

#

const commands

sinful belfry
#

if you continue, you will be muted, ok?

vernal rivet
#

?

hollow sedge
#

He's talking to table

sinful belfry
#

^

indigo flax
#

guys

sinful belfry
#

feel free to chat development here lol

indigo flax
#

can i change const commandFiles to const commands

hollow sedge
#

@indigo flax name of variable does not matter

indigo flax
#

ok

#

thx

hollow sedge
#

Change it to whatever you like

indigo flax
#

ok

vernal rivet
#

What's the question?

hollow sedge
#
const client = new Discord.Client()

const config = require('./config.json')
const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));

client.on('ready', () => {
  console.log('The client is ready!')

client.login(config.token)```

@indigo flax

vernal rivet
#

Oh ok

indigo flax
#

const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));

#

works

#

right?

#

or did i type it wrong

vernal rivet
#

Is fs require in the file?

indigo flax
#

shoot

#

now it is

vernal rivet
#

Then yes

indigo flax
#

ok

digital ibex
#

hi, im having an issue i dont understand..

vernal rivet
#

What's your issue?

digital ibex
#

i have an object which is the guild in my database, and when i do guild.purgeLogs it says undefied, when i do guild it has purgeLogs inside.. any ideas?

#

this is only on the website btw, on the bot for some reason it works as intended

vernal rivet
#

Is the property undefined or the guild object undefined?

digital ibex
#

but every other thing inside the object returns the correct value, but purgeLogs is undefined

#

property is undefined

vernal rivet
#

Is this d.js?

digital ibex
#

no

indigo flax
#

question

digital ibex
#

its got nothing to with discord lol

indigo flax
#

const ban = require('./ban.js')

#

does that

#

mean

#

it reads

#

commands/ban.js

#

or do i need something else

digital ibex
#

only unless it has a module.exports inside ban.js, austin

vernal rivet
#

Oh, then your not passing it into object lost

digital ibex
#

i am, lemme show u

spare goblet
indigo flax
#

@spare goblet i fixed it

spare goblet
vernal rivet
#

Lmao. Tbh if I didn't see that there, then he did a good job at hiding it

digital ibex
#

if i do guild.logs it returns the stuff i need, guild.prefix the stuff i need etc

#

but guild.purgeLogs no worky

vernal rivet
#

Are you treating the purgeLogs as an array?

digital ibex
#

no, its an object

indigo flax
#

const command = require('./command')

vernal rivet
#

That's not an object

indigo flax
#

is that

#

command

#

or

#

command/command

vernal rivet
#

[] is an array

indigo flax
#

sorry same question

#

im still confused

digital ibex
#

purgeLogs: {}

#

not purgeLogs: []

#

messages is an array

vernal rivet
#

Check that image you sent here

digital ibex
#

not the purgeLogs itself

#

oh im actually clapped lmfao

indigo flax
#

@vernal rivet ```const command = require('./command')

#

command/command

#

or

#

just

#

command

digital ibex
#

so yeah. i am 🤦 lol

indigo flax
#

if i want to do command/command

vernal rivet
#

Yes it can be a dir or a file

indigo flax
#

then would it be

digital ibex
#

its been a while since i've touched this

indigo flax
#

./command/command?

digital ibex
#

./command/command

indigo flax
#

ok

#

thx

vernal rivet
#

./command/ping.js

#

Example

indigo flax
#

thx

vernal rivet
#

Np

#

So yea that's your problem lost 😅

digital ibex
#

wdym?

vernal rivet
#

Technically you can't treat the array like an object. So when you said it's undefined then that could mean you didn't declare it, you didn't pass it in correctly, or your treating it like an object, which is not allowed. Try accessing the first item in the array

sage bobcat
#

One message removed from a suspended account.

vernal rivet
#

Yes what's up?

digital ibex
#

i can still access the variable though, its a property

sage bobcat
#

One message removed from a suspended account.

vernal rivet
#

From my knowledge I think your artifact I'd might be an invalid form of an I'd.

digital ibex
#

i just added something to commands and that returns an array

#

with the data inside and as expected

vernal rivet
#

Oh wait do console.debug(guild) lost.

digital ibex
#

nvm im clapped today

vernal rivet
#

Oofers

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

vernal rivet
#

FLdogekek so I was partly right

digital ibex
vernal rivet
#

And it says purgeLogs is undefined?

digital ibex
#

yes

#

everything else is fine

vernal rivet
#

Can you show the error please?

digital ibex
#

it just logs undefined

vernal rivet
#

What does your code look like for that?

digital ibex
#

guild.purgeLogs

vernal rivet
#

Are you logging it after the declaration, or later on?

digital ibex
#

after what declaration?

vernal rivet
#

Guild declaration

digital ibex
#

im doing that on a different process

#

when messages gets purged it adds the data to that

#

even if theres nothing in that, it should still return something

vernal rivet
#

Where's tim. He is the J's wizard. FLRemDed

honest perch
#

If tim left this server it would be an apocalypse but a smart strategy for him as hundreds of js devs would swarm his server

hollow sedge
#

do you need an intent to DM?

earnest phoenix
#

no

#

that's a REST request

hollow sedge
#

huh ok thanks

#

for some reason my bot does not respond to DMs

earnest phoenix
#

you're more than likely filtering them out from your message handler

#

or if it's sharded, dms go to shard 0

hollow sedge
#

well i havent done anything on_message so idk

#

it's because I was getting the guild prefix on message, but obviously that's not possible for DMs

earnest phoenix
#

makes sense

muted venture
#

is anyone here has a music bot that supports spotify urls?
i have a question
(language be javascript would be a lot better)

earnest phoenix
#

best practice is to just ignore dms altogether

hollow sedge
#

yeah, that's my plan

sudden geyser
#

A lot of bots that have Spotify support just take the name and search for it on YouTube.

#

You can't stream songs from Spotify as it's against their ToS, but I believe it's also against YouTube's ToS, but who cares.

earnest phoenix
#

spotify actually takes legal action

muted venture
#

i know it's impossilbe from spotify

earnest phoenix
#

youtube doesn't care but it's also against their tos too

muted venture
#

i'm getting spotify data with a package and im searching it like this:
spData.title + ' - ' + spData.artist

but some songs would be wrong, so i was thinking maybe someone knows a better format search,

Note: im using simple-youtube-api package to search in youtube, if u have a better one, i would be happy to hear it

earnest phoenix
#

there's no "perfect format" per se

#

you'll always get an estimated song

#

in case you haven't noticed pretty much all bots sometimes get spotify songs wrong

muted venture
#

well, i don't know how

#

but this mf rythm is getting them all right

#

XDDD

sudden geyser
#

There's no perfect format like cry said, but it's more common to do Artist Name - Song Name

earnest phoenix
#

or remove the dash altogether

sudden geyser
#

yeah that too

earnest phoenix
#

that package is probably scraping youtube searches which means the queries are tuned to be humanized

#

i.e. just search it in a format that a human would

muted venture
#

well we have a lot of diffrent humans, like the one who search lyrics and ..... XDDD
but thanks about that @sudden geyser!

#

thank u too @earnest phoenix

hollow sedge
#

anyone know a good website for listing my bot's commands?

sudden geyser
#

or your github repository

hollow sedge
#

alright thanks

earnest phoenix
#

Hi

#

Does anyone have a logging code I can have for a bot ? kinda like carl-bot logs ?

#

<Client>.users I've found no longer caches all users the bot has a mutual server with, and only like 50-100? I've found it only caches users if they do something like join a server or send a message somewhere, it used to be that it cached all users regardless - is there any way to return to this?
This is discord.js Version 12 btw, ping me if you reply

sudden geyser
#

Does anyone have a logging code I can have for a bot ? kinda like carl-bot logs ?
@earnest phoenix listen for events and log them to their destined channel. We're here to help you with issues you have, but not give you the answer to everything (such as "pre-made" commands).

#

@earnest phoenix are you looking to cache all users on startup (fetchAllMembers option)? Do you have the correct intents enabled?

earnest phoenix
#

ah the fetchAllMembers option is probably what I need

#

I'll try it

#

Tried the fetchAllMembers option, bot took longer to login but it's still only adding users to <Client>.users when they send a message

#

this only started happening today though, did something with discord.js change?

#

or the Discord API?

sudden geyser
#

Your issue is likely due to intents.

#

That got rolled out yesterday.

quartz kindle
#

you need to enable the GUILD_MEMBERS toggle in your dev portal

sudden geyser
#

Which affects the state of your bot by what events you'll receive.

earnest phoenix
#

oh. Is that the Server Members intent?

#

Assuming it is, I'll have to recode everything to fetch users individually that aren't in the cache, which isn't really too much of a problem I guess

quartz kindle
#

in order to be able to fetch all members, you need the server members intent

#

in order to receive online users at login, you need the presence intent

earnest phoenix
#

are there actually any bots that don't need that information?

quartz kindle
#

lots

#

mine doesnt need anything whatsoever other than messages

earnest phoenix
#

how would I go about going through lots of users the bot has a mutual guild with without that?

#

the fetchUser() function is kinda slow

quartz kindle
#

you want to see how many guilds the same user is in? or what?

earnest phoenix
#

No, I've just been using the <Client>.users collection assuming it has all the users the bot knows about in a lot

quartz kindle
#

that was never the case, even before this change

#

the collection only contained online users

obtuse jolt
#

How do I use emojis from a different shard

quartz kindle
#

unless you use fetchAllMembers of course

#

@obtuse jolt what do you want to do with them?

obtuse jolt
#

Reactions and in embeds

#

@earnest phoenix you...

quartz kindle
#

just use their ids

earnest phoenix
#

yeah I use fetchAllMembers - is there any way for me to achieve a similar effect without the Guild members intent?

obtuse jolt
#

just use their ids
@quartz kindle I tried this it just said unknown emojis

earnest phoenix
#

@earnest phoenix you...
@obtuse jolt hi

quartz kindle
#

@earnest phoenix nope

obtuse jolt
#

@obtuse jolt hi
@earnest phoenix it’s... been quite a while

earnest phoenix
#

welp, guess I'm leaving bot development

quartz kindle
#

rip

#

what kind of feature did you make that needs that?

earnest phoenix
#

Like it means you can't have autoroles, member join/leave logs

#

I have commands wherein I need to fetch a lot of users based on IDs I have too

#

them not being in the cache makes them take way too long to be usable

obtuse jolt
#

o shit I need to make all my logs support sharding crap that’s not good

quartz kindle
#

well, there are workarounds probably, depending on your exact use case

#

is your bot verified? and you didnt apply for the guild members intent when you verified?

earnest phoenix
#

I can't verify

#

I have no ID

soft horizon
#

hi

quartz kindle
#

ah

earnest phoenix
#

I'm 17 and I've never needed it

obtuse jolt
#

You can have a passport at 17

#

they accept those as a form of ID

quartz kindle
#

they accept anything that has a photo of you

#

even a bicycle license lul

crimson vapor
#

Anyone know if there is a way to do this more efficiently?

const png = async (_pngPath) => {
  if (Math.floor(Math.random() * 100) !== 69) return;
  _pngPath = path.resolve(__dirname + '../../../' + _pngPath);
  if (!existsSync(_pngPath)) return;
  let image = await Canvas.loadImage(_pngPath);
  let canvas = Canvas.createCanvas(image.width, image.height);
  let ctx = canvas.getContext('2d');
  ctx.translate(image.width, 0);
  ctx.rotate(Math.PI / 2);
  ctx.drawImage(image, 0, 0, image.width, image.height);
  writeFileSync(_pngPath, canvas.toBuffer());
  return;
};```
earnest phoenix
#

really? I'll try something I have then

crimson vapor
#

take a .png and rotate it

quartz kindle
#

if you want to save the image back to disk, thats pretty much how you do it

crimson vapor
#

ok

obtuse jolt
#

@quartz kindle how can I download a file sent in chat into a directory

#

With a certain name

crimson vapor
#

which language?

#

and lib

obtuse jolt
#

nodejs djs

quartz kindle
#

check message.attachments and download it from the url

obtuse jolt
#

Yeah how do I do the downloading part

quartz kindle
#

any http lib

#

like axios, node-fetch, etc

crimson vapor
#

then just use fs and write the file right

quartz kindle
#

you can also stream it directly to the file instead of buffering it in memory

crimson vapor
#

oh how do you do that?

ancient nova
#

does anyone know how would one make a effective command cooldown? (d.js)

quartz kindle
#

fs.createWriteStream

bright bane
#

hey boomers

#

just a question

#

how does break/continue work in js?

#

it seems to be "odd"

quartz kindle
#

break = cancel loop
continue = skip current iteration

bright bane
#

wait

#

so

#

why doesnt it work inside of functions, even if the functions are in a loop

#

and why does it take something similar to a paramater?

quartz kindle
#

something similar to a parameter?

crimson vapor
#

Tim do you know if it is possible or how to load a pfd into canvas

boreal iron
#

for( ... )
{
if(true) break;

doSomethingElse();
}

bright bane
#

something similar to a parameter?
@quartz kindle Yeah you can do like break smth; Just like how you can do return smth;

#

im not sure what the "smth" for break is tho

quartz kindle
#

ah

#

you can create labels for loops

#

although nobody uses that

#

for example if you have a loop inside a loop, you can create a label for the outer loop, so you can chose which one you want to break

bright bane
#

for example if you have a loop inside a loop, you can create a label for the outer loop, so you can chose which one you want to break
@quartz kindle How does one make a label, because I bet that way I can break inside a function thats inside of the loop

quartz kindle
#

@crimson vapor pfd? you mean pdf? lul

crimson vapor
#

yes

#

I didn't see that mistake

boreal iron
#

Etc

crimson vapor
#

before I kinda forgot the word possible

#

but do you know if it is possible?

bright bane
#

so how do you label a loop tho

#

it cant be like

#

let <labelname> = for (...) {...}

crimson vapor
bright bane
#

since its not something resolveable

#

is it?

crimson vapor
#

looks to be what you are looking for

bright bane
#

oh

#

wait

#

oh level

#

ah

#

oh u just label with colon

#

ok

#

hold up

#

gotta try this lol

quartz kindle
crimson vapor
#

what

#

label is a name

bright bane
#

wait

#
events.js:287
      throw er; // Unhandled 'error' event
      ^

SyntaxError: Undefined label 'loop'
crimson vapor
#

it could be
coolLoop:

bright bane
#

when I do this

boreal iron
#

@quartz kindle huh JS doesn’t support this?

#

One second

bright bane
#
loop:for(...){..}
#

somewhere down the line I do break loop;

quartz kindle
#

are you trying to break it from outside?

#

you can only break it from inside the loop

fast trench
#

is anyone else having problems with this not working? client.users.cache.size

boreal iron
#

@quartz kindle haha JS is just real bullshit doesn’t even support levels for break and continue

quartz kindle
bright bane
#

are you trying to break it from outside?
@quartz kindle no the inside

boreal iron
#

I assumed it would... embarrassing

bright bane
#

its inside of a function

#

thats inside

#

of the loop :/

fast trench
#

ahhh forgot about that lol @quartz kindle thank you 🙂

quartz kindle
#

you cant do it from inside functions

crimson vapor
#

is the function defined inside of the loop?

quartz kindle
#

functions create a separate scope

#

anything inside the function is not aware the function is inside of a loop

crimson vapor
#

could you use the label as an argument?

fast trench
#

So what is the fix for it?

bright bane
#

anything inside the function is not aware the function is inside of a loop
@quartz kindle So even breaking with a label can't solve this

#

thats hella gae

quartz kindle
#

¯_(ツ)_/¯

#

there are a million other ways to do it tho

#

thats why nobody uses labels for loops

fast trench
#

any idea on a fix?

quartz kindle
#

did you read the news?

#

it explains everything you need to know lol

boreal iron
#

Don’t use JS lmao

bright bane
#

bruh'

fast trench
#

yes...but it has a solution in there and idk what to do

quartz kindle
#

read the solution

#

lmao

fast trench
#

I just said idk what to do...

quartz kindle
#

because you didnt read

boreal iron
fast trench
#

yes...I did read it...

crimson vapor
#

but it has a solution in there

#

what

quartz kindle
crimson vapor
#

so it has a solution

#

but you dont know what to do

#

not attacking you just pointing out a flaw in the reasoning I see

quartz kindle
#

@fast trench TLDR:
you need the server members intent to be able to request guild members and use fetchAllMembers
and you need the presences intent to get online users at login

#

both of those can be enabled in your bot's developer portal

fast trench
#

Fixed thank you.

earnest phoenix
#

i keep getting this error while trying to load a json file:

#

Help pls!

Ignoring exception in on_ready
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/discord/client.py", line 333, in _run_event
    await coro(*args, **kwargs)
  File "main.py", line 141, in on_ready
    data= json.load(f)
  File "/usr/lib64/python3.7/json/__init__.py", line 296, in load
    parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
  File "/usr/lib64/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/usr/lib64/python3.7/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib64/python3.7/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
#

line of code where the error occurs, data=json.load(f)

#

i defined in this format:

#
with open('potd.json', 'r') as f
#

Does anyone here have experience with using node-gyp before? I ran node-gyp rebuild and this error appeared saying bindings.gyp is not found and I have no idea about what is that.

silver lintel
#
user.setNickname(args.slice(1).join(" "))
      .catch((err) => message.channel.send("I do not have permission to change this user's nickname"))
      .then(message.channel.send(`:white_check_mark: | Successfully changed **${user.user.tag}'s** nickname to **${args.slice(1).join(" ")}**`));
    ```
both of them are sending, how do i make only one sends
pale vessel
#

.then() first, and then .catch()

silver lintel
#

it still doesnt work

#

still sends 2

pale vessel
#

.then(() => message.channel.send())

#

not .then(message.channel.send())

magic wind
pale vessel
magic wind
#

@mint thicket what should i need to do?

copper cradle
#

@earnest phoenix what's inside the json file

silver lintel
#

omg tysm flazepe

earnest phoenix
#

how to make folders for difrent types of commands like admin commands fun commands on discord.js?

#

@earnest phoenix it means your json is empty

drowsy epoch
#

does anyone know how to stop a bot from doing @everyone

placid iron
#

Allowed mentions

#

Also just don't give them @everyone perms

drowsy epoch
#

but it still does @everyone

quartz kindle
#

disableMentions:"everyone"

#

In your client options (assuming discord.js)

drowsy epoch
#

Okay

slender wagon
#

how tf do u update node in heroku

woven sundial
#

Hi, is it possible to update nodejs without updating npm ?

#

on debian

pale vessel
#

@slender wagon you specify the version in package.json

#

"engines": { "node": "12.x" } for example

honest perch
#

node? More like storage

#

Nevermind

#

Dead joke

sudden geyser
#

size, pointers, cons/nil, segmentation fault

tired panther
#
const premium = await client.shard.broadcastEval(`this.guilds.cache.get("692021327283879957").members.cache.get("${msg.author.id}")`);
    if(!premium){
        const pembed = new Discord.MessageEmbed();
        pembed.setTitle("This is a  premium feature.🌟");
        pembed.setDescription("Join **[this]()** server to unlock premium tier")
        pembed.setFooter(`Stay in the server, to have premium ;)`);
        pembed.setColor(`#FAA61A`)
       return msg.channel.send({embed: pembed,});
    }

why it does not work? Any idea?
no error
it should get the user from that guild

sudden geyser
#

.broadcastEval returns an array to my knowledge.

tired panther
#

yes right

#

then use instead fetchtclientvalues?

sudden geyser
#

That also returns an array.

tired panther
#

So I have to irritate through the object?

sudden geyser
#

That's one way, yes.

tired panther
#

and the other other one ? xD

sudden geyser
#

wot

restive furnace
#

@tired panther map or reduce

tired panther
#

okay

#

@restive furnace How do i reduce , I just know it when I add something, but remove anything , how does thet work?

restive furnace
#

[array]#reduce(params)

vocal sluice
#

how would you have a bot remove a users reaction, but have the bots reaction stay?

sudden geyser
#

what library

vocal sluice
#

js

pale vessel
#

awesome

crimson vapor
#

there are like 4 js libs

sudden geyser
#

Use <Message>.reactions.cache.get(...).users.remove(...) to remove a single user reaction. For example, if there are 5 reactions for 🎉 and I use that expression, there will be four. See https://discord.js.org/#/docs/main/stable/class/Message?scrollTo=reactions for more info.

little meteor
#

@earnest phoenix python count = 0 for guild in client.guilds: count += len(guild.members)

#

try this

sudden geyser
#

That's not very reliable, as you'll have to manage a cache which may not contain every member.

#

You should be able to add up guild.member_count

earnest phoenix
#

not working

sudden geyser
#

What isn't working about it

little meteor
#

That's not very reliable, as you'll have to manage a cache which may not contain every member.
@sudden geyser I see thanks for the info