#development

1 messages ยท Page 579 of 1

mossy vine
#

but how are we supposed to help if we dont even know what lib youre using

upbeat solstice
#

What is a lib

earnest phoenix
#

library

upbeat solstice
#

Oh

mossy vine
#

the library you are using for your bot

upbeat solstice
#

Wdym a library

earnest phoenix
#

โœ

slender thistle
earnest phoenix
#

there are other python libs

slender thistle
#

@upbeat solstice Can you mention the YuiBot you are talking about, if it's here?

earnest phoenix
#

and different versions of them

upbeat solstice
#

@earnest phoenix

slender thistle
#

Python libs? Really?

upbeat solstice
#

I MEAN

earnest phoenix
#

rewrite or async

upbeat solstice
#

Async

slender thistle
#

disco? Shit

mossy vine
slender thistle
#

It might be an embed image

earnest phoenix
#

they said attachment

slender thistle
#

Oh, well

#

Who even uses disco nowadays thonkku

upbeat solstice
#

Mk thanks for the link,

#

But I'm confused a bit

#

How do i make my bot send the embed image?

earnest phoenix
#

what do you want

#

an attachment

#

or an embed

upbeat solstice
#

Embed

earnest phoenix
#

it has an embed parameter

upbeat solstice
#

Okay

earnest phoenix
upbeat solstice
#

But in which part do i paste the link?

#

em = discord.Embed(title='My Embed Title', description='My Embed Content.', colour=0xDEADBF) em.set_author(name='Someone', icon_url=client.user.default_avatar_url) await client.send_message(message.channel, embed=em)

earnest phoenix
#

i linked you the method above

#

last link i sent

upbeat solstice
#

Mk

#

I think I did it wrong

#

;-;

slender thistle
#

uhm

#

Why are you sending 2 messages on every command

earnest phoenix
#

you cant use html as a url

slender thistle
#

I suggest you learn string formatting

earnest phoenix
#

the docs strictly say it needs to be a http(s) link to the image

#

that too what was said above

upbeat solstice
#

Oh

earnest phoenix
#

that is invalid python, you are missing quotes

upbeat solstice
#

Oh

earnest phoenix
#

and it cannot be a link to the website

upbeat solstice
#

Oh

earnest phoenix
#

it must be a direct link to the image

upbeat solstice
#

Oh---

#

How do i get the direct link

earnest phoenix
#

google it

upbeat solstice
#

Okay

#

?

earnest phoenix
#

that is still not a direct url

upbeat solstice
#

Then what is it

earnest phoenix
#

a direct will lead straight to the image and doesnt load anything else but the image

#

usually ends in an extension

upbeat solstice
#

But how do i get to ut

#

It*

earnest phoenix
#

google it

#

its browsing 101

upbeat solstice
#

.-.

#

Mk-

amber fractal
#

Open the image in a new tab

upbeat solstice
#

I did

#

TwT

restive halo
#

I am getting. A very weird. And very annoying bug

#

Basically. My scp command won't recognise the number 334 specifically. Don't get any of the error responses. Just nothing

umbral trench
#

||Oof||

restive halo
#

Thats what I get when testing the command

#

Tried it with a bunch of other random nums and get what I should do

#

Can show the code the command uses if its needed

earnest phoenix
#

-r

#

what does -r do

pale marsh
#

It's probably something related to the API you're using

#

@earnest phoenix can you be more specific?

mossy vine
#

@restive halo since scp-334 does indeed exist, you should give us our code

amber fractal
#

I'd guess they are using the wikidot api

restive halo
#

Not using the wiki api since you can't really get access to it

mossy vine
#

huh that seems weird

restive halo
#

It should be working for 334, cause everything else works fine

mossy vine
#

this is really weird ๐Ÿค”

#

can you console.log() the text, just to make sure its working?

restive halo
#

Can do but I'd have to do that later

amber fractal
#

Or console.log(response.statusCode)

restive halo
#

Added the extra else to check for status codes

#

To see if there was an error other than null or a bad status code

#

Had the same issue with 999 but fixed it randomly when I was adding new stuff

summer birch
#

Does anybody know if it's possible for the API to run a command on channel selection? For example, could I write a bot command if a user were to select Channel A, then another command if they selected Channel B?

mossy vine
#

what

summer birch
#

Is the question not clear enough?

slender thistle
#

Channel selection... are you talking about clicking on channels?

mossy vine
#

it probably is but im too tired to understand it

summer birch
#

@slender thistle yeah

slender thistle
#

Not possible

summer birch
#

Ok, thanks

amber fractal
#

Wait

#

you can run commands in other channels than the one it's called int

#

in*

#

Like sending a message to a channel other than the one the command is called in

#

if that's what you mean

summer birch
#

No, I'm talking about when a user physically clicks on a channel.

amber fractal
#

Only if they go into voice channels, but not clicking into other text channels

upbeat solstice
#

Nobody continued to help me soo

late hill
#

Poor soul

earnest phoenix
#

you didnt ask any further questions

#

lol

restive halo
#

The issue was the returned text was 3k chars long

earnest phoenix
#

What is this?
``
(node:647) UnhandledPromiseRejectionWarning: Error: write EPROTO 140236323837760:error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure:../deps/openssl/openssl/ssl/s23_clnt.c:802:

at WriteWrap.afterWrite [as oncomplete] (net.js:868:14)

(node:647) 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(). (rejection id: 2)

(node:647) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
``

amber fractal
#

it's an error log.

upbeat solstice
#

@earnest phoenix But did you even scroll up? I was trying to wait for you to answer but you just ignored.

earnest phoenix
#

thonk

#

i told you to google how to get a direct link from an image

#

and this:
``
(node:812) 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(). (rejection id: 2)

(node:812) UnhandledPromiseRejectionWarning: Error: connect ETIMEDOUT 104.16.58.5:443

at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1191:14)

``

mossy vine
#

thats an issue with your code lmao

earnest phoenix
#

but where?

mossy vine
#

In your code

grim aspen
earnest phoenix
#

xdd

#

fixed

#

@mossy vine thanks for help xd

mossy vine
#

Youre welcome

earnest phoenix
#

lol

upbeat solstice
opaque eagle
#

Anyone have an idea on why this weird anomaly occurs? When I change the first codeblock to the second, I get an error.js setTimeout(() => that.tick(), delta);``````js setTimeout(that.tick, delta);

quartz kindle
#

setTimeout requires a function or something that resolves into a function. if you pass that.tick directly to it, it will resolve the value and pass the value, which isnt a function

opaque eagle
#

oh

#

I thought it'd be similar to how you can pass in functions as callbacks to EventEmitter (node.js api) events

#

like js const readyFunction => console.log("Ready"); new Discord.Client().on("ready", readyFunction);

inner jewel
#

that.tick.bind(that)

opaque eagle
#

I'm using Font Awesome icons on my webpage, and weirdly, there's this white line underneath them... any idea how to get rid of it?html <div class="hero-foot"> <nav class="tabs"> <div class="container"> <ul> <li><a>Learn More</a></li> <li><a><i class="fab fa-windows"></i></a></li> <li><a><i class="fab fa-apple"></i></a></li> </ul> </div> </nav> </div>

lilac geyser
#

This is saying there's something wrong with internet connection, right?

#

But I can use Discord like normal, and there's nothing wrong with the code, this wasn't a problem yesterday.

opaque eagle
#

Show code @lilac geyser

#

The most common mistake that produces that error when using snekfetch is when u do .json() at the wrong place.

amber fractal
#

isnt snekfetch deprecated?

opaque eagle
#

Yeah, you're supposed to use node-fetch

#

But discord.js stable uses snekfetch internally (master switched to node-fetch), so stable users tend to stick to snekfetch

amber fractal
#

Figuring to update to master soon

opaque eagle
#

Yeah, master is eons ahead...

amber fractal
#

Just want it to become stable mmLol

opaque eagle
#

It's stable...

#

I've used it for a long time with no issues.

#

The last time I used stable was a couple months back, to try and reproduce an error someone was having

lilac geyser
#

@opaque eagle Closed source, decided by other developer, sorry. But I'm very sure I used the exact same code several hours ago before I went to sleep and this wasnt a problem.

#

There's no .json() at any point

opaque eagle
#

Are u calling snekfetch urself?

lilac geyser
#

Nope

opaque eagle
#

Hmm

#

This is a long shot, but did u go into ur node_modules folder and change the contents of the discord.js module? jk

#

Does that error show up as soon as the bot starts up, or when u do something specific?

lilac geyser
#

Never touched the discordjs package until today when I added if (err) console.log(err) at line 61 as said above

#

As soon as bot starts

opaque eagle
#

Why did you edit discord.js? Thonk

#

do npm i discord.js again

lilac geyser
#

I dont think you got what I meant

#

and i made no other changes

opaque eagle
#

So you went into node_modules/discord.js/src/util/Util.js and added that line in line 61?

lilac geyser
#

added line 62

opaque eagle
#

But did you change that file?

lilac geyser
#

The error was there before I changed it so I went there to get it to log the error

opaque eagle
#

You shouldn't be editing the package.

#

And, adding that line in didn't tell you any more than what you previously knew.

lilac geyser
#

Yes it did

#

Lets not argue over this, that line affects nothing

opaque eagle
#

Wait... is that an API ban? mmLol

lilac geyser
#

@opaque eagle I highly doubt

amber fractal
#

What are you trying to get a member count?

lilac geyser
#

It's the existing member count bot you know, i hope

amber fractal
#

I tried to get a member count too and I kept getting an unexpected end of json input

opaque eagle
#

P.S. if you wanna get the full error, instead of editing discord.js, you can just do: process.on('unhandledRejection', console.error); in your main file.
Same thing + edits you make to modules in the node_modules folder don't remain if you copy your code onto a vps or smth.

lilac geyser
#

It doesnt even get into the file

#

or does it

amber fractal
lilac geyser
amber fractal
#

I thought it returned json

opaque eagle
#

(Instead of doing all that extra crap, just type in exactly what I sent)

lilac geyser
#

Okay now this is a big question, npm install gets stuck as well

opaque eagle
#

woah, thanks captain obvious

lilac geyser
#

yeah

opaque eagle
#

Man, ur bot must have like no dependencies whatsoever lmao @amber fractal
I've used the api endpoints and https module in separate projects, bot not in the same one.

lilac geyser
#

What do I do :|

spiral lava
#

so many bot devs

lilac geyser
#

thats how dbl earns a living

opaque eagle
#

dbl doesn't earn a living

#

Oliy earns sports cars

lilac geyser
#

lol

amber fractal
#

That's my node test file

opaque eagle
#

oh

amber fractal
#

I was able to do it now, but I had to slice "undefined" from the beginning

#

Which is weird

lilac geyser
#

@opaque eagle Resolved by restart, thankssss

opaque eagle
#

lmao

#

the age-old saying is actually true, who knew @lilac geyser

lilac geyser
#

lol

high lava
#

The connection.play() method seems to always return that it's not a function no matter what

#

Is this a known bug or am I just missing something

earnest phoenix
#
module.exports = CurrencyCommand;
``` is anything wrong with this? i kept getting an error from this
quartz kindle
#

is currencycommand a function?

obtuse wind
#

I have a question, is it possible for me to make my bot make a new line every time XP is added? (like in the picture), instead of all being 1 line..

earnest phoenix
dreamy wraith
#

module.exports = class CurrencyCommand {}

dusky marsh
#

@obtuse wind if you are trying to create a database like structure with json I HIGHLY recommend you look at other options such as sqlite or another form of data storage

#

@earnest phoenix try doing module.exports.CurrencyCommand = CurrencyCommand

earnest phoenix
#

Okay, i'll try

dusky marsh
#

If that doesn't work, just send the error you get and ping me out ๐Ÿ‘Œ๐Ÿผ

earnest phoenix
dusky marsh
#

might be the incorrect file path to the database

#

on glitch, i think the db is in some data folder, and is called sqlite.db or something, if i remember correctly

#

it should be on the readme how to connect to the db

earnest phoenix
#

which readme

#

@earnest phoenix did you install quick.db?

#

oh yeah

#

i forgot about that

#

xD

#

Yeah you should do that

#

thank you zoro

#

it's working now

#

np

dusky marsh
#

oi is quick.db just an in-memory db i aint never heard of that one

earnest phoenix
#

no its not

#

its a wrapper for better-sqlite3

dusky marsh
#

ah

#

surprised i havent heard of it

granite oracle
#

Hello, currently having a problem with the website if anyone could help me! @fossil oxide

fiery birch
#

At no point should you mention Oliy

#

The mods are here to help, also please move to #general @granite oracle

granite oracle
#

Alrighty

fleet horizon
#

proceeds to ping all mods

lunar ravine
#

Hloo

jovial sigil
#

sorry for the long text :D

#

Hello, I was wondering if someone can help me with using async/await in discordjs
Basically i want to send multiple messages in succession
main.js

client.on('message', message => {
    // some code here before sending it to a different file
    command.execute(message, args);
})

ch.js

module.exports = {
    ...,
    execute(message, args) {
        array = [1, 2, 3] // build up an array of text here
        array.forEach(function(arr){
            message.author.send(arr);
        });
        return false;
    }
}

problem is, I don't know where to put the async and await stuff.

tiny fulcrum
#

internal/modules/cjs/loader.js:583
throw err;
^

Error: Cannot find module 'quick.db'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (C:\Users\Edison\Desktop\Squiford\index.js:15:12)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)

#

help

#

Already tried npm install quick.db, Did not work

earnest phoenix
#

On their npm page it says this is how you install it

Run:
npm -g --add-python-to-path install windows-build-tools node-gyp in powershell as administrator

Restart CMD prompt windows (Close & Reopen)

Run: 
npm i quick.db```

Are you sure you did all those steps when installing quick.db?
#

if so check your node modules folder for a quick.db folder

tiny fulcrum
#

I'll test, thank you.

earnest phoenix
#

np

tiny fulcrum
#

I put the "Run:" ?

earnest phoenix
#

no

tiny fulcrum
#

I'm not finding how to open powershell as admin

#

Could you explain how I can open it?

earnest phoenix
#

search for powershell in the windows search then right click to run as administrator

tiny fulcrum
#

thank you

earnest phoenix
#

np

tiny fulcrum
#

I'm still learning

earnest phoenix
#

good to know

tiny fulcrum
#

still giving the same mistakes

#

;-

earnest phoenix
#

hmm

#

Check node modules folder

#

for quick.db

#

also did you get any errors while installing quick.db

tiny fulcrum
#

Yep

earnest phoenix
#

send screenshot of the error

#

or copy paste the error text

tiny fulcrum
earnest phoenix
#

yeah

#

did you run this

#

in powershell admin

#

npm -g --add-python-to-path install windows-build-tools node-gyp

#

then try to install the package again

tiny fulcrum
#

again?

earnest phoenix
#

yes

#

run it again

tiny fulcrum
#

---------- Visual Studio Build Tools ----------
Still waiting for installer log file...
------------------- Python --------------------
Successfully installed Python 2.7

earnest phoenix
#

wait

#

just wait a while until it completes

#

scratch that

#

run this instead, it seems to work better

tiny fulcrum
earnest phoenix
#

just let that continue

#

its gonna take a while

tiny fulcrum
#

horrible internet

#

after?

earnest phoenix
#

after it is actually done then install quick.db

tiny fulcrum
#

same mistake

earnest phoenix
#

are you waiting for it to be done

tiny fulcrum
#

whay?

earnest phoenix
#

whats ur node version

tiny fulcrum
#

last

earnest phoenix
#

run

#

node -v

#

and tell me what it says

tiny fulcrum
#

v10.15.1

earnest phoenix
#

run this

#

in powershell ADMIN window

#

npm i -g --add-python-to-path --vs2015 --production windows-build-tools

#

and wait for it to be done

tiny fulcrum
#

again?

earnest phoenix
#

yes

tiny fulcrum
#

ok

#

?

earnest phoenix
#

is the other install still running

tiny fulcrum
#

why?

#

reopen

earnest phoenix
#

it says its busy or locked which could be caused by the other install still running

tiny fulcrum
#

and now?

#

why

#

@earnest phoenix

earnest phoenix
#

Sorry, but i have to go, but someone can help you if you post your original message again

tiny fulcrum
#

`internal/modules/cjs/loader.js:583
throw err;
^

Error: Cannot find module 'quick.db'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (C:\Users\Edison\Desktop\Squiford\index.js:15:12)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)`
help

amber fractal
#

What do you want from us?

tiny fulcrum
#

Knowing how to do this

amber fractal
#

Did you copy paste code?

tiny fulcrum
#

what code?

#

error?

amber fractal
#

The code that is used to make the bot

tiny fulcrum
#

Token?

amber fractal
#

I need to go to bed, good night

tiny fulcrum
#

;-;

#

what code?

high lava
#

did you run npm i quick.db

tiny fulcrum
#

of error

high lava
#

No. Did you actually do npm i quick.db

#

in the bot folder

#

installing windows-build-tools doesn't install quick.db

tiny fulcrum
#

it was not

high lava
#

Did you install visual studio?

tiny fulcrum
#

yes

high lava
#

When you open the installer, do you see that?

tiny fulcrum
high lava
#

Not visual studio code

#

Windows-Build-Tools needs at least visual studio community to function

#

Actually scratch that. It could be an issue though. It was necessary before with somebody else i was working with

#

npm install --global --production windows-build-tools

#

Use this line instead. It worked for me

lilac geyser
#

Hello, I would like to get some tips regarding sharding. As my bot is about to hit 100k servers, I'm seeing this as an issue: it takes rather long to fully start up the bot. So I thought of two ways:

  1. Clustering, possible multiple instances of ShardingManager?
  2. This is regarding updates: shard migration. How would I go about doing something like, loading all the commands and events before updating the shards, instead of ending the process then start everything?

Or is there something else I can do? Thanks :p

earnest phoenix
#

i doubt that, searching your id on google doesn't provide any bots or anything, but okay

you can't circumvent the delay between each shard connect and disconnect

weary magnet
#

i

#

Hi Olvy

lilac geyser
#

@earnest phoenix There's definitely got to be a way that we can get the shards loaded first, without connecting. Then after the loading finishes it then go on to reconnect.

earnest phoenix
#

no

#

...?

#

shards are just individual connections to the websocket

#

they need to connect to be ready

#

besides, shards should be independent of each other

lilac geyser
#

I've seen other bots using another library do this

#

:/

earnest phoenix
#

you've probably been misinformed

lilac geyser
#

Highly doubt

#

What about clustering then, any idea?

earnest phoenix
#

bad idea

#

the library wouldn't handle ratelimits properly

#

you'd get kicked off from some connections

lilac geyser
#

And basically what I wanted to do was to run the rest of the codes, then finally login, not possible?

earnest phoenix
#

stop trying to bypass something that's been put in place for a reason

#

well

#

it is

#

but again, shards should be independent of eachother

lilac geyser
#

Right, so any tips?

#

Thanks but again I've seen other bots do both of these ๐Ÿคท

earnest phoenix
#

you probably haven't and you've probably been misinformed

#
CHamburrToday at 2:24 PM
And basically what I wanted to do was to run the rest of the codes, then finally login, not possible?```

for this, you could increment a number each time a shard connects and  decrement each time a shard disconnects, you can then have an if check in your message received event to see if current shard count matches the desired number
#

if it isn't, return out of the function

#

but again

#

shards should be independent

#

if one shard, e.g in the US region dies, you're locking your whole bot

lilac geyser
#

Trust me I did.

#

and alright, thanks

earnest phoenix
#

can you provide an example of where you have seen that

#

because you can't get shards ready if they don't connect

#

the whole process of them getting ready is them connecting

#

even big bots like ayana, rythm etc. deal with this issue

#

you can't possibly get the shard ready before connecting because the shard wouldn't be populated with any entities

split hazel
#

How would i get rid of a string from a specific beginning character to an ending character for example
some !cool? string
How would i remove the string from ! to ?

dreamy wraith
#

@split hazel

  var myString = "some !cool? string";
  var myString = myString.split("!");
  var firstpart = myString[0];
  
  var myString = myString[1];
  var secondpart = myString.split("?");
  secondpart = secondpart[1];

console.log(firstpart + secondpart)

Result: "some string"

split hazel
#

thanks alot

dreamy wraith
#

@split hazel

var myString = "some !cool? string";
var string = myString.replace(/!.*\?\s/, '');
console.log(string);

This is much cleaner

mossy vine
#

yeah, regex make shit simple

split hazel
#

yeah more cleaner, thanks

quick matrix
#

Ok so I want reactions in my help command like people will react and the bot will show the next page of it.

#

When we will click on the reaction the bot will show next page of help command

#

How to do it?

hushed berry
#

Send the message, record message id somewhere. Listen for reactions on that message and edit the message accordingly

neon plume
#

can anyone help me to make music bot in js

mossy vine
#

no

neon plume
#

ok

lime obsidian
#

You can download ready to use bots and learn from that

amber fractal
#

Download bots Thonk

marble needle
#

probably refering to the tiny bit of outdated code you can find on github OMEGALUL

lime obsidian
#

Yeah :/

#

That is how I learned it

opaque eagle
#

Something's up with my command handler :(```js
module.exports = class CommandStore extends Map {

constructor(client) {
    super();
    this.client = client;

    // eslint-disable-next-line no-console
    console.log(this.client instanceof require("eris").Client); // returns true

}

/**
 * Load a command.
 * @param {string} cmdPATH The path to the command's file.
 */
load(cmdPATH) {

    const command = new (require(cmdPATH))(this.client);
    if (command.init) command.init();

    this.set(command.name, command);
    command.aliases.forEach(alias => this.set(alias, command));

}

};``````sh
/usr/src/app/structures/CommandStore.js:22
throw err;
^

TypeError: Cannot read property 'client' of undefined
at load (/usr/src/app/structures/CommandStore.js:18:57)```

amber fractal
#

this is undefined for some reason in your command loader

#

idk how that works tho

earnest phoenix
#

how would you make something like this
--------๐Ÿ”˜---------------------
i use discord.js-lavalink

amber fractal
#

Math.

tiny fulcrum
#

`internal/modules/cjs/loader.js:583
throw err;
^

Error: Cannot find module 'quick.db'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (C:\Users\Edison\Desktop\Squiford\index.js:15:12)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)`
help

mossy vine
#

install quick.db

#

i remember you posted the same question before

amber fractal
#

He asked this yesterday

mossy vine
#

and were given answers

#

yes

amber fractal
tiny fulcrum
#

I try to download, only from the error.

#

@amber fractal I was sleepy bye

#

required visual studio ?

#

without being the code

#

anyone who has anydesk could help me?

marble needle
#

help yourself, stop pasting code you don't understand

mossy vine
#

he understands the code

#

just doesnt know how to follow a fucking guide on how to install prerequisites for quick.db

fiery birch
#

@tiny fulcrum if you send me where you are getting the bot code from I can help you! ๐Ÿ˜ƒ

tiny fulcrum
#

after npm install quick.db

fiery birch
#

so go ahead and install quick.db

#

oh

tiny fulcrum
fiery birch
tiny fulcrum
#

I already tried it yesterday

amber fractal
#

Well

#

Node gyp was messing up for someone yesterday too

#

I dont use it, idek what it does tbh

tiny fulcrum
amber fractal
#

Yes

#

it's not quick db

tiny fulcrum
#

why?

#

again?

quartz kindle
#

Why are you installing it on system32?

split hazel
#

How do i get the first 3 items from a collection

mossy vine
#

get the array of keys and get the first 3

inner jewel
#

@opaque eagle how are you calling load?

opaque eagle
#
class MyBot extends Eris.Client {

   constructor() {
      this.commands = new CommandStore();
      this.walk("commands", this.commands.load);
   }

   walk(dir, callback) {
      for (const file of fs.readdirSync(dir)) {
         const filepath = path.join(__dirname, dir, file);
         if (fs.lstatSync(filepath).isDirectory()) {
            this.walk(filepath, callback);
         } else if (file.endsWith(".js")) {
            callback(filepath);
         }
      }
   }

};```
inner jewel
#

yeah, that won't work

#

var x = something.function; x() doesn't work

#

you need to bind x to the instance

#

var x = something.function.bind(something); x() works

opaque eagle
#

oh

viral spade
#

Hi i have a question,
First i start up my shards and all existing/new guilds get distributed between them. I wonder if after this initial assignment, can it be that a guild switches shards?

inner jewel
#

no

mossy vine
viral spade
#

thx

inner jewel
#

shard_id = (guild_id >> 22) % shard_count

mossy vine
inner jewel
#

a guild only gets assigned to a different shard if you change the count

viral spade
#

so it might rarely happen with auto shardcount

mossy vine
#

relevant code

<div class="top">
    <h1>KTaNE Expert</h1>
</div>```

```css
h1 {
    color: white;
    text-align: center;
    font-size: 2em;
    vertical-align: middle;
    vertical-align: middle !important
}
.top {
    height: 5%
}```
inner jewel
#

it might happen every ~1k guilds + restart

viral spade
#

but its not a problem in my case because the memoryalso resets

mossy vine
#

can anyone help with my css issues above ^

viral spade
#

it looks like the header of a page, why not simply use margin top and bottom?

mossy vine
#

but with what values?

viral spade
#

what looks nice

#

^^

mossy vine
#

but the thing is that it doesnt work

#

adding margin-bottom or top to h1 doesnt change anything

viral spade
#

margin-top: 5%;
margin-bottom: 5%;

delete the .top height attribute

#

delete the vertical aligns

mossy vine
#

i deleted them

#

do i put the margins in .top?

viral spade
#

delete the whole top thingy, div and css

mossy vine
#

but i plan to add more things in the div

#

that would be (also vertically aligned) on the right and left

viral spade
#

what do you mean with vertcally aigned? where do you gain your height from? do you mean you have f.e. 3 columns where each element in vertically aligned (except the highest one ofc)

mossy vine
#

let me beautifully draw what i want to achieve

viral spade
#

ok^^ is it for a webpage? can you use css frameworks?

mossy vine
#

yeah its for a webpage, and i dont want to use a framework for this project

#

excuse my shitty drawing skills

viral spade
#

you shouldnt fixate on the 5% imho

mossy vine
#

oh

#

then how should i do it?

#

i want it to take up a small portion of the screen

viral spade
#

well the font size changes with the view ajyways

#

so it wont be 5% exactly but it will be ralative

mossy vine
#

it doesnt resize

viral spade
#

try 1. delete every div and css except the h1 and textarea
does the textarea still overlap?

mossy vine
#

huh, no it doesnt

viral spade
#

okey try to keep it basic. you should first create 3 columns, then insert text with alternating height (or buttons), then try vertically aligning those

mossy vine
#

sooooo a table?

viral spade
#

if two html elemnts overlap, that are behind in your code, then its not clean

#

or some floating boxes or so

mossy vine
#

so instead of the div i need to make a table with 3 columns?

viral spade
#

honestly i would go about it by searching for css only headers

#

in google

#

copy paste , everything set with example buttons and neat stuff

mossy vine
#

im actually kind of confused about how to go with the design

viral spade
#

then take whats offered ๐Ÿ˜ƒ

mossy vine
#

i only really need to switch between 3 tabs (not actual browser tabs), an faq href, and a grid href ๐Ÿค”

viral spade
#

makes life easier

mossy vine
#

how would i align the content to be on the left, in the center, and on the right respectively?

#

@viral spade

earnest phoenix
fringe rover
#

I need help

marble needle
#

just ask your question heavythonk

earnest phoenix
#

don't scrape google

#

they don't allow it and you'll get ip banned

#

scrape duckduckgo instead

bright spear
#

honestly theres a low chance google will notice and ban you

earnest phoenix
#

rdanny gets banned often

#

ยฏ_(ใƒ„)_/ยฏ

ruby talon
#

For scraping idk if you can do this in js (your probb able to do that tho) but with Python you are able to add data so that the site thinks that its a casual user.

shadow dust
earnest phoenix
#

yes hello

shadow dust
#

Is there a way I can "flatten" the AsyncEnumerables the library implements ?

earnest phoenix
#

1.0 or 2.0

shadow dust
#

2.0

earnest phoenix
#

FlattenAsync

shadow dust
#

I have a type incompatibility

earnest phoenix
#

๐Ÿค” show your code

shadow dust
earnest phoenix
#

is there await in f#

#

if so, use it

shadow dust
#

Well okay but that method doesnt return a Task

#

Ok FlattenAsync does but its not compatible anyways because the types dont match

earnest phoenix
#

thonk, not really familiar with f# or how it works

#

that code should work in c# and vb

shadow dust
#

Welp guess ill have to cast it

hushed berry
#

@shadow dust what language is that?

dreamy wraith
#

python?

amber fractal
#

is it?

#

It doesnt look like it to me

#

Maybe tho

#

I dont use python

#

Python ^^

#

I dont think that's python

slender thistle
#

There's no let reserved in Python

#

So no

#

That's not Python

inner jewel
#

f#

hushed berry
#

ahh ok

#

thanks natan

slim heart
#

is there like an easy way to check something in the name of something else so say like there
lol = {whatwfe: 2313, 1231234: 13535y4, 123123: 3125423463} //not really just ex
is there a way to like make it so i can check if(!whatwfe | !2313 instead of if(!lol.whatwfe | lol.2313 (replace | with || cuz heckin spoilers)

hushed berry
#

@slim heart in what, js?

slim heart
#

yes

amber fractal
#

that was so confusing

#

Are you trying to check if 2 keys

#

have the same name?

sinful lotus
#

Just wondering, is it possible to extend the JDA client so that I can append some properties like hashmap onto it

slim heart
#

Likely

#

Have you tried it?

sinful lotus
#

yeah but Im not sure what kind of errors it throws

#

so Im thinking of a class that contains the client instead

slim heart
#

I mean that obv would work, but it doesnt make sense why they wouldnt let you?

sinful lotus
slim heart
#

Huh. I guess not then

#

Well then I guess your logic of just putting client into its own class would be the best thing ya could do aIdkMan

keen drift
#

Would a shared database in microservices be considered an anti pattern

hushed berry
#

yeah

#

it would

#

@keen drift

keen drift
#

alright

silver lintel
#

how do you check if a message is made/edited/deleted by a bot?

marble needle
#

which lib?

#

it's <Message>.author.bot for both djs and eris

ruby talon
#

@worn ridge hey.
So I was watching your code of @last onyx on github and I saw this:

# Xenon>bot>cogs>basics.py

@cmd.command()
async def ping(self, ctx):
"""Pong""" 
ย ย ย ย await ctx.send(**ctx.em(f"I have a **latency** of **{round(self.bot.latency * 1000, 1)} ms**.", type="info"))

When I was looking for the type object in the message I didn't knew what it did.
When looking in the discord.py rewrite docs I couldn't find it.
(https://discordpy.readthedocs.io/en/rewrite/api.html#discord.abc.Messageable.send)
Would you like to inform me about what it does?

cursive dagger
#

@ruby talon shortcut for ctx.message.channel.send

worn ridge
#

wut

#

Do you mean **ctx.em ?

ruby talon
#

Nop I meant the type="info"

worn ridge
#

That's an argument for the em method

#

not the send message

ruby talon
#

So with the type="info" the message gets embedded?

worn ridge
ruby talon
#

Oh, thanks!

lilac geyser
#

May I know what this refers to?
Invalid Form Body permission_overwrites[1].id I didn't use permissionsOverwrite anywhere in my code, checked thoroughly

hard ruin
#

@gilded plank

whole condor
#

Can someone help me? I have a problem when I play music on the bot

mossy vine
#

is node-opus installed properly?

whole condor
#

I can not install it properly

ruby talon
#

@lilac geyser you might want to provide some more information.
Since we are unable to help you with the information you gave.

lilac geyser
#
let channel = await obj.guild.createChannel(cName, 'voice', [
            {
                id: obj.guild.defaultRole || obj.guild.id, 
                allow: ['VIEW_CHANNEL'], 
                deny: ['CONNECT'] 
            },
            {
                id: obj.guild.me, 
                allow: ['CONNECT'] 
            }
        ]);``` This is the only code that I think concerns permissionOverwrites
#

@ruby talon ^

#

And I believe there's nothing wrong with that? and obj is basically message

ruby talon
#

I would guess js.

lament meteor
#

ye that is js

ruby talon
#

Idk I prefer python rn, and I don't know js, I'll learn js in this future.

lilac geyser
#

Ooof

late hill
#

id: obj.guild.defaultRole || obj.guild.id what

#

You're using an expression as id ?

#

Expressions return true or false afaik

lilac geyser
#

Hmm but even so it wouldn't return 'invalid form body', right?

quartz kindle
#

Idk if defaultrole works, since its kind of a weird thing

#

And idk if using the guilds own id as a role id works either

#

Have you tried without that part to see if it works?

#

Its fine to use a || b

amber fractal
#

Its just a shortcut

late hill
#

what the frick

ruby dust
#

in discord.py, does await bot.process_commands(message) fully execute when the command has finished executing, or right after it starts executing it?

quartz kindle
earnest phoenix
#

So I recently got visual studio code as my editor, And this dumb program keeps opening automatically with a file named "cli.js" even when it's closed visual studio opens and that project opens, Anyone knows how to fix? The content is about how the program or such is free to use etc.

mossy vine
#

wat

#

so visual studio (not code ) opens up randomly???

earnest phoenix
#

So I recently got visual studio code as my editor

mossy vine
#

even when it's closed visual studio opens and that project opens

#

you meant vsc there?

earnest phoenix
#

And this dumb program keeps opening

haughty rose
#

If I transfered a bot to a team, and do a command check for is_owner, will anyone on the team be able to use is_owner command checks?

earnest phoenix
#

Yes, I meant vsc

mossy vine
#

most likely because that was the file you were editing most recently?

#

stuff like that can also happen when you have multiple instances of vsc open at the same time

earnest phoenix
#

Listen, When I close vsc it opens automatically after 5 minutes or so.

mossy vine
#

what the fuck

earnest phoenix
#

Like it's 100% closed, but it opens automatically

ruby dust
#

maybe you have something that opens it in the background, like it's updater?

earnest phoenix
#

Idk, I run it as admin tho can that be a problem?

mossy vine
#

here is my suggestion: reinstall vsc completely, and if it still opens randomly, report it as an issue

sinful lotus
#

Your vsc runs randomly?

earnest phoenix
#

Yea

sinful lotus
#

maybe a bik virus?

ruby dust
#

that was my guess

earnest phoenix
#

A what?

mossy vine
#

but why would a virus make vsc open a bit after its closed thonkku

ruby dust
#

some stupid virus by a stupid engineer, I assume

earnest phoenix
#

And open a specific project named "cli.js" and in there it states about license, free to use and such

#

And that I can read more in the license.txt file

#

I deleted everything in the file because it was some small code bit in there, As stupid as I was.

mossy vine
#

did you make cli.js?

earnest phoenix
#

Nope

#

I'll try reinstalling it then

#

Aight, I'll try sending y'all a screenshot of the file if it happens again

mossy vine
#

upload the contents to an unlist pastebin/hastebin instead, way better than having to look at screenshots

mossy vine
#

what the fuuuuck

sinful lotus
#

wth is that

mossy vine
#

beautified

"use strict";
const bootstrap = require("./bootstrap");
bootstrap.avoidMonkeyPatchFromAppInsights(), bootstrap.configurePortable(), bootstrap.enableASARSupport(), require("./bootstrap-amd").load("vs/code/node/cli");
//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/1b8e8302e405050205e69b59abb3559592bb9e60/core/cli.js.map```
#

one thing is for sure
the packages required in the code are NOT the ones on npmjs.com, as they dont have the functions mentioned in the code

#

what the actual fuck is this

#

do i have that file in my vsc installation as well?

earnest phoenix
#

idk check, C:\Users\USERNAME\AppData\Local\Programs\Microsoft VS Code\resources\app\out\

#

And you should be directed to a folder containing "cli.js"

mossy vine
#

yep, its there as well

#

but why does it reopen vsc???

earnest phoenix
#

I have no idea, I downloaded it from their website so there's nothing that can have gone wrong...

#

That one correct?

mossy vine
#

try reinstalling then

#

yep

earnest phoenix
#

I did

mossy vine
#

does it still happen?

earnest phoenix
#

Yes

#

Nothing pops up when I search "cli.js" on their support page

mossy vine
#

if anyone else has an idea as to what the fuck is going on above, post it

ruby dust
earnest phoenix
#

Is anyone intrested in helping me code a bot in Node? I have like 2% experience in coding, I've used Discord Bot Maker (I know smh) where you need to use variables and connect different action etc but that's it. I have Atom, PyCharm, Visual Studio Code

neon plume
#

how to make ascii art bot in node.js?

mossy vine
#

@neon plume google

neon plume
#

hmm

#

i tried

quartz kindle
#

As text or as image?

neon plume
#

text

quartz kindle
#

Discord's fonts are different from standard fonts, so regular ascii art generators do not work very well

neon plume
#

ok

quartz kindle
#

If you dont find anything specific for discord, then nothing you can do besides trying to make your own

neon plume
#

i want to make simple ascii art bot

quartz kindle
#

Ascii art is not simple

neon plume
#

means

#

which has simple font

#

not colourful

quartz kindle
#

But you want to send as text right? So it will use discord's fonts

neon plume
#

yeah

quartz kindle
#

Go to any ascii art website, copy an art and paste it on discord

#

You will see that it will not show correctly

neon plume
#

ohh

#

i will try to make myself then

#

so tim, how did you got certified developer?

quartz kindle
#

There is an application form in the website

neon plume
#

ohk

quartz kindle
sinful lotus
#

@earnest phoenix Javascript is already simple enough, if you compare it to other languages like Java, Javascript just needs a bit of effort

fringe rover
#

Can some one help me?

neon plume
#

for?

fringe rover
#

My bot.

mossy vine
#

just post the issue

neon plume
#

what help @fringe rover

fringe rover
#

Thereโ€™s no issue i just need help with a command.

neon plume
#

what are you using

fringe rover
#

Node?

quartz kindle
#

Post what you are trying to do, and the code you tried

neon plume
#

ohh

fringe rover
#

Tim i donโ€™t know The code though.

quartz kindle
#

What do you want to do?

fringe rover
#

Make my bot add roles to users and stuff

#

Basic commands.

quartz kindle
#

Youre using discord.js?

fringe rover
#

Yes?

quartz kindle
fringe rover
#

Ok

quartz kindle
#

They have all the documentation you need

earnest phoenix
#

Ok, I'll check it out @sinful lotus

fringe rover
#

But its different from The commands Iโ€™ve been using.

quartz kindle
#

What have you been using?

fringe rover
#

Ill show you

#

The code Iโ€™ve been using is different.?

mossy vine
#

nice token leak

#

time to reset it

fringe rover
#

Yep

earnest phoenix
#

oofers

fringe rover
#

Lol

neon plume
#

fast reset your token

fringe rover
#

Yep

quartz kindle
#

Doesnt look any different to me

neon plume
#

coz everyone can raid your server

mossy vine
#

it doesnt matter that its deleted

neon plume
#

using your bot

#

okok

brittle orchid
#

๐Ÿ‘€

neon plume
#

i use python and node

amber fractal
neon plume
#

node is just started

earnest phoenix
#

can i get some help from a staff member?

fringe rover
#

@neon plume ?

#

Raid my server ?

neon plume
#

no

#

i am not like that

fringe rover
#

What did u mean?

#

You said โ€œraid your serverโ€.

quartz kindle
#

If your bot has admin permissions, people can ban everyone jn your server and delete all channels lol

fringe rover
#

Ow

#

Whoopsies

#

I have re generated a new token anyways

mossy vine
#

good

#

dont leak that one

fringe rover
#

So its all good

neon plume
#

one of my friend got raid many times due to that problem

fringe rover
#

Rip

neon plume
#

but its fixed now

quartz kindle
#

Anyway, from the code that you showed before, you should be able to figure out role commands as well, since they are not that different

#

Unless your whole code is copy and pasted and you have no idea what youre doing lol

neon plume
#

can anyone tell, how to make a good welcomer?

mossy vine
#

with code

neon plume
#

my welcomer is not much good

quartz kindle
#

Dont make one

#

Lmao

mossy vine
#

^or that

fringe rover
#

@quartz kindle Erm yer that

neon plume
#

but i am happy with what i have got

fringe rover
#

๐Ÿ˜‚๐Ÿ˜‚

quartz kindle
#

I figured...

#

Are you interested in learning at all though?

fringe rover
#

Well i was sat for 6 hours trying to get my bot online

#

Lol

neon plume
#

you can host through servers

fringe rover
#

Yes (Tim)

#

?

neon plume
quartz kindle
#

Then you should start with basic javascript. Look up some online courses like codecademy or whatever

neon plume
#

but

fringe rover
#

Iโ€™ve tried that and i donโ€™t understand it .?

#

But ill retry.

quartz kindle
#

If you dont understand basic javascript you wont undestand 99% of making bots with javascript

haughty rose
#

Does anyone know if you can do multiple command.cooldown checks on a single command?
like this

@commands.cooldown(1, 30, commands.BucketType.guild)
#

A command can only have a single cooldown.

fringe rover
#

@quartz kindle i understand bits of it.

#

But not all if you get me?

mossy vine
#

you dont understand basic javascript but want to make a discord bot with javascript

quartz kindle
#

Then learn. Programming is something you need to study, its not something you can learn on one day

#

Slowly study and get familar with it, and slowly become able to do more things

#

And eventually you will know how bots work and will be able to make them easily

earnest phoenix
#

This is going to be so dumb but i'm new ok?

client.on('message', (message) => {

    if(message.content == 'ping') {
        message.reply('pong');
    }

});```
When i run that it gives me an error saying "ReferenceError: client is not defined"
mossy vine
#

because client is not defined

#

you need to install d.js, import d.js in your file, then define a d.js client

#

just copypasting code and expecting it to work aint how you do things

#

learn javascript first

#

there are some great resources pinned

earnest phoenix
#

I'm watching a video not copy and pasting ๐Ÿ˜‰

mossy vine
#

im guessing you still dont understand the majority of it, because of your lack of javascript knowledge and experience

quartz kindle
#

What he said. client needs to exist somewhere. Did you create it?

earnest phoenix
#

True, I don't know where to learn java script tho. It's apparently much easier to code a bot using java script than nodeJS

fringe rover
#

There the same thing ๐Ÿคฆ๐Ÿปโ€โ™‚๏ธ

earnest phoenix
#

Wait a moment lmao

mossy vine
#

you dont even know what nodejs is holy fuck

#

Node.jsยฎ is a JavaScript runtime built on Chrome's V8 JavaScript engine.

fringe rover
#

^

mossy vine
#

and as i said, there are great resources for learning javascript pinned in this channel

earnest phoenix
#
like glitch.com or heroku```

no, don't use free hosting for public bots
mossy vine
earnest phoenix
#

I got it that's why the message is deleted ๐Ÿคฆ

fringe rover
#

Cyber can you give me a direct link to add the command to add roles for my bot in Discord.js Org

#

??

earnest phoenix
#

no

mossy vine
#

Slinky can you read docs

earnest phoenix
#

a) it isn't a link
b) we aren't spoonfeeding code

quartz kindle
fringe rover
#

@quartz kindle ly xx

#

Right aswell Iโ€™m looking through docs and i canโ€™t find it

quartz kindle
#

Its righ there lol

#
message.member.addRole('193654001089118208')
  .then(console.log)
  .catch(console.error);```
fringe rover
#

Ow

#

Shit

#

Whoops

#

Now i make a Client = shit

glossy hazel
#

?play

opal copper
#

hey discord js has defaultChannel but it not working, how can i do a same command as defaultChannel

mossy vine
#

of course its not

#

its been deprecated for months, if not a year

opal copper
#

yes, i see that in discordjs documentation

mossy vine
#

then whats the problem?

opal copper
#

how can i do a same option than defaultChannel

amber fractal
#

You vany

#

Cant

#

It doesnt exist

#

If I'm to guess, master doesnt have it anymore

#

You're probably on stable

opal copper
#

yes i'm on stable version of discordjs

quartz kindle
#

There is no default channel since people can delete it

#

What you can do it send to the first channel that you have permissions to send

amber fractal
#

Which isnt always a good idea either.

slender thistle
#

System channel

#

Or let users set up the correct channel for that

#

(moderators or admins)

ruby talon
#

Hello.
Before showing my problem you need to know that I'm using Python 3.7.2 64-bit.
My code:

[in the Moderation File]
from Extras.utils.files import Files

Error:

No name 'files' in module 'utils'

My file layout.

โ”‚   run.py
โ”‚
โ””โ”€โ”€โ”€Extras
    โ”‚   Currency.py
    โ”‚   Moderation.py
    โ”‚
    โ””โ”€โ”€โ”€utils
            files.py
ruby talon
#

Fixed btw --

flint trellis
outer niche
#

Is there any way to host I bot that was coded on mobile

fervent fern
#

Anybody know of a bot that is able to take information from a certain channel and automatically post a standard poll on another private channel?

#

For example, we have a graphic design channel in which people apply for roles such as "Junior, Intermediate, Advanced, Professional and Illustrator", when they apply in the #role-application channel we'd like a bot to take their application and create a poll in our #role-critique channel that has 5 emojis of the available roles for us to vote on

stray wasp
#

No but it would be easy to create

fervent fern
#

How much would that go for?

restive halo
#

I mean if you have access to a server @outer niche you can likely run it on that
What language are you using?

outer niche
#

Pydroid 3 @restive halo

restive halo
#

Ah
I use js for mine
Not sure what you use to get a python bot running

outer niche
#

How would I get a server

inner jewel
#

with money

restive halo
#

^

outer niche
#

Well I need to know where to get one

restive halo
#

You can search for them online

inner jewel
#

check the pins

#

on this channel

restive halo
#

And if you're gonna be doing it off your phone I'd recommend getting Termux

inner jewel
#

you can't reliably host a bot from a phone

restive halo
#

Termux would just be for ssh'ing into the server

#

Actually hosting a bot on a phone sounds like actual pain

ruby dust
#

for those that know how discord.py works, if I request a user object from discord, is it stored in cache or not, considering that their information may change and not have a mutual server will only make it inaccurate in the future

spring ember
#

@ruby dust discord notifies on user change afaik

ruby dust
#

what

earnest phoenix
#

rest information isn't cached

#

i think

spring ember
#

Umm Users should be cached and updated on new events I think

earnest phoenix
#

for the socket

#

not rest

hushed berry
#

I seriously doubt it caches users retrieved through rest calls

lilac geyser
#

@quartz kindle @quartz kindle I didn't try with id, since the it doesnt return the error every time, just occasionally, so idk why :(

dense dove
#

i've just made a webhook code for logging votes, but it didnt log the vote...

bright spear
#

@dense dove don't ask the same thing in multiple channels. #topgg-api is the correct channel

dense dove
#

sorry den lol

#

thought i asked in wrong one so asked here too

prime junco
#

how would I set up a reaction based help command, that if you were to hit the reaction to go forward it would go to the next page, and if you were to hit the back reaction it would go back?

restive halo
#

What language are ya using?

hushed berry
#

yeah, there may be a prebuilt thing for it depending on the langerino

prime junco
#

discord.js

#

java

outer niche
#

How do I host a bot with v3rmillion

prime junco
#

I am just going to do a per page thing, if they do like ;help 1 It will show them the first page

earnest phoenix
#

you're using java... with a library for javascript

#

excusez moi quoi de la fuck

prime junco
#

so if I just set up the help command to give the list per section of commands would that be okay? like ;help displays one section of help ;help2 displays the second section and so on?

earnest phoenix
#

hello guys, someone know how I can transform 1 array to 3? (javascript)

#

[1, 2, 3, 4, 5, 6, 7, 8, 9]
->
1: [1, 2, 3]
2: [4, 5, 6]
3: [5, 8, 9]

plz ping me

sinful lotus
#

you want to make 3 arrays?

keen drift
#

huge w 0 w

sinful lotus
#

Im thinking of manual method but split may work?

#

just google it like fishy linked lmao

grim aspen
karmic lake
#

ok now eval process.exit(0);

grim aspen
#

no

karmic lake
#

why?

grim aspen
#

that exits node process

karmic lake
#

how can you be so sure

grim aspen
#

looked it up

stark bear
#

i host my discord bot on my samsung smart fridge- any tips to improve performance?

grim aspen
#

what the fuck?

#

how the hell would you host a bot on a samsung smart fridge?

stark bear
#

u just gotta be smart about it

#

what helps is it keeps my hydrated

grim aspen
stark bear
#

so whenever i need to check up on the bot, i grab myself a drink

#

anyways, back to my original question, any tips for achieving maximum performance with a smart fridge?

ruby dust
#

Can we please leave #development for more serious discussions instead?

stark bear
#

rip my performance then but ok

edgy beacon
#

@earnest phoenix that array would have been easy for me in 1988 but alas, too many years and loss of grey matter...

earnest phoenix
#

cool

#

i fixed the problem

outer niche
opaque eagle
#

Node.js doesn't allow for import/export

#

you need common.js require statements

outer niche
#

So if I can't use import what am I supposed to use

opaque eagle
#

Common.js

outer niche
#

Ok

opaque eagle
#

require()

#

module.exports

#

that stuff

empty owl
#

oof

opaque eagle
#

Or wait I think u can run it with the --experimental-modules flag, if your node version is recent enough @outer niche

#

But I still don't get some of your syntax

#

It kinda looks like python lmao

bright spear
#

i think that is python

#

like

#

that whole thing is python @outer niche

#

its not js

opaque eagle
#

yeah

#

changing a filename to a .js extension doesn't make it javascript code.

worn hull
worn hull
#

my code is just messy

amber fractal
#

That makes the issue about 1000x harder to fix

#

It's no wonder theres a syntax error in there tbf

#

Unexpected end of input is the error

#

so you're missing something

#

a } or a ) most likely

#

Which isnt surprising.

sinful lotus
#

use beautify or smh

empty owl
#

whats that

amber fractal
#

It wouldnt work anyways.

#

Well that wasn't beautifier*

#

The editor I use on my chromebook will auto format, and usually it's correct

keen drift
#

i see roblox

#

I ignore

earnest spear
#

hey guys how can i have my bot loop through an entire cast and send it as a message.channel.send?

#

for example let's say I have this cast array:

characters: [
"Narrator",
"Twilight Sparkle",
"Twinkleshine",
"Spike",
"Applejack",
"Granny Smith",
"Apple Bloom",
"Rainbow Dash",
"Rarity",
"Fluttershy",
"Ponies",
"Pinkie Pie",
"Mayor Mare",
"Nightmare Moon"
],
languid dragon
#

for (const entry of entries) {
// entry = entries[0]
}

earnest spear
#

ohhh i think i get it. i'll have to use Array.prototype.join for javascript is that correct?

high lava
#

Oh. That loop. Yes that. What Deftones said

languid dragon
#

depends what you're trying to send?

#

are you trying to send an organised user friendly list?

high lava
#

If you want to OUTPUT all of them, then do

m.channel.send(characters.join(' '));
earnest spear
#

yes i just want to output

high lava
#

Yeah. That joins them with a space

earnest spear
#

alright i think i have a better understanding...

high lava
#

You may want to do ```
m.channel.send(characters.join(', '));

#

that puts a comma in between each name

earnest spear
#

ok

#

you've been all very helpful

#

let me try this

languid dragon
#

if so i'd reccommend using

Array.map((value, index) => `${index}. ${value}`).join('\n')
high lava
#

that's added to my future use file

earnest spear
#

oh a map to transform them as an organized list

#

smart

languid dragon
#

depends how fancy you want to make it

earnest spear
#

worked perfectly

lilac geyser
#

I am having memory issues with discord.js, rss grows indefinitely and memory usage is way too high. I captured snapshots with chrome dev tools, and realised there's many of such objects, is this normal?
https://media.discordapp.net/attachments/404569720583618560/546345656336252941/unknown.png

If it is, then what can I do? I currently have 16GB of RAM for 80k+ servers and is running out terribly, crashing the bot every single day. forever is currently used to keep it alive, but definitely not a good idea.

languid dragon
#

pins in #general also why are you asking here

lilac geyser
#

@languid dragon Are you talking to... me? ๐Ÿ‘€

languid dragon
#

no

lilac geyser
#

oh

sinful lotus
#

@lilac geyser Theres nothing you can do other than to download more ram, I mean put more ram

lilac geyser
#

@sinful lotus So it's the fact that discord.js is bad at memory... :(

heady zinc
#

just rewrite to eris hahayes

sinful lotus
#

yeah, you can do some stuff to reduce

#

it

#

but other than that

#

ยฏ_(ใƒ„)_/ยฏ

lilac geyser
#

lol @heady zinc at this stage im very familiar with discordjs and changing a library just seem... you know

#

a bit late

#

@sinful lotus Hmm, some stuff?

sinful lotus
#

nuke cache

#

but be careful on what you nuke

lilac geyser
#

How do I do that ๐Ÿ‘€

sinful lotus
#

nuking something blindy will cause you errors