#development
1 messages · Page 1168 of 1
ikr
um
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
You have to run in debug @slate oyster
Can anyone help me in eval command of discord.py
@safe kelp commands extension or on_message?
Ah, gotcha
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
5/20s is the ratelimit
@faint prism That did not work
I created a breakpoint in my main method to test
so once per 4 seconds is the bare minimum
is that java?
Ye
Yea
{ 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.
alright
Ant then pressed this button
@slate oyster do you have multiple main functions in your project by chance?
was*
Only one
means everyone could chat there?
was*
no
@slender thistle command extension
@slate oyster Is your program actually launching?
Yes
It's getting way further than my actual breakpoint
It should not be logging anything yet, as that code doesn't get called until later
What is that
It means that the class cannot be extended or instatiated
In other words, it can only run static methods
{ 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.
@slate oyster Could be disabled
So it thinks breakpoints are disabled?
I'll have to figure out how to enable them
Could be specific to that breakpoint perhaps.
@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!
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

I think anything lower than high-level programming languages is going to go over most people's heads here.
scratch 2
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
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
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
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
the process by default takes your code, tokenizes it, puts it in an AST, then makes it a representation of code that LLVM understands
idk how to use webhook how i can ?
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
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
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
Reverse engineering my own C# programs with a disassembler was the lowest I've ever gone
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
I was mostly following syscalls and logic trees then comparing it to my source
Nope lol
The only disassembler I've used is JDGUI
I mean Ghidra is pretty good and the NSA make that tool lol
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
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?
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
Mhmm, I've seen that. It's pretty cool
You're talking about the window on the right, correct?
A lot of disassemblers have that neat feature
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#
Oh I said C# earlier. I meant C. My bad
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
ah
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
ok its not assembly
its a .NET assembly
different representation
not asm
its kinda like thecode representation generated in bytecode
i tried reverse engineering a delphi program and got nowhere lul
try reverse engineer native program
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)
delphi and object pascal are pretty much the same thing no?
I mean, Delphi is the IDE for Object Pascal
as far as I'm informed, at least
so eh
🤔
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

technology moves too fast
am wondering how u guys use timers on database or anywhere. Where you store remaining time for let's say top.gg vote
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
yes
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
lmao
everywhere education system is bad
they teach useless things
and arent updated with newer things
I mean, we are still taught PascalABC instead of stuff like in-depth Java/C#/ASM/C/Python/JS
yes
like how many members in all the guilds my bot is in
is there like a property for it
client.users.cache.size
oh
you need to loop over guilds and combine their guild.memberCount property
no
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#
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
that will fetch a single user
oh
yes
thats true e.e
so client.users.cache.size ??
if you only want online users, yes
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
as i don't rlly want alts showing
oh
then how do i make it all users e.e
sry im stoopid
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?
there are 3 ways, each does a different thing
@earnest phoenix change the premissions for the role
ye
make it so it denies send messages
i did
- client.users.cache.size (only online users)
- add the guild.memberCount property of all guilds (all users including offlines but also including duplicated users that share guilds)
- 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)
but that would mute them in the channel of the message
discord.Permissions(send_messages=False)
hm
after running it
idk whats wrong then
i checked role settings
everything was off
except for the read messages
but they can still chat
me confused
k rip 😦
I can't seem to be able to use YTDL to extract video data, how do I fix this?
oops wrong channel x3
up to you, popular decisions include javascript+node.js and python
which is most easiest out off your opinion
prolly javascript
try it again
TIME TO DOWNLOAD ANOTHER APP
LOL
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
Bruh
caps lock intensifes
Code is supposed to code your bot
i love this
by "apps" you mean apps in your phone?
I TRIED DOWNLOADING DISCORD.JS BUT I NEED TO DOWNLOAD NODE.JS NOW I HAVE NO CLUE WHAT TO DO IN LIFE
caps lock intensifes
@regal saddle lmao
I coded the code just so I can code my code
Code is supposed to code your bot
i love this
lmao ikr
@vivid wadi would you mind to stop writing in caps?
NodeJS lets you run your JS project outside a web browser.
So that's pretty essential
how can I make a line chart and send it as an image in js
the client constructor is upper case
@vivid wadi would you mind to stop writing in caps?
@regal saddle yep sure i was just really mad
TIme to waste Another Half an hour trying to figure this out bying doing ur thingy
This is why I don't usually use Eclipse's built-in run option
Preferring the Gradle option
@quartz kindle now what
caSiNg
you only did the first one
Lol
Casing is the worst thing in coding ngl -.-
the disableEveryone option doesnt exist anymore, you're following an outdated tutorial
oh
@quartz kindle tim
can somebody show me a video on a tutorial before i get really mad
what happens if you get mad
Uhoh
ever seen what 800k users speaking at once looks like?
i get crazy
Tim should make a d.js tutorial 
Yes @opal plank
@opal plank now do that with the presenceUpdate event
ever seen what 800k users speaking at once looks like?
@opal plank what bot is that ur using
my bot lel
click my name if you really that curious
its still amazing to see i hit a wall at 800k
you know what ima just waste another 2 hours finding a tutorial how to make ur bot online 24/7
i simply cant run on my rig more than that

CPU / postgres
rip
I get this error with YTDL:
ERROR: dQw4w9WgXcQ: YouTube said: Unable to extract video data
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)))```
well you probably shouldnt be doing calls on every single message
ever heard of eventual consistency?
How would I setup a command handler that containts multiple subfolders
How i can make a lavalink status command ?
20K entries within an hour
this is also a great stress test
i dont think discord can pull this many updates at once
lmao
maybe rythm or mee6
just switch to an eventually consistent storage solution and all your problems will be solved
@leaden rover The video you are using is invalid
ok
eventual consistency is basically caching + chunked updates
Oh yeah
at the expense of allowing your data to get a bit outdated
prob be better off with redis i'd think
all big companies like youtube facebook etc use this model
storing it in cache with redis might be the better solution for me
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
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
Hello
if you can afford a tiny bit of data loss, store it in memory then chunk it out to redis/postgres in an interval
seems like 800k is the answer
What is the best way to store on how many messages the bot sent per day.
@quartz kindle cold i review ur bot?
how to make a line chart and send it as an image
sure lol
@feral aspen im depositing every message on my database then querying it
of course the db is encrypted and i dont store content
@quartz kindle dm me ur bot link
Oh ok!
ok
only stuff i keep content on is on cache
@quartz kindle which is it
<
what is help command
somebody know how to remove the record of my domain?
@quartz kindle ur help board is so difficult to understand
it was the only way to have the entire docs in it
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?
and it is hard to understand
LMFAOOOO
@midnight blaze no
its like 30+ pages actually
u need to program the shard
how to make a line chart and send it as image
manager.spawn(manager.totalShards,10000);
manager.on('shardCreate', shard => console.log(`Launched shard ${shard.id}`));
this should be enough, right?
which file? the entire folder?
idk, but < 100mb
How does one only allow a command to be done in DMS, in d.js
i have a theory- if (!message.DM) return;
@quartz kindle how many commands ?
not many
about 10 commands i think
probably because each of the commands are rather complicated?
because its main command has a lot of options
you can literally max out the 2000 chars limit in a single command
:0
which is good because discord basically helps me with rate limiting it lmao
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 : /
one of your fields is empty
but how
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 ?
are you using express?
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 ?
is this a linux vps?
mac vps
what
do you have brew installed?
||4Chan is hosted with a Macbook air pro cluster||
no i didn't
so its not mac
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 \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?
oh
slice(22) ?
you need to add a font file to your bot files and use canvas's registerFont method
slice(22) ?
@faint prism i dont think i need it now, i updated my code but that still wont fix my issue
man that seems complicated
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
ok
wait what do i do in the file nothing?
oh
all computers have it
ok
@earnest phoenix console.log(args) before banReason and show what it says in the console
hm?
can't I just not use the font then? would it use the default?
you mean before the const banReason = args.join(" ") @quartz kindle
yes
i did
then show what it says
Use args.slice(1).join(" ") because there's a user mentioned before the reason
@earnest phoenix try mine
your args is empty
const banreason = args.slice(1).join(" ")
his args is literally empty
const banreason = args.slice(1).join(" ")
@summer frigate
what are you gonna slice?
@quartz kindle he is mentioning the user
im talking to w-legit
@earnest phoenix are you using a command handler?
@summer frigate no
@summer frigate you told him to use .slice(1) when his args is empty, there is nothing to slice
Oh then use args.sice(2).join(" ")
bruh
@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
wait
@summer frigate look at his screenshot, its empty
W-legit his args is empty
Yes I know but what was he slicing how much?
alright
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 ????
.
gj
i was going to change the slice of something else but accidentally changed that one i guess
dotpost?
😔
with css
@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
with css
@quartz kindle ik, but how can I acces that button?
whats the class or id
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
Could somebody help me fix my code by this thing on visual studio code
what is your error
nothing i just need a new code for it cause i have codes that are gone
.env file
TOKEN="INSERT TOKEN"
nothing i just need a new code for it cause i have codes that are gone
@vivid wadi Wait what
ctrl z 

does someone know a easier way to get canvas

@ebon kelp
pls stop repositing. We can scroll up lol

require('dotenv').config();
Instead of line 2 + 8-10
@vivid wadi is much cleaner
@ebon kelp im new to coding so i look up on videos for now just incase i dont know what it is
It means exactly the same, but in a shorter line
is it all done?
oh wow u play fall guys @ebon kelp i love that game even tho i do not have it 
remove const { config } = and line 8-10
I love it too, but after 14+ hours it gets kinda the same
oh
why not?
i do not understand
.env is a file extension
oh
to be honest i just copied off youtube the hole code
i do not understand
@vivid wadi Hold on
do you understand how it works?
i mean kind off.
cool
i think this part is to make it online idk
console.log("I'm Online!");```
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);
its actually client.login
not client.on()
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);```
Should work the same, but just improved code
okay so now what do i do?
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

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
yes
still offline D:

node index.js?
you sure it's your bot token and not your client id?
how do i go from execute(message, args) to async
Your token has to be a string
Your token has to be a string
@ebon kelp so between ""
async execute(message, args) @worthy glacier I think
show
Have you tried turning it on and off again? 
That seems good
how do i turn it on then off 
does it
Same it tho
im a noobie
Ctrl S on files
what if you store the token in a json file and try after?
wait no that's a dumb idea nvm
still no
try saving index.js
and .env
now 1 saved
Ctrl S on files
@ebon kelp I said it earlier
Not in the file explorer
in de code editor
netail bro help me as well 😔
tim left on me 
netail bro help me as well 😔
@stark abyss With your canvas?
Never worked with it
😔
Sorry 
ty tho

I got an error
I couldn't solve it
Yea you could
message.channel.send(`ok daddy`).then(m => m.delete(5000))```
how do i start my bot i need help
@glossy elk
message.channel.send(`ok daddy`).then(m => {
setTimeout(function(){
m.delete() ;
}, 5000);
})
I see.
"ok daddy" 
help idk how to start my discord bot on visual studio code
node index.js in console dummy
EIGHWUOGHEOWUGWE
I got an error
@stark abyss Can you give more info
oohhhh
node index.js in console dummy
@vivid wadi this
ayy you almost started it
no
?
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
What module is not found?
discord stuff is the file for the thingy
It said module not found
@vivid wadi the bot file
where client is
discord.js is the library
I already said that @misty sigil
idk
Scroll a bit up in the terminal

why use .env, I use a config.json?
sO what should i type 
ertwjiopk['vgfq erqbng uhkswdrhugijhsdriyghuidsfh
my guy that's not helping me it's wrong code - someone asked for help 
Can you send your part of code
whos
@ebon kelp #development message
the thing about canvas is that there is more then couple ways to do it i think
See
Now bot online
the thing about canvas is that there is more then couple ways to do it i think
@stark abyss yes

~~(try to keep the useless chat off) I am really tryna get some help here 😔 ~~
with?
told ya @misty sigil she was missing a module
Good work.
ight, goodluck..
I know I know
xd
I wish tim was here or erwin 
Can you post your code on https://codeshare.io/5e74dl
me?
the ss was all of it
the ss was all of it
@stark abyss But like I don't wanna type it all over
oh okay
bruh no
how tu download discord.js
you need to host it
how tu download discord.js
@strange flare npm i discord.js
on what website
@vivid wadi depends
I recommend a VPS
okay
because its more reliable
@strange flare npm i discord.js
@misty sigil that's it?
if you have npm installed, thatll install the djs lib, which you can use to make a bot
I installed node
@ebon kelp https://codeshare.io/5e74dl
I see yes
my code is completely messed up in trial and error process
errors are part of the fun
`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
if your not erroring, your not living life
i can't exactly help you without seeing code
rip
@stark abyss yikes my code editor crashes because of run
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
uh
man
nor errors
npm install -g npm
@ebon kelp i found an easier npm to use then canvas so don't worry about it thank you for helping though
npm install npm?

idfk
thing said to do that
what do u want to install?
someone help this dog
some weird square
updating npm
yes
npm i npm is updating npm
told me to update
@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
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
how do i install discord.js
npm i discord.js
you develop your bot
goodmorning youtube
youtube is a bad source for discord bots
youtube videos are typically out of date
the docs, and the guide are the best sources
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
does anyone have a hosting website i can host my bot 24/7
i suck at coding
@stark abyss no me
object.property kyoji, for example: user.username
@stark abyss could u show me what to do on it on ss
does anyone have a hosting website i can host my bot 24/7
@vivid wadi leave it open on your desktop
object.propertykyoji, for example:user.username
@cinder patio i do <var>.get(key).username, but its not defined
is that your exact code?
Heres my ss
I mean run node index.js in cmd and forget about it
@cinder patio
@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
okay? How is that related to your question
okay? How is that related to your question
@cinder patio I cant seeem to get their Username and discriminator
That's not how you should be iterating through a map/collection
uh
Maps aren't indexed, they atore key/value pairs
how should i then?
yes
the map
has one object
the user
the key is the ID
then it returns a object
couldnt you just not put it in a map if its just one user 🤔
Either use the forEach method or this:
for (let [, member] of filtered) {
....
}
To iterate through a map
uh
hi
doesnt rlly fix my problem but ok
<@&304313580025544704> how do we add my bot
You haven't really told us your exact problem
cant you just use
.fetch(userid) anyway 🤔
-atmods @earnest phoenix
@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.
AYAYA

@modern sable sorry bro
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
-faq 1 @earnest phoenix
@earnest phoenix
That's how you add your bot
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..?
thank you @oak cliff 
@stark abyss I fixed your code
@oak cliff Do we have to fill in English
help
Wait I send DM
please
No it can be whatever language @earnest phoenix
thank you
i'm just gonna give up
..

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
}
Like the 9th person I've seen give up on making a bot in the first hour this week
nice
Do I have to write here
@oak cliff
you dont need to
No you dont have to
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.
Its optional
Oh
okay
the IDS are correct bc its stored in a json file
I have alr read and parsed it in an array called ids{}
[]*
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
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...
No
the key works
but i dont know how to take the USERNAME
dm me
ill screenshare
no
You are already doing that in your code, you are getting the username and the discriminator
Well, you are console logging it
you can write nothing
That's optional
Well, you are console logging it
@cinder patio It logs "undefined#undefined"
its optional
It console logs that because the ID is not in the map
its optional
@solemn latch will there be any trouble
thanks 
Because you are not iterating through the map correctly how many times do I have to tell you
i
am
looking
for
the
username
not
ID
If i do not do .username
it sends the whole map
he told you twice iirc
for(i = 0; i < filtered.size; i++) { console.log(filtered.get(ids[i]).username + "\#" + filtered.get(ids[i]).discriminator) }
Maps aren't indexed
Still, ids[i] is not guaranteed to be in the map
Yes
ik that
its the point
i ONLY want the ones in my json and in the erver
server
filtered already contains all the ids in your json
You just have to iterate theough it normally
also, you can just fetch specific user ids
guild.members.fetch({ user: ['id', 'id2'] })
no need to make the filtered var 🤷♂️
filteredalready contains all the ids in your json
@cinder patio yes but i cant get those if i dont have the key
You can, if you LOOP THROUGH IT NORMALLY
Do you know what filter means.By calling that filter function you only get the ones that are inside your json
uh can we maybe not yell at each other
yes?
oh wait i forgot i put that
oof sorry
ok lemme read how iterate correctly apparently
its up above
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
You could use the .forEach function, or use a for...of loop
Naaahhh, for loops give more power 🌩️
for of is in js
rlly?
there are like 7 diffrent types of lopps in js
inpy is for i in range
It's for x in y in Python
idk about py, but there is a for of in javasceipt
for of also exists 🤔
okay so what foreach or for>
foreach element of iterable
Doesn't really matter in your case
A for loop is universal
i think it probably depends
Wot do I eval to see the server's channel count?
channels.count or length?
What library
D.js
message.guild.channels?
^get the length of that, don't reference it directly expecting the int to be returned
message.guild.channels.length or .size?
something like that. Whatever it is for JS
size
Thx
Doesn't really matter in your case
@cinder patio how would i do it? lmao
An example:
map.forEach(member => {
// Get username for each member here ....
});
oh





