#development

1 messages · Page 1646 of 1

crimson vapor
#

hi Luke

rustic nova
#

Sus

#

whenImpostorSus one sec

crimson vapor
rustic nova
#

@earnest phoenix please don't advertise here

lyric mountain
#

plus the documentation is written with Comic Sans-like font

crimson vapor
#

pog

cinder patio
#

the functionality's probably very limited tho

green kestrel
#

when we were at college doing computing, as a complete beginner exercise for those who had never programmed they asked them to write some instructions to an alien who'd never been to earth before how to make a cheese sandwich

#

cue rabbit warren of realising that you have to define what bread is, what a knife is, how to hold it, where to get bread....

crimson vapor
#

how many years ago was this?

green kestrel
#

hmm, 23?

crimson vapor
#

lmao

#

boomer

pale vessel
#

god damn

green kestrel
#

it still applies though! think about it

crimson vapor
#

yeah it really does

green kestrel
#

its showing how you cant expect a computer to assume anything, it takes everything literally

#

so where someone in their thing puts "put butter on bread", the lecturer acts out what the alien would do, takes the literal box of butter and places the BOX on the loaf

#

🤣

crimson vapor
#

lmao

green kestrel
#

we all already know how to code, so this is captain obvious moment to us

#

but if youre explaining programming to your grandma... well this is where i'd start

pale vessel
#

by the way Brain did you take a break from moderating or?

green kestrel
#

no im no longer a moderator

crimson vapor
#

ah

pale vessel
#

I see

crimson vapor
#

working more on the bot?

green kestrel
#

i didnt have time to fit it in alongside family, job and triviabot, i stopped doing queue

lyric mountain
crimson vapor
#

yeah I assumed it was a time thing

green kestrel
#

eventually they decided enough was enough and took my access away, but tbh i dont miss reviewing endless stream of turkbots at all

#

i found it demoralising and demotivating

crimson vapor
#

yeah it just seems like pain

green kestrel
#

i can actually make reasonable money developing triviabot in my free time now

#

and thats fun 😄

crimson vapor
#

triviabot has a patreon or something?

cinder patio
#

you go girl

green kestrel
#

it has premium

crimson vapor
#

ah

#

how much is premium?

green kestrel
#

basic month premium is £3, charged through stripe/chargebee
in jan i made £750, because 5 people all bought lifetime all at once

crimson vapor
#

wow

pale vessel
#

pog

green kestrel
#

it averages about 350 a month atm

crimson vapor
#

thats pog

#

especially if it contiunes to grow

green kestrel
#

it may sound a lot but most of this is repaying the thousands i sunk into ads lol

#

i loaned myself big money

lyric mountain
#

you receive a minimum wage

crimson vapor
#

yeah I remember you talking about how its not really worth it

green kestrel
#

its not worth it to do as a day job no

#

i have a day job, so its additional income

crimson vapor
#

a fun project with benefits basically?

green kestrel
#

yup

#

the aim was to get it to pay for its own hosting

#

i didnt even expect to get that far, because no other project ive ever done has

#

i sunk years of my life and a couple of thousand £ into developing and releasing a game on steam

#

that never made its money back

crimson vapor
#

yikes

#

was it at least a fun project? or was it just painful

green kestrel
#

tbh for releasing a quality game, £2000 is nothing. people spend millions

#

i refused to spend any money on ads/marketing

#

it was very much fun

crimson vapor
#

well thats good

green kestrel
#

and i was nominated as finalist at an indie games competition

crimson vapor
#

oh thats cool

green kestrel
#

won an all expenses paid trip to london, vip pass, afterparties, and exhibited the game at an expo

#

it was awesome

crimson vapor
#

pog

green kestrel
#

a thing thatll prob never happen again

crimson vapor
#

how many years ago was this?

green kestrel
#

2019

crimson vapor
#

oh so the game is still current

green kestrel
#

yup

pale vessel
#

what's it called?

green kestrel
#

search steam for 'mr boom's firework factory'

modest maple
#

tl;dr is a puzzle game

#

its pretty cool

green kestrel
#

its a really really hard puzzle game, like the dark souls of puzzle games with a dark storyline

#

it makes people want to throw their gamepad at the screen

#

and do this

#

(╯°□°)╯︵ ┻━┻

crimson vapor
#

game engine or from scratch?

green kestrel
#

game engine

#

ue4

crimson vapor
#

ah

green kestrel
#

i did two previous versions from scratch and abandoned them

#

part of the reason it took so long

#

a large portion of the £2000 cost was graphical assets, and the voice over for the main character

#

mr boom's voice was done by a guy called matt howell who did the voice over for the world of tanks ad on US TV during the superbowl one year

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

crimson vapor
#

oh that makes sense

green kestrel
#

when i went to that expo, i networked with a bunch of people and one of them put me in touch with really nice voice talent

#

i think his voiceover cost me £300

small meteor
#

Sooo my bot isn't responding to ANY commands out of the blue

#

I changed nothing

solemn latch
#

any errors?

small meteor
#

Nope

green kestrel
#

steam listing itself cost me £70

small meteor
#

Nothing

solemn latch
#

are you catching every error 👀

green kestrel
#

discord listing £25

#

basically lots of little costs to release

small meteor
#

And my bot is being reviewed today or tmmrw so this is kind of sad

#

Yea, out of NOWHERE this happened.

#

It was working fine last night then now nothing

sterile lantern
#
if(!answer4.first().content.toLowerCase() === "partner") {
  return message.author.send("That was not a valid program. Please re-run the command and enter a valid program next time.")
}
if(!answer4.first().content.toLowerCase() === "notable group") {
 return message.author.send("That was not a valid program. Please re-run the command and enter a valid program next time.")
}```
#

confusion

#

if i say partner

#

it returns that message

solemn latch
green kestrel
#

@small meteor you didnt host it in france at ovh did you? lulw

sterile lantern
#

but i want it to say that message if the content is not partner or notable group

solemn latch
#

lol brain

small meteor
#

No, its CA OVH @green kestrel

lyric mountain
#

ovh...

crimson vapor
#

LMAO

small meteor
#

And no

green kestrel
small meteor
#

@solemn latch

lyric mountain
#

this bot's on fireeeeeeee

green kestrel
#

im on OVH Poland

sterile lantern
#

i tried and

solemn latch
#

have you tried restarting the bot?

crimson vapor
#

@green kestrel im on OVH Virginia

sterile lantern
#

i thought that was the issue

#

but then i seperated

#

still doesnt work

crimson vapor
#

thats even more of an issue

green kestrel
#

i need to review my backup policy tbh, reading about what happened to france DC scared me

small meteor
#

Yea I did

crimson vapor
#

DC?

green kestrel
#

makes me wonder what corners they may be cutting at my DC

#

datacentre

lyric mountain
#

data center

crimson vapor
#

ah

small meteor
#

Can someone take a look with me in a VC?

solemn latch
sterile lantern
#
if(!answer4.first().content.toLowerCase() === "partner" || !answer4.first().content.toLowerCase() === "notable group") {```
small meteor
#

yea

green kestrel
#

unfortunately i cant. my work uses discord, i spend 9 hours a day in their VC

crimson vapor
solemn latch
#

thats a bad thing, you wont know what errors are happening if you never log them

small meteor
#

@solemn latch There is nothing wrong with the Code..... everything in the Code is fine, the bot just doesn't trigger commands

#

Dashboard runs fine

crimson vapor
#

@green kestrel bro get discord canary and stable so you can have 2 vc connections

sterile lantern
#

wym

#

well when i say partner

#

it sends error msg

#

thats what i dont want

lyric mountain
#

!(condition1 || condition2)

sterile lantern
#

o

#

didnt i do that tho

lyric mountain
#

instead of !condition1 || !condition2

sterile lantern
#

ih

#

oh*

crimson vapor
#

this is basic logic

#

lmao

lyric mountain
#

the former will run if either of those is true

#

the later will run if either of those isn't true

small meteor
#

I even restarted my VPS

solemn latch
small meteor
#

I cant see how that is possible lol

sterile lantern
#

do you do any requests with your bot

#

web requests

#

in your main bot file

#

bc that can be the cause of ur bot not responding

small meteor
#

It works now... I found the problem

sterile lantern
#

what was it?

small meteor
#

@sterile lantern thank you for that idea, I had the handle incorrect

sterile lantern
#

oof

#

rip

#

np

small meteor
#

I must have typed something there on accident bc on one of my lines it said thank you LOL

#

Welp

solemn latch
#

one of the things that can help with these types of accidents is using git. once you update something, you can see all changes from that point to find those kinds of mistakes.
it can save a lot of time

green kestrel
#

use git, love git.

#

git is life

lyric mountain
#

git gud

misty sigil
#

me merging my 17 commits across 2 machines

green kestrel
#

the best bit is that one final guy

#

who trips over the guy getting up

lyric mountain
#

those two untracked files

earnest phoenix
lyric mountain
#

you again...

#

why are you still making those if comparations?

earnest phoenix
#

Because

#

idk

earnest phoenix
solemn latch
#

<Permissions>.toArray(); will give you the permissions as an array

#

no need to if each permission

earnest phoenix
#

yes but

#

Why is it listing the permissions when the user doesn't have them

solemn latch
#

no idea tbh, im too hungry to think 👀

#

but you could get rid of 99% of the code, for a 100% working method

lament rock
#

Is Permissions what the user has or what's modified? isn't there an allow | deny property

earnest phoenix
#

It should list the permissions that the user has

#

but the permissions that should be listed that the user has are listed

#

and not like a permission view channel

earnest phoenix
#

I don't understand that

#

lol

solemn latch
#

👀

#

The overall set of permissions for this member, taking only roles into account

earnest phoenix
#

I am less intelligent PepeDumb

#

but

#

how do I use it

#

just like uh

solemn latch
#

i explained a working method above

#

<Permissions>.toArray(); will give you the permissions as an array

earnest phoenix
#

so just put

#

.permissions.toArray();

#

and it works?

solemn latch
#

member.permissions.toArray();
instead of all those if statements should give you the permissions the user has as an array.

earnest phoenix
#

let me get this straight

#

.addField(`Permissions: member.permissions.toArray()`, true)

misty sigil
#

What the fuck no

solemn latch
#

the only thing your doing is replacing the if statements

#

and instead setting your permissions variable to the array

#

this part, can stay the same. ```
.addField(Permissions: ${permissions.length ? permissions.join(', ') : 'None'}, true)

earnest phoenix
#

I'm confused

#

What do I remove and what. do I add

misty sigil
#

don’t you need another value

solemn latch
#

didnt i just say exactly that 👀

misty sigil
#

Fields need 2 values

#

title and value

#

.addField(title, value, inline)

drifting wedge
#

how can i read a dict in py?

#

like do i index it?

solemn latch
slender thistle
#

index how

drifting wedge
#

how do they work

#

like how can i read a dict

slender thistle
#

They're not sorted/indexed

earnest phoenix
slender thistle
#

You read a dictionary by a key

drifting wedge
#

how can i read one then?

earnest phoenix
#

the title, value and inline is there

misty sigil
#

no

#

It’s not

drifting wedge
#

i do dict["key"]?

slender thistle
#

yes

drifting wedge
#

ohhh

#

makes sense

#

alr ty shiv

#

as always

slender thistle
drifting wedge
#

who the fuck needs google when u have shiv lol

slender thistle
#

Tim is the StackOverflow here

tired panther
#

lol

restive willow
#

does anyone here run a bot in a lot of servers? having some issues with lag and wondering if anyone else has experienced & fixed similar issues

slender thistle
#

Usually has something to do with resource-heavy processing

restive willow
#

im nto really doing anything intensive, most it does is upload emojis

slender thistle
#

Is that all it does?

#

Could be an issue with caching

restive willow
#

thats the most intensive thing i can think of it, most of the other commands are sending embeds with stuff in them

#

wym by caching

slender thistle
#

Member/user/presence caching

restive willow
#

I haven't touched that, would i need to disable aynthing

slender thistle
#

Well, it's suggested to only cache what you really need, so go through what the bot needs to cache and apply appropriate intents to your client on connection

#

Apart from that, make sure the machine the bot runs on doesn't get overwhelmed along with its network

lament rock
restive willow
#

lag as in sometimes commands take a while to respond, even simple ones like >help

#

let me pull up the vps dashboard

#

and ill get back to you

misty sigil
#

100% cpu usage

lament rock
#

python seems like. Might possibly be asyncio wait blocking the thread.

#

What you should do is use non blocking methods or multithread your application

restive willow
restive willow
lament rock
#

186MB free is also not great. You shouldn't be depending on swap too much. Might possibly be the garbage collector blocking the thread

solemn latch
#

What's with the big cpu increase? New feature?

restive willow
restive willow
lament rock
#

The issue just might be that you have a memory leak or that you should look into intents. I know discord.py isn't all that great when it comes to cache management, so I'm not too sure what you can do in that regard. I don't code in python, so I wouldn't know what your best course of action could be other than to possibly cut back on intents you don't need such as presences. Practicing efficient memory management is good

earnest phoenix
#

Is there any way to have a module like in npm but private .Since i want to update it across folders.

misty sigil
#

Linux is using 2.5G for a disk cache

#

it’ll reallocate it as needed tho

cinder patio
lament rock
#

The disk may be a hdd and trying to sweep from an hdd will lock the process while it sweeps

misty sigil
lament rock
#

avoid swap at all costs

restive willow
#

mine started struggling around 15k so somewhere around there

earnest phoenix
green kestrel
#

that's a sizeable amount yes

earnest phoenix
#

with module i mean a folder which can i update via command

misty sigil
#

usb flash drive

#

:p

lament rock
#

:/

earnest phoenix
solemn latch
#

As in updating from like github?

lament rock
#

github private repos can serve as private npm packages

#

npm also has private packages, but I haven't personally seen this

earnest phoenix
lament rock
#

no you don't

solemn latch
#

for private repos?

lament rock
#

github private repos are free

earnest phoenix
#

there is github submodule

earnest phoenix
solemn latch
#

does it have to be npm?

#

whats the requirement that means it absolutly needs to be npm?

earnest phoenix
lament rock
#

if you're installing something as a dep, github works. npm works

misty sigil
#

Just pull from gh?

lament rock
#

npm install AmandaDiscord/Reloader
github repo

vivid fulcrum
#

don't you need the git+ prefix

#

or does it automagically recognize it's a gh repo

lament rock
#

if it's in the package.json, you need git:User/Repo

earnest phoenix
#

i will use submodule.If there is no other opinion

cinder patio
#

but the repo has to be public, no?

earnest phoenix
lament rock
#

I think you can auth in npm

earnest phoenix
#

where the frick do I add a , AAAA

#

nvm got it

#

im dumb

#

xd

misty sigil
#

what thE FUCK is that indentation

earnest phoenix
#

lol my repo

earnest phoenix
solemn latch
#

what if you indent things, but like only once

earnest phoenix
#

nO

small tangle
#
channel.sendMessage("Calculating ping...").queue((msg) -> {
    final long ping = ChronoUnit.MILLIS.between(message.getTimeCreated(), msg.getTimeCreated());

    msg.editMessage("You reached the alpacafarm in **" + ping + "**ms").queue();
});

Am i calculating the ping correct? because im getting a 700/800 ms result or is just my latency so high

quaint wasp
#

I get this error..

#
        message.winner.send(`**Hey ${message.author}! You just won a giveaway for ${prize}, in server named ${guild.name}!`)
                       ^

TypeError: Cannot read property 'send' of undefined```
#

And what I am executing from index is thiS:

misty sigil
#

message.winner?

unreal estuary
#

cri

quaint wasp
#

I definded it like so:

unreal estuary
#

where is it defined

misty sigil
#

It’s just winner

#

you NEVER define message.winner

unreal estuary
#

margarine

quaint wasp
#

..

unreal estuary
#

eat some to clear ur mind

quaint wasp
#

alr, I guess I dont realy need that part..

unreal estuary
#

yeah

#

just winner.

#

send

misty sigil
#

no

quaint wasp
unreal estuary
zenith terrace
misty sigil
#

yes

quaint wasp
unreal estuary
#

if winner is correct

quaint wasp
#

alr. Thanks

#

wait

#

how do I define guild?

#

is it possable?

earnest phoenix
#

İm how give a bit developer?

#

Bot

quaint wasp
#

I think its already defined..

solemn latch
unreal estuary
solemn latch
misty sigil
#

m.guild?!

quaint wasp
unreal estuary
#

message.guild yes

misty sigil
#

think about it

#

no it’s m.guild

unreal estuary
#

if ur doing the guild of the giveaway message?

quaint wasp
#

yes..

misty sigil
#

message might be entirely different

unreal estuary
#

ok

earnest phoenix
#

I'm create a bot

quaint wasp
#

I*

solemn latch
#

youve asked this question several times before smug, and gotten the answer several times before

quaint wasp
#

alr. Code it @earnest phoenix

earnest phoenix
#

Wait

misty sigil
#

Is this the dude who didn’t know how to create an object

#

I genuinely wouldn’t be surprised

#

it is

zenith terrace
#

yea..

misty sigil
#

😅

solemn latch
#

if your having trouble remembering solutions to a problem, maybe try writing down issues you have in a journal(or file on your computer) and looking at that when you have an issue.

quaint wasp
misty sigil
#

yes it is

solemn latch
#

i always find writing down my development issues helps.

quaint wasp
#

oh..

misty sigil
quaint wasp
#

ok

earnest phoenix
#

Hard hard hard hard hard hard hard hard hard hard hard hard hard hard

quaint wasp
#

..

#

?

#

go to the Discord.js guid

#

its really helpful..

umbral zealot
#

D.js Official? helpful? Have they changed so much that they've become suddenly helpful in the last year?

earnest phoenix
#

.setFooter(`Uptime: ${uptime}`);

How do I set the bot icon in the footer iconURL

quaint wasp
#

.setFooter(`Uptime:`, uptime, client.user.displayAvatarURL());

#

I think its something like that.

solemn latch
#

footers only have two parameters.

quaint wasp
#

oh

#

dang it I forgot that

vestal stirrup
#

can someone help me solve this problem?

The code:

.addFields (
  {name: 'Difficulty:', value: {
  im: s.Aim,
  Rating: s.Rating,
}, inline: true},
)```

the problem:
umbral zealot
vivid fulcrum
#

please why does everyone have fucked up indentation

vestal stirrup
umbral zealot
#

... no you need to give value a string

restive furnace
umbral zealot
#

value will not accept anything else

vestal stirrup
jade saddle
#

hmm

#

I have a minesweeper bot with this code

        for (c = 0; c < board.length; c++) {
            if (board[b][c] > 8) {
                try {
                    if (b - 1 < 0 || c - 1 < 0) {} else {
                        board[b-1][c-1]++
                    }
                } catch (error) {};
                try {
                    if (b - 1 < 0) {} else {
                        board[b-1][c]++
                    }
                } catch (error) {};
                try {
                    if (b - 1 < 0 || c + 1 < 0) {} else {
                        board[b-1][c+1]++
                    }
                } catch (error) {};
                try {
                    if (c - 1 < 0) {} else {
                        board[b][c-1]++
                    }
                } catch (error) {};
                try {
                    if (b < 0 || c + 1 < 0) {} else {
                        board[b][c+1]++
                    }
                } catch (error) {};
                try {
                    if (b + 1 < 0 || c - 1 < 0) {} else {
                        board[b+1][c-1]++
                    }
                } catch (error) {};
                try {
                    if (b + 1 < 0 || c < 0) {} else {
                        board[b+1][c]++
                    }
                } catch (error) {};
                try {
                    if (b + 1 < 0 || c + 1 < 0) {} else {
                        board[b+1][c+1]++
                    }
                } catch (error) {};
            }
        }
    }```I wanna find a way to make it more efficient
umbral zealot
#

why in heavens is that not a global try/catch, first of all?

jade saddle
#

Explanation: loops through the whole board, finds which squares that are bombs, and adding 1 to all of the squares around it

umbral zealot
#

Also... do you not know how to invert conditions?

#

this code hurts my brain and my heart all at once

jade saddle
vestal stirrup
jade saddle
#

it will catch on the -1

vestal stirrup
jade saddle
#

because I don't want list index -1

#

but then it will skip over the other squares

umbral zealot
#

ok but try/catch is to catch errors, oyu shouldn't be purposefully introducing errors in your code

#

make sure your conditions are correct and don't cause errors

jade saddle
#

what happens if I have list index out of range then

umbral zealot
#

uh make sure it's not?

#

You create the grid, you know the size of that grid, how would you ever get an index out of bounds?

#

that would be a sign of bad programming

tired panther
#

I have a command folder and how do I delete the whole cache of the command folder (to reload it)?

#

Ik its delete require.cache , but does it work for it?

jade saddle
#

so something like this? for (b = 0; b < board.length; b++) { for (c = 0; c < board.length; c++) { if (board[b][c] > 8) { if (b - 1 < 0 || c - 1 < 0) {} else { board[b-1][c-1]++ } if (b - 1 < 0) {} else { board[b-1][c]++ } if (b - 1 < 0 || c + 1 > 0) {} else { board[b-1][c+1]++ } if (c - 1 < 0) {} else { board[b][c-1]++ } if (c + 1 > 0) {} else { board[b][c+1]++ } if (b + 1 > 0 || c - 1 < 0) {} else { board[b+1][c-1]++ } if (b + 1 > 0) {} else { board[b+1][c]++ } if (b + 1 > 0 || c + 1 > 0) {} else { board[b+1][c+1]++ } } } }

#

wait no

umbral zealot
#

Also... ```js
if (b - 1 < 0) {} else {
board[b-1][c]++
}

easily simplified with ```js
                if (b - 1 > 0) { board[b-1][c]++ }
tired panther
umbral zealot
#

invert the condition and suddenly you don't need the else part anymore

umbral zealot
tired panther
#

thats a easy operation

umbral zealot
#

When you respect proper recommended linter setups

tired panther
tired panther
jade saddle
#
                if (b - 1 > 0 && c - 1 > 0) {board[b-1][c-1]++}
                if (b - 1 > 0) {board[b-1][c]++}
                if (b - 1 > 0 && c + 1 < boardSize-1) {board[b-1][c+1]++}
                if (c - 1 > 0) {board[b][c-1]++}
                if (c + 1 < boardSize-1) {board[b][c+1]+}
                if (b + 1 < boardSize-1 && c - 1 > 0) {board[b+1][c-1]++}
                if (b + 1 < boardSize-1) {board[b+1][c]++}
                if (b + 1 < boardSize-1 && c + 1 < boardSize-1) {board[b+1][c+1]++}```
something like this should work right?
tired panther
# tired panther lol, my question got lost 😦
    const resolveFolder = folderName => path.resolve(__dirname, "..", "..", folderName);
        const commandsFolder = resolveFolder("commands");
        fs.readdirSync(commandsFolder).map(async(dir) => {
            if (dir.endsWith(".txt")) return;
            fs.readdirSync(path.join(commandsFolder, dir)).map((cmd) => {
                const pull = require(path.join(commandsFolder, dir, cmd));
                delete require.cache[pull];
                client.commands.delete(pull.name);
                client.commands.set(pull.name, pull);
                if (pull.aliases) {
                    pull.aliases.map((p) => client.aliases.delete(p));
                    pull.aliases.map((p) => client.aliases.set(p, pull));
                }
            });
        });
``` Does not work, It does not reload the commands
quaint wasp
#

guys

#

my bot is like..

#

EXTREAMLY slow..

#

It takes it like 10 seconds to reply..

#

and its only in 17 or so servers..

#

😐

tired panther
#

You did something wrong in your code

jade saddle
#

or internet broke

quaint wasp
#

And idk if I should make sharding..

#

nah.. its pretty good

tired panther
quaint wasp
#

Im litilary next to modem.

quaint wasp
jade saddle
quaint wasp
#

ya

#

I got internet..

#

Wify

earnest phoenix
#

every guild by me uses 2mb ram

quaint wasp
#

wify

umbral zealot
#

wifi isn't internet. wifi is your local home connection

jade saddle
#

do an internet speed test

quaint wasp
#

ho

#

w

jade saddle
quaint wasp
#

@jade saddle its arround 230s.

jade saddle
#

230s what

#

230ms?

earnest phoenix
#

Random question but, is there a length limit for vanity url?

jade saddle
#

idk

quaint wasp
#

I think there is..

quaint wasp
earnest phoenix
quaint wasp
#

oh

#

MPBS

#

wow..

jade saddle
quaint wasp
#

my ping is 10.

earnest phoenix
#

MPBS is not mb/s :c

quaint wasp
umbral zealot
#

Speed looks great, so definitely not a problem with your internet then

#

Sounds like a code issue - 10 seconds is simply way too long even for a show internet

#

What sort of command are you running?

quaint wasp
#

any

#

like stats command

tired panther
quaint wasp
#

help command

jade saddle
#

👍 1ms ping

tired panther
tired panther
earnest phoenix
quaint wasp
jade saddle
#

absolutely real

quaint wasp
#

no

#

like wtf

umbral zealot
#

Is every command slow or just those ones?

jade saddle
quaint wasp
#

I got a command handler

quaint wasp
jade saddle
#

also sometimes my bot has -1000ms ping

#

idk

#

but my ping command may be broken

tired panther
quaint wasp
#

o

jade saddle
#

wait

#

is the embed defined every time?

deft lark
#

hi

jade saddle
#

might be a bit more efficient to define the embed when you first start the bot

quaint wasp
#

wait

#

what

#

?

jade saddle
#

so like

crimson vapor
#

ping is stupid

quaint wasp
#

const (embedname) = new Discord.Messageembed?

crimson vapor
#

don't ever compare it

quaint wasp
#

ya..

jade saddle
#
const help = new Discord.MessageEmbed()
.setTitle("Minesweeper Bot")
.setColor("#E6E7E8")
.addField("ms/small [difficulty(1-3)]", "Generate small game (6x6)", false)
.addField("ms/medium [difficulty(1-3)]", "Generate medium game (8x8)", false)
.addField("ms/large [difficulty(1-3)]", "Generate large game (10x10)", false)``` put that at the beginning of your code
crimson vapor
#

ping is quite literally how far you are from the server

jade saddle
#

and just call "help" every time you run the command

crimson vapor
#

it really only matters when its super high

quaint wasp
crimson vapor
#

ping for a bot matters

#

because thats bot -> discord

#

a speedtest tho

#

thats internet -> the random server

smoky herald
#

hello, I made a new update for my bot which was running completely fine in the test environment, but when I ran it on the standart version it seemed to loop in this error

crimson vapor
#

therefore if you do it at some Uni, its gonna be low. Even when you could be miles away from discord servers

quaint wasp
#

now its like this

smoky herald
#

I read that Discord Client extends the node emitter or smth, could I have too many shards that I need to increase the emitter limit mb?

#

can't even run the index.js file anymore

quaint wasp
#

lol

quaint wasp
#

I got this:

opal plank
#

it extends emitter

quaint wasp
#
module.exports = {
  name: 'ban',
  execute: async (client, message, args) => {
    if (!message.member.hasPermission('BAN_MEMBERS')) return message.channel.send("You can't use that!");
    if (!message.guild.me.hasPermission('BAN_MEMBERS'))
      return message.channel.send("I don't have the right permissions.");

    const member = message.mentions.members.first() || message.guild.members.cache.get(args[0]);

    if (!args[0]) return message.channel.send('Please specify a user');

    if (!member) return message.channel.send("Can't seem to find this user. Sorry 'bout that :/");
    if (!member.bannable)
      return message.channel.send(
        "This user can't be banned. It is either because they are a mod/admin, or their highest role is higher than mine",
      );

    if (member.id === message.author.id) return message.channel.send("Bruh, you can't ban yourself!");
    let reason = args.slice(1).join(' ');

    if (!reason) reason = 'Unspecified';

    member.ban(`${reason}`).catch(err => {
      message.channel.send('Something went wrong');
      console.log(err);
    });
    const Discord = require('discord.js')
    const banEmbed = new Discord.MessageEmbed()
      .setColor('#FF0000')
      .setTitle('Member Banned')
      .setThumbnail(member.user.displayAvatarURL())
      .addField('User Banned', member)
      .addField('Kicked by', message.author)
      .addField('Reason', reason)
      .setFooter('Time banned', client.user.displayAvatarURL())

    message.channel.send(banEmbed);
    console.log("Ban command had been ran..")
  },
};```
opal plank
#

which you likely use already

quaint wasp
#

But..

#

it says invalid body form.

opal plank
#
client.on('message')```
#

you likely have that in code

quaint wasp
#

DiscordAPIError: Invalid Form Body

quaint wasp
opal plank
#

the reason you can use .on() and .emit() is because its constructd with super() with the event emitter

#

aka its extending

#

smug, not you

quaint wasp
#

oh

opal plank
#

@smoky herald referring to this person

smoky herald
opal plank
#

as far as too many shards, realisitically its completely up to your processor/threads

#

theres no "hard limit" on shards

tired panther
#

I made a cool npm module, with all moderation commands and db. But I wont publish it. Bc it doesnt fullfill the standards of @Not Erwin#8753 lol

opal plank
#

though you'll hit the maximum your processor/threads can handle depending on how many you'll be spawning

opal plank
#

good, keeping NPM a friendly and clean place

opal plank
#

i assume the issue is
.addField('User Banned', member)
.addField('Kicked by', message.author)
either one of those

smoky herald
opal plank
#

while they SHOULD turn into string called with toString(), tehcnically you passing an object to where it should be a string

quaint wasp
#

I.... dont understand.

opal plank
opal plank
#

as per discord api documentation

tired panther
#
 require.cache[require.resolve(`./dev/eval.js`)];
``` why doesnt this work lol, 
```errror
cannot find module './dev/eval.js'
``` I want to reload a command in a category
opal plank
#

member is an object

#

same for author

#

you should be passing a string

#

not an object

#

this is one of the downsides of not using ts, typescript would warn you about that

#

@quaint wasp

#

typescript would tell you about this error before you even ran the code

tired panther
opal plank
#

what do you have rn in terms of code?

#

internal or cluster sharding?

smoky herald
#

I'm using the inbuild discord.js sharding manager

opal plank
#

hmmm i havent used d.js sharding, you might need to ask someone who knows more

#

i know about sharding, since i use it myself, but not in d.js

#

even though i know a bunch, im not going to give input on something im not sure of myself

opal plank
#

i use a better lib mmulu

quaint wasp
#

o.

smoky herald
#

so I just have this in the index.js that I'm running and the client.on() "ready" and "message" in the app.js file

tired panther
tired panther
quaint wasp
opal plank
quaint wasp
#

the stuff surrounding the message?

smoky herald
quaint wasp
#

👀

tired panther
#

Flash emojis are not allowed 😦

opal plank
opal plank
crimson vapor
#

shit too flashy

smoky herald
crimson vapor
#

📸

opal plank
crimson vapor
#

is it?

opal plank
#

yeah, it glows in the dark

crimson vapor
#

ah

#

I see now

tired panther
tired panther
crimson vapor
#

huh

tired panther
#

and your code pls

smoky herald
opal plank
tired panther
opal plank
#

i had to set my listeners dynamically for my other project

#

i should've added that to the cursed code i've created

smoky herald
smoky herald
quartz kindle
#

thats not a solution lol, thats hiding the error

opal plank
#

the issue is that i knew what i was doing

quartz kindle
#

you're adding data and error listeners to the same emitter, not different emitters

opal plank
#

any half baked dev would tell you how critically dangerous what im doing is for a coding evnironment

#

actually

#

while tim is here

#

@quartz kindle let them know how good this is

vestal stirrup
#

I want to create another line in the fields, I tried to use the comma but it didn't work

code:

{name: 'PP', value: "raw: \ " + pp.raw, inline: false}
tired panther
opal plank
#

the reason thats there is so node 15 doesnt crash

#

most stuff i have is shielded inside catch blocks

quartz kindle
#

why do you need so many listeners lol

opal plank
#

me?

quartz kindle
#

ye

opal plank
#

for this

tired panther
opal plank
#

since theres multiple processes, i need to create/remove them as needed

crimson vapor
#

yikes

tired panther
# opal plank

a question, what are the "__", how are they called?

opal plank
tired panther
#

a 💡

opal plank
#

usually you append _ for stuff thats used internally

#

since the lib im using already has stuff internally, im adding my own internal

#

so i stacked 2

vestal stirrup
#

...

opal plank
#

some events have a generated id too

tired panther
opal plank
#

probably a really shitty design, but since it was already super complicated i went for adding/removing listeners on the go

opal plank
#

usually people use _ for lodash

tired panther
opal plank
#

but not, apart from global theres nothing js provides out the gate for you

earnest phoenix
#

hello

opal plank
#

and process

#

i think theres 2 other things

#

but i cant remember what they were

quartz kindle
#

well, you could easily increase/decrease max listeners instead of setting a global max

earnest phoenix
#

any good free service to host 24/7?

quartz kindle
#

increase when adding, decrease when removing

jade saddle
tired panther
opal plank
#

that would work, but i went for 50 simultaneous messages/events per shard(slave)

tired panther
earnest phoenix
#

free service

#

hacker plan is not free

opal plank
#

@earnest phoenix werent you asking about that a couple days ago?

earnest phoenix
#

yea but turns out

opal plank
#

well, regardless

#

do you have credit card?

tired panther
earnest phoenix
#

heroku only has 20 days a month and I need to add a credit card for that extra 10 days smh

opal plank
#

do you have a credit card or nah?

earnest phoenix
#

no

opal plank
#

then heroku/repl/glitch are your only options

#

not even repl

#

fuck that

earnest phoenix
opal plank
#

glitch or heroku

jade saddle
slender thistle
#

Repl is fine

earnest phoenix
#

heroku only 20 days a month

opal plank
#

i heard some token leaks from rpl

jade saddle
#

and run that 24/7

cinder patio
#

repl is better than glitch

earnest phoenix
#

glitch is shit

opal plank
#

who was it that was mentioning it?

#

@crimson vapor was it u?

crimson vapor
#

what

#

ive never used repl

#

kekw

opal plank
#

i recall someone mentioning having their tokens stolen from repl

tired panther
opal plank
#

yeah

#

i dont recall who was it

#

green name, thats all i remember

jade saddle
#

the safest option is obv just local host it

#

but if you can't

tired panther
slender thistle
#

token leaks you mean from .json files or .env

opal plank
#

i assumed that too

#

but they showed it wasnt posted

#

and after they changed, it got leaked again

slender thistle
opal plank
#

i really dont recall who it was

slender thistle
#

Sounds like just dumbassery to me

opal plank
#

i assumed too, but i kept it in mind

tired panther
#

Assuming their server did not get hacked

earnest phoenix
#

I hate heroku, 20 days free hosting but need to add a credit card for that extra 10 days

earnest phoenix
#

but before it was 1000 hours free without credit card

#

that's kinda shet

smoky herald
#

I can't literally start the bot

tired panther
jade saddle
#

there was this really weird bug with linux and discord.js

opal plank
#

this has nothing to do with maxEventLIsteners

jade saddle
#

it was using .flat and apparently javascript on linux doesn't have that

opal plank
#

what?

misty sigil
#

It does

#

??

opal plank
#

that makes no sense whatsoever

#

its node

#

your node version prob outdated af

jade saddle
#

or node on linux

crimson vapor
#

yeah make sure you update

opal plank
#

i use node on linux

crimson vapor
#

lol

opal plank
#

absolutely bs

jade saddle
#

i just removed the lines it was on

opal plank
#

im using ubuntu

jade saddle
#

and it worked fine

crimson vapor
#

you are probably on node 11

opal plank
#

^^

umbral zealot
#

array.flat() was introduced on node.js 12.0

opal plank
#

update your node my dude

jade saddle
#

hmmm

smoky herald
jade saddle
#

ok

quartz kindle
#

you're likely using the outdated linux node

smoky herald
quartz kindle
#

you have to install node directly from the node website, or using node installers/managers

#

the linux repos for node are always outdated

opal plank
#

so unless you're coding your bot properly(which i can see you arent), dont update to anything beyond 15

tired panther
smoky herald
#

ahh

#

15.2.1

tired panther
smoky herald
jade saddle
#

uhhhhh

jade saddle
#

I followed the directions on the website

quartz kindle
#

no

#

that will always be outdated

jade saddle
#

how should I do it then?

quartz kindle
#

you can try this https://github.com/nodesource/distributions/blob/master/README.md

#

or install nvm from github

crimson vapor
vestal stirrup
#

I finally got it

opal plank
#

hell nah

crimson vapor
#

pog

misty sigil
#

lmao

opal plank
#

im working, and i got 4 massive projects to work on

crimson vapor
#

lmao

vivid fulcrum
#

same, but not same for the im working part

quartz kindle
#

^

#

lmao

vestal stirrup
#

lmao

vivid fulcrum
#

i literally just stare at my code for a few hours instead of... working on it

quartz kindle
#

same

slim heart
#

now i have to do it

#

weary

quartz kindle
#

i dont even stare at it actually

slim heart
#

tim u do it

#

ez

quartz kindle
#

i just think about it 24/7

slim heart
#

its not in ts

#

B)

quartz kindle
#

but never do it

misty sigil
#

just think about working on it but never do it

quartz kindle
#

i code in my imagination and in my dreams

misty sigil
quartz kindle
#

line 42*

misty sigil
#

plot twist: they’re the same line

#

how?

#

no idea

vivid fulcrum
#

i've had moments where i'm very tired and i have a problem in my life and i find out the solution in my head to that problem with programming... then i remember that you can't do that

latent heron
#

quartz kindle
#

hahah

tired panther
jade saddle
#

and I followed what it said

proven lantern
#

is there ever a case where a bot can reply to a message in a text channel using msg.reply, but cant use msg.channel.send?

slim heart
#

should i separate my rest code to a different package

#

e

misty sigil
#

no you need it

jade saddle
#

actually, reply is basically sending a message while mentioning the user

#

so prob not

quartz kindle
jade saddle
latent heron
#

quartz kindle
#

ye thats old

proven lantern
misty sigil
#

o h god

latent heron
#

slim heart
quartz kindle
misty sigil
#

use what hen, tim

jade saddle
#

o wait

slim heart
#

just like ez import { RestManager } from '@disord-rose/rest' or something

jade saddle
#

for the curl command

opal plank
cinder patio
#

I didn't know some people's birthdays lasted 2 days

misty sigil
#

look Tim’s like the queen

opal plank
#

ez, birthday on feb 29

misty sigil
#

has 2 birthdays

#

and those are just ones we know of

opal plank
#

he's gonna have cake role for the next 4 years

slim heart
#

<@&330168063729074177> bonk

opal plank
#

i would actually laugh my ass if he kept it

slim heart
#

ez tim ping

solemn latch
#

his birthday is clearly several days long

#

👀

misty sigil
#

Tim does not consent to having his cake role taken away

opal plank
#

fuck

#

@quartz kindle not this year

graceful shore
#

can someone help me message.guild.members.cache.random(); is returning undefined

misty sigil
#

no members cached

opal plank
#

2024 tim gets cake role for the next 4 years

#

is .random() even a thing in collections?

slim heart
#

yes

misty sigil
#

yep

stable nimbus
#

Even though I only call for one message to be send, why is my bot going back over and sending a second message? Basically doubling down, only one node processes by the way I already checked that.

graceful shore
#

yes

opal plank
#

onteoresting

graceful shore
#

so is there a way to fix it?

slim heart
#

very onteoresting

slim heart
graceful shore
slim heart
#

do u have the members intent

stable nimbus
#
await message.channel.send(`Okay ${message.member.displayName}, this will take you about 15 seconds! (I will give you your results)`);

                    setTimeout(function() {
                        if(x <= 20) {
                            return message.channel.send(`No damage to the cuffs when you tried to pick them, but you're stuck still.`)
                        }

Why would this be sending two messages?

graceful shore
#

yes

tired panther
graceful shore
#

i do

quartz kindle
#

lmao

graceful shore
#

i have it

tired panther
slim heart
#

idk how djs works anymore ask in their support server

graceful shore
#

its toggled on

tired panther
graceful shore
#

ws?

tired panther
#
ws: {intents:["GUILDS","GUILD_MESSAGES", "GUILD_MESSAGE_REACTIONS", "GUILD_MEMBERS" ]}
})```
graceful shore
#

ah

tired panther
graceful shore
tired panther
opal plank
#

wait what

graceful shore
#

message.guild.members.cache.random()

opal plank
#

intents is a number

misty sigil
#

It takes an array

tired panther
graceful shore
#

get a random member

opal plank
#

@misty sigil it dont

misty sigil
#

it takes an array too

#

on djs

opal plank
#

read the first line

graceful shore
#

oh yeah i probably should have said im using discord.js

opal plank
#

@misty sigil client: Client = new Discord.Client({

misty sigil
#

ah

opal plank
#

it would be idiotic of me to call detritus Discord

misty sigil
#

type script

tired panther
graceful shore
#

it works

#

(im using
if(message.content) { console.log(message.guild.members.cache.size); } to log)

#

@tired panther

tired panther
graceful shore
#

ah if i do .tag is undefined

#

which is what i was using

daring prawn
#

which bot has the best css in top.gg?

opal plank
#

mine mmulu

#

confidence is everything nowadays

#

erm

#

nani

graceful shore
#

how do i fix it

#

so i can use it like user.tag

opal plank
#

someone broke my presence

#

oh there we go

tired panther
opal plank
#

bad

daring prawn
#

lol

opal plank
tired panther
opal plank
daring prawn
#

wait got it

tired panther
#

just supported on node 14

opal plank
#

sssshhh

#

details

daring prawn
opal plank
#

properly check if random() returned something

opal plank
tired panther
opal plank
#

leviathan is my twitch/discord bridge bot

opal plank
daring prawn
tired panther
earnest phoenix
# opal plank

Because you hover to ALL which is indeed number no? What if you hover the intents parameter, docs say it is IntentsResolvable which is including but not limited to number or I'm just too sleepy

graceful shore
#

discord just did big lag

opal plank
daring prawn
opal plank
#

oh that

#

dunno

#

prob color:

daring prawn
#

adding like animation etc

opal plank
#

or background-color:

#

you need to learn css to do fancy stuff

daring prawn
#

no but top.gg removed the one i had before in the recent update

opal plank
#

one thing i've learned is

#

css breaks

#

easy

#

REALLY easy

#

copy pasting small things work

daring prawn
#

lol

opal plank
#

but the moment you try to adjust it to all platforms and window size it fucks up

#

REAL good time

daring prawn
#

but i wanted to change vote buttons etc but top.gg removed it in the latest update

#

that bot is in 5kservers

#

or having custom commands feature

#

bruh

opal plank
#

it still there tho

daring prawn
#

my bot is all in one and only 100servers

opal plank
#

mine is in 3.3k

#

¯_(ツ)_/¯

daring prawn
#

i ecently made my bot

#

recently*

opal plank
#

live updates too

daring prawn
#

wait

#

how

#

can u tell me

daring prawn
#

bruh thats crazy

opal plank
#

SDK

daring prawn
#

oh

opal plank
daring prawn
#

ohh

#

oh

tired panther
daring prawn
#

my bot is all in one and i recently released it but only 100servers

tired panther
daring prawn
#

@opal plank i learned a way to copy css from other bots in top.gg

#

using inspect

opal plank
vivid fulcrum
#

i learned from watching my cousin steal other people's myspace designs

opal plank
#

kinda blew up

daring prawn