#development

1 messages · Page 1168 of 1

faint prism
#

man I hate getting those type of errors in linux lol

ionic shard
#

ikr

faint prism
#

You're missing a lib

#

Try rebuilding the project first

ionic shard
#

um

slate oyster
#

Anybody know how to use breakpoints in Eclipse?
I would have thought it would have been this toggle breakpoint button...

#

But it doesn't actually work

faint prism
#

You have to run in debug @slate oyster

slender thistle
#

Can anyone help me in eval command of discord.py
@safe kelp commands extension or on_message?

slate oyster
#

Ah, gotcha

restive furnace
#

is setting status every 5s api abuse?
Otherwise, take a look wherever you are repeatedly calling an API.
Make sure to space out your requests as to not spam
@faint prism it is, the minimum is 12secs

slender thistle
#

5/20s is the ratelimit

slate oyster
#

@faint prism That did not work
I created a breakpoint in my main method to test

slender thistle
#

so once per 4 seconds is the bare minimum

slate oyster
#

But it did not stop at my breakpoint

restive furnace
#

is that java?

faint prism
#

Ye

slate oyster
#

Yea

merry grove
#
      { level: 2,

        name: "2",

        check: (message) => {
          try {
            const modRole = message.guild.roles.find(r => r.name.toLowerCase() === message.settings.modRole.toLowerCase());
            if (modRole && message.member.roles.has(modRole.id)) return true;
          } catch (e) {
            return false;
          }
        }
      },

This is for the permission levels but it isnt working and there is no error.

restive furnace
#

alright

faint prism
#

Ant then pressed this button
@slate oyster do you have multiple main functions in your project by chance?

delicate shore
#

wait

fluid basin
#

was*

slate oyster
#

Only one

delicate shore
#

means everyone could chat there?

fluid basin
#

was*

earnest phoenix
#

no

fluid basin
#

now its locked

#

so don't bother

safe kelp
#

@slender thistle command extension

faint prism
#

@slate oyster Is your program actually launching?

slate oyster
#

Yes

#

It should not be logging anything yet, as that code doesn't get called until later

faint prism
slate oyster
#

It means that the class cannot be extended or instatiated
In other words, it can only run static methods

merry grove
#
      { level: 2,

        name: "2",

        check: (message) => {
          try {
            const modRole = message.guild.roles.find(r => r.name.toLowerCase() === message.settings.modRole.toLowerCase());
            if (modRole && message.member.roles.has(modRole.id)) return true;
          } catch (e) {
            return false;
          }
        }
      },

Its the permission levels but it doesnt give them the permission level and there is no error.

faint prism
slate oyster
#

So it thinks breakpoints are disabled?
I'll have to figure out how to enable them

faint prism
#

Could be specific to that breakpoint perhaps.
@slate oyster

slate oyster
#

@faint prism Thanks. I looked up how to enable breakpoints and got the breakpoint to work
I didn't realize breakpoints were disabled
Thanks!

zinc condor
#

A compiled programming language would go
Code->Tokenizer->AST->Representation->LLVM->Binary
here is my idea
An Unreal Blueprinting like language with drag and drop which compiles directly with LLVM. Low level visual scripting that skips 3 of those steps and straight modifies representation of the code
Mainly just a showoff or cool project but would actually be nice
write simple programs that can interface with C++ libs with simple bindings and stuff
what you guys thinking?
maybe even a discord lib for it

faint prism
#

I think anything lower than high-level programming languages is going to go over most people's heads here.

quartz kindle
#

scratch 2

zinc condor
#

well its designed to be lightweight, easy, and fast but ALSO low level

#

so it might not seem low level

#

but it is operating close to low level

#

its just abstracted a bit

faint prism
#

How would it handle different processor instruction sets? I am not well versed on anything past tokenizing, other than knowing a lot of compilers use JIT or a intermediary language

zinc condor
#

well LLVM is a library designed for actually compiling the code for you

#

by default it supports most instruction sets and most operating systems

#

this actually skips tokenizing and the AST and straight goes to representation

#

which then gets compiled

faint prism
#

If you're skipping tokenizing, are you just writing in a very low-level language that LLVM understands?

#

This is a bit over my head, but I'm trying to keep up

zinc condor
#

the process by default takes your code, tokenizes it, puts it in an AST, then makes it a representation of code that LLVM understands

visual lake
#

idk how to use webhook how i can ?

zinc condor
#

usually looks like an array of objects and a main one

#

since mine is visual scripting and has an editor it would effectively skip symbol checking and conversion because the editor directly pushes items to the representation on modification

#

and that conversion is only one step

#

makes an edit->representation object modified->LLVM

#

its not really a language when you think about it

#

a visual language?

#

visual programming

faint prism
#

Sounds like an interesting project, that's for sure.

#

I'd have to dive into learning how compilers are made to understand most of it

slate oyster
#

I think anything lower than high-level programming languages is going to go over most people's heads here.
@faint prism Tbh I wrote something in Qemu once

#

But that's the only time I've done anything lower level than Java, Lua, or JS

faint prism
#

Reverse engineering my own C# programs with a disassembler was the lowest I've ever gone

slate oyster
#

Ow, that's some hardcore stuff
I can barely write assembly, much less read it

#

And I'd assume a disassembler wouldn't just output nice C code

faint prism
#

I was mostly following syscalls and logic trees then comparing it to my source

#

Nope lol

slate oyster
#

The only disassembler I've used is JDGUI

faint prism
#

I mean Ghidra is pretty good and the NSA make that tool lol

slate oyster
#

Anyways
Writing a program that runs on Qemu is the only low-level thing I've ever done
I've completely forgotten C since then
And - let's be honest - I hardly understood assembly in the first place

opaque seal
#

I would like to display my bot uptime on its website, with like a graph and statistics about it's uptime. Any idea on how I could achieve that?

zinc condor
#

5_bugcatstare there are many ways to dissasemble Java and C# code

#

they arent actually compiled rather compiled to VM readable bytecode

#

so you can just follow their assemblies and reverse it. The code wont be as pretty and might vary from the original tho

faint prism
#

Mhmm, I've seen that. It's pretty cool

#

A lot of disassemblers have that neat feature

zinc condor
#

No thats remaking C code from assembly generated by C no?

#

im talking about dissasembling a VM assembly, not actual asm code

#

thats how you get Java source

#

or C#

faint prism
#

Oh I said C# earlier. I meant C. My bad

slate oyster
#

I've only used JDGUI
Which discompiles Java bytecode
I had been under the assumption that C# compiled to compiled assembly machine code, but I guess I was wrong

zinc condor
#

ah

faint prism
#

Kind of afraid to disassemble my C# code tbh. Idk what abstractions and interfaces look like in assembly, but I'd imagine it's frightful

zinc condor
#

ok its not assembly

#

its a .NET assembly

#

different representation

#

not asm

#

its kinda like thecode representation generated in bytecode

restive furnace
#

i like real asm

#

even i understand 1/10 of it

earnest phoenix
#

Reverse engineering coinimp rn

#

Then I'll publish an npm package

quartz kindle
#

i tried reverse engineering a delphi program and got nowhere lul

restive furnace
#

try reverse engineer native program

slender thistle
#

...a Delphi program?

#

isn't it just Object Pascal?

zinc condor
#

pascal has classes?

#

oh im dum

#

im thinking of fortran

slender thistle
#

Object Pascal does, I guess. In my college, we work with PascalABC and Delphi.

And in Delphi, we don't really do shit like custom classes. Just creating the UI and then utilizing events (methods)

quartz kindle
#

delphi and object pascal are pretty much the same thing no?

slender thistle
#

I mean, Delphi is the IDE for Object Pascal

#

as far as I'm informed, at least

#

so eh

quartz kindle
#

well wiki says this

slender thistle
#

🤔

#

Once again, I doubt the level of professionalism in my college.

#

Our programming teacher didn't know what regex is

#

but it's rather interesting

placid iron
quartz kindle
#

technology moves too fast

plucky harness
#

am wondering how u guys use timers on database or anywhere. Where you store remaining time for let's say top.gg vote

quartz kindle
#

things become obsolete so quickly that by the time programming teachers get qualified to teach in unis, their entire field is no longer relevant

#

store timestamps

plucky harness
#

and

#

then calculate with a script?

quartz kindle
#

yes

slender thistle
#

technology moves too fast
Tim, no joke. You just made me realize that and changed my mind about my country's education system with one sentence

plucky harness
#

hmm

#

which education system

quartz kindle
#

lmao

plucky harness
#

everywhere education system is bad

#

they teach useless things

#

and arent updated with newer things

slender thistle
#

I mean, we are still taught PascalABC instead of stuff like in-depth Java/C#/ASM/C/Python/JS

sharp thicket
#

hi does anyone know how to make it like number Members

#

discord.js

quartz kindle
#

number members?

#

you mean count them?

sharp thicket
#

yes

#

like how many members in all the guilds my bot is in

#

is there like a property for it

fleet zealot
#

client.users.cache.size

sharp thicket
#

oh

quartz kindle
#

you need to loop over guilds and combine their guild.memberCount property

fleet zealot
#

no

cinder patio
#

We're been learning visual basic for over 2 years now... started at C++ and C# and moved to Visual Basic, no clue why, would've loved to stay at C++ or C#

quartz kindle
#

client.users.cache.size will only give you cached users, which means only users who are online and users who sent messages or did something

fleet zealot
#

hmm

#

client.users.fetch() then

quartz kindle
#

that will fetch a single user

fleet zealot
#

oh

sharp thicket
#

yes

fleet zealot
sharp thicket
#

thats true e.e

fleet zealot
#

I just checked

#

that's right

sharp thicket
#

so client.users.cache.size ??

quartz kindle
#

if you only want online users, yes

fleet zealot
#

client.users.cache.size will only give you cached users, which means only users who are online and users who sent messages or did something

sharp thicket
#

as i don't rlly want alts showing

#

oh

#

then how do i make it all users e.e

#

sry im stoopid

fleet zealot
#

this is the answer @sharp thicket

earnest phoenix
#

Hello! I need help :(

I just made a mute command that works functionally. It creates a role called "Muted" if there isn't already a role called "Muted".

The person gets assigned the role properly, but they can still chat. What is the problem?

quartz kindle
#

there are 3 ways, each does a different thing

sharp thicket
#

@earnest phoenix change the premissions for the role

earnest phoenix
#

the only permission it has is read messages

#

all others are false

sharp thicket
#

hm

#

overwrites ?

earnest phoenix
#

ye

sharp thicket
#

make it so it denies send messages

earnest phoenix
#

i did

quartz kindle
#
  1. client.users.cache.size (only online users)
  2. add the guild.memberCount property of all guilds (all users including offlines but also including duplicated users that share guilds)
  3. use fetchAllMembers in your client options (this will make option 1 give you all members including offlines and not include duplicates, but costs a lot of memory)
sharp thicket
#

but that would mute them in the channel of the message

earnest phoenix
#

discord.Permissions(send_messages=False)

sharp thicket
#

hm

earnest phoenix
#

after running it

sharp thicket
#

idk whats wrong then

earnest phoenix
#

i checked role settings

#

everything was off

#

except for the read messages

#

but they can still chat

#

me confused

sharp thicket
#

hmm

#

idk whats wrong

earnest phoenix
#

k rip 😦

sharp thicket
#

@quartz kindle wdym expensive ?

#

i mean costs alot of money

fleet zealot
#

memory

#

not money

sharp thicket
#

ohh

#

i am so blind

#

sryfor the ping e.e

#

iam just go with the 1st one

leaden rover
#

I can't seem to be able to use YTDL to extract video data, how do I fix this?

digital wagon
#

oops wrong channel x3

opal plank
#

holy fuck

#

i was not expecting this to handle almost 5k messages per minute

vivid wadi
#

i have a question

#

What do you guys think i should code my bot with?

valid frigate
#

up to you, popular decisions include javascript+node.js and python

vivid wadi
#

which is most easiest out off your opinion

valid frigate
#

prolly javascript

vivid wadi
#

for me i tried node.js

#

wont even work

valid frigate
#

try it again

vivid wadi
#

TIME TO DOWNLOAD ANOTHER APP

valid frigate
#

LOL

vivid wadi
#

like srsly

#

I DOWNLOAD 2 APPS TODAY

#

NODE.JS AND ANOTHER ONE

#

AND THEY WERE FOR CODING

#

AND THEY DIDNT EVEN MAKE MY BOT ONLINE

elder plume
#

Bruh

valid frigate
#

bro

#

mind showing ur code

regal saddle
#

caps lock intensifes

elder plume
#

Code is supposed to code your bot

#

-.-

valid frigate
#

Code is supposed to code your bot
i love this

quartz kindle
#

by "apps" you mean apps in your phone?

vivid wadi
#

I TRIED DOWNLOADING DISCORD.JS BUT I NEED TO DOWNLOAD NODE.JS NOW I HAVE NO CLUE WHAT TO DO IN LIFE

elder plume
#

caps lock intensifes
@regal saddle lmao

faint prism
#

I coded the code just so I can code my code

elder plume
#

Code is supposed to code your bot
i love this
lmao ikr

regal saddle
#

@vivid wadi would you mind to stop writing in caps?

faint prism
#

NodeJS lets you run your JS project outside a web browser.
So that's pretty essential

vivid wadi
halcyon ember
#

how can I make a line chart and send it as an image in js

vivid wadi
#

everything i have on the pictures IS Copied on youtube

quartz kindle
#

the client constructor is upper case

vivid wadi
#

@vivid wadi would you mind to stop writing in caps?
@regal saddle yep sure i was just really mad

quartz kindle
#

{ Client }
client = new Client()

#

if its not uppercase it wont work

vivid wadi
#

TIme to waste Another Half an hour trying to figure this out bying doing ur thingy

elder plume
#

My bot can get reviewed by mods at any time now

#

Gosh

#

It's almost a month

slate oyster
#

This is why I don't usually use Eclipse's built-in run option
Preferring the Gradle option

vivid wadi
quartz kindle
#

those two must be uppercase

faint prism
#

caSiNg

quartz kindle
#

you only did the first one

elder plume
#

Lol

vivid wadi
#

oh

#

now

#

?

elder plume
#

Casing is the worst thing in coding ngl -.-

quartz kindle
#

the disableEveryone option doesnt exist anymore, you're following an outdated tutorial

vivid wadi
#

oh

opal plank
#

@quartz kindle tim

vivid wadi
#

can somebody show me a video on a tutorial before i get really mad

quartz kindle
#

what happens if you get mad

faint prism
#

Uhoh

opal plank
vivid wadi
#

i get crazy

regal saddle
#

Tim should make a d.js tutorial LULW

elder plume
#

Yes @opal plank

quartz kindle
#

@opal plank now do that with the presenceUpdate event

vivid wadi
#

ever seen what 800k users speaking at once looks like?
@opal plank what bot is that ur using

opal plank
#

my bot lel

#

click my name if you really that curious

#

its still amazing to see i hit a wall at 800k

vivid wadi
#

you know what ima just waste another 2 hours finding a tutorial how to make ur bot online 24/7

opal plank
#

i simply cant run on my rig more than that

elder plume
#

@opal plank your pfp

quartz kindle
#

what kind of wall?

#

ram?

vivid wadi
opal plank
#

CPU / postgres

quartz kindle
#

rip

leaden rover
#

I get this error with YTDL:
ERROR: dQw4w9WgXcQ: YouTube said: Unable to extract video data

opal plank
#

it cant do that many calls on every single message

#

focus on twitch stats

leaden rover
#

My play command code:

    async def _play(self, ctx: commands.Context, search: str):
        """Plays a song.
        If there are songs in the queue, this will be queued until the
        other songs finished playing.
        This command automatically searches from various sites if no URL is provided.
        A list of these sites can be found here: https://rg3.github.io/youtube-dl/supportedsites.html
        """
            
        if not ctx.voice_state.voice:
            await ctx.invoke(self._join)

        async with ctx.typing():
            try:
                source = await YTDLSource.create_source(ctx, search, loop=self.bot.loop)
            except YTDLError as e:
                await ctx.send('An error occurred while processing this request: {}'.format(str(e)))
            else:
                song = Song(source)

            await ctx.voice_state.songs.put(song)
            await ctx.send('Enqueued {}'.format(str(source)))```
quartz kindle
#

well you probably shouldnt be doing calls on every single message

opal plank
#

i need them

#

best i can do i switch to redis

#

instead of postgres

quartz kindle
#

ever heard of eventual consistency?

thin turret
#

How would I setup a command handler that containts multiple subfolders

earnest phoenix
#

How i can make a lavalink status command ?

opal plank
#

20K entries within an hour

#

this is also a great stress test

#

i dont think discord can pull this many updates at once

quartz kindle
#

lmao

opal plank
#

maybe rythm or mee6

quartz kindle
#

just switch to an eventually consistent storage solution and all your problems will be solved

opal plank
#

this is way too many message events

#

i need to see what that is

slate oyster
leaden rover
#

ok

quartz kindle
#

eventual consistency is basically caching + chunked updates

leaden rover
#

Oh yeah

quartz kindle
#

at the expense of allowing your data to get a bit outdated

opal plank
#

prob be better off with redis i'd think

quartz kindle
#

all big companies like youtube facebook etc use this model

opal plank
#

storing it in cache with redis might be the better solution for me

quartz kindle
#

that is one option yes

#

if you absolutely cant lose data, send everything to redis in real time

#

then chunk it out to postgres at some interval

opal plank
#

thats what a friend told m to do, this is more stress testing that deployment tbh, i need to see how much the current code can handle

feral aspen
#

Hello

quartz kindle
#

if you can afford a tiny bit of data loss, store it in memory then chunk it out to redis/postgres in an interval

opal plank
#

seems like 800k is the answer

feral aspen
#

What is the best way to store on how many messages the bot sent per day.

vivid wadi
#

@quartz kindle cold i review ur bot?

halcyon ember
#

how to make a line chart and send it as an image

quartz kindle
#

sure lol

vivid wadi
#

could* lol

#

im eating ice cream rn

#

at night

opal plank
#

@feral aspen im depositing every message on my database then querying it

#

of course the db is encrypted and i dont store content

vivid wadi
#

@quartz kindle dm me ur bot link

opal plank
#

tos compliant

feral aspen
#

Oh ok!

quartz kindle
#

@vivid wadi just search for "astrobot" on top.gg

vivid wadi
#

ok

opal plank
#

only stuff i keep content on is on cache

quartz kindle
vivid wadi
quartz kindle
#

<

vivid wadi
#

what is help command

dire obsidian
#

somebody know how to remove the record of my domain?

earnest phoenix
#

@quartz kindle ur help board is so difficult to understand

quartz kindle
#

it was the only way to have the entire docs in it

earnest phoenix
#

LoL

#

like u have 5+ pages

midnight blaze
#

one question about shards. I have mine on auto, does this mean, when my bot reach 2500 for example, will it get a new shard?

earnest phoenix
#

and it is hard to understand

vivid wadi
earnest phoenix
#

@midnight blaze no

quartz kindle
#

its like 30+ pages actually

earnest phoenix
#

u need to program the shard

halcyon ember
#

how to make a line chart and send it as image

earnest phoenix
#

@quartz kindle how big is ur bot file

#

100mb ?

#

1gb ?

midnight blaze
#
manager.spawn(manager.totalShards,10000);
manager.on('shardCreate', shard => console.log(`Launched shard ${shard.id}`));

this should be enough, right?

earnest phoenix
#

idk

#

look docs

quartz kindle
#

which file? the entire folder?

earnest phoenix
#

ye

#

folder*

#

not file

quartz kindle
#

idk, but < 100mb

earnest phoenix
#

:))

#

wut

still merlin
#

How does one only allow a command to be done in DMS, in d.js
i have a theory- if (!message.DM) return;

earnest phoenix
#

@quartz kindle how many commands ?

quartz kindle
#

not many

earnest phoenix
#

wut

#

but the docs

#

it big

quartz kindle
#

about 10 commands i think

earnest phoenix
#

Wtf

#

wtf

#

ahm wtf

midnight blaze
#

probably because each of the commands are rather complicated?

opal plank
#

quality > quantity

#

¯_(ツ)_/¯

quartz kindle
#

because its main command has a lot of options

earnest phoenix
#

ye

#

true

quartz kindle
#

you can literally max out the 2000 chars limit in a single command

earnest phoenix
#

:0

quartz kindle
#

which is good because discord basically helps me with rate limiting it lmao

earnest phoenix
#
if(!args[0]) return message.channel.send("Please specific a Problem to report !")
            let problem = args.slice(0).join(" ");
            let embed = new MessageEmbed()
                .setColor(red_light)
                .setTitle("Problem report")
                .setDescription("**Problem:** \n" + problem)
                .setThumbnail(message.member.displayAvatarURL())
                .addField("**Reporter:**", message.author.username, true)
                .addField("**Reporter id:**", message.author.id, true)
                .addField("**Server name:**", message.guild.name, true)
                .addField("**Server id:**", message.guild.id, true)
                .addField("**Date:**", message.createdAt.toLocaleString(), true)
            bot.channels.cache.get("...").send(embed).then(() => {
                message.author.send("Thank you for reporting problems. I will send You newest Infomation about the Problem !");
            })

It says cannot send emty msg : /

quartz kindle
#

one of your fields is empty

earnest phoenix
#

but how

regal jacinth
#
requestsJar = requests.cookies.RequestsCookieJar()



v = {'id': 'lol', 'name':"Yami", "flag":"shit", 'do': "not"}
for key, value in v.items():
    requestsJar.set(key, value, domain="httpbin.org", path="/cookies")
    print(key)
    print(value)

r3 = requests.get(url, cookies=requestsJar)
print(r3.text)```
 hey 
so i managed to know how to make a cookie
but idk how and where to save it
can some one help pls ?
quartz kindle
#

are you using express?

stark abyss
#

Aight so I am tryna make a canvas thing ok
const Canvas = require('canvas')
and so I get

Fontconfig error: Cannot load default config file
#

error and I have no clue how to fix it

#
const { createCanvas, loadImage } = require('canvas')
const Canvas = require('canvas')
const canvas = Canvas.createCanvas(100, 200)
const ctx = canvas.getContext('2d')```
#

what ?

quartz kindle
#

is this a linux vps?

stark abyss
#

no

#

mac

pale vessel
#

mac vps

stark abyss
#

mac operating system and repl.it vps

pale vessel
#

what

quartz kindle
#

do you have brew installed?

faint prism
#

||4Chan is hosted with a Macbook air pro cluster||

stark abyss
#

no i didn't

quartz kindle
#

wait

#

is the bot in the mac or in the repl.it?

stark abyss
quartz kindle
#

so its not mac

stark abyss
#

I am using mac book and i m hosting it on repl.it yes

earnest phoenix
#
if(mentionMember.bannable) {

    const banReason = args.join(" ").slice(22);

    if(!banReason) {
        message.channel.send(`Hey ${message.member} you have to input a reason to ban, h.help for more information`);
        return;
        } 

        let banMessage = new Discord.MessageEmbed()
        .setColor('#ff0000')
        .setTitle('**Ban**')
        .setDescription(`${mentionMember} wont be coming back anytime soon ![hisokasmile](https://cdn.discordapp.com/emojis/744282907597865020.webp?size=128 "hisokasmile")\n\n **Ban Reason:**\n\n ${banReason}`)
        .setFooter(`User ID: ${mentionMember.user.id}`, 'https://cdn.discordapp.com/avatars/743786547987611780/2355af02de940f41d85f6bb54d436e3a.png?size=128')
        .setImage('https://i.pinimg.com/originals/80/bb/d2/80bbd2c31eb8b6d493e3b807bf69ecbe.jpg')

        let banDM = new Discord.MessageEmbed()
        .setColor('#ff0000')
        .setTitle('**:x: Banned :x:**')
        .setDescription(`You have been banned from **${message.guild}**\n\n**Reason**\n\n${banReason}`)
        .setImage('https://cdn.discordapp.com/emojis/744287877596184657.png?v=1')

        message.channel.send(banMessage)
        mentionMember.send(banDM)
        await delay(500)
        message.guild.members.ban(mentionMember, { reason: banReason })
    }

when i execute the ban command it gives me the message that it would if i did not input a reason, why?

quartz kindle
stark abyss
#

oh

faint prism
#

slice(22) ?

quartz kindle
#

you need to add a font file to your bot files and use canvas's registerFont method

earnest phoenix
#

slice(22) ?
@faint prism i dont think i need it now, i updated my code but that still wont fix my issue

stark abyss
#

man that seems complicated

quartz kindle
#

its not complicated

#

just get a generic font like arial

#

find its ttf file or otf or woff or whatever

#

and put it in your bot files

stark abyss
#

ok

quartz kindle
#

like ```js
index.js
arial.ttf

#

then in your code, use registerFont

stark abyss
#

wait what do i do in the file nothing?

quartz kindle
#

no

#

get the actual font file

#

either download it, or find it in your system

stark abyss
#

oh

quartz kindle
#

all computers have it

stark abyss
#

ok

quartz kindle
#

@earnest phoenix console.log(args) before banReason and show what it says in the console

earnest phoenix
#

hm?

stark abyss
#

can't I just not use the font then? would it use the default?

quartz kindle
earnest phoenix
#

you mean before the const banReason = args.join(" ") @quartz kindle

quartz kindle
#

yes

earnest phoenix
#

i did

quartz kindle
#

then show what it says

summer frigate
#

Use args.slice(1).join(" ") because there's a user mentioned before the reason

earnest phoenix
summer frigate
#

@earnest phoenix try mine

quartz kindle
#

your args is empty

summer frigate
#

const banreason = args.slice(1).join(" ")

earnest phoenix
#

i did

#

nothing changed

quartz kindle
#

his args is literally empty

earnest phoenix
#

const banreason = args.slice(1).join(" ")
@summer frigate

quartz kindle
#

what are you gonna slice?

earnest phoenix
#

the reason

#

like

summer frigate
#

@quartz kindle he is mentioning the user

quartz kindle
#

im talking to w-legit

summer frigate
#

@earnest phoenix are you using a command handler?

#

@quartz kindle ban reason

earnest phoenix
#

@earnest phoenix are you using a command handler?
@summer frigate no

quartz kindle
#

@summer frigate you told him to use .slice(1) when his args is empty, there is nothing to slice

earnest phoenix
#

How can you change the color of the invite button on top.gg page?

summer frigate
#

Oh then use args.sice(2).join(" ")

quartz kindle
#

its empy

#

there is no args at all

#

the problem is how he defines args

earnest phoenix
#

bruh

summer frigate
#

@summer frigate you told him to use .slice(1) when his args is empty, there is nothing to slice
@quartz kindle so he is slicing 1 which is gonna return to the user and not give him the reason, as h isn't using a command handler the first argument will be the mentioned user

earnest phoenix
#

wait

quartz kindle
#

@summer frigate look at his screenshot, its empty

earnest phoenix
#

W-legit his args is empty

summer frigate
#

Yes I know but what was he slicing how much?

floral creek
earnest phoenix
#

alright i fixed i problem

#

i accidentally put const args = messageArray.splice(22);

#

just changed the 22 to a 1

#

and it worked

#

Yes I know but what was he slicing how much?
@summer frigate ????

summer frigate
#

.

quartz kindle
#

gj

earnest phoenix
#

i was going to change the slice of something else but accidentally changed that one i guess

stark abyss
#

google isn't helping me with getting font file to repl.it

faint prism
#

dotpost?

stark abyss
#

😔

earnest phoenix
#

How can you change the color of the invite button on top.gg page?
anyone?

quartz kindle
#

with css

opal plank
#

@quartz kindle just did the math, 543 writes per minute

#

thats the mean, but it goes as high as 700 and as low as 370

earnest phoenix
#

with css
@quartz kindle ik, but how can I acces that button?

#

whats the class or id

pale vessel
#

use the inspector

#

try pressing f12

earnest phoenix
#

ok

#

thanks

stark abyss
#

it stills tells me the same error even after i comment out the font line

#

the problem is the text is like that so it's the font issue after all?

#

@quartz kindle

vivid wadi
#

Could somebody help me fix my code by this thing on visual studio code

misty sigil
#

what is your error

ebon kelp
#

require('dotenv').config();

#

Instead of line 2 + 8-10

vivid wadi
#

nothing i just need a new code for it cause i have codes that are gone

ebon kelp
#

.env file
TOKEN="INSERT TOKEN"

vivid wadi
ebon kelp
#

nothing i just need a new code for it cause i have codes that are gone
@vivid wadi Wait what

#

ctrl z 1head

stark abyss
vivid wadi
stark abyss
#

does someone know a easier way to get canvas

earnest phoenix
#

npm I canvas

#

?

stark abyss
#

other then that

#

since it's too hard for me to use

#

😔

earnest phoenix
vivid wadi
faint prism
#

pls stop repositing. We can scroll up lol

vivid wadi
ebon kelp
#

require('dotenv').config();
Instead of line 2 + 8-10
@vivid wadi is much cleaner

vivid wadi
#

@ebon kelp im new to coding so i look up on videos for now just incase i dont know what it is

ebon kelp
#

It means exactly the same, but in a shorter line

vivid wadi
#

oh wow u play fall guys @ebon kelp i love that game even tho i do not have it SadnessCat

ebon kelp
#

remove const { config } = and line 8-10

#

I love it too, but after 14+ hours it gets kinda the same

vivid wadi
#

like that?

stark abyss
#

"./env"?

#

i think

vivid wadi
#

oh

ebon kelp
#

remove line 8-10 and = on line 2

#

"./env"?
@stark abyss no

stark abyss
#

why not?

vivid wadi
#

i do not understand

ebon kelp
#

.env is a file extension

stark abyss
#

oh

ebon kelp
#

for secrets

#

like bot token

vivid wadi
#

to be honest i just copied off youtube the hole code

ebon kelp
#

i do not understand
@vivid wadi Hold on

vivid wadi
#

cause im new to coding

misty sigil
#

do you understand how it works?

vivid wadi
#

i mean kind off.

misty sigil
#

cool

vivid wadi
#

i think this part is to make it online idk

    console.log("I'm Online!");```
ebon kelp
#
const { Client } = require('discord.js');
require('dotenv').config(); 

const client = new Client({
    disableEveryone: true
});

client.on("ready", () => {
    console.log("I'm online!")
});

client.login(process.env.TOKEN);
misty sigil
#

its actually client.login

stark abyss
#

so can anyone help me understand how i can add a font file to my repl.it for canvas

vivid wadi
#

should i copy that?

#

oh

misty sigil
#

not client.on()

ebon kelp
#

That's what I meant with remove line 8-10

#

And improve line 2

vivid wadi
#

kk so i should delete the hole thing?

#

and put it as

require('dotenv').config(); 

const client = new Client({
    disableEveryone: true
});

client.on("ready", () => {
    console.log("I'm online!")
});

client.login(process.env.TOKEN);```
ebon kelp
#

You could

#

Up to you

vivid wadi
ebon kelp
#

Should work the same, but just improved code

vivid wadi
#

okay so now what do i do?

stark abyss
#

so can anyone help me understand how i can add a font file to my repl.it for canvas

#

u go make commands and have fun

vivid wadi
#

also i found that thingy on youtube to make my bot online

#

CUZ WHEN I MAKE A BOT THESE ARE MY STEPS

#

1 - make the bot
2 - make it online
3 - make commands

stark abyss
#

yes

ebon kelp
#

Well this should work

#

So you're at step 3 now

vivid wadi
stark abyss
ebon kelp
#

node index.js?

stark abyss
#

you sure it's your bot token and not your client id?

vivid wadi
#

yes

#

wait let me check

worthy glacier
#

how do i go from execute(message, args) to async

ebon kelp
#

Your token has to be a string

worthy glacier
ebon kelp
#

Your token has to be a string
@ebon kelp so between ""

stark abyss
#

async execute(message, args) @worthy glacier I think

vivid wadi
#

its my bot token

#

oh

stark abyss
#

ok

#

any errors?

vivid wadi
#

still nothing not online

#

i putted " " also

#

like on the token

ebon kelp
#

show

stark abyss
#

and you ran the code right?

ebon kelp
#

Have you tried turning it on and off again? peepoLaugh

vivid wadi
ebon kelp
#

That seems good

vivid wadi
#

how do i turn it on then off 3D_think

stark abyss
#

does it

ebon kelp
#

Same it tho

vivid wadi
#

im a noobie

ebon kelp
#

Ctrl S on files

stark abyss
#

what if you store the token in a json file and try after?

#

wait no that's a dumb idea nvm

vivid wadi
#

still no

stark abyss
#

I need help with canvas

#

anyone good at it?

vivid wadi
#

and there

misty sigil
#

try saving index.js

ebon kelp
#

and .env

vivid wadi
#

now 1 saved

ebon kelp
#

Ctrl S on files
@ebon kelp I said it earlier NotLikeThis

#

Not in the file explorer

#

in de code editor

stark abyss
#

netail bro help me as well 😔

vivid wadi
#

o

#

i did ctrl on it

stark abyss
#

tim left on me pensivezoom

vivid wadi
#

nothing happend

#

OOF

#

#ripP025

ebon kelp
#

netail bro help me as well 😔
@stark abyss With your canvas?

stark abyss
#

yes

#

if you could

ebon kelp
#

Never worked with it

stark abyss
#

😔

ebon kelp
#

Sorry cz_sadcatto

stark abyss
#

ty tho

vivid wadi
ebon kelp
#

I can look into it

#

@stark abyss What did you want to know?

stark abyss
#

I got an error

glossy elk
#

Hey if i send a message

#

can i delete it

stark abyss
#

I couldn't solve it

glossy elk
#

after like 5 seconds

#

let's say

misty sigil
#

Yea you could

glossy elk
#
message.channel.send(`ok daddy`).then(m => m.delete(5000))```
vivid wadi
#

how do i start my bot i need help

ebon kelp
#

@glossy elk

message.channel.send(`ok daddy`).then(m => {
  setTimeout(function(){ 
    m.delete() ;
  }, 5000);
})
glossy elk
#

I see.

ebon kelp
#

"ok daddy" peepoWeirdLeave

vivid wadi
#

help idk how to start my discord bot on visual studio code

ebon kelp
#

node index.js in console dummy

vivid wadi
#

EIGHWUOGHEOWUGWE

ebon kelp
#

I got an error
@stark abyss Can you give more info

vivid wadi
#

oohhhh

faint prism
#

node index.js in console dummy
@vivid wadi this

vivid wadi
#

still offline ajenniecry

faint prism
#

ayy you almost started it

ebon kelp
#

npm i discord.js

#

I think

misty sigil
#

no

vivid wadi
#

?

stark abyss
#

I got an error of css Fontconfig error: Cannot load default config file
Tim said in order for me to use font i need to somehow add font file and use it through registerFont

ebon kelp
#

What module is not found?

misty sigil
#

its obvious that index.js is not there

#

@vivid wadi what is the file called

vivid wadi
#

discord stuff is the file for the thingy

ebon kelp
#

It said module not found

misty sigil
#

@vivid wadi the bot file

vivid wadi
misty sigil
#

where client is

faint prism
#

discord.js is the library

misty sigil
#

its index.js

#

so try node index.js

#

idk

vivid wadi
ebon kelp
#

I already said that @misty sigil

misty sigil
#

idk

ebon kelp
#

Scroll a bit up in the terminal

misty sigil
#

this code is confusing me

#

it should work

stark abyss
ebon kelp
misty sigil
#

why use .env, I use a config.json?

vivid wadi
#

first message

ebon kelp
#

config.json hanaDisgust

#

npm i dotenv in console

#

then node index.js

vivid wadi
#

sO what should i type 3D_think

ebon kelp
#

ertwjiopk['vgfq erqbng uhkswdrhugijhsdriyghuidsfh

stark abyss
#

my guy that's not helping me it's wrong code - someone asked for help pensivezoom

ebon kelp
#

Can you send your part of code

vivid wadi
#

whos

ebon kelp
#

@stark abyss

#

npm i dotenv in console
then node index.js
@vivid wadi

stark abyss
#

the thing about canvas is that there is more then couple ways to do it i think

vivid wadi
ebon kelp
#

See

#

Now bot online

#

the thing about canvas is that there is more then couple ways to do it i think
@stark abyss yes

vivid wadi
strange flare
#

wow

#

someone is typing

vivid wadi
#

thank u

#

yes im typing

stark abyss
#

~~(try to keep the useless chat off) I am really tryna get some help here 😔 ~~

strange flare
#

with?

ebon kelp
#

told ya @misty sigil she was missing a module

stark abyss
#

canvas

misty sigil
#

Good work.

strange flare
#

ight, goodluck..

ebon kelp
#

I know I know

misty sigil
#

You win this time Netail.

#

You win.

ebon kelp
#

xd

stark abyss
#

I wish tim was here or erwin pensivezoom

ebon kelp
stark abyss
#

me?

ebon kelp
#

yes

#

The canvas part

stark abyss
#

the ss was all of it

strange flare
#

idek how to download discord.js

#

big brain

ebon kelp
#

the ss was all of it
@stark abyss But like I don't wanna type it all over

stark abyss
#

oh okay

vivid wadi
#

i have a question

#

will my bot be 24/7 online?

misty sigil
#

bruh no

strange flare
#

how tu download discord.js

misty sigil
#

you need to host it

vivid wadi
#

kk

#

on what website

misty sigil
#

how tu download discord.js
@strange flare npm i discord.js

#

on what website
@vivid wadi depends

#

I recommend a VPS

vivid wadi
#

okay

misty sigil
#

because its more reliable

strange flare
#

@strange flare npm i discord.js
@misty sigil that's it?

misty sigil
#

yea

#

if you have node installed that is

solemn latch
#

if you have npm installed, thatll install the djs lib, which you can use to make a bot

strange flare
#

I installed node

stark abyss
ebon kelp
#

I see yes

stark abyss
#

my code is completely messed up in trial and error process

strange flare
#

holy shit

#

I got tons of errors

solemn latch
#

errors are part of the fun

strange flare
#

`npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules/dot-prop
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules/configstore
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules/npm-registry-fetch
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules/rc/node_modules/minimist
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules/meant
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules/rc/node_modules
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/lib/node_modules/npm/node_modules/dot-prop
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules/npm/node_modules/dot-prop'
npm ERR! [Error: EACCES: permission denied, access '/usr/local/lib/node_modules/npm/node_modules/dot-prop'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules/npm/node_modules/dot-prop'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/CoolName/.npm/_logs/2020-08-19T20_57_03_284Z-debug.log`

#

welp

solemn latch
#

if your not erroring, your not living life

strange flare
#

I guess i am very alive..

#

.-.

#

can smne help me

stark abyss
#

i can't exactly help you without seeing code

strange flare
#

rip

ebon kelp
#

@stark abyss yikes my code editor crashes because of run

stark abyss
#

yeah

#

it's messed up

#

i suck at coding

#

😔

strange flare
#

npm install -g npm
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules/configstore
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules/dot-prop
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules/npm-registry-fetch
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules/rc/node_modules/minimist
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules/meant
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules/rc/node_modules
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/lib/node_modules/npm/node_modules/configstore
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules/npm/node_modules/configstore'
npm ERR! [Error: EACCES: permission denied, access '/usr/local/lib/node_modules/npm/node_modules/configstore'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules/npm/node_modules/configstore'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/Dog/.npm/_logs/2020-08-19T21_01_11_204Z-debug.log

#

send help

#

I don't like warns

solemn latch
#

uh

faint prism
#

man

strange flare
#

nor errors

solemn latch
#

npm install -g npm

stark abyss
#

@ebon kelp i found an easier npm to use then canvas so don't worry about it thank you for helping though

solemn latch
#

npm install npm?

stark abyss
strange flare
#

idfk

solemn latch
#

how are you going to tell npm to install npm

#

🤔

strange flare
#

thing said to do that

stark abyss
#

what do u want to install?

strange flare
#

i'm just gonna start over

#

.-.

stark abyss
#

someone help this dog

solemn latch
#

🤔

#

what thing told you to npm install npm

strange flare
#

some weird square

ebon kelp
#

updating npm

strange flare
#

yes

ebon kelp
#

npm i npm is updating npm

strange flare
#

told me to update

ebon kelp
#

@ebon kelp i found an easier npm to use then canvas so don't worry about it thank you for helping though
@stark abyss Nah now I'm gonna finish what I started

stark abyss
#

well that's on you okay I am telling you at this point I don't need help

#

if u do in case go further and find useful information ping me

ebon kelp
strange flare
#

how do i install discord.js

ebon kelp
#

npm i discord.js

strange flare
#

done

#

what now?

solemn latch
#

you develop your bot

solemn latch
strange flare
#

goodmorning youtube

solemn latch
#

youtube is a bad source for discord bots

#

youtube videos are typically out of date

#

the docs, and the guide are the best sources

stark abyss
#

idk man

#

i suck at coding

#

😔

zenith knoll
#

How would i get a specific piece of info from a member from the object? the key is the ID but i cant get the value of username

vivid wadi
#

does anyone have a hosting website i can host my bot 24/7

#

i suck at coding
@stark abyss no me

stark abyss
cinder patio
#

object.property kyoji, for example: user.username

vivid wadi
#

@stark abyss could u show me what to do on it on ss

faint prism
#

does anyone have a hosting website i can host my bot 24/7
@vivid wadi leave it open on your desktop

zenith knoll
#

object.property kyoji, for example: user.username
@cinder patio i do <var>.get(key).username, but its not defined

vivid wadi
#

u mean visual studio code @faint prism

#

??

cinder patio
#

is that your exact code?

zenith knoll
#

Heres my ss

faint prism
#

I mean run node index.js in cmd and forget about it

zenith knoll
stark abyss
#

@vivid wadi you gonna have to learn some stuff on your own but repl.it is a free hosting website that can run your discord bot online 24/7 although it will go down for a sec and be up if you use an ping service like fresh works

vivid wadi
#

i do not understand

cinder patio
#

okay? How is that related to your question

zenith knoll
#

okay? How is that related to your question
@cinder patio I cant seeem to get their Username and discriminator

cinder patio
#

That's not how you should be iterating through a map/collection

zenith knoll
#

uh

cinder patio
#

Maps aren't indexed, they atore key/value pairs

zenith knoll
#

how should i then?

#

yes

#

the map

#

has one object

#

the user

#

the key is the ID

#

then it returns a object

solemn latch
#

couldnt you just not put it in a map if its just one user 🤔

zenith knoll
#

Uh, i dont get to decide

#

Its what .fetch gives me

cinder patio
#

Either use the forEach method or this:

for (let [, member] of filtered) {
  ....
}
#

To iterate through a map

zenith knoll
#

uh

earnest phoenix
#

hi

zenith knoll
#

doesnt rlly fix my problem but ok

earnest phoenix
#

<@&304313580025544704> how do we add my bot

cinder patio
#

You haven't really told us your exact problem

solemn latch
#

cant you just use
.fetch(userid) anyway 🤔

modern sable
#

-atmods @earnest phoenix

gilded plankBOT
#

@earnest phoenix

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.
slender thistle
#

AYAYA

misty sigil
earnest phoenix
#

@modern sable sorry bro

solemn latch
#

guild.members.fetch('66564597481480192').then(member => {
member.nickname
})

#

🤔

#

you seem to be fetching all users, then only getting one

#

when fetch already can do that

oak cliff
#

-faq 1 @earnest phoenix

gilded plankBOT
#

@earnest phoenix

Frequently Asked Questions 📜
oak cliff
#

That's how you add your bot

zenith knoll
#

You haven't really told us your exact problem
@cinder patio I do filtered.get(ID).username
(filtered = map)
(ID is the key)

it is undefined though its an object

#

which should work..?

earnest phoenix
#

thank you @oak cliff LordanKrmz

ebon kelp
#

@stark abyss I fixed your code

earnest phoenix
#

@oak cliff Do we have to fill in English

stark abyss
#

help

ebon kelp
#

Wait I send DM

stark abyss
#

please

oak cliff
#

No it can be whatever language @earnest phoenix

earnest phoenix
#

thank you

strange flare
#

i'm just gonna give up

zenith knoll
#

..

solemn latch
cinder patio
#

No, it shouldn't you are not iterating through the map correctly:

const ids = [1, 2, 3, 4]

Let's say your filtered map contains the keys 1 and 4.

for (let i=0; i < filtered.size; i++) { 
   //On the first iteration, the code inside will run fine, but on the second, it will error, because the key 2 doesn't exist
}
solemn latch
#

Like the 9th person I've seen give up on making a bot in the first hour this week

strange flare
#

nice

zenith knoll
#

yes

#

its what im doing

#

then?

#

how would i get the USERNAME and TAG

earnest phoenix
misty sigil
#

you dont need to

oak cliff
#

No you dont have to

cinder patio
#

Are you sure the code you are showing us is yours? You are already doing that. But your code can easily error if one of the IDs is missing.

oak cliff
#

Its optional

zenith knoll
#

Oh

earnest phoenix
#

okay

zenith knoll
#

the IDS are correct bc its stored in a json file

#

I have alr read and parsed it in an array called ids{}

#

[]*

sudden geyser
#

Like the 9th person I've seen give up on making a bot in the first hour this week
@solemn latch how much in total

cinder patio
#

Then the code should run fine if you arw 100% sure all IDs are correct and in the guild you are fetching the members from

#

But it doesn't, so...

zenith knoll
#

No

#

the key works

#

but i dont know how to take the USERNAME

#

dm me

#

ill screenshare

cinder patio
#

no

#

You are already doing that in your code, you are getting the username and the discriminator

#

Well, you are console logging it

earnest phoenix
#

@oak cliff dude

#

I do not know what to write

#

:(

solemn latch
#

you can write nothing

cinder patio
#

That's optional

zenith knoll
#

Well, you are console logging it
@cinder patio It logs "undefined#undefined"

solemn latch
#

its optional

cinder patio
#

It console logs that because the ID is not in the map

earnest phoenix
#

its optional
@solemn latch will there be any trouble

solemn latch
#

no

#

its optional

earnest phoenix
#

thanks LordanKrmz

cinder patio
#

Because you are not iterating through the map correctly how many times do I have to tell you

zenith knoll
#

i

#

am

#

looking

#

for

#

the

#

username

#

not

#

ID

#

If i do not do .username

#

it sends the whole map

solemn latch
#

your looping incorrectly either way

#

doesnt matter what you want

zenith knoll
#

How

#

i am in a for loop

solemn latch
#

he told you twice iirc

zenith knoll
#

for(i = 0; i < filtered.size; i++) { console.log(filtered.get(ids[i]).username + "\#" + filtered.get(ids[i]).discriminator) }

cinder patio
#

Maps aren't indexed

zenith knoll
#

thats my code

#

ids is an array

#

an array I defined

cinder patio
#

Still, ids[i] is not guaranteed to be in the map

zenith knoll
#

Yes

#

ik that

#

its the point

#

i ONLY want the ones in my json and in the erver

#

server

cinder patio
#

filtered already contains all the ids in your json

#

You just have to iterate theough it normally

solemn latch
#

also, you can just fetch specific user ids
guild.members.fetch({ user: ['id', 'id2'] })
no need to make the filtered var 🤷‍♂️

zenith knoll
#

filtered already contains all the ids in your json
@cinder patio yes but i cant get those if i dont have the key

cinder patio
#

You can, if you LOOP THROUGH IT NORMALLY

zenith knoll
#

WHY TF

#

I SAID

#

if theyre not in the json

#

i want to skip em

cinder patio
#

Do you know what filter means.By calling that filter function you only get the ones that are inside your json

sinful belfry
#

uh can we maybe not yell at each other

zenith knoll
#

yes?

#

oh wait i forgot i put that

#

oof sorry

#

ok lemme read how iterate correctly apparently

solemn latch
#

its up above

zenith knoll
#

ik

#

for (let i=0; i < filtered.size; i++) {
//On the first iteration, the code inside will run fine, but on the second, it will error, because the key 2 doesn't exist
}

#

wait

#

thats the same for loop i had

#

now what to put inside?

#

i dont usually work with maps

cinder patio
#

You could use the .forEach function, or use a for...of loop

faint prism
#

Naaahhh, for loops give more power 🌩️

zenith knoll
#

ok so a forEach??

#

also

#

i think ur using py

#

cause a for of loop

#

im in js

solemn latch
#

for of is in js

zenith knoll
#

rlly?

solemn latch
#

there are like 7 diffrent types of lopps in js

zenith knoll
#

inpy is for i in range

slender thistle
#

It's for x in y in Python

cinder patio
#

idk about py, but there is a for of in javasceipt

zenith knoll
#

in js its for()

#

hm

solemn latch
#

for of also exists 🤔

zenith knoll
#

okay so what foreach or for>

solemn latch
slender thistle
#

foreach element of iterable

cinder patio
#

Doesn't really matter in your case

zenith knoll
#

Okay

#

which more optimal

slender thistle
#

A for loop is universal

solemn latch
#

i think it probably depends

earnest phoenix
#

Wot do I eval to see the server's channel count?

faint prism
#

channels.count or length?

slender thistle
#

What library

earnest phoenix
#

D.js

zenith knoll
#

message.guild.channels?

faint prism
#

^get the length of that, don't reference it directly expecting the int to be returned

zenith knoll
#

message.guild.channels.length or .size?

faint prism
#

something like that. Whatever it is for JS

cinder patio
#

size

earnest phoenix
#

Thx

zenith knoll
#

Doesn't really matter in your case
@cinder patio how would i do it? lmao

slender thistle
#

.cache also

#

Better refer to the documentation

zenith knoll
#

wut if it not cached

#

so

cinder patio
#

An example:

map.forEach(member => {
   // Get username for each member here ....
});
zenith knoll
#

oh