#development

1 messages · Page 1259 of 1

opal plank
#

how the fuck am i gonna make all this mess redable?

umbral zealot
#

prettier FTW

opal plank
#

prettied gud

#

but i mean actual organization

#

prettier only deals with linter shit

umbral zealot
#

well, maybe start splitting this into modules then

opal plank
#

they are already

#

well, most of them

#

most of the index is binders

umbral zealot
#

but not your events it seems?

#

¯_(ツ)_/¯

opal plank
#

the events are

umbral zealot
#

my index is 99 lines

opal plank
umbral zealot
#

and most of that is a thing I could definitely throw outside if I wanted

opal plank
#

this aint discord tho lol

#

my discord one is also somewhat short

umbral zealot
#

yeah I gathered it wasn't d.js

opal plank
#

though i should clean my other indexes as wel tbh

#

and i forgot to add second parameter on the process event too now that i look at it

#

though luckily its only organization, in matter of performance shit is working perfectly good

umbral zealot
#

client.on(eventName, event.bind(null, client)); is an awesome little line of code 😛

#

like, ```js
const evtFiles = await readdir("./events/");
client.log("log", Loading a ${evtFiles.length} events.);
evtFiles.forEach(file => {
const eventName = file.split(".")[0];
const event = require(./events/${file});
client.on(eventName, event.bind(null, client));
});

opal plank
#

i did something a bit better

umbral zealot
#

6 lines to load all my events is not too shabby

opal plank
#

lot more cooler too

#

pass it the binder, the event name and client and you good to go

#

not only for client events

#

there are multiple processes i need to bind listeners on

#

specially when i start doing clustering

#

i'll attempt sharding/clustering on twitch

#

So happy that yesterday all this shit ive been doing paid off good time

#

i was testing nightbot and moobot vs my bot regarding response times

#

my cache beat them every single time when it comes to responsiveness

#

cutting down on api calls does make a huge difference in performance

quartz kindle
#
for(let file of fs.readdirSync("./events")) {
  client.on(file.slice(0,-3),require(`./events/${file}`))
}
pale vessel
#

one line it :^)

opal plank
#

i did one line it, though i needed to get a fuction beforehand

#

technically

#

ish

quartz kindle
#

technically you dont need to bind client because all djs classes have .client

opal plank
#

too bad this isnt d.js lul

#

this shit bare bones

#

it does handling for you, but just gives you the message

#

thats about it

#

anything over that is on you

quartz kindle
#

i dont like one-lining for loops, but sure you can js for(let file of fs.readdirSync("./events")) client.on(file.slice(0,-3),require(`./events/${file}`))

opal plank
#

though im cheating

#

i have my events and the function declared beforehand

quartz kindle
#

and you have a bunch of hidden lines there :^)

opal plank
#

its only 4 lines doe

#

even the function calls for outside scripts

#

tried to make it as clean as i could

restive furnace
#

whats chat?

#

chat

opal plank
#

chat is the IRC connection/connector

#

Twitch still hasnt replied to my request to verify my bot

peak osprey
#
if (command === 'purge') {
  const args = message.content.split(' ').slice(1);
  const amount = args.join(' '); 
  if (!amount) return msg.reply('You haven\'t given an amount of messages which should be deleted!'); 
  if (isNaN(amount)) return msg.reply('The amount parameter isn`t a number!'); 
  if (amount > 100) return msg.reply('You can`t delete more than 100 messages at once!'); 
  if (amount < 1) return msg.reply('You have to delete at least 1 message!'); 

  async function asyncCall() { await msg.channel.messages.fetch({ limit: amount }).then(messages => { 
    msg.channel.bulkDelete(messages)
)});```
#

Debugger attached.
Waiting for the debugger to disconnect...
c:\Users\linds\Downloads\MyBot\MyBot.js:86
if (!amount) return msg.reply('You haven't given an amount of messages which should be deleted!'); // Checks if the amount parameter is given
^

ReferenceError: msg is not defined
at Client.<anonymous> (c:\Users\linds\Downloads\MyBot\MyBot.js:86:16)
at Client.emit (events.js:326:22)
at MessageCreateAction.handle (c:\Users\linds\Downloads\MyBot\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (c:\Users\linds\Downloads\MyBot\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (c:\Users\linds\Downloads\MyBot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
at WebSocketShard.onPacket (c:\Users\linds\Downloads\MyBot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
at WebSocketShard.onMessage (c:\Users\linds\Downloads\MyBot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
at WebSocket.onMessage (c:\Users\linds\Downloads\MyBot\node_modules\ws\lib\event-target.js:125:16)
at WebSocket.emit (events.js:314:20)
at Receiver.receiverOnMessage (c:\Users\linds\Downloads\MyBot\node_modules\ws\lib\websocket.js:797:20)
Process exited with code 1
Uncaught ReferenceError: msg is not defined

misty sigil
#

it’s message

prisma oriole
#

why are you using message then msg

misty sigil
#

IKR

prisma oriole
#

you have to use whichever one you declared in the listener

umbral zealot
#

message and msg are not the same thing. They're obviously different.

misty sigil
#

whitenames i fucking swear

prisma oriole
#

guys what are you talking about did you not see see the new ESNext version? They introduced msg === message

umbral zealot
#

dude that's roleist

prisma oriole
#

bot === client

#

very interesting new feature is Js

peak osprey
#

yeah

umbral zealot
#

oh man javascript has conditions now? I've been waiting for this forever

peak osprey
#

now it wont delete the messages

umbral zealot
#

you need to convert the amount to an actual integer

#

parseInt can help you there.

prisma oriole
#

parseInt(amount) as Hindsight suggested

peak osprey
#

ok

pale vessel
#

string - 0 😤

#

by the way you can just specify the amount in bulkDelete(), no need to fetch the messages

peak osprey
#

why is it saying that?

misty sigil
#

Cuz 101 > 100

#

??

#

like bruh

peak osprey
#
async function asyncCall() { await msg.channel.messages.fetch({ limit: amount }).then(messages => { // Fetches the messages
    msg.channel.bulkDelete(messages)```
#

is this command correct

umbral zealot
#

only if amount is a number, and only if it's between 2 and 100

peak osprey
#

ok

umbral zealot
#

though you don't actually need to fetch the messages.

peak osprey
#

so why wont it do anything when i type the command

umbral zealot
#

bulkDelete can directly take an integer and removes those messages directly

misty sigil
#

just message.channel.bulkDelete(NUMBER)

umbral zealot
#

you also defined a function but you never called it

misty sigil
#

let around = parseInt(args[0]) or something

#

Your code is a mess

#

where did you copy paste it from

pale vessel
#

ignored 😔

umbral zealot
#

you would benefit greatly from actually learning javascript before trying to make a bot. you need to get the basics down before doing something as advanced as a bot.

misty sigil
#

because anyone with a sip of js knowledge would like know how to fix it

#

and that 101 > 100 will always return tru

prisma oriole
#

only real js programmers know that the secret to any comparison is

if(!truthy !== false)
peak osprey
misty sigil
#

well

#

UGH

#

ok so basically

#

1 is always less than 2

#

please

umbral zealot
#

you also defined a function but you never called it

misty sigil
#

fUCk

prisma oriole
#

ok listen

#

i think your need to learn js first

misty sigil
#

wait neither of those matter

#

uh

#

fUCk

peak osprey
#

i have the numbers right

umbral zealot
#

god, please go learn javascript. seriously.

#

Before you make a Discord Bot, you should have a good understanding of JavaScript. This means you should have a basic understanding of the following topics:

  • proper syntax
  • debuging code
  • basic features (vars, arrays, objects, functions)
  • read and understand docs
  • nodejs module system

As much as we'd like to assist everyone with making their bots, we rarely have the time and/or patience to handhold beginners through learning javascript. We highly recommend understanding the basics before trying to make bots, which use advanced programming concepts.

Here are good resources to learn both Javascript and NodeJS:

Javascriptinfo: https://javascript.info/
Codecademy: https://www.codecademy.com/learn/javascript
FreeCodeCamp: https://www.freecodecamp.org/
Udemy: https://www.udemy.com/javascript-essentials/
Eloquent JavaScript, free book: http://eloquentjavascript.net/
You-Dont-Know-JS: https://github.com/getify/You-Dont-Know-JS
NodeSchool: https://nodeschool.io/
CodeSchool: https://www.codeschool.com/courses/real-time-web-with-node-js

Please take a couple of weeks/months to get acquainted with the language before trying to make bots!

midnight blaze
#

pandasad freecodecamp for example

#

freeCodeCamp is the best for sure

pale vessel
#

never used it

midnight blaze
#

you are too good for it flazepe

pale vessel
#

who the hell starred that

midnight blaze
#

only beginners would use it

#

me

pale vessel
#

oh

#

yeah don't

midnight blaze
#

ok :>

prisma oriole
#

i died at

if(1 < 2) {
  msg.reply("")
}
midnight blaze
#

I wont nxt time

pale vessel
#

maybe it's false in another universe

prisma oriole
#

maybe

#

just mayve

midnight blaze
#

that if (1<2) is kinda cute tho

obtuse niche
#

👀

stoic dock
#
if (true) console.log("true worked")
if (1 < 2) console.log("1 < 2 worked")

Console:

true worked
1 < 2 worked
obtuse niche
#

Next level coding

quartz kindle
#
if(input === 1) console.log(1)
if(input === 2) console.log(2)
if(input === 3) console.log(3)
if(input === 4) console.log(4)
if(input === 5) console.log(5)
if(input === 6) console.log(6)
obtuse niche
#

maybe it's false in another universe
Lmao

solemn leaf
midnight blaze
#
let myObject = {
myFunction: function (){
message.channel.send(this === myObject)
message.channel.send(this === myOtherObject)
}
}
let myOtherObject = {};

myObject.myFunction.call(myOtherObject);

this and truthy.. smirk

quartz kindle
#

whats the outcome? false true?

midnight blaze
#

yeah O: it shows how this can be different in js

quartz kindle
#

different from what?

midnight blaze
#

other languages

opal plank
#

@solemn leaf addfields takes an array

solemn leaf
#

the problem is the addfleid

opal plank
#

why you doing addfield if u got addfields?

solemn leaf
#

oh

#

Imma go

#

bye

quartz kindle
#

console.log the embed before sending, and you'll see which field is missing

opal plank
#

fairly certain its this

solemn leaf
#

It shouldnt be it thou

opal plank
#

you prividing a string

#

it cannot error

#

¯_(ツ)_/¯

midnight blaze
#

why is there a false? Just delete that

#

inline are bugging anyway

opal plank
#

you gotta choose between pretty or fuck up mobile users

midnight blaze
#

fuck up mobile = inline

opal plank
#

not like non-inline will help them much either way

restive furnace
#

not like non-inline will help them much either way
inline truly shits out mobile embeds

#

(without FOooOOoOOoOOOoter)

solemn leaf
#

ok

#

it was

#

v.disc

opal plank
#

told ya

#

¯_(ツ)_/¯

solemn leaf
#

hmm

#

can I make an if

#

that checks if it is Nan

quartz kindle
#

just make an or

solemn leaf
#

?

quartz kindle
#

v.desc || "no value"

solemn leaf
#

ah ok

opal plank
#

or show off and use nullish coalescing

digital ibex
#

anyone know why im getting dis? ```js
MongoError: not authorized on lost-bot to execute command { find: "guilds", filter: { id: "446067825673633794" }, projection: {}, limit: 1, singleBatch: true, batchSize: 1, returnKey: false, showRecordId: false, lsid: { id: UUID("ab15804b-774b-4ef0-b616-a9be75e6a230") }, $db: "lost-bot"

#

works on my pc, but i move it to the vm and it errors

#

any ideas? this is the connection uri

misty sigil
#

did you try it with an account with admin perms?

quartz kindle
#

null coalescing will let "" pass, which will error anyway

misty sigil
#

what perms does the account have?

opal plank
#

does empty string not pass on fields?

digital ibex
#

mongodb://lost:da5dcd14c27c6c3cc69f81542b605a05a0df8524e@localhost:27017/lost-bot?authSource=lost-bot slightly modified, not the exact thing

#

i cant

misty sigil
#

why?

digital ibex
#

and that account was made by the admins

misty sigil
#

ooOh

quartz kindle
#

nope, afaik empty string still throws the empty field error

misty sigil
#

it might be a problem on that side

#

are you using the same db?

digital ibex
#

im using it for other projects yh

#

not same uri

#

but their db

misty sigil
#

no i mean same db on pc and vm

digital ibex
#

no, my pc: mongodb://localhost:27017/lost
vm: mongodb://lost:da5dcd14c27c6c3cc69f81542b605a05a0df8524e@localhost:27017/lost-bot?authSource=lost-bot

opal plank
#

hmmmm

misty sigil
#

aH, that could be the problem then

#

do they have the same perms?

tired nimbus
#

Is it possible to make all linked images at a fixed height and length?

#

what do you add after the image link?

digital ibex
#

not sure what u mean by perms, its just local host

misty sigil
#

when you make the account

#

account has perms

#

like "adminAnyDb" or something which is practically root

digital ibex
#

the admins made it, they're not responding rn so for now im just assuming so

misty sigil
#

can you compass in to see what you can do?

slate oyster
#

Hey guys
I am not using Java annotations, but am getting an error when importing a JVM package

I literally copy/pasted these files from the previous version of my bot, so they should work?

digital ibex
#

im not on my pc, so i cant download stuff

#

im coding on githubs ui on prod :p

sudden geyser
#

Hover over the red text. What does it say?

restive furnace
#

I'm wondering, should I go for TS or JS for a discord bot?

earnest phoenix
#

do you want type safety

opal plank
#

do you wanna write more and make safer code?

#

ts

#

you a lazy cuck who assumes & believes unshakably in your ability to use js without bugs? go js

restive furnace
#

hmm ok

#

ill prob go ts

opal plank
#

ts you type way more

#

but it makes up in production with way lesser bugs

#

you put more commitment into development and less into debugging/patching

#

your code WILL likely be 40% girthier btw

#

so expect to be typing and struggling quite a bit

restive furnace
#

that's true, I have experienced both, and when using JS, it was 90% of the time debugging.

opal plank
#

creating interfaces, types, avoiding compiler errors/catching shit that would work on js, stuff like that

#

you'll have a great time typing twice as much in ts

leaden rover
#

How do I make a command which changes the bot's language in a guild? I don't really know how to translate stuff like that... Is there a lang feature I can use?

silk chasm
earnest phoenix
#

ts also transpiles down to "proper" js, there's a good chance that you're going to get faster code from the transpiler making smart decisions a human otherwise wouldn't in js

opal plank
#

^^

restive furnace
#

hmm i'll go for TS

opal plank
#

THOUGH

#

compiling takes longer in ts

#

so expect longer startup times

leaden rover
#

Well, I know python, but how do I change the entire bot's language? Is there a database that I need to use?

opal plank
#

unless you already pre-compiled

charred kindle
#

@leaden rover wdym

slender wagon
#

what's the difference between ts and js

#

?

topaz fjord
#

ts has types

opal plank
#

as the name suggests, TYPESCRIPT

#

its typed

topaz fjord
#

but in the end it gets transpiled into js

opal plank
#

strong typed, i should say

charred kindle
#

lol

restive furnace
#

yeah, it transpiles to js first, and then you can run the project

leaden rover
#

As in when someone uses the command, it changes the bot's language in the guild

charred kindle
#

ooooh

silk chasm
#

everybody ignored my message cuz of war btw ts and js

opal plank
#

meaning your objects need to have their types set, string, number, etc

charred kindle
#

you mean spoken languages

#

uh

#

idk

topaz fjord
#

the typescript type checking is only at compile time

leaden rover
#

ok

charred kindle
#

tbh

restive furnace
#

the typescript type checking is only at compile time
@topaz fjord + PROPER js

topaz fjord
#

since it gets compiled into js which doesn't have explicit types

slender wagon
#

but does that make it better than js it self?

opal plank
topaz fjord
#

gets read of nullability issues

#

ig

#

rid

opal plank
#

check video, it shows a lot of the perks ts has to offer

slender wagon
#

also can i use this js if(user.presence.status === ("dnd")) { ctx.drawImage(dnd, 20, 20, 35, 35); }
in the middle of canvas? i tried doing that but it doesn't draw anything

crisp meteor
#
const DIG = require("discord-image-generation");
client.on("message", async (message) => {
  if (message.content === "-change") {
      let avatar = message.attachments.find(attachments=>attachments.url);
      if(!avatar) return message.channel.send("> **قم بإرفاق الصورة مع الامر**");
      let img = await new DIG.Greyscale().getImage(avatar)
      let attach = new Discord.MessageAttachment(img, "William.png");
      message.channel.send(attach)
  }
});```
misty sigil
#

we can't help

#

ask the lib developers

crisp meteor
#

@misty sigil who are the lib developers ?

misty sigil
#

we don't know.

crisp meteor
#

-.-

slender wagon
crisp meteor
#

@slender wagon I have a month I want to contact them and there is no response

slender wagon
#

can't help

opal plank
#

switch to canvas or something

#

¯_(ツ)_/¯

#

generate your own images rather than relying on a 1-click lib that seems to be unmaintained

misty sigil
#

^

crisp meteor
#
const prefix = "-"
client.on('message',message=>{
  let command = message.content.toLowerCase()
    if(command.startsWith(`${prefix}change`)){
if(!message.channel.guild) return message.reply(`**This Command For Servers Only**`).then(messages => messages.delete(2000))
        if(!message.guild) return;
        let args = message.attachments.find(file=>file.url)
        if(!args) return message.channel.send("**Please send the picture.**");
      message.channel.send(`https://some-random-api.ml/canvas/greyscale?avatar=${args.url}`);
    }  
});```
#

Even this is the same thing

opal plank
#

wtf is that code doing

#

also that indentation killing me

crisp meteor
#

I want it to convert the image to the same size and not bigger or smaller

opal plank
#
    client.on('message', (message) => {
      let command = message.content.toLowerCase();
      if (command.startsWith(`${prefix}change`)) {
        if (!message.channel.guild)
          return message
            .reply(`**This Command For Servers Only**`)
            .then((messages) => messages.delete(2000));
        if (!message.guild) return;
        let args = message.attachments.find((file) => file.url);
        if (!args) return message.channel.send('**Please send the picture.**');
        message.channel.send(
          `https://some-random-api.ml/canvas/greyscale?avatar=${args.url}`
        );
      }
    });```
#

here, much cleaner

crisp meteor
#

Same thing, it enlarges the image

leaden lake
#

The embed image don't want to upload on my command, but before (when I installed this command to my bot) it sends it with no problem, can anyone help me ?

        embed = discord.Embed(title = "Stats Command",
                                  description = "They are the stats of my bot",
                                  colour = discord.Colour.purple()
                                  )
        embed.set_footer(icon_url = "https://cdn.discordapp.com/avatars/341257685901246466/83a72d7485fe313cd0f0141f0b221943.png?size=4096",
                         text = "JeSuisUnBonWhisky#1688")
        embed.set_author (name = "Unconnected Bot#8157",
                          icon_url = 'https://cdn.discordapp.com/avatars/543924044110626826/1341bf81b2289bf25bd0e5de2aafbad2.png?size=4096')
        embed.add_field(name = "TopGG Page",
                        value = "[You can click on this link to see the bot page](https://top.gg/bot/543924044110626826)",
                        inline = False)
        embed.set_image(url = "https://top.gg/api/widget/543924044110626826.png")

        await message.channel.send(embed = embed)```
opal plank
#

also why u checking for channel.guild AND message.guild?

#

i didnt change your code william, i simply formatted it

#

cuz you seem to not have a linter or a shit one at that

crisp meteor
#

Well can you help me

opal plank
#

can you tell me whats the issue?

crisp meteor
#

I want to convert the image to black and white, when he converts it he converts it to a larger scale and not the same size as the image that you sent

opal plank
#

also im pretty sure avatar is suppose to get a 1:1 ratio pic

#

likely cuz its stretching to fit

#

you are providing a non 1:1 pic

crisp meteor
opal plank
#

also i think you can use arguments for format

crisp meteor
#

And when I convert a large picture, it zooms out

opal plank
#

did you bother reading what i sent or you just throwing random info in chat?

crisp meteor
#

It resizes all images to a fixed size

umbral zealot
#

Save the file to disk, or open the URL in the browser, and see if it does the same.

opal plank
umbral zealot
#

If it does, it's the API's/module's fault.

opal plank
#

did EITHER of you read what i sent?

crisp meteor
#

yes

opal plank
#

clearly not

#

1:1 image

#

look at the ratio of the image sent

#

avatars are suppose to be 1:1

umbral zealot
#

I did, and I'm offering an alternative to try to see if it's the apis that do it or not.

crisp meteor
#

What do you mean non 1:1 pic

umbral zealot
#

¯_(ツ)_/¯

opal plank
#

100x100

umbral zealot
#

larger than it is taller

opal plank
#

200x200

#

300x300

#

thats 1 to 1 ratio

earnest phoenix
#

How do I get the information of an emoji?
example: /emoji papagan

opal plank
#

1:1

crisp meteor
#

It converts all images into 500 x 500

opal plank
#

@earnest phoenix regex and throw its id into the api

#

@crisp meteor yeah, cuz thats whats its suppose to do

#

feed it a 1:1 ratio file

#

and like i said

#

you can use arguments

umbral zealot
#

@crisp meteor right, so, that's your problem. Give it a square image, it gives you a square image in return. Give it a rectangle image, it gives you a square image anyway.

crisp meteor
#

How do I fix this, I want it to convert it black and white at the same size that I sent

umbral zealot
#

use a different API that doesn't resize.

opal plank
#

add the params on the url

#

im fairly certain you can do ?width=YOUWIDTH%height=YOURHEIGHT

#

in the end of the url

#

usually if it only returns the image, i should say

crisp meteor
#
message.channel.send(`https://some-random-api.ml/canvas/greyscale?avatar=${args.url}```
#

that ?

opal plank
#

no

#

well

#

yeah

#

thats where you'd put it

earnest phoenix
opal plank
#

but you need to add extra queries

earnest phoenix
#

I finally made some working code

crisp meteor
#

Such as ?

slate oyster
#

@sudden geyser it says "the import javax.annotation.Nonnull cannot be resolved"

opal plank
#

you really dont read what i send do you?

#

im fairly certain you can do ?width=YOUWIDTH%height=YOURHEIGHT

thick gull
#

wouldn't it be &height

crisp meteor
#

I read, but I am not very experienced and did not understand you clearly

opal plank
#

im not sure tbh

#

url encode

#

lemme check rq

umbral zealot
#

so clearly, it's expecting a square image, and that's that.

opal plank
#

you can pull from source

#

i think its doable

#

holdup

#

im assuming its a get request

#

either way, gimma a sec

#

i knew it

#

you can

#

its unrelated to their api

sudden geyser
#

@slate oyster are you possibly missing it because it's supposed to be specified as a dependency?

opal plank
#

actaully

umbral zealot
#

OH I see what you mean. you meant the discord URL not the api one.

opal plank
#

actually

#

yeah

#

you can resize it

crisp meteor
#

I did not understand anything 😭

slate oyster
#

@sudden geyser I'm not using Java modules, so I don't need to specify the packages I depend on
And it should be part of the JVM, not something I need to import through Gradle

#

It's just a Nonnull, so I might just remove it and move on with life

opal plank
#

alternatively you could use a resizing api for it

#

though im fairly certain you can add params to most images

crisp meteor
#

Can you give me a site api ?

opal plank
#

you gotta look for one

#

shouldnt be that hard to find

#

i gotta say though, thats one sketchy domain name right there

slate oyster
#

@opal plank nice find

opal plank
crisp meteor
#

It has rights, they put rights on the image

opal plank
#

generate👏 your 👏 own👏 image👏 rather 👏 than👏 relying 👏 on 👏 sketchy 👏 api👏

obtuse jolt
#

How do I check if a time stamp is more than 3 days old

opal plank
#

date.now - timestamp

#

then convert the miliseconds into days

obtuse jolt
#

I mean like if timestamp is older then 3 days do this

#

Is js

opal plank
#

again

#

date.now - timestamp

obtuse jolt
#

It was significant different last time I asked

opal plank
#

you have the timestamp, yes?

obtuse jolt
#

Yeah I have the time stamps stored

opal plank
#

then its what i said

#

date.now - timestamp

#

that returns miliseconds

obtuse jolt
#

It was like date.now + 3 days > or < date.now

#

Last time I asked

opal plank
#

divide by 1000(seconds), then 60(minutes), then 60(hours) then 24(days)

#

you can do that too

#

not days though

obtuse jolt
#

Yes how do I do that method?

opal plank
#

wdym?

obtuse jolt
#

It was like date.now + 3 days > or < date.now

opal plank
#

your method is exactly the same as mine but you adding time

#

see this?

#

divide by 1000(seconds), then 60(minutes), then 60(hours) then 24(days)

#

rather than dividing, you multiplying this and adding onto your timestamp

slate oyster
#

Except for the Blurple bot, I'd say image generation isn't even useful imo

opal plank
#

urs => timestamp + (3 days worth in miliseconds) > date.now

mine => date.now - timestamp (then convert into 3 days worth from miliseconds)

#

both you'll have to convert 3 days from/to milliseconds either way

obtuse jolt
#

yeah google time conversion is pretty cool

opal plank
#

huh?

#

@earnest phoenix screenshots are native to windows

obtuse jolt
earnest phoenix
#

What is the problem?

opal plank
#

@earnest phoenix screenshot dont take pics wqith cellphone

earnest phoenix
#

Ok

opal plank
#

what google is doing is the same what i said lol

#

divide by 1000(seconds), then 60(minutes), then 60(hours) then 24(days)

#

though multiplying

tidal marlin
#

Should I make warns based on servers the user is in or based on users in the servers? Which take on the subject is the better one? Like either storing warns in serverData as of each user, or inside each userData store servers and warns in them

umbral zealot
#

Actually not a screenshot. Copy/paste your code on https://hasteb.in/ but remove the token from the client.login!! @earnest phoenix

left lake
#

store warns by server per user

opal plank
#

Yikes

#

i just noticed

earnest phoenix
#

^

opal plank
#

he showed his token

#

already

obtuse jolt
#

Store warns per server back if not then other servers can see their warns

tidal marlin
#

mmmm token, tasty

left lake
#

^^

opal plank
#

@earnest phoenix delete that picture and reset your bot token, you just 300IQ leaked your bot token

earnest phoenix
#

done

left lake
#

also makes it easier to remove a users data from your db's if needed

earnest phoenix
#

@umbral zealot done

opal plank
#

@earnest phoenix RESET UR BOT TOKEN

#

now

umbral zealot
#

ok so give us the URL you get from hastebin 😉

obtuse jolt
#

lmfao this man finna just leaked his token

earnest phoenix
left lake
#

but can anyone help me here, my bot is not registering a command that is clearly in its files, no matter if i remove a command, restart it, do whatever, it simply just wont register it

umbral zealot
#

client.on=('message' , message => { <--- this is not valid javascript

left lake
#

ive removed another unrelated command that was working fine and the bot removed it and when i added it back it registered it just fine

umbral zealot
#

if(!message.content.startwith(prefix) || message.outhor.bot) return; <--- this is not valid either, learn to spell author

earnest phoenix
#

lul

obtuse jolt
#

@earnest phoenix message.author.bot

opal plank
#

code hardly misbehaves, its likely you doing some bad filter @left lake

umbral zealot
#

startwith(prefix) isn't valid, it's startsWith

left lake
#

it cant be thouhg

#

since the bot wont even run the command

opal plank
#

then the problem is your code

umbral zealot
#

mfw copying extremely badly from a youtube video. someone needs new glasses.

earnest phoenix
#

wtf man thats so hard

left lake
#

even though its in its command folder, it isnt the command handler

obtuse jolt
#

startwith(prefix) isn't valid, it's startsWith
@umbral zealot won’t it not work either because it’ll be pretixcommand not prefix command

left lake
#

it isnt how im filtering the commands,

#

it simply just wont recognize the file itself for no apparent reason

obtuse jolt
#

So it wouldn’t start with the prefix if it’s !lol it would if it’s ! lol

opal plank
#

show me ur file, your folder and the code that requires the file @left lake

umbral zealot
#

@obtuse jolt uhhh... no... I'm pretty sure you're 100% wrong there my friend.

obtuse jolt
umbral zealot
#

In fact I'm 100% sure you're wrong

obtuse jolt
#

I’m gonna test it

umbral zealot
#

because that's args parsing I literally wrote myself, so...

left lake
opal plank
#

okay, good

left lake
#

i even tried to just put in a test file with nothing really in it but nothing still

opal plank
#

next up, code requiring it

earnest phoenix
#

and now?

opal plank
#

extension seems fine

umbral zealot
#

no you're not using startsWith correctly

#

and still not spelling it right

opal plank
#

js is case sensitive

left lake
#

by code requiring it are you referring to what is executing the command or the help command which is filtering them

opal plank
#

aVariable is different than avariable

earnest phoenix
#

done

umbral zealot
#

startsWith is a function that requires an argument, startwith is exactly nothing.

opal plank
#

@left lake if thats your thing, then yeah

#

you usually map commands in a collection

restive furnace
#

what language wouldn't be case sensetive?

earnest phoenix
#

done

opal plank
#

can you even run the command(not the help, the actual file) ?

slender thistle
#

Pascal

left lake
#

no

opal plank
#

SQL

restive furnace
#

ok.. nice

opal plank
#

SQL be like CAPS

left lake
#

and it shouldn't be an issue with the way im filtering it since its in the same category of commands as some of my others

#

and those are showing up just fine

opal plank
#

@left lake lemme check nonetheless

#

its clearly something there

#

if it was an oversight i might be able to catch it

#

2 heads > 1

earnest phoenix
#

the bot is online but he dont write

left lake
#

let funcat = commands.filter(c=> c.file.category === 'fun').map(c=> c.name).join(', ') this is whats filtering the commands by category

umbral zealot
opal plank
#

do this in your code rudy

earnest phoenix
#

ok thx

opal plank
#
const tweettrump = require(./goosie/commands/trumptweet.js);
console.log(tweettrump)
#

fix the path and the name

#

cuz idk how your directory is handled

#

but i assume its root/commands/categories

wide shard
#

Oi

left lake
#

root/goosie/commands

#

close enough

opal plank
#

i wanna see if it requires the file just fine

#

if it does, its your importer thats blurping

left lake
#

fun part with that is from the vps theres no way for me to log anything to the console 😐

opal plank
#

send in chat a check then

left lake
#

i'd do the same thing on my machine where im self-hosting the testing version, but that bot isnt encountering any issues with that

stark abyss
#

how to cache users using their id?

#

in djs

opal plank
#
if(message.channel.id === 'MY TESTING CHANNEL') message.channel.send(if(tweettrump))```
#

@left lake

left lake
#

zero response from the bot

opal plank
#

the next time you send a message in that channel it'll send you true or false

#

needless to say, replace MY TESTING CHANNEL with some channel id you want to be testing in

#

just a quick patch to walk around the console issue

woven sundial
#

Hi, I'm trying to update an existing message with an other one that already exist too.

let changelog = new Discord.MessageEmbed()
        .setTitle(":bookmark_tabs: **__Dernier changelog de NetBot__** :bookmark_tabs:")

        setInterval(async () => {
          client.channels.cache.get("757658326459744267").messages.fetch("757664985815056394").then(patch => 
            client.channels.cache.get("757661526848176158").messages.fetch("757662070845079602").then(toChange => 
              changelog.setDescription(patch.content)
              .setFooter("Dernière recherche de changelog ")
            .setTimestamp(),
            toChange.edit(changelog)
              )
            )
        }, temps)```
error : ``` ReferenceError: toChange is not defined``` 
I think I'm doing it wrong, can someone help me ?
left lake
#

i put the snippet you gave me inside of a command (since im too lazy to deal with my headache of the message client event)

opal plank
#

:/

left lake
#

let me try requiring a command that works and see if its not my code

opal plank
#

fam you gotta put commitment

stark abyss
#

no one ones how to cache users in djs?

left lake
#

fetch them and cache them?

stark abyss
umbral zealot
#

users are cached automatically

left lake
#

😐

umbral zealot
#

but if they're not you can fetch them

left lake
#

if its not a large guild

stark abyss
#

how to

opal plank
#

why async if you chaining .then()'s ?

#

@woven sundial

umbral zealot
#

client.users.fetch("id") for users. guild.members.fetch("id") for guild members (which does both)

left lake
#

command is the same thing as a message event

#

wouldnt change anything but 1 sec

stark abyss
#

okay

woven sundial
#

why async if you chaining .then()'s ?
@opal plank That's not really my question xd

opal plank
#

it still useless code

#

shows u dont know promises/async

proud onyx
#

how do you add the servers bot is in part in top.gg

#

how do you add the servers bot is in part in top.gg

opal plank
#

probably #topgg-api related now that i think about it

left lake
#

after all of that still no response from the bot

opal plank
#

needless to say that should be right under your message

left lake
#

dont know what else to do, the file is there, it has nothing to do with how im filtering the commands, my command handler isnt fucked up, the file exists and is there (with code that actually works)

#

if i add any other commands it wont show up on the bots help message (i.e doesnt exist)

opal plank
#

well i tried help you debugging it

#

¯_(ツ)_/¯

#

if you giving up thats on you

left lake
#

i never said i was giving up i literally just told you the bot isnt responding

opal plank
#

which means you are putting it in the wrong place

left lake
#

the

#

what

opal plank
#

the MESSAGe

left lake
#

chief the message is being put in the right spot what

opal plank
#

client.on('message' => if(message.channel.id === 'MY TESTING CHANNEL') message.channel.send(if(tweettrump))

left lake
#

yes

#

it is infact inside of a client message event

#

since i just put it in there 30 seconds ago

opal plank
#

there has to be a response in that channel

#

if channel id match it sends it

#

thats about it

left lake
#

i just put it in there and the bot wouldn't respond to any command

#

within that channel

opal plank
#

if its not sending you either put it in the wrong spot(or before a check) or you didnt put the right id

#

im just doing guess work, your best bet is to dump your index into https://paste.awoo.rocks/ and sending me the link so i can take a look at it

#

welp, anyway, im off to code now

#

gotta add some resolvers for my client cache

peak osprey
gentle lynx
#

is there a mysql tutorial in node.js?

earnest phoenix
umbral zealot
#

@peak osprey if it works, you did it right.

#

Marilyn seems to disapprove though

earnest phoenix
#

xD

gentle lynx
#

are u coding in ur lessons xd

umbral zealot
#

Ok that's code. Cool code thumbs

earnest phoenix
#

my bot dont wirte anything

#

when i give him a commande

#

o

umbral zealot
#

Mmkay. tell me, what's your prefix?

slender wagon
#
const serverQueue = message.client.queue.get(message.guild.id);

(node:7844) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'get' of undefined

earnest phoenix
#
const serverQueue = message.client.queue.get(message.guild.id);

(node:7844) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'get' of undefined
@slender wagon message.client.queue is undefined

peak osprey
#

are u coding in ur lessons xd
@gentle lynx nope ELA

earnest phoenix
#

what is a prefix -_-------------------

#

client.on('message' => if(message.channel.id === 'MY TESTING CHANNEL') message.channel.send(if(tweettrump))
@opal plank THAT'S FUCKING WRONG

#

:c

slender thistle
#

pre = before

#

prefix-message-postfix

earnest phoenix
umbral zealot
#

I'll repeat again: you need to learn javascript before you try to make bots

opal plank
#

@earnest phoenix no its not

earnest phoenix
#

it is

opal plank
#

no it aint

umbral zealot
#

if you can't even understand what the prefix variable is doing, you do'nt know enough to make a bot

earnest phoenix
#

ik but i want do this than i learn

opal plank
#

my code, my compiler, my rules

umbral zealot
#

Learn javascript first, then make a bot.

earnest phoenix
#

client.on('message'=> what an awesome arrow function);

opal plank
#

like i said, my code, my compiler, my rules

earnest phoenix
#

@earnest phoenix you will most likely go nuts trying to make a bot without knowing js

opal plank
#

wdym go nuts?

earnest phoenix
#

yes why not xD

shy turret
#
manager.broadcastEval(`console.log(this.guilds.cache.get('${guilds[i].id}'));`) // this works
manager.broadcastEval(`this.guilds.cache.get('${guilds[i].id}');`) // this does not works (im trying to just get the result of this)

EJS + sharding... um
I keep getting (node:6204) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added to [ChildProcess]. Use emitter.setMaxListeners() to increase limit if i do the second one using ejs

opal plank
#

its pretty easy to make a bot without knowing js

shy turret
#

wait nvm

earnest phoenix
#

like i said, my code, my compiler, my rules
@opal plank you shouldn't give pseudocode to someone who's asking for help (which you did)

shy turret
#

i think i know what i did wrong

opal plank
#

Step 1: Watch and outdated video tutorial on youtube
Step 2: Get Errors
Step 3: Copy shit from stack overflow
Step 4: Ask around in #development servers for people to fix your code

Bot making in 2020

earnest phoenix
#

wait nvm
@shy turret node version manager?

shy turret
#

im pretty sure v12 let me check

opal plank
#

@earnest phoenix they did understand the gist of what i said

umbral zealot
#

that was probably the fastest starboard I've ever seen in my life @opal plank , congrats.

earnest phoenix
#

@shy turret node version manager?
@earnest phoenix dont fucking tell me you dont know what nvm means

opal plank
#

lmao ty

shy turret
#

v12.18.2

#

nvm

#

nodejs version?

#

or node package manager

#

or discordjs version

earnest phoenix
#

did u do node -v?

shy turret
#

yes

#
C:\Users\USER>node -v
v12.18.2
earnest phoenix
#

then thats the node.js version you are currently running

shy turret
#

yes i do know

#

fetchClientValues seems very useful

#

i love watching all those undefineds coming on my console

#
            <% for (var i = 0, len = guilds.length; i < len; i++) { %>
                <% manager.fetchClientValues(`guilds.cache.get('${guilds[i].id}');`).then(check => { %>
                    <%= check %>
                <% }) %>
            <% } %>

i hate using sharding :))

opal plank
#

you hate using sharding, imagine me who will likely scream and cry attemtping to cluster my twitch bot

shy turret
#

f

opal plank
#

from what i saw its basically an IPC server

#

luckily im somewhat familiarized with it

shy turret
#

oauth2 is ez
making a bot is ea--.. sharding FRICK

opal plank
#

Gonna stream coding a bit

modest smelt
#

whats ur stream

shy turret
#
[object Promise] [object Promise] [object Promise] [object Promise] [object Promise] [object Promise] [object Promise] [object Promise] [object Promise] [object Promise] [object Promise] [object Promise] [object Promise] [object Promise] [object Promise] [object Promise] [object Promise] [object Promise] [object Promise] [object Promise] [object Promise] [object Promise] [object Promise] [object Promise] [object Promise] [object Promise] [object Promise] [object Promise] [object Promise] [object Promise] [object Promise] [object Promise] [object Promise] [object Promise] [object Promise] [object Promise] [object Promise] [object Promise] [object Promise] [object Promise] [object Promise] [object Promise]

funny

#
<%= manager.broadcastEval(`this.guilds.cache.get('${guilds[i].id}');`) %>
modest smelt
#

?

#

r u OK?

shy turret
#

and i cant even use await

#

because ejs

#

r u OK?
@modest smelt no i can clearly not fine rn

modest smelt
#

lol

#

then use py

shy turret
#

with a website dashboard "no"

cinder patio
#

Why are you using ejs?

modest smelt
#

await ctx.send(";)')

#

😉

shy turret
#

@cinder patio because it sucks

#

idk why but i spent 2 months making a model or something i was gonna make

#
["f","f","f","f","f","f","f","f","f","f","f","f","f","f","f","f","f","f","f","f","f","f","f","f","f","f","f","f","f","f","f","yay","f","f","f","f","f","f","f","f","f","f"]

ive been playing and this happened

earnest phoenix
#

XDD

shy turret
#

f = cannot find server
yay = can find server

earnest phoenix
#

I am a beginner :c

shy turret
#

oof

flint warren
#

how i can check if the bot has manage_messages Permissions in d.py

opal plank
#

Fuck that was annoying

#

typeof NaN === 'number'

#

welp, the resolver is done at least

#

i can now call the streams directly via the method rather than searching for id on cache

slender wagon
#

is discord-canvas faster than canvas?

opal plank
#

judging by the name, no, since its likely canvas but with extra code on top

slender wagon
#

lmao aight

#

canvas is just too slow ffs

opal plank
#

how much are you willing to learn rust?

slender wagon
#

i have to learn python for school now and also kotlin for a project that i'm developing with my friend

opal plank
#

what is an extra language when you already doing that many

#

might as well

slender wagon
#

have u learned it?

quartz kindle
#

why is canvas slow lol

#

its not slow for me :^)

slender wagon
#

i have no clue

#

but it is really slow

#

it takes up to 10 seconds to send a userinfo card

opal plank
#

cof cof shit code cof cof

quartz kindle
#

then you're doing something seriously wrong

opal plank
#

Tim

quartz kindle
#

my bot generates complex images with resolutions up to 4k x 4k in less than 1 second

opal plank
#

wanna rate some atrocity ?

slender wagon
#

then you're doing something seriously wrong
@quartz kindle damn u think so?

misty sigil
#

lmfao

#

4k x 4k in less than a second is

#

impressive

#

to say the least

earnest phoenix
#

image generation anywhere should run smoothly if your cpu isnt a celeron

iron raven
#

]]vps

slender wagon
#

it's a i5

honest perch
cinder patio
#

I don't think there's anything like node-canvas for Rust

honest perch
#

@mint thicket

#

Can you pin

opal plank
quartz kindle
#

are you sure its canvas that is slow?

iron raven
#

alright.

slender wagon
#

yeah

iron raven
#

thank you

quartz kindle
#

have you measured individual components of it?

opal plank
#

i smell shit host/pc

slender wagon
#

not really

opal plank
#

grainger

#

add this to your code

slender wagon
#

ye

#

it's a pc

#

it is still in visual

#

not pushed yet

opal plank
#
console.time('canvas')

//do ur canvas thing here

console.timeEnd('canvas')
``` @slender wagon
slender wagon
#

aight

opal plank
#

see how long its taking for the ACTUAL canvas

slender wagon
#

give me a sec

opal plank
#

i wanna see the canvas alone timer without any other extra stuff in ur code

slender wagon
#

oh

opal plank
#

it might not even be canvas whats slowing down your command

earnest phoenix
#

there's always native image generation with something like imagemagick

slender wagon
#

so u want me to test it in a clean file?

opal plank
#

either work

slender wagon
#

aight

opal plank
#

that'll just add a timer

iron raven
#

does anyone know an vps hosting service that has paying method Paysafecard?

opal plank
#

even if its in production it wont affect the command itself

slender wagon
#

it started but never ended

#

canvas: 0.134ms

opal plank
#

wdym never eneded?

slender wagon
#

like log the time end?

opal plank
#

if it logged it means it ended

slender wagon
#

oh my bad lmfao

opal plank
#

0.134 MS?

slender wagon
#

ye

opal plank
#

thats nano seconds dude

#

its aint canvas

#

its some other shit code you put

slender wagon
#

F

opal plank
slender wagon
#

i was reading canvas docs

opal plank
#

i had a feeling it wasnt canvas slowing down your command

#

canvas isnt that resource intensive

slender wagon
#

me too

#

but whyyy

opal plank
#

you can recycle my snippet

#

attach some random timers in your coed

#

see whats taking that big ass chunk of time

slender wagon
#

oh

slow otter
#

how can i make my bot ban All

#

?

misty sigil
#

api aboose

opal plank
#

sounds like a raid bot

slow otter
#

I think so xd

slender wagon
#

that's illegal

#

hehe

slow otter
#

jejeje

#

It can?

opal plank
#

no

slender wagon
#

can what?

opal plank
#

bad

slender wagon
#

very bad

opal plank
slow otter
#

xd

opal plank
#

shoo we dont condone api spam/abuse

earnest phoenix
#

replace is an operation on a string

#

location is a string

#

you aren't doing anything

#

set the window.location with a setter

#

redirection like that is supposed to be done serverside though

#

as long as your bot shares the guild with the emoji, it can use it anywhere

slate oyster
#

I once ran some custom code on my bot to help a user ban users from a raid
They all had the same username, so I was able to just compare usernames for each user
I hope that wasn't considered API abuse...
I mean, the library I use automatically handles rate limits

modest smelt
#

hello

#

i need help in python

#

i can't put the code here

opal plank
#
Moobot: [1006, 869, 1011, 769, 799, 789, 961] = mean:886ms
Nightbot: [950, 876, 1002, 1008, 788, 766, 789] = mean:882ms
StreamLabsBot: [1131, 1004, 1102, 894, 751, 799, 978] = mean:951ms
Leviathan: [681, 412, 512, 551, 671, 413, 409] = mean:521ms

All hail aggressive caching. 300ms avarage difference in command response time on Twitch

modest smelt
#

Error: Traceback (most recent call last): File "main.py", line 85, in <module> main() File "main.py", line 44, in main 'Discord': roaming + '\\Discord', TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

#

if u are good in python pls DM me

#

i will give u nitro xbox if u help me fix

earnest phoenix
#

if you encounter a raid, the prune feature is there for a reason, also set your server to tableflip security level or whatever it's called

slate oyster
#

Oh, never heard of prune

balmy anchor
#

(JS) Hi guys,
I have a question.
I tried to get Role using this:

let role = message.guild.roles.get("757697634050900029");

But Idk why it don't work, any help will be great thx 😄

shy token
#

@balmy anchor if it helps here's how i did smth with a verification to get a role :

client.on('message', async message => {
if(message.author.bot) return;
if(message.channel.id === '727664831381110834')
await message.delete();
if(message.content.toLowerCase() === '.f verify' && message.channel.id === '727664831381110834')
{
await message.delete().catch(err => console.log(err));
const role = message.guild.roles.cache.get('719164888337088552');
if(role) {
try {
await message.member.roles.add(role);
console.log("Role added!");
}
catch(err) {
console.log(err);
}
}
}
});

balmy anchor
#

Oh, ok I'll try thx 😄

shy token
#

can someone help me with why isn't this getting sent in the channel as an Embed message?

#

if (command === config.folder[i] || command === "aesthetic") {
if (command === "aesthetic")
{ i = Math.floor(Math.random() * config.folder.length); }

      folder = i; 
      
     
      fs.readdir('./' + config.folder[i], (err, files) => {
          number = files.length;

          if (!args.length || command === "aesthetic")
          { imageNumber = Math.floor(Math.random() * number) + 1; }
          else 
          { 
              imageNumber = args[0] * 1; 
              if (imageNumber > number)
              { return message.channel.send(embed)("Possible arguments: " + config.prefix + command + " [1-" + number + "]."); }
          } 

          console.log(imageNumber);
    

          message.channel.send(embed)({files: ["./" + config.folder[folder] + "\\" + imageNumber + ".jpg" ]} )
             


          message.channel.send(embed)({files: ["./" + config.folder[folder] + "\\" + imageNumber + ".png" ]} ) 

  

 
          message.channel.send(embed)({files: ["./" + config.folder[folder] + "\\" + imageNumber + ".jpeg" ]} )


  

      
          message.channel.send(embed)({files: ["./" + config.folder[folder] + "\\" + imageNumber + ".gif" ]} )

});
return;
}
}
});

earnest phoenix
#

don't spoonfed code

shy token
#

sorry

balmy anchor
#

@balmy anchor if it helps here's how i did smth with a verification to get a role :

client.on('message', async message => {
if(message.author.bot) return;
if(message.channel.id === '727664831381110834')
await message.delete();
if(message.content.toLowerCase() === '.f verify' && message.channel.id === '727664831381110834')
{
await message.delete().catch(err => console.log(err));
const role = message.guild.roles.cache.get('719164888337088552');
if(role) {
try {
await message.member.roles.add(role);
console.log("Role added!");
}
catch(err) {
console.log(err);
}
}
}
});
@shy token I tried it and It showed this :

(node:10696) UnhandledPromiseRejectionWarning: TypeError [INVALID_TYPE]: Supplied roles is not a Role, Snowflake or Array or Collection of Roles or Snowflakes.
    at GuildMemberRoleManager.add (C:\Users\Amitai\Desktop\Development Folder\JS\Discord Bots\Icy Discord Bot\node_modules\discord.js\src\managers\GuildMemberRoleManager.js:93:15)
    at Client.<anonymous> (C:\Users\Amitai\Desktop\Development Folder\JS\Discord Bots\Icy Discord Bot\index.js:34:30)
    at WebSocket.onMessage (C:\Users\Amitai\Desktop\Development Folder\JS\Discord Bots\Icy Discord Bot\node_modules\ws\lib\event-target.js:125:16)
    at WebSocket.emit (events.js:315:20)
(node:10696) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:10696) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated.
shy token
#

no sorry

balmy anchor
#

hey, is there anyone who knows java?
@torpid forge I do know Java but I don't use JDA if this is the question

shy token
#

@balmy anchor wanna get in a call and try to solve it?

earnest phoenix
balmy anchor
#

@balmy anchor wanna get in a call and try to solve it?
@shy token I just tried it again and it worked sorry I forgot to say thanks haha lull 😄

shy token
#

no worry's

#

<3

#

lmaooooo @earnest phoenix

balmy anchor
#

wdym "manipulator"?

#

I dont even know this myself, probaby doesnt matter

#

idk 🙂

#

i guess not

#

i dont even use those things

#

i started from using SpigotAPI for minecraft as I started with java

#

np

#

@shy token
do you how do I add a role to multiple people and not only one?

shy token
#

I mean they have to add it to themselves

#

by reacting to something

#

that's the most legal way

balmy anchor
#

oh, I want to add it to 10 people lol

shy token
#

do it manually

#

lol

balmy anchor
#

O K

shy token
#

lazy boi

balmy anchor
#

normal discord.js,
im searching for a voice libraries and these

#

idk :{

slender wagon
#

Turns out the canvas problem was just my internet lmao

shy token
#

why would u need a voice library

#

making a music bot or smth?

balmy anchor
#

im trying to make an Among Us discord bot,
but, im bad at js xD

#

lol

slender wagon
#

Learn it then

misty sigil
#

Turns out the canvas problem was just my internet lmao
@slender wagon KEK

slender wagon
#

What does kek means and why are u screaming it

shy token
#

@balmy anchor good luck with it buddy <3

balmy anchor
#

@shy token TY 😄 ❤️

#

nice gif tho froe

shy token
#

tyty <3

balmy anchor
#

wow thx @torpid forge

#

❤️

shy token
#

so could anyone help me figure out why isn't my math.random not sending the files as an embed message? : ```js
if (command === config.folder[i] || command === "aesthetic") {
if (command === "aesthetic")
{ i = Math.floor(Math.random() * config.folder.length); }

      folder = i; 
      
     
      fs.readdir('./' + config.folder[i], (err, files) => {
          number = files.length;

          if (!args.length || command === "aesthetic")
          { imageNumber = Math.floor(Math.random() * number) + 1; }
          else 
          { 
              imageNumber = args[0] * 1; 
              if (imageNumber > number)
              { return message.channel.send(embed)("Possible arguments: " + config.prefix + command + " [1-" + number + "]."); }
          } 

          console.log(imageNumber);
    

          message.channel.send(embed)({files: ["./" + config.folder[folder] + "\\" + imageNumber + ".jpg" ]} )
             


          message.channel.send(embed)({files: ["./" + config.folder[folder] + "\\" + imageNumber + ".png" ]} ) 

  

 
          message.channel.send(embed)({files: ["./" + config.folder[folder] + "\\" + imageNumber + ".jpeg" ]} )


  

      
          message.channel.send(embed)({files: ["./" + config.folder[folder] + "\\" + imageNumber + ".gif" ]} )

});
return;
}
}
});

#

it just sends it as a normal image

#

-_-

#

been stuck the whole day

balmy anchor
#

It's working! Thank you so much @torpid forge 😄

#

@torpid forge do u know how do I server mute ppl?

#

I mean, for example: the bot has adminstrator so he can use Server Mute on people no?

#

it checks boolean
@torpid forge ik

#

oh ok thx

#

ill check how to server mute ppl now

shy token
#

;(

#

wai

#

tbbruh

#

burh

#

@torpid forge welp i dont understand

{ i = Math.floor(Math.random() * config.folder.length) --> config.folder[Math.floor(Math.random() * config.folder.length)] }
^

ReferenceError: Invalid left-hand side expression in postfix operation

balmy anchor
#

Does anyone know how to server mute everyone on the command's author voice channel?

shy token
#

@balmy anchor u down to code and lofi and chill and help each other?

balmy anchor
#

im talking w/ my friend who i didnt talk to him alot,
ill talk with ya later ok?

shy token
#

aight bet

#

add me

#

btw

balmy anchor
#

?

shy token
#

client.on('message', (message) => {
    if (message.content == '/muteAll') {
        let channel = message.member.voiceChannel;
        for (let member of channel.members) {
            member[1].setMute(true)
        }
     }
});

#

this should work

balmy anchor
#

i know its the same thing i saw

#

he's using a library or something i guess

#

cuz i tried it and it didnt worked

shy token
#

he's using discord.js

#

lmao

#

oh wait

balmy anchor
#

ummm

shy token
#

it's the old version

#

lemme dig up the new one

balmy anchor
#

from?

astral matrix
balmy anchor
#

ok

shy token
#

@astral matrix u put :exerin: as description and not as .setTitle('Some title')

#

i think

digital meadow
#

Emotes cannot be in a title

astral matrix
#

I want add emoji to title

#

Oh god

#

Ok

#

Thanks

shy token
#

oh yeah u can't use emotes

astral matrix
#

Im new

#

Xd

balmy anchor
slender wagon
#

What are u trying to do?

balmy anchor
#

huh

#

idk

shy token
#

@balmy anchor the thing we both saw is from 2018/06

balmy anchor
#

ik

shy token
#

@balmy anchor i love it

balmy anchor
#

ty 😄

shy token
#

bruh

#

@balmy anchor + guildMember.voice.setMute(true);

balmy anchor
shy token
#

ohhhhh

#

i big dummy

#

:(

balmy anchor
#

Yay!!!!!!!
It workedddddd

shy token
#

how'd u do it

#

i might need

balmy anchor
shy token
#

oh

#

ur welcome ?

#

i guess

astral matrix
#

@digital meadow i cant use emoji in description too

balmy anchor
#

haha

#

@torpid forge thx for helping me using my brain tho

digital meadow
#

@digital meadow i cant use emoji in description too
You can

#

with the emote id

balmy anchor
#

@shy token is a pro code i guess xD

#

haha

shy token
#

@balmy anchor defo not hahah

digital meadow
#

<:name:id>

balmy anchor
#

oki

#

😄

shy token
#

<3

digital meadow
shy token
#

nice

hot belfry
#

Huh

#

:elonmusk:

#

:elonmusk:

#

...

digital meadow
#

You need to be in the server the emote is

hot belfry
#

Huh

#

Lol

digital meadow
#

Lol

hot belfry
#

Lol

hot belfry
#

...

sinful belfry
#

this does not look related to development in any way zoomeyes

errant perch
#

guild.users.cache.size is not accurate (discord.js)

sinful belfry
#

that returns only cached users

earnest phoenix
#

Thats the cached size

errant perch
#

how do i dont lol

#

guild.users.size?

hot belfry
#

Mmmhm

misty sigil
#

@errant perch guild.memberCount

errant perch
#

ah yes

worthy glacier
#

why does my code automatically jump to this even when my args[0] is something else

solemn leaf
#

@worthy glacier you should use a switch

sudden geyser
#

Because that's not how you do or/and operating

worthy glacier
#

what did i mess up on

sudden geyser
#

args[0] == "..." could be false, then you're defaulting to a string which has content in it, which is considered truthly.

#

What you should do instead is also check if that string is equal to that arg

#

For example: args[0] === "..." || args[0] === "..."

worthy glacier
#

so args[0].toLowerCase

sudden geyser
#

no

exotic zephyr
#

quick question

#

can i set address with 192.168.1.x

faint prism
#

can i set address with 192.168.1.x
@exotic zephyr well if that's on your router's config. It probably means it's only using a certain subnet 192.168.0.* and not 192.168.1.*

#

So, no you can't. Unless you tell your router you want everyone to use that subnet

exotic zephyr
#

ok but

#

to 192.168.0.x

quartz kindle
#

Why do you want to change it?

exotic zephyr
#

because it was 192.168.0

#

but it changed

quartz kindle
#

You'd have to change the whole subnet and gateway address

exotic zephyr
#

i tried changing ipv4 and wifi settings, but it stays the same

quartz kindle
#

But theres no point in changing it

#

It works the same

exotic zephyr
#

nvm, ill figure something out

quartz kindle
#

Open cmd, type ipconfig

#

Your local ip will likely also be on .0.x

exotic zephyr
#

its not

quartz kindle
#

Then there is a device mismatch

#

Do you have a modem and a router as two separate devices?

exotic zephyr
#

o wait

#

i think windows was trolling me

quartz kindle
#

lul

exotic zephyr
#

when i enter router LAN users

#

it shows different addresses.. they all start with 0

quartz kindle
#

And cmd shows .1.x?

exotic zephyr
#

actually im retarded

#

i was looking at wrong IP

quartz kindle
#

xd

uncut void
#

Oi alguém aqui fala português?

quartz kindle
#

Sim, porém neste canal não é permitido falar outros idiomas além de inglês