#development

1 messages · Page 1038 of 1

wet dove
#

pls

autumn aspen
#

Bruh

#

Ok

solemn latch
#

MOO

#

my mortal enemy

autumn aspen
#

lol

earnest phoenix
#

Cheers, all sorted and fixed had @solemn latch

      .map(c => c.help.category)
      .filter((v, i, a) => a.indexOf(v) === i);```
autumn aspen
#

@solemn latch Can u help me with the purge command

#

rlly hard

bronze bramble
#

I still haven’t figured out how to reply with bot

solemn latch
#

well, whatcha got so far?

autumn aspen
#

I still haven’t figured out how to reply with bot
@bronze bramble Lol I can teach u later

#

well, whatcha got so far?
@solemn latch I havent do smth lol

#

Thats why idk even know where to start on a purge command

#

@solemn latch can u help?

#

sorry for pings

#

hello @kind sedge!

kind sedge
#

Whats up

low marsh
#

ello guys

#

I'm trying to create a loop command for audio

#

but it's not working,somebody has an idea?

solemn latch
#

that doesnt look like a loop 🤔

#

while loops, for loops

low marsh
#

well I already tried this,but failed

#

so I tried it like this: if stream ends -> add to queue

#

so it's gonna be replayed again

low marsh
#

well I guess it's not a good idea to put this in a while loop

sonic lodge
#

is the call to loop() outside the function definition or am i dumb

low marsh
#

yes it is

#

xd

sonic lodge
#

yeah i would try what Woo suggested

solemn latch
#

the way to make this work, would do exactly what a while loop would do

#

i think your looking for an event, rather than a loop tbh

low marsh
#

a while loop to spam it in my queue array?

pure lion
#

suiuuuuuuuuuuuuuuuuuuuuuuup

#

wait nvm i figured it out

solemn latch
#

you changed names

#

and colors

#

and pfps

low marsh
#

well the thing is,spamming it in a while loop is not a good idea

#

rip performance

solemn latch
#

thats why im saying an event

pure lion
#

Wooooooo how do I reload commands if I'm using module.exports

solemn latch
#

what i think your trying to do is see when dispatcher ends right?
so an event that fires when dispatcher ends makes sense

pure lion
#

Shit I don't have eval brb

pure lion
#

Tyvm

low marsh
#

idk howto create the event lmfao

solemn latch
#

iirc, dispatcher has a finished event already

low marsh
#

does not work for me

#

or I am just retarded

warm marsh
#

dispatcher.on('event', callback)

low marsh
#

does not work for me

#

there is no console output

amber fractal
#

That's because it doesnt exist in v12, use the 'end' event from nodejs' writablestream

solemn latch
#

youd have to look at the docs to find it

amber fractal
solemn latch
#

.on is for events

low marsh
#

the log was just an example

solemn latch
#

🤔

warm marsh
#

No?

amber fractal
#

uh what

warm marsh
#

On is for subscribing to an event.

amber fractal
#

dispatcher.on('end', () => {}) should work though

warm marsh
#

Yeah, I can't remember where the event emitter is in the docs.

#

Try using 'end'.

amber fractal
#

https://discord.js.org/#/docs/main/stable/class/StreamDispatcher it's right here and there is no finish event, but this class extends WritableStream which has an end event

low marsh
#

nope does not work for me

Try using 'end'.

tulip ledge
#

Any idea why when I do console.log(message.mentions.members.size) and tag 2 people it sais the size is 1?

#

Nvm

#

Its cuz I tagged a bot

solemn latch
#

lol

warm marsh
#

Oh nice, They fixed mentions?

#

Niclas where is dispatcher defined?

low marsh
#

at the top of my script

pure lion
#

its .on('finish'

#

it should be

low marsh
#

on('finish') does not work for me

pure lion
#

wh-

tulip ledge
#

Is tere a way to loop through the message.mentions.members?

console.log(message.mentions.members[0])

This doesn't work

warm marsh
#

It returns a collection not an array.

#

.first()

#

Will return the first.

tulip ledge
#

Now I can't

warm marsh
#

Or you can use .values

tulip ledge
#

I need to loop through it

low marsh
tulip ledge
#

.values[0]?

warm marsh
#

Yeah

low marsh
#

"finished playing" is not on the console

warm marsh
#

It will return the data of each key

tulip ledge
#

console.log(message.mentions.members.values[0]) undefined

warm marsh
#

It's a method

#

.values()

tulip ledge
#

Oh

solemn latch
#
dispatcher.on('finish', () => {
    console.log('audio.mp3 has finished playing!');
});
#

straight from the guide

warm marsh
#

In the docs it says use Array.from(<collection>.values())

tulip ledge
#

console.log(message.mentions.members.values()[0]) still undefined

balmy knoll
#

How can I control the permissions of a specific channel for the everyone role? discord.js

warm marsh
#

So acts as if it were an array.

tulip ledge
#

Oh

#

kk

low marsh
#

@solemn latch yea but it does not work

warm marsh
#

channel.setPermissions?

solemn latch
#

are you waiting for dispatcher to finish?

low marsh
#

yes

solemn latch
#

🤔

balmy knoll
#

@warm marsh No set permissions, but only check

earnest phoenix
#

@balmy knoll permissionOverwrites?

warm marsh
#

Check the permissions of the everyone role

balmy knoll
#

Yes, but this doesn't work for me, it gives me always undefined

warm marsh
earnest phoenix
#

What gives you undefined? @balmy knoll

warm marsh
#

Idk how you're supposed to check the everyone role but you can try.

tulip ledge
#
    let partyArray = Array.from(message.mentions.members.values())[0]
    for (let u = 0; u < partyArray.length; u++) {
      message.channel.send(partyArray[i].username)
    }

Any idea why this isn't sending a message?

#

No errors either

#

Oh

#

The 0 has to go

balmy knoll
#

message.channel.permissionOverwrites.get(message.guild.id).deny;
TypeError: Cannot read property 'deny' of undefined

warm marsh
#

ChickenDev you should make it send their names in one message so don't get rate limited.

solemn latch
#

i wonder if you send it the everyone role from the manager

#

if itll work

warm marsh
#

Are you using v12 or v11?

balmy knoll
#

v12

warm marsh
#

As it's overwritePermissions

#

But that's used for changing the permissions of a channel.

earnest phoenix
#

overwritePermissions, overwrites the permissions... Not checking... Lemme see if i can figure this out

warm marsh
#

permissionsFor is the method required for checking.

#

It takes a role or member resolvable.

#

Using message.channel.permissionsFor(message.guild.roles.everyone)

#

Might work.

balmy knoll
#

Okay, this works, but now it gives me the bitfield permissions, how can I convert it to see the actual permissions?

earnest phoenix
#

@balmy knoll the thing you tried would work if there was an overwrite for the everyone role on that channel, it says undefined because that channel doesn't have overwrites for it

#

toArray() ?

warm marsh
#

Using permissionsFor should allow you to do .has('permissions_name')

balmy knoll
#

No, I've set some permissions on deny for everyone on that channel, but it still undefined (Voltrex Master)

earnest phoenix
#

@balmy knoll and if you want to see the permissions instead of the bitfield just use .toArray() on it

#

Hmm that's strange

low marsh
#

ok I did it @solemn latch

tulip ledge
#
    message.channel.awaitMessages(filter, { max: party.length, time: 30000, errors: ['time'] })
    .then(collected => {
      console.log(collected)
      if(collected.first().content.toLowerCase() === "yes") {
        message.channel.send("Check!")
        accepted.push(collected.first().author.id)
        console.log(accepted)
        if(accepted.length === party.length) message.channel.send(`Start`)
      }
    })

Any idea why this only works when the last second user types "yes"? The accepted array only logs his ID

    const filter = response => {
      return party.includes(response.author.id) && !accepted.includes(response.author.id);
    };

This is the filter

low marsh
#

I created a boolean and in my PlayMusic Function i check this boolean and do this:

summer torrent
#

@tulip ledge what is party.length

tulip ledge
#

2

#

as I tagged 1 user + me is 2 people

summer torrent
tulip ledge
#

So shouldn't it do it twice?

#

This is weird I just put this in the filter

      console.log(party.includes(response.author.id))
      console.log(!accepted.includes(response.author.id))

When I type yes it both logs "true" but doesn't fire the awaitMessages and when the 2nd user types yes it's also both true but it DOES fire the code in the awaitMessages

#

Is it maybe

#

That it waits for the max to be reached

#

And then does it?

#

I got it half working now

    const filter = response => {
      if(party.includes(response.author.id) && response.content.toLowerCase() === "yes") accepted.push(response.author.id)
      console.log(accepted)
      return party.includes(response.author.id) && !accepted.includes(response.author.id);
    };
    message.channel.awaitMessages(filter, { max: party.length, time: 30000, errors: ['time'] })
    .then(collected => {
      let collectedArray = Array.from(collected.values())
      for (let i = 0; i < collectedArray.length; i++) {
        if(collectedArray[i].content == "no") return message.channel.send(`**${collectedArray[i].user.tag}** did not accept.`)
      }
      return message.channel.send(accepted)
    }).catch(() => {return message.channel.send("Someone didn't answer in time.")})

It's just not sending the accepted in the channel and runs the catch instead

#

Please tag me if you know a solution

digital ibex
#

what are you trying to do? just a simple message collector?

tulip ledge
#

I'm tryna let everyone who's ID is in an array say yes

#

And then add them to a different array

#

even if I set max to 2 it doesn't work

digital ibex
#

is the issue the filter doesn't work, or its saying u ran out of time?

tulip ledge
#

It sais I ran out of time

#

And I have a feeling it's cuz the filter isn't working

digital ibex
#

just add an e into the params, and console.error(e) in the catch function

tulip ledge
#

And I know why now

digital ibex
#

see what it logs

tulip ledge
#

I'm adding the user to the array

#

And then seeing if the user is not in the array

#
      if(party.includes(response.author.id) && response.content.toLowerCase() === "yes") accepted.push(response.author.id)
      console.log(accepted)
      return party.includes(response.author.id) && !accepted.includes(response.author.id);
#

This will obviously return false

#

Is there a way to still d othis?

digital ibex
#

wai

#

t

#

u want them things to happen if party.inlcudes bit in that if statement is true?

tulip ledge
#

No

#

So

digital ibex
#

im confused what ur issue is then

tulip ledge
#

I want to add the users to the accepted array
And then run the message filter if they are i nthe party and aren't accepted

#

But the thing is if they are in the party I'm adding them to the accepted array

#

I think I have a work around but it might not be so nice

digital ibex
#

so its doing ['user ID 1', 'user ID 1'] even though user id 1 is in the array?

#

and it'll keep pushing that same user into that array?

tulip ledge
#

No

#

I fixed it

pure lion
#

how do i get the user flags as flags and not a number

quartz kindle
marble juniper
#

how can I run lavalink and a nodejs command at the same time

#

is there some way to idk make the js script execute a shell command to run the lavalink jar

#

cuz I tried that and it gives me an error

#

and I tried doing java -jar Lavalink.jar && node index.js

#

doesn't work either

quartz kindle
#

what error?

pure lion
#

Yeh I fix exuwjd

#

Fuck I'm tired

#

Btw hi Tim I'm using djs light because I'm recoding my bot and my god it's so fast thank you

marble juniper
#

I don't think this helps much

#

lol

pure lion
#

Use newline?

marble juniper
#

well it was an exec script

pure lion
#

Oh yeah it's coeldjwn

#

Sorry

marble juniper
#

and when I do the same script in my terminal its all fine

#

with that I mean console command

#

I don't understand

quartz kindle
#

so it says command failed when you use child_process.exec() ?

marble juniper
#

yeah

quartz kindle
#

im not familiar with lavalink, but does it give you back control of the terminal when you run it? or is it like a discord bot that keeps the terminal busy until you ctrl+c?

marble juniper
#

keeps busy

#

doesn't exit

#

maybe I can try running it with a bat file

quartz kindle
#

then you should run it either completely separate, for example in pm2, or use child_process.spawn()

pure lion
#

Okay rusnwidw fml

#

Yaaaaaaaaaaaaaaaay

#

Shit I forgot how to html

marble juniper
#

fuck it im using youtube tutorials if I have to

sudden geyser
#

What are you using the tutorial for.

pure lion
#

How the fuck do I make stuff change colour when I hover over it

marble juniper
#

My solution would be using shelljs and make a second script running that with pm2 so that script runs lavalink for me

quartz kindle
#

:hover

pure lion
#

I did, it doesn't work

marble juniper
#

I tried and shelljs works

#

but it won't work with the bot script

#

so I need a second script

ornate copper
#

1 new server //working sql first added server
/root/dc/DHL/events/guildCreate.js:17 //second added server throw error, anyy fixes?
if (err) throw err;
^

Error: Cannot enqueue Handshake after invoking quit.
at Protocol._validateEnqueue (/root/node_modules/mysql/lib/protocol/Protocol.js:215:16)
at Protocol._enqueue (/root/node_modules/mysql/lib/protocol/Protocol.js:138:13)
at Protocol.handshake (/root/node_modules/mysql/lib/protocol/Protocol.js:51:23)
at Connection.connect (/root/node_modules/mysql/lib/Connection.js:116:18)
at module.exports (/root/dc/DHL/events/guildCreate.js:16:5)
at Client.emit (events.js:327:22)
at Object.module.exports [as GUILD_CREATE] (/root/node_modules/discord.js/src/client/websocket/handlers/GUILD_CREATE.js:33:14)
at WebSocketManager.handlePacket (/root/node_modules/discord.js/src/client/websocket/WebSocketManager.js:386:31)
at WebSocketShard.onPacket (/root/node_modules/discord.js/src/client/websocket/WebSocketShard.js:436:22)
at WebSocketShard.onMessage (/root/node_modules/discord.js/src/client/websocket/WebSocketShard.js:293:10) {
code: 'PROTOCOL_ENQUEUE_AFTER_QUIT',
fatal: false
}

#

does the sql connection die on the second die of running the file guildCreate.js ?

quartz kindle
#

are you using .disconnect() anywhere?

#

or .close()?

ornate copper
#

i believe not

quartz kindle
#

or .end()

ornate copper
#

yes i use .end() @quartz kindle

#
module.exports = (client, guildCreate) => {
//db for scount
con.connect(function(err) {
  if (err) throw err;
 var sql = "UPDATE scount SET servercount = servercount + 1";
  con.query(sql, function (err, result) {
    console.log(result.affectedRows + " new server");

  });
   con.end();
});
}
#

im not including the connection details but i do do them above this

quartz kindle
#

and that runs on the guildCreate event?

ornate copper
#

yes

#

i made sure because i looked at the sql

quartz kindle
#

well the problem is concurrency

ornate copper
#

and it worked the first time

#

what is "concurrency"?

quartz kindle
#

events being processed at the same time

#

one is busy disconnecting while the other wants to connect immediately

#

you probably want to keep the connection alive and re-use it every time

#

instead of constantly connecting and disconnecting

ornate copper
#

but i tried it without .end()

#

same error

quartz kindle
#

for a program that is permanently connected such as a discord bot, its much better to use a connection pool, check out this example

ornate copper
#

i saw that post, but what is the connectionLimit: 10, part do

#

is it like 10 minutes, 10 times or what ive never used a connection pool before and i dont know what it is sorry

quartz kindle
#

it defines how many open connections it will manage

#

for example 10 connections always open

#

every request you make will use one of those connections

#

if one of them gets disconnected, another is created to replace it

ornate copper
#

oh so is there a max limit?

#

ohh so saying 10 will work for more then 10 servers

quartz kindle
#

if multiple queries are done at the same time, each will be done in a different connection to improve performance

pure lion
#

How do I make a button link somewhere (also I tried href and it didn't work, laugh at me)

digital ibex
#

how did u do it?

quartz kindle
#

if each query takes 1 second to complete, with 10 connections you can make 10 queries per second

#

where with one connection, it would take 10 seconds (1 per second)

pure lion
#

href='invite url'

pale vessel
#

don't tell me you did <button href=

pure lion
#

:D

#

I did <button href=

pale vessel
#

fuck

ornate copper
#

ohhh thanks for the help @quartz kindle also whats the link to that article just so i can see if theres any more information

quartz kindle
#

its the mysql npm page

pure lion
#

How do I do it actually 🐖

ornate copper
#

thank you 🙏

pale vessel
#

you can either use <a href= and style a or use <button onclick="javascript">

pure lion
#

Okay

#

How do I make it rounded with css

quartz kindle
#

or use <a href=""><button></button></a>

pure lion
#

a {

}

digital ibex
#

border-radius: ??

pure lion
#

Okay

#

dude I don't know frontend<

digital ibex
#

?? = number

#

same

pure lion
#

¿?

pale vessel
#

and a unit

earnest phoenix
#

what causes the error

#

spawn ENOMEM

pure lion
#

You tell me

earnest phoenix
#

i cant because i do not know

pale vessel
#

no memory?

earnest phoenix
#

thats why i ask

pure lion
#

Err no memory

#

That took me 3 minutes

digital ibex
#

wolfy, send the full error

earnest phoenix
#

i only logged the error.message

pale vessel
#

well, something is eating your memory

pure lion
#

Me

digital ibex
#

lmao

earnest phoenix
#

that's weird because that didnt used to happen

pure lion
#

That's because I just started eating it

#

Smh

earnest phoenix
#

stfu honestly

digital ibex
#

either remove the last thing u done, or just optimise ur code tpsip

pure lion
#

How the golfball do i change the font

quartz kindle
#

how about measuring memory usage?

digital ibex
#

font-family: font

pure lion
#

'font-family: monospace font-color:''fffffff"

#

I mean colour

#

It's not working

digital ibex
#

color: colour

pure lion
#

And replace fffffff with a hex code

#

Oh

#

In the style= thingy?

#

thingy

digital ibex
#

yeah, whatever u wanna change the colour of, do it on that

pure lion
#

O ok ty

earnest phoenix
#

yo

digital ibex
#

so if i had a paragraph

#

i'd do css p { color: purple; }

earnest phoenix
#

So if i have a message collector like this

let filter = m => m.content && m.author.id === message.author.id;
 				let collector = await message.channel.createMessageCollector(filter, { max: 1, time: 15000 });
 				collector.on("collect", async msgC => {
 					if(!msgC.content.match(/\d/) || isNaN(msgC.content)){
 						await csmtd.delete();
 						return message.channel.send("Provided selection index is not a number, closing selection...");
 						collector.stop();
 						} else if(parseInt(msgC.content) > 10 || parseInt(msgC.content) <= 0 || parseInt(msgC.content) > getInfo.videos.slice(0, 10).length){
 							await csmtd.delete();
 							return message.channel.send(`Provided selection index must be between 1-${getInfo.videos.slice(0, 10).length}, closing selection...`);
 							collector.stop();
 							} else {
 								await csmtd.delete();
 								songInfo = getInfo.videos[parseInt(msgC.content) - 1];
 								collector.stop();
 								}
 						});```
As it only collects one message at max, it's useless to have `collector.stop()` right?
pure lion
#

Why is it when I use the <a> tag the font colour goes blurple and changes when I hover

digital ibex
#

i assume so since you've got the returns and else statements

#

idk tho

pale vessel
#

style hover too

#

a:hover { color: gay; }

pure lion
#

A

earnest phoenix
#

@pale vessel ideas?

pale vessel
#

NOP

earnest phoenix
pure lion
#

Iz not working

#

Also dumb question but how do I keyframe border radius (or anything)

quartz kindle
#

@earnest phoenix if you're only collecting 1 message, use channel.awaitMessages

earnest phoenix
#

Oh yea correct... Wait, does TextChannel.awaitMessages() has collect and end events too?

quartz kindle
#

no

#

it gives you a promise that resolves once it ends

earnest phoenix
#

Oh, will sure look into it... Thanks tim

pure lion
#

Lol 13 pings

#

Also what the fuck, whenever I hover over it it goes blurple even when I have it to not do that

pale vessel
#

oh

#

send screenshot

#

or try a:visited { color: <color>; }

pure lion
#

Aaaa okay

misty sigil
#

anyone know cheap vps?

pure lion
#

perhaps

misty sigil
#

I'm thinking of moving out to a vps once i hit 75 servers

pale vessel
#

contabo

proven lantern
#

are we allowed to have our bots put in a command for another bot? like could my bot put in a command that the Rythm bot would listen too?

pale vessel
#

duh

misty sigil
#

@proven lantern rythm won't respond to bots

quartz kindle
#

most other bots ignore commands coming from bots

proven lantern
#

probably a good idea

misty sigil
#

contabo
@pale vessel
is cheap tick
is good (looks like it)

pure lion
#

Flaz it's not working uhhhh

proven lantern
#

in my case it might be a good idea to let other bots call my bot

misty sigil
#

no

pale vessel
#

show code

pure lion
#

Okay

#

itdoesntworkatall:((((

pale vessel
#

dude at least remove the invalid style code first

pure lion
#

i can hear your anger through the keyboard

#

idontevenknowwhatsvalid

#

ill learn it tomorrow its fiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiine

misty sigil
#

i might go for ovh

solemn latch
#

i avoid ovh

misty sigil
#

why

pure lion
#

Ovharies

solemn latch
#

ovh likes to keep billing you

#

after you cancel

misty sigil
#

hell no

#

contabo it is

quartz kindle
#

contabo oversells

#

your cpu and ram are randomly stolen by other people

pure lion
#

Oh no

quartz kindle
#

but its still good, for the amount of resources they offer

pure lion
#

I mean it's not like my bot's gonna get popular X)

misty sigil
#

lmao

#

where do i get hosting then @quartz kindle

pure lion
#

Server boi

misty sigil
#

it works

pure lion
#

:)

#

tired noises<

misty sigil
#

what about when my bot outgrows my measly 50mb/s connection

quartz kindle
#

there is no perfect hosting

#

just chose whatever you feel like

#

both contabo and ovh are decent options

misty sigil
#

ill probs go for contabo

pure lion
#

I think I'm dying send help

misty sigil
#

waaaaaaaat wat

sudden geyser
#

english pls

pure lion
#

Maybe I should sleeep 😅

gray zealot
#

Hi, sorry for interrupting but I have a question 😅

marble juniper
#

so I have this code

const { channel } = message.member.voice;

// Spawns a player and joins the voice channel.
const player = client.music.players.spawn({
    guild: message.guild,
    voiceChannel: channel,
    textChannel: message.channel
});

and thats the same code I used in a second file (which worked) but everytime I try to run the play command it tell me that it can't read the id property from the voice channel even though the id exists and I did log the object and everything is fine and that shit is the exact same code execpt im using a command handler and it worked in the other file but not in this one and I do not understand and no the problem doesn't come from the node module because otherwise that other script I made wouldn't work

#

so where the fuck is the problem

#

Hi, sorry for interrupting but I have a question 😅
@gray zealot also don't ask to ask

#

just ask the question

tepid canyon
#

Hmmm

gray zealot
#

Hi, sorry for interrupting but I have a question 😅
@gray zealot I'm trying to retrieve a string from a JSON file, but It is retrieving all of the strings. heres the code: ```css
const animalsFromJSON = require("./animals.json");

if (message.content === ${prefix}animal) {

const animals = Object.values(animalsFromJSON)

animals[ Math.floor(Math.random() * animals.length) ]
message.channel.send(animals)
console.log(animals)

}

#

just ask the question
@marble juniper ok 😄

tepid canyon
#

I see

#

You are sending all the values when you message.channel.send(animals)

pale vessel
#

wouldn't you want to send animals[Math.floor(...)] instead of animals?

gray zealot
#

k..

#

oh

#

probably 😅 ill try that

tepid canyon
#

Or make a const for that function and send that, either works

gray zealot
#

ok

#
if (message.content === `${prefix}animal`) {

  const animals = Object.values(animalsFromJSON)

  var test = animals[ Math.floor(Math.random() * animals.length) ]
  message.channel.send(test)
  console.log(animals)


}
``` would this work?
#

😄

#

sorry

pale vessel
marble juniper
#

well if nobody answers me then I gotta find a solution myself

tepid canyon
#

Ill check what I use, and see if I can help. Let me open my src lol

gray zealot
#

ok so, ```css
if (message.content === ${prefix}animal) {

const animals = Object.values(animalsFromJSON)

animals[ Math.floor(Math.random() * animals.length) ]
message.channel.send([Math.floor(Math.random() * animals.length)])
console.log(animals)

}
``` i don't think I did this correctly bc I have no errors, but, the message.channel.send send 0

tepid canyon
#

you forgot the animals

#

word b4 the [

gray zealot
#

oh 😄

#

one sec

strange trout
#

It sends a number because that's the random number

gray zealot
#

no, still sends all the animals...

#

It sends a number because that's the random number
@strange trout ok 😄

marble juniper
#

@quartz kindle why when I try to access message.member.voice.channel it returns null
discord.js-light btw

tepid canyon
#

why -light? isnt it just message.member.voice?

#

Or is the .channel light specific

pale vessel
#

because lower memory consumption

marble juniper
#

discord.js-light is pretty much anti caching

#

which disables most intents too

#

and most stuff has to be fetched

pale vessel
#

take it from this man, he also uses it ^

#

oh it was you bruh

strange trout
#
const animals = Object.values(animalsFromJSON);

message.channel.send(animals[Math.floor(Math.random() * animals.length)]);
gray zealot
#

ok, ty

#

ill try it...

strange trout
#

Mobile so something might be wrong

gray zealot
#

ok, ty though 😄

#

hmm, it still doesnt work... something might be wrong with my json 😄

marble juniper
#

like

strange trout
#

What does animals log

marble juniper
#

the voice property does not even fucking exist

#

its just undefined

gray zealot
#

the animal that got sent

What does animals log
@strange trout

marble juniper
#

even after fetching

#

bruh

strange trout
#

Animals should be an array

gray zealot
#

yes

#

it is

strange trout
#

Array of links?

gray zealot
#

one sec

#

no, emojis

median star
#

hi

#

so i want to be able to get the id offa channel tagged

#

like if you say

#

poge setup #channel

#

then it would do stuff in that channel

strange trout
#

Resolve the channel from the mention

#

Then get the ID

gray zealot
#

no, emojis
@gray zealot 😄

bronze bramble
#

@bronze bramble Lol I can teach u later
@HoLdFιZzT#0001

snow urchin
gray zealot
#

nopee

median star
#

how

#

@strange trout thats my wuestion

paper phoenix
#

@median star:

const [ [ id, channel ] ] = message.mentions.channels;
gray zealot
#

Can I still have help :D
(😬)

opal plank
#

Hmmm, got a question, how would i send an image when its inside an obj with Image property in it to the channel without saving it locally? any decent way to request the cache path of that object property?
on the json payload to send it on an embed i see it requires attachment://filename.png
though im unsure how to target the obj and its property dynamically without saving, sending, deleting

sudden geyser
#

So you mean the image URL is in an object and you want to send that image in the channel? What library are you using

opal plank
#

no

#

no url, the image is inside an object

#

this {image: new Image()}

sudden geyser
#

What exactly is Image? I assume this is JavaScript

opal plank
#

indeed

median star
#

hi

#

@paper phoenix discord py

#

-_-

#

not js

paper phoenix
#

Oh. Gotcha

median star
#

cool

quartz kindle
#

you can attach an image to an embed from a buffer or a stream

#

no need to save locally

median star
#

???

opal plank
#

buffer huh

#

lemme try that rq

median star
#

hello

gray zealot
#

Array of links?
@strange trout idk if you saw this but no, they are emojis

#

Bombarded by questions!

median star
#

bombared?

gray zealot
#

nvm

median star
#

what does that mean?

gray zealot
#

edited 🙂

median star
#

ah oki

strange trout
#

Can you show me how it looks when you log it

gray zealot
#

sure

median star
#

me?

strange trout
#

Kian

gray zealot
#

one sec 😄

#

sorry

opal plank
#

hmmm still struggling with it

quartz kindle
#

where are you getting the image from?

median star
#

please help

gray zealot
#

etc.

median star
#

how do i get the id of a mentioned channel

opal plank
#
message.channel.send({
      files: Buffer.from(obj.cover),
      content: 'test',
    });```
strange trout
#

Okay so looks like it's an array inside of an array

gray zealot
#

rlly? lemme see 😄

steel drum
#

is it really worth using typescript for a bot? from my research, compiled javascript from typescript is slower than written nodejs / javascript (which really doesn't matter in context of a discord bot whatsoever, but its still something to note imo) and the errors you'd avoid with typescript would be caught in debuggers according to my research

opal plank
#

thats what im attempting, but clearly im doing something wrong

quartz kindle
#

Eloni get it from channel mentions, if you check the discord.py docs you should be able to see a property thats something like message.channel_mentions, or something simimlar

gray zealot
#
{
    "animals" : [
        "🦐",
        "🦞",
        "🦪",
        "🦀",
        "🐡",
        "🐠",
        "🐟",
        "🐬",
        "🐋",
        "🦈",
        "🐊",
        "🐅",
        "🐆",
        "🦓",
        "🦍",
        "🐘",
        "🦛",
        "🦏",
        "🐪",
        "🐫",
        "🦒",
        "🦘",
        "🐃",
        "🐂",
        "🐏",
        "🦙",
        "🦌",
        "🦚",
        "🦜",
        "🦩",
        "🦥",
        "🦦",
        "🦨",
        "🦝",
        "🦡",
        "🐿️",
        "🦔",
        "🐉",
        "🦄"
    ]
}
``` this is the json
opal plank
#

holy code block

gray zealot
#

take out the {}

#

?

opal plank
#

any ideas tim?

strange trout
#

I don't think you need to use Object.values

quartz kindle
#

@opal plank what is this Image object? is it like the native Image object from browser js?

gray zealot
#

ok

strange trout
#

Just const { animals } = require("path to file")

opal plank
#

good question, i'd have to dig into the library to see whats its fetching tbh

strange trout
#

Then get a random item from it

gray zealot
#

Just const { animals } = require("path to file")
@strange trout k

opal plank
#

lemme check their index rq

strange trout
#

Because Object.values() creates an array of the key values

quartz kindle
#

how are you creating this Image object?

strange trout
#

So it's just giving you an array with another array in it

gray zealot
#

Ty so much @strange trout ! It worked!!

#

lol

opal plank
#

its already created

#

checking their docs but i think ill have to go thru the code itself

strange trout
#

Nice

opal plank
#

thats all that it says in the docs

quartz kindle
#

where is it coming from? which lib is it?

opal plank
#

prob better to dm you

gray zealot
#

Nice
@strange trout now! 😄 Is there a way I could make percent chances?

#

lol

strange trout
#

Wym

gray zealot
#

lets say I want one of the animals to only be sent 1% of the time

pure lion
#

Math.floor and ceil

strange trout
#

Hmm adding some type of weight to it and doing some other js stuff

gray zealot
#

🙂

strange trout
#

Dunno though. Having the same issue with my slots machine command

gray zealot
#

ok 🙂 ty though!

#

1 more... maybe.... I feel like this is simple, but how do I add a cooldown timer

#

all the help is great! 😄

#

but if you have MANAGE_MESSAGES perm it doesn't affect you

heavy anchor
#

@pure lion

#
module.exports = {
    name: 'afk',
    aliases: ['setafk'],
    description: `Users can set an afk message that shows when thay get pinged.`,
    usage: "<afk message>",
    cooldown: 5,
    category: 'general',
    async execute(msg, args, bot, Discord, db) {
        let afkMessage = args.join(" ") || `${msg.author.tag} is currently afk.`;

        await db.set(`users.${msg.author.id}.afk.enabled`, true);
        await db.set(`users.${msg.author.id}.afk.message`, afkMessage);

        const afkEmbed = new Discord.MessageEmbed()
            .setDescription(`Your status has been set to afk with message \`${db.get(`users.${msg.author.id}.afk.message`)}\``)
            .setColor('#7289DA')
            .setTimestamp()
            .setFooter(msg.author.tag, msg.author.displayAvatarURL({
                dynamic: true,
                format: "png",
                size: 4096
            }));
        msg.channel.send(afkEmbed);

    },
};
pure lion
#

If (permission has manage messages) return else setTimeout ())))) milliseconds)))

gray zealot
#

ty

pure lion
#

@heavy anchor is db defined and shit?

heavy anchor
#

yes it is

pure lion
#

Okay

#

Do you know how to use tables? I'm honestly surprised nobody uses them

heavy anchor
#

no lol

pure lion
#

It's stupid easy

heavy anchor
#

Is there's something wrong with the way I'm doing it?

pure lion
#

No idea I can barely see and I'm a tired

heavy anchor
#

oh ok

pure lion
#

But why are you writing asynchronously

#

Setting

#

Also what's the error again

heavy anchor
#

But why are you writing asynchronously
@pure lion idk lol

#

the error is db.set is not a function

pure lion
#

Then don't 😄

#

Oh

#

Hm

#

Send the full command file

heavy anchor
#

that is

#

oh filr

#

file

lyric mountain
#

That's clearly a reference error

heavy anchor
#

lol

pure lion
#

Yeah zjenddn dforn line 1 to line n whathefuck that may be

#

No

#

Use bin please

heavy anchor
#

kk

pure lion
#

Thanks and sorry notlikenoot

heavy anchor
pure lion
#

You haven't defined db

#

Okay I'm going to sleep now

heavy anchor
#

ok gn

#

and i did here async execute(msg, args, bot, Discord, db)

quartz kindle
#

show how the command gets executed

#

in your main file

pure lion
#

const db = sjwmiwnfisnd

heavy anchor
#
try {
      command.execute(msg, args, bot, Discord, dbl, db);
   } catch (error) {
      console.error(error);
      msg.reply('There was an error trying to execute that command!');
   };
quartz kindle
#

arguments are passed by order, not by name

#

your db in your command file is actually dbl

coarse hearth
#
const { MessageEmbed } = require('discord.js')

module.exports = {
    name: "b!reactions",
    run : async (client, message ) => {
        let embed = new MessageEmbed()
        .setTitle('Reaction Roles')
        .setDescription('React to obtain the role')
        .setColor('FCO1FF')

        let MsgEmbed = await message.channel.send(embed)
        MsgEmbed.react('💍')
    
    }
}
#

what am i missing outt

#

coed isnt responding pls help joy_gonna_ascend

heavy anchor
#

@coarse hearth ~~ You need to replace let embed = new MessageEmbed() with let embed = new Discord.MessageEmbed()~~

quartz kindle
#

^ thats not the problem

heavy anchor
#

oh

quartz kindle
#

the code is fine, its likely the problem is elsewhere

#

show where you call command.run()

coarse hearth
#

er

#

what do u mean call command run

heavy anchor
#

your db in your command file is actually dbl
@quartz kindle ohhh i see so I should include msg, args, bot, Discord, dbl, db in all my command files?

quartz kindle
#

in your main file, or in your message event file, somehwere you have a line that does .run()

heavy anchor
#

Thanks that makes sense

quartz kindle
#

thats one option yes

coarse hearth
quartz kindle
#

what about in your command handler

#

or in the message event file

coarse hearth
#

this?

quartz kindle
#

yes

coarse hearth
#

er

#

so

#

what do i do?

quartz kindle
#

can you show the full code from that file?

coarse hearth
#

other commands work fine just this

#

sent

quartz kindle
#

add a console.log("bla") before the command.run() line

#

does it log "bla" when you run the reaction command?

coarse hearth
#

lm try

quartz kindle
#

yes

coarse hearth
#

nope

#

it doesnt

#

respond

#

is it because i made a new file?

quartz kindle
#

you made a new folder?

coarse hearth
#

yea

#

er

quartz kindle
#

show where you load your folder

coarse hearth
#

what do u mean

quartz kindle
#

fs.readdir

coarse hearth
#

er

quartz kindle
#

or just readdir

coarse hearth
#

o

quartz kindle
#

you're loading files from the commands folder

coarse hearth
#

icic

#

how do i add the ||

quartz kindle
#

a || is not enough

#

you will need to repeat some code

coarse hearth
#

i can copy paste and edit right

quartz kindle
#

probably yes, the readdirSync block, with everything inside it

coarse hearth
#

asdo

quartz kindle
#

make another one, including everything inside it, and replace the folder name

#

not the module exports part

#

everything should be inside a single module.exports

coarse hearth
#
const { readdirSync } = require('fs');

module.exports = (client) => {
    readdirSync('./commands/').forEach(dir => {
        const commands = readdirSync(`./commands/${dir}/`).filter(file => file.endsWith('.js'));
    
        for (let file of commands) {
            let pull = require(`../commands/${dir}/${file}`);
    
            if (pull.name) {
                client.commands.set(pull.name, pull);
            } else {
                continue;
            }
    
            if (pull.aliases && Array.isArray(pull.aliases)) pull.aliases.forEach(alias => client.aliases.set(alias, pull.name));
        }
    });
    readdirSync('./commandsprivate/').forEach(dir => {
        const commands = readdirSync(`./commandsprivate/${dir}/`).filter(file => file.endsWith('.js'));
    
        for (let file of commands) {
            let pull = require(`../commandsprivate/${dir}/${file}`);
    
            if (pull.name) {
                client.commands.set(pull.name, pull);
            } else {
                continue;
            }
    
            if (pull.aliases && Array.isArray(pull.aliases)) pull.aliases.forEach(alias => client.aliases.set(alias, pull.name));
        }
    });
    readdirSync('./events/').forEach(file => {
        const events = readdirSync('./events/').filter(file => file.endsWith('.js'));

        for (let file of events) {
            let pull = require(`../events/${file}`);

            if (pull.name) {
                client.events.set(pull.name, pull);
            } else {
                continue;
            }
        }
    });
}

#

er

#

so

#

messy

quartz kindle
#

yes, now it should work

#

but you're reading a folder inside a folder, so your commandsprivate should also have folders inside it, not directly a file

coarse hearth
#

o

#

okok

earnest phoenix
#

How to make vote only command

#

Like if user votes then only he can use that command in . Js

coarse hearth
#

thanks so much

#

❤️

median star
#

anyone

earnest phoenix
#

how i get all the messages of a channel?

tired nimbus
#

Ive never actually seen this and I dont see any method in the docs, but is it possible to fetch an embed completely?

#

like a clone

sudden geyser
#

What library are you using

tired nimbus
#

discord.js

solemn latch
#

when you get a message i think its just message.embed

tired nimbus
solemn latch
#

ye

coarse hearth
#
(node:41760) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'partials' of undefined
#

how do i add partials

tired nimbus
#

let me test it

solemn latch
#

looks like its an array

tired nimbus
#

yea ill just do [0]

solemn latch
#

ye

#

im so used to people not knowing how things work

#

@coarse hearth looks like whatever your using .partials on is undefined

coarse hearth
#

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

#

i have this

solemn latch
#

🤔

coarse hearth
#
const client = new Client({
    disableEveryone: true || ({ partials: ["MESSAGE", "CHANNEL", "REACTION"]})
});
#

this ok?

solemn latch
#

i honestly dont know whats going on in that code snippet

proven lantern
#

is it possible for a bot to allow two people connected to different voice channels to talk to each other temporarily?

earnest phoenix
#

in html how can i list all the servers that a user is in

#

for my web dashboard

solemn latch
#

yes, but i think youd have to build that logic yourself. @proven lantern

#

you want it to be built into the html?

earnest phoenix
#

well

#

ejs

amber fractal
#

you can host a little api for yourself on your bot and in your express backend query the api to get data you need

proven lantern
#

is there a function in discord.js that would let me connect two users?

earnest phoenix
#

or i can fetch it like everyone else

#

but idk how

sudden geyser
#

Ben do you plan on logging in with two bot accounts or do something else

solemn latch
#

you would have to build that yourself @proven lantern

#

i think he is making a call system lite

#

cross server and whatnot

amber fractal
#

if you dont know how, how do you know that's not what they do?

sudden geyser
#

ah

proven lantern
#

i plan to have two rooms with a team of 4 people and 1 leader. the leaders can talk to the other leaders using a modifier

solemn latch
#

well, just so you know. this system would likly have a lot of lag

#

their voice would be sent to discord, then to your bot, then back to discord and to the user again

proven lantern
#

ouch

#

bandwidth would be gonzo

solemn latch
#

if the users are far away from the server, you can be looking at seconds of delay

proven lantern
#

maybe i could just move the player to the room temporarily

#

can i setup keyboard/mouse event listeners?

solemn latch
#

for users in discord?

proven lantern
#

probably isn't allowed

solemn latch
#

if they type a key 🤔

drowsy sequoia
#

anyone here know the best place host a discord bot?
Am coding my first ever bot and I can't find solid places to host for cheap

proven lantern
#

like a PTT button

solemn latch
#

i like galaxygate @drowsy sequoia

#

oh maybe @proven lantern

#

but it would be thier normal ptt

#

i dont think that event would be useful actually

#

the "speaking" event i think bots have acess to

#

this one i think

proven lantern
#

maybe i could listen for a double click of the PTT button

#

i could log the PTT click time and if they click within a certain time they get moved

opal plank
proven lantern
#

will client.guilds.cache have all the guilds that my bot is invited to?

foggy scaffold
#

@proven lantern are u trying to count the number of servers ur bot is in?

proven lantern
#

yeah

solemn latch
#

client.guilds.cache.size will return the number of guilds in the cache.
typically, thats all of them(if not sharding)

earnest phoenix
#

unless youre on discord.js v11

#

then its client.guilds.size

coarse hearth
#
(node:53544) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'partial' of undefined
    at Object.run (C:\Users\LXPC\Documents\GitHub\brutalbotgit\commandsprivate\other\selfroles.js:16:30)
#

help please

#
const { MessageEmbed, ReactionCollector } = require('discord.js')


module.exports = {
    name: "b!reactions",
    run : async (client, message, reaction, user ) => {
        
        let embed = new MessageEmbed()
        .setTitle('Reaction Roles')
        .setDescription('React to obtain the role')
        .setColor('FCO1FF')

        let MsgEmbed = await message.channel.send(embed)
        MsgEmbed.react(':jack_o_lantern:')

        if (reaction.message.partial) await reaction.message.fetch();
        if (reaction.message.channel.id === "730593650386151"){
            if (reaction.emoji.name === ':jack_o_lantern:'){
                await reaction.message.guild.member.cache.get(user.id).roles.add("730596667311226")
            }
        }
    
    }
}
zinc flare
lyric mountain
#

Is it coded correctly?

#

Like, any error?

zinc flare
#

It still worked earlier.

#

Can check, wait

#

No, i don't get any error messages

#

it works earlier like 1-2 hours before @lyric mountain

marble geode
#
const discord = require('discord.js')

exports.run = async(client, message, args) => {
 
  let money = db.fetch(`money_${message.author.id}`);
  let content = "";
  
  for(let i = 0; i < money.length; i++) {
    let user = client.users.cache.get(money[i].split("_")[1].data)
    
    content += `${i+1}. ${user} - ${money[i]}$`
  }
  
  let embed = new discord.MessageEmbed()
  .setTitle(`Leaderboard`)
  .setColor("RANDOM")
  .setDescription(`${content}`)
  .setTimestamp()
  
  message.channel.send(embed);
 
}
exports.help = {
         name: "leaderboard",
         description: "",
         usage: "",
         example: "",
};

exports.conf = {
          aliases: ["lb"],
          cooldown: 5
};```
#

that is my code i succesfully return the embed but not showing anything

lyric mountain
#

That formatting is a mess

median star
#

hey

lyric mountain
#

That or mobile is messing all the code

median star
#

whats wrng with this code

#

@bot.command()
async def getid(ctx, channel:discord.TextChannel):
await ctx.send('' % channel.id)

tired nimbus
#

what is that

#

is that like python

median star
#

it is outputting nothing but wont output to console

#

@tired nimbus tis

#

discord rerwite

marble geode
#
const discord = require('discord.js')

exports.run = async(client, message, args) => {
 
  let money = db.fetch(`money_${message.author.id}`);
  let content = "";
  
  for(let i = 0; i < money.length; i++) {
    let user = client.users.cache.get(money[i].split("_")[1].data)
    
    content += `${i+1}. ${user} - ${money[i]}$`
  }
  
  let embed = new discord.MessageEmbed()
  .setTitle(`Leaderboard`)
  .setColor("RANDOM")
  .setDescription(`${content}`)
  .setTimestamp()
  
  message.channel.send(embed);
 
}
exports.help = {
         name: "leaderboard",
         description: "",
         usage: "",
         example: "",
};

exports.conf = {
          aliases: ["lb"],
          cooldown: 5
};```

help me

tired nimbus
#

chill

median star
#

no

#

help me

tired nimbus
#

bruh

median star
#

lmAO

#

but srly if i could get some help thatd be pog

granite nexus
#

add ; at the last .set

#

not sure if thats all you need

median star
#

?

#

me

granite nexus
#

yes

median star
#

@bot.command()
async def getid(ctx, channel:discord.TextChannel):
  await ctx.send('' % channel.id)

where

#

.sett

granite nexus
#

wait, not you :PPPP

#

add ; at the last .set
@kang baso

olive rune
#

How would I remove the border for the bot avatar and the border for the vote image (image attached for vote)

marble geode
#
const discord = require('discord.js')

exports.run = async(client, message, args) => {
 
  let money = db.fetch(`money_${message.author.id}`);
  let content = "";
  
  for(let i = 0; i < money.length; i++) {
    let user = client.users.cache.get(money[i].split("_")[1].data)
    
    content += `${i+1}. ${user} - ${money[i]}$`
  }
  
  let embed = new discord.MessageEmbed()
  .setTitle(`Leaderboard`)
  .setColor("RANDOM")
  .setDescription(`${content}`)
  .setTimestamp()
  
  message.channel.send(embed);
 
}
exports.help = {
         name: "leaderboard",
         description: "",
         usage: "",
         example: "",
};

exports.conf = {
          aliases: ["lb"],
          cooldown: 5
};```
#

help me

ember lodge
#

I made this code so my bot sends a DM to people who votes but I don’t know why it doesn’t works

marble geode
#

the embed not showing content

ember lodge
#

It doesn’t sends anything to logs ExcusemeWtf

median star
#

wait, not you :PPPP
@granite nexus i feel betrayed ;-;

granite nexus
#

@marble geode

marble geode
#

ya

granite nexus
#

Pls read my message

marble geode
#

add ; ?

granite nexus
#

👍

opal plank
#

@marble geode had some trouble not awaiting before running code sync btw

#

might wanna await calls to make sure the code doesnt run before it returns

marble geode
#

where?

opal plank
#

in your first database call

#

console log it right after, see if its finishing before the code runs

marble geode
#

await db.fetch??

opal plank
#

ya

marble geode
#

ok

opal plank
#

if the query doesnt finish before the next line is ran it'll just log (promise)

marble geode
#

same

ember lodge
#

Help, it doesn’t works and doesn’t sends anything to logs

opal plank
#

did u log it?

marble geode
opal plank
#

LOG it

#

on console

#

console log it right after, see if its finishing before the code runs

marble geode
#

console.log(money) that?

opal plank
#

yes, right under it, without await

olive rune
#

How does one remove the border around the vote button? I managed to fix the bot icon

marble geode
#

same bro

opal plank
#

show here

marble geode
lyric mountain
#

@olive rune use f12 to find out vote button's class

olive rune
#

Do I set the border to none?

opal plank
#

i give up

viral spade
#

Any mongodb specialist here?

lyric mountain
marble geode
#

@opal plank iam trying that for 1 week lol

opal plank
#

well im giving you instructions to help you debug it but you keep sending the same screenshot

#

even though i told you to console log it, you are sending me discord screenshots

#

you know what console is, right?

#

this is console

#

now calmly, add console.log(money) after your database call. then show me the console printing whats inside @marble geode

viral spade
#

someone with mongodb knowledge here?

opal plank
#

im only familiar with postgres

marble geode
#

leave that i deleted the code :v

opal plank
marble geode
#

are you have idea for new command in economy?

lyric mountain
#

Are you have lul

earnest phoenix
#

Hi

#

I am a new guy

#

I want to make a bot fast

opal plank
#

hello new guy, you need help?

#

define fast

#

thats a big vague

earnest phoenix
#

I want to make a modbot in 1 week?

opal plank
#

do you know any programming languages?

clever vector
#

Hello Guys

#

Can you help me???

opal plank
#

dont ask to ask, just ask

earnest phoenix
#

Nope

clever vector
#

I use repl.it to make bot with my friend

#

So

opal plank
#

you need to learn one before trying a bot

clever vector
#

I want my bot status

#

to count

opal plank
#

JavaScript or Python would be my recommendations

clever vector
#

other people

#

I use Node.js

earnest phoenix
#

How to learn JS

opal plank
#

lemme get some links for you

clever vector
#

CodeAcademy

earnest phoenix
#

IK some things

#

CodeAcademy
@clever vector = money

earnest phoenix
#

me not rich

#

XD

opal plank
#

this is also good material for checking

earnest phoenix
#

@opal plank check DM

clever vector
#

@opal plank I want to make my status count other people online in other server

#

can you help me

opal plank
#

@clever vector which lib you use?

clever vector
zenith terrace
#

ilb

opal plank
#

not a library

#

which library you use

clever vector
#

and i use Node.JS

opal plank
#

JavaScript then

#

which lib?

earnest phoenix
#

u need discord.js right?

opal plank
#

or eris

clever vector
#

What do you mean Library

opal plank
#

or d.js light

#

or a bunch of others

marble elm
#

or deno

opal plank
#

uhum

#

i need to know which library you are using to give you proper advice

clever vector
opal plank
#

again, not a library

#

thats the service

clever vector
#

Node.js

opal plank
#

not a library

marble elm
#

😭 good luck mate

opal plank
#

im assuming you have discord.js

clever vector
#

What do u mean by Library

#

can example

opal plank
#

discord.js

#

eris.js

#

deno js

clever vector
#

The app?

opal plank
#

d.js light

#

no, the LIBRARY

earnest phoenix
#

How u made the bot? via CMD or Powershell or an APP

opal plank
#

thats the term

clever vector
#

Where can i find it

earnest phoenix
#

U need to install it

opal plank
#

you make a bot with coding. Use VSC or Atom(goes by your preference) @earnest phoenix

earnest phoenix
#

Atom is good

opal plank
#

I would recommend VSC , my personal preference

clever vector
#

i dont use any library

earnest phoenix
#

SHow SS

clever vector
#

and my bot worked 2 command

#

Help and rpa

#

rpa*

#

rps*]

earnest phoenix
#

@clever vector pls show a ss

#

screen shot

opal plank
#

repl isnt a library mah dude

clever vector
#

i dont want to download anything

#

my pc having an error

earnest phoenix
#

Bruhhhhh

opal plank
#

someone take this one

#

im pasing the towel

earnest phoenix
#

see YT tutorials

opal plank
#

dont see yt tutorials

#

use the proper documents

earnest phoenix
#

LOL

#

I understood somewhat from YT tutorials

#

like some basics

opal plank
#

Youtube tutorials are:
shit
likely outdated
just teaches you to copy-paste
doesnt have the examples nor the explanations that the docs have

earnest phoenix
#

KK

#

@opal plank boolean what is it?

opal plank
#

true or false

earnest phoenix
#

K

hollow granite
#

hi, im having some high memory usage / possible memory leak issues with by bot. i ran a version of my bot without commands or client events, but it still takes gigabytes of my ram, im thinking it's something to do with the guild & user count (~50K guilds). How could i lower the bot's memory usage? or is it just normal for a big bot to take up this much memory?

dreamy heron
#

What language are you coding in?

hollow granite
#

im using the Discord.js library, javascript

solemn latch
#

discordjs loves to cache

#

everything

dreamy heron
#

I was just

#

About to start talking about that

#

lmao

solemn latch
#

try using intents @hollow granite

dreamy heron
#

So if you have a large server, and you cache a lot of entities, it can suck up RAM like no other

#

^

solemn latch
#

if you still cant get ram to levels you want

#

and dont wanna swap to eris

#

try discordjs-light

dreamy heron
#

Thanks woo <3

hollow granite
#

ok, thank you both

dreamy heron
#

ofc <3

autumn summit
#

someone please help

#

I was making overwrites

#

I got this error

#

TypeError: __new__() got an unexpected keyword argument 'allow_new'

marble geode
#

I have a problem, when people buy a gun he can mine even though if you want mine you must have pickaxe I use if (db.has (`$ {message.author.id}`, 'pickaxe') === true) { here the code }

clever vector
#

Hello guys

#

can i ask

#

What is this

opal plank
#

im pretty sure you shouldnt share joinSecret

sudden geyser
#

it's probably an example off the docs

restive pebble
#

yes

clever vector
#

What is that

restive pebble
#

learn classes

clever vector
#

Bros

restive pebble
#

or void

clever vector
#

Can i ask

#

how do i add emoji to my bot

restive pebble
#

from where u got

#

in status ?

opal plank
#

here

#

just checked

restive pebble
#

okk

#

u cannot add custom emojis to bot

clever vector
#

No

#

i mean

#

i have a server that have emojis

restive pebble
#

sending in channel?

clever vector
#

but i want to use it to add

opal plank
#

\ + emote

clever vector
#

to help part

restive pebble
#

default style

clever vector
#

How

opal plank
restive pebble
#

emoji id

opal plank
clever vector
#

<:lol:23567:>?

opal plank
#

you need id, use \ before it

restive pebble
#

thats not a id tho

#

well nvm

opal plank
#

name:id

clever vector
#

example

opal plank
#

it s

restive pebble
#

:kekw:someid

clever vector
#

<:noice:94939939939939393:>??

#

use \ before

#

right]

restive pebble
#

animated emojis should be with a

opal plank
#

no, you use the big thing

clever vector
#

/ ?

opal plank
#

you only use \ to see the name of it