#development

1 messages · Page 1243 of 1

earnest phoenix
#

@glad charm triple match type

opal plank
#

yeah they both strings

#

should work

#

!= no type

#

!== type

uneven lagoon
#

wait, is that js?

glad charm
#

I'm blind and thought I saw a number, mb.

uneven lagoon
#

Wew.

earnest phoenix
#

@uneven lagoon JS

uneven lagoon
#

Ah.

glad charm
#

Imagine not using TS.

#

TS gang

earnest phoenix
#

If you dont want to worry about type

opal plank
#

offline is string[] ,and the d.user_id is also id

earnest phoenix
#

Ise TS

opal plank
#

it IS typescript

uneven lagoon
#

I was seeing these e_c shit and got confused.

earnest phoenix
#

@glad charm AYYYY

#

TS GANGGGGGG

glad charm
#

YOOOOOOOO

sonic lodge
#

try adding a return

opal plank
#

though because this is debugger its debugging in javascript

earnest phoenix
#

Sadly sharding manager dont support TS

#

So

#

I have to switxh back to JS

sonic lodge
slim heart
#

yeah u need a return

uneven lagoon
#

JS gang.

slim heart
#

{} doesnt auto return

glad charm
#

Why don't you use find instead of filter anyway?

earnest phoenix
opal plank
#

i want all valuesOTHER than that one

glad charm
#

I/m

#

so fucking stupid

#

ignore me

opal plank
#

lol all good

#

return huh?

uneven lagoon
#

What are you trying to achieve?

#

I'm fucking dumb.

slim heart
#

or remove the {} entirely

#

.filter(e_c => ....)

opal plank
#

aight

earnest phoenix
#

@glad charm qt dw we are stupid sometime

glad charm
#

Omg you're right you do need to return

#

Why are you using {} for that anyway

slim heart
#

dont judge the man pensiveaf

glad charm
#

Forgive me I'm a React/TS webdev

#

I'm just stupid voerall

opal plank
#

linter says nono

#

i might need a return

#

() => {}

#

arrow function

slim heart
#

can u paste the code

#

rq

earnest phoenix
#

@uneven lagoon @earnest phoenix learn real coding if you want to do voting stuff and webhook stuff

glad charm
#

You could just have it do e_c => e_c !== d.id

earnest phoenix
#

Because you need to make a webseever to recieve requests

uneven lagoon
#

@uneven lagoon @earnest phoenix learn real coding if you want to do voting stuff and webhook stuff
@earnest phoenix wait, real coding is a language?

opal plank
#

cant

glad charm
#

Unless your linter wants that styling

opal plank
#

try typing that in TS

earnest phoenix
#

bruh

glad charm
#

Then use a return.

#

@opal plank I have

earnest phoenix
#

@uneven lagoon by real coding

#

@uneven lagoon

uneven lagoon
#

Huh.

earnest phoenix
#

I mean language that isnt BDFD or domeshit

uneven lagoon
#

I mean language that isnt BDFD or domeshit
@earnest phoenix Oh I use js.

opal plank
#

oh nvm

earnest phoenix
#

js or py

opal plank
#

im retarded

earnest phoenix
#

Instead Java, TS, C++, C#

opal plank
#

i forgot to remove;

glad charm
#

@opal plank it is your turn to have the stupid

earnest phoenix
#

is py hard?

#

@earnest phoenix JS for simpifly, PY for hella lot of stuff u can do

uneven lagoon
#

is py hard?
@earnest phoenix Not really.

earnest phoenix
#

PY dont have bracket

uneven lagoon
#

But I find it easier to use JS.

earnest phoenix
#

So ye if you are bracket type, then fuck

uneven lagoon
#

me.

earnest phoenix
opal plank
#

aight lets try that

#

be back in 20 when it caches 1000 streams

slim heart
#

js is a language that can do pretty much everything rlly fast

#

py is more like a utility lang imo

#

using py for production is like using linux on ur pc; it works, but its kinda dumb, but like it works lmao

opal plank
#

same for js vs ts

#

js just runs

#

ts warns you about your dumbshit

slim heart
#

im proficient in js and py and js is much better for production applications

#

its packs simplicity into an also easily expandable package which can be used for super advanced shit

opal plank
#

good and bad

faint prism
#

using py for production is like using linux on ur pc; it works, but its kinda dumb, but like it works lmao
@slim heart I disagree with both of those opinions

opal plank
#

good as it provides tools for people

slim heart
#

good for you

earnest phoenix
#

i got python

opal plank
#

bad cuz it oversaturates the community with shitty poorly written packages and scripts

sonic lodge
#

is there any package manager for java

faint prism
#

yeah

opal plank
#

why write your own code when you can just yank pre-made packages that do shit for you for 0 effort?

#

its more copy paste than developing at this point

slim heart
#

thats the dumbest thing ive ever heard tbh

#

same shit happens to python

#

not a language thing

#

thats a developer thing

earnest phoenix
#

the only thing i know about js is
const Discord = require 'discord.js' and i think i got it wrong

sonic lodge
#

interesting

faint prism
#

is there any package manager for java
@sonic lodge Maven or gradle

opal plank
#

never said it was only bound to js

#

but its a thing i notice more often than ever

slim heart
#

thats just cuz js attracts simple users

#

but thats not to say its something that has to be simple

opal plank
#

people moment you look for a packacge that would take 5 minutes to write,you doing it wrong

slim heart
#

thats not a language criticism

opal plank
#

indeed

#

test

#

hmmm

faint prism
#

I'd miss the class structure if I used JS heavily

slim heart
#

to put it lightly i've never seen a good production level application built in python, and stay in python for its lifetime. simple as that lol

opal plank
#

discord hiccup?

faint prism
#

mhm

slim heart
#

I'd miss the class structure if I used JS heavily
@faint prism u can turn js into an oop

faint prism
#

with TS ik

slim heart
#

there's literally classes lol

#

no

#

js

#

literally has classes

#

my entire bot is oo

faint prism
#

there's literally classes lol
@slim heart Functions can be used to somewhat simulate classes, but it's not classes

slim heart
#

n0o

#

bruh

#

are u

#

u cant even fucking google shit before u criticize lmao

#

there's

#

literally classes in js

opal plank
#

eeey lets go

#

@slim heart ty

slim heart
faint prism
#

It's a prototype-based lang

slim heart
#

omf

#

educate urself hun

sonic lodge
#

classes are "syntactical sugar"

faint prism
slim heart
#

it's still literally classes

#

I'd miss the class structure if I used JS heavily
"structure" not backbone

#

the entirety of discord.js and most production level bots/apps use classes

#

dont act like u care what it actually turns into at run-time, its all abt syntax

steep shale
#

<html>
<head>
</head>
<a href="https://top.gg/bot/id_here" >
  <img src="https://top.gg/api/widget/id_here.svg" alt="Spark ++" />
</a>
<body>
  <style>
    *{
       color: lightgray !important;
    }
    body {
       background-image: url("https://i.imgur.com/nwV0SBe.jpg");
       color: gray !important;
        }
    span {
    color: white !important;
    }
    code {
    color: white !important;
    background: #420000c8 !important;
    }
    .btn-orange {
    background: #420000c8 !important;
    }
    .botpagebutton {
    color: white !important;
    background: #420000c8 !important;
    }
    .atag {
    color: white !important;
    background: #420000c8 !important;
    }
    .content {
    color: white !important;
    background: #420000c8 !important;
    }     
</style>
</body>
</html>``` to use the top.gg svg thing should it look like this
#

Where the <a href...is

opal plank
#

hopefully this should work now

#

its so annoying having to test this shit on production

lament meteor
#

yes

#

people who use the production stuff doesnt use it as intended so u never know what happens

uneven lagoon
#

Ah.

opal plank
#

i cant test it on my local rig, the traffic is just too big

lament meteor
#

oof

steep shale
#

Ping on reply

opal plank
#

it literally freezes my computer if i try loading 30% of total load

faint prism
#

dont act like u care what it actually turns into at run-time, its all abt syntax
@slim heart not gonna lie, I don't know JS at all.
I do care about runtime, but only for compiled languages.
From preliminary research, Mozilla docs seemed to suggest that classes were an afterthought that extend the prototyping-based inheritance.
But I agree with what your point about "all abt syntax". If it's the same functionally, then I'd be happy just to have classes accommodated by the language

opal plank
#

so im having to push shit to the production server and test it there without a debugger

#

which is super annoying

uneven lagoon
#

Wew.

lament meteor
#

bruh...

slim heart
#

it is and aftert-thought yeah, but functionality and looks wise its pretty much the same as any other oop

#

js can turn fully oop if you want it to be which is why i praise it so much, it can be so simple but it can also be very advanced

lament meteor
#

what are u running Erwin?

opal plank
#

basically 80% of twitch's global traffic

lament meteor
#

wew....

opal plank
#

theres no way a normal pc handles that

#

im stress testing cache

lament meteor
#

yea lol

#

u cant rlly stress test on local machine sadly

opal plank
#

indeed

#

i tried with a smaller amount

#

but that brought my rig to the brink

#

i think i tried 120 streams on my pc

#

cpu running 90-99% at all times

lament meteor
#

oof

steep shale
#

<html>
<head>
</head>
<a href="https://top.gg/bot/id_here" >
  <img src="https://top.gg/api/widget/id_here.svg" alt="Spark ++" />
</a>
<body>
  <style>
    *{....
          }
</style>
</body>
</html>``` to use the top.gg svg thing should it look like this

Where the `<a href...`is
slim heart
#

try it

opal plank
slim heart
#

there's also a snippet on the top.gg edit page

quartz kindle
#

if thats for your top.gg description, the whole thing is wrong already

opal plank
#

hi tim

faint prism
#

the man, the myth

quartz kindle
#

lol hi

steep shale
#

Bruh no it isnt

lament meteor
#

the stackoverflow

steep shale
#

how is that wrong bruh

#

It works perfectly fine

slim heart
#

if thats for your top.gg description

#

smh

steep shale
#

yeah no shit if the description is 140 charac only

slim heart
#

no need to get rude buddy

faint prism
#

@quartz kindle Will become my personal Astrologer?

slim heart
#

you're the one coming here for useless help chillax

quartz kindle
#

top.gg's description is injected into an existing page. therefore the code above will basically put <html> and <body> inside the top.gg's existing <html> and <body> and more

#

@faint prism sure, just subscribe to the highest tier on my patreon :3

faint prism
#

That's a cool website ngl

opal plank
lament meteor
opal plank
quartz kindle
#

yes

faint prism
#

Your API made it seem scientific

#

Or is it more tarot card reading stuff?

quartz kindle
#

it is scientific

faint prism
opal plank
#

petition to add blackholes into it

#

somewhere, somehow

quartz kindle
#

astrology and tarot are nothing alike

faint prism
#

astrology is constellations, yeah?

quartz kindle
#

tarot relies on the randomness of the card shuffle, astrology relies on accurate and predictable positions of planets

faint prism
#

but it's pseudoscience though, isn't it?

quartz kindle
#

so you could say tarot is random, astrology is not

faint prism
#

Your API made it seem like it was Astronomy-focused

lament meteor
#

planets are fake

opal plank
#

pluto is a hoax

faint prism
#

I don't mean to critique, you're awesome imo

quartz kindle
#

astrology and astronomy go hand in hand, they both use the same base

opal plank
#

actually, does pluto go into astrology?

quartz kindle
#

the only reason why astrology is pseudoscience is that there is no physical evidence of planets affecting us

#

yes it does

lament meteor
#

i mean it is the 8th and 9th planet

opal plank
faint prism
#

||What about planet x nibiru mmLol ||

quartz kindle
#

there are some imaginary/hypothetical planets in astrology, most people dont use them though lul

#

there are many planet Xs

lament meteor
#

very development

quartz kindle
#

basically if one comes up with a set of orbital elements to describe a planet's orbit, and writes a book about it, many people will try to use it in astrology, even if it doesnt actually exist, just to see if it has any meaning

faint prism
#

quick, apply it to comp sci ||before shiv goes #general ||

earnest phoenix
#

@faint prism tf

#

Twitch stat expose their api token?

faint prism
#

that one website does

#

lmao

#

It's literally in the html source

opal plank
#

'WHY NOT?'

uneven lagoon
quartz kindle
#

thats how everything starts

opal plank
#

if it wasnt illegal i'd connect to their client and go send a message on every single stream saying 'ignore me, im a bad dev at twitchtracker.come'

uneven lagoon
quartz kindle
#

"lets cut a stone into a circular shape and roll it around because why not"

faint prism
opal plank
#

or spam their api till twitch revokes their key

#

to answer such stupid question

#

'why not?'

#

@faint prism you should probably main them that

#
  • what i said about spamming the twitch api with their token /secret
#

which would lead to its revokation

thick gull
#

"why not?" => some hobbyist who doesnt really care

quartz kindle
#

discord file system

#

why? why not?

slim heart
#

well-

uneven lagoon
#

I dont even know anymore.

quartz kindle
#

lets make a discord-backed shared network drive

thick gull
#

D. fuck you too

earnest phoenix
#

Sure

faint prism
#

there you go

uneven lagoon
#

Oh wew.

opal plank
#

bunch of geniuses at tracker

faint prism
#

fr lmaooo

opal plank
#

ignore the shitstar, thats my personal starboard

faint prism
#

lol alright

quartz kindle
#

its not an uncommon practice tho

faint prism
#

To break TOS and publicly post a API secret?

quartz kindle
#

placing user credentials in the page source

#

are those not the user's own credentials?

opal plank
#

no

#

its their credentials

quartz kindle
#

lmao

#

this is why you never make api calls client side

opal plank
#

this is why i hate testing in production

#

350 stream in an hour

#

it takes so long to startup

faint prism
opal plank
#

y'know what'd be fun?

#

being the creator of something like Typescript and then attending a JS class/course so you can get a diploma

steep shale
opal plank
#

text-align:center?

steep shale
#

Idk where to put that

opal plank
#

css

steep shale
#

yeah Im using css

faint prism
#

So use that css

steep shale
#

ima just try it

#

Still didnt work

restive notch
#

where can i get all of the message.member.guild functions

#

for discord.js

faint prism
#

The docs

fast trench
#

ok so it makes sense that I'm getting this error with this code but I can't figure out how to get the username and stuff just by having the user's id...They aren't in any mutual servers with the bot so idk how to get the info...
codejs const member = args[0]; const memberUsername = member.username console.log(client.members.cache.find(m => m.id === member)); const blacklisted = await StateManager.connection.query(`SELECT * FROM blacklisted WHERE memberId = ${member}`); try { message.delete(); if (message.author.id === '473034033496850452') { if (blacklisted[0][0] === undefined) { message.channel.send(`Member has been blacklisted.`); await StateManager.connection.query(`INSERT INTO blacklisted (memberId, memberDiscriminator) VALUES ('${member}', '<@${member}>')`); } else { message.channel.send(`Member is already blacklisted.`); } } else { message.channel.send(`This command can only be used by the bot developer.`) } } catch (e) { console.log(e) }errorjs (node:54700) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'cache' of undefined

steep shale
#

can someone help

#

Tryna align all my text to make it centered, idk how to center it all though

restive notch
#

body { text-align: center; }

steep shale
#

and it didnt make a difference

restive notch
#

is that text wraped in <body>

steep shale
#

no

restive notch
#

do that

#

or else it wont work

steep shale
#

like that?

restive notch
#

it need to be your other stuff <body> <p> bllahs </p> <p> ect </p> </body>

steep shale
#

sorry I dont get it

restive notch
#

i think so

#

if it looks like this ```<html>
<head>
</head>
<a href="https://top.gg/bot/721397896704163965" >
<img src="https://top.gg/api/widget/721397896704163965.svg" alt="Spark ++" />
</a>
<body>
<style>
*{
color: lightgray !important;
}
body {
text-align: center;
background-image: url("https://i.imgur.com/nwV0SBe.jpg");
color: gray !important;
}
span {
color: white !important;
}
code {
color: white !important;
background: #420000c8 !important;
}
.btn-orange {
background: #420000c8 !important;
}
.botpagebutton {
color: white !important;
background: #420000c8 !important;
}
.atag {
color: white !important;
background: #420000c8 !important;
}
.content {
color: white !important;
background: #420000c8 !important;
}
</style>
<p> absdsdfsdfsdfasdas </p>
</body>
</html>

#

but where <p> absdsdfsdfsdfasdas </p> is your stuff

steep shale
#

whats “stuff”

restive notch
#

the "100+ commands" and all that stuff

earnest phoenix
#

Hi, I have a command that worked before and doesn't work anymore

const { MessageAttachment, MessageEmbed } = require("discord.js")
const canvacord = require("canvacord");
const db = require("quick.db")


module.exports = {
    name: 'rank',
    description: "rank command",
    run: async(bot, message, args) => {

        let user = message.mentions.users.first() ||
            message.guild.members.cache.get(args[0]) || message.author

        let level = message.bot.db.get(`level_${user.id}`) || 0
        level = level.toString()
        let exp = (bot.db.get(`xp_${user.id}`) || 1).toString()
        let neededXP = Math.floor(Math.pow(level / 0.1, 2)).toString()

        let every = bot.db
            .all()
            .filter(i => i.ID.startsWith("xp_"))
            .sort((a, b) => b.data - a.data)
        let rank = every.map(x => x.ID).indexOf(`xp_${user.id}`) + 1
        rank = rank.toString()

        const card = await canvacord.rank({
            username: user.username,
            discrim: user.discriminator,
            level: level,
            rank: rank,
            neededXP: neededXP.toString(),
            currentXP: exp.toString(),
            avatarURL: user.displayAvatarURL({ format: "jpg" }),
            background: 'https://images.pexels.com/photos/370799/pexels-photo-370799.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500',
            //background: await client.canvas.color("#07A2E7"),
            //color: 'White'

        })
        const attachment = new MessageAttachment(card, "rank.png")
        return message.channel.send(attachment)

    }
}

And i have this error which says TypeError: Cannot read property 'get' of undefined

restive notch
#

define your discord alone dont do the { MessageEmbed, Ect } = require('discord.js') do Discord = require('discord.js') then just do Discord.MessageEmbed or whatever

earnest phoenix
#

okay

#

Now i have this error

#

TypeError: Cannot read property 'db' of undefined

#

I just get rid of the require discord thingy

#

cuz i have it in index

restive notch
#

oh you cant

earnest phoenix
#

wdym

restive notch
#

can you define them sperately like const MessageEmbed = require("discord.js") and const MessageAttachment = require("discord.js")

indigo burrow
#

I wanna recode a v11 is not to v12 can someone help me please I don't know even a single thing about v11catCry

earnest phoenix
#

wait

#

I still have the same error

restive notch
#

idk anything about v11 @indigo burrow

#

@earnest phoenix hmm

thick gull
#

@indigo burrow don’t use v11!

indigo burrow
#

@restive notch can we just re write the code in v12

sudden geyser
thick gull
#

it will stop working in October

#

?

restive notch
#

ohh

thick gull
#

wait is he saying v12 > v11

restive notch
#

they want to make v11 to v12

indigo burrow
#

@thick gull ik that is why I am asking peeps to help me

thick gull
#

or v11 > v12

#

ah

#

nvm

#

use the djs

indigo burrow
#

And glitch isn't supporting v11 anymore

sudden geyser
#

Migration shouldn't take too long.

#

Can be a few minutes or an hour or two.

indigo burrow
#

Then help me reeeee

#

Or

sudden geyser
#

See the guide I linked above.

indigo burrow
#

Ty

#

@sudden geyser early supporter

sudden geyser
#

what

steep shale
earnest phoenix
#

Im getting the same error

thick gull
#

@earnest phoenix bot is undefined

restive notch
#

@steep shale yeah

thick gull
#

can’t read db of undefined

#

you have bot.db

indigo burrow
#

Anyone down to recode invitemanager?

sweet ruin
#

what language?

slate oyster
#

I tried to make my bot modular
Now, if I want to import, say, User, I have to select from 4 options in the auto-import screen

sweet ruin
#

@indigo burrow

what language?

indigo burrow
#

Js

#

Wait

#

It's in

#

Half js

#

And

#

Eren

restive notch
#

they want to code discordjs v11 to v12

slate oyster
sweet ruin
#

half eren?

indigo burrow
#

I have a bot in python to invitemanager bot

#

@sweet ruin yea

sweet ruin
#

never heard of that

steep shale
indigo burrow
#

Eris or eren the code in which dyno is coded

#

F

summer torrent
#

And glitch isn't supporting v11 anymore
@indigo burrow what Thonk

steep shale
#

it keeps auto moving <html> and everything to above the text

indigo burrow
#

@summer torrent yea dosent works for me

summer torrent
#

it is not related with glitch

earnest phoenix
#

Now i have this error TypeError: Cannot read property 'get' of undefined

restive notch
#

@steep shale yeah it should be like that

steep shale
#

apparently not

restive notch
#

hmm

#

odd

steep shale
#

if I try to copy paste that into my description it just moves the last 3 lines surrounded with the <> to above the text

indigo burrow
#

``Discord.RichEmbed()```
was removed right?

midnight blaze
#

yes, many years ago

sweet ruin
#

its Discord.MessageEmbed()

indigo burrow
#

Tf happened to me

earnest phoenix
#

I did this: MessageEmbed = require("discord.js")?

sweet ruin
#

makesure to do Const

indigo burrow
#

Imagine coding again after months

midnight blaze
#

@indigo burrow here, I didnt code for a while

indigo burrow
#

🎉 🎉 catCry catCry

#

🎉 🎉 catCry catCry

#

Tf

midnight blaze
#

I do not even know how to console log now

indigo burrow
#

I do not even know how to console log now
@midnight blaze I felt that

midnight blaze
#

yeah, feels bad

#

why must it?

#

and why for free

sweet ruin
#

basically

#

they want the coding badge

#

check my profile you will see

indigo burrow
#

Vo the autocorrect first

#

FUC**K THE AUTOCORRECT FOR FFS

#

FOR 3RD TIME

#

why must it?
@midnight blaze coz me noob

midnight blaze
#

@sweet ruin why should I check your profile?

#

I have also a badge lol

sweet ruin
#

idk i didnt bother looking or cared to look

#

it was just a referance

carmine summit
#

why do i feel like java is javascript but with different words

midnight blaze
#

java and javascript are very different lol

sweet ruin
#

^^^

carmine summit
earnest phoenix
#

can someone link me an actual good guide on javascript dates pls

sudden geyser
earnest phoenix
#

yeah ty

carmine summit
#
        let code = args.slice(0).join(" ")
        console.log(code)
        try {
            message.channel.send(eval(code))
        } catch (err) {
            console.log(err)
            message.channel.send(err);
        }
    }```
How to make work?
sudden geyser
#

What about it is broken

small zenith
#

whats wrong in it

#

args.join(" ") is shorter and better

sudden geyser
#

There could be a lot of improvements, such as converting the evaluated code to a string with util.inspect. The same with err since .send takes a string, but having the issue would be more helpful.

restive notch
#

how can i convert this command client.on("message", message => { if (message.content === "e!ping") { const embed = new MessageEmbed() .setTitle("Ping") .setColor(0xff0000) .setDescription(`My Latency is ${Math.round(client.ws.ping)}ms`); message.channel.send(embed); } }); into a command that can be used in a command handler command

sudden geyser
#

You store the commands in some type of collection so you can look it up by name (the name being the user input). If it's found, you run the command.

restive notch
#

thats the guid i used to make the command handler work

#

and i need to make an embed for the command handler

sudden geyser
#

Confused. Just make the embed in the run/execute function and send it then?

restive notch
#

ill try that

#

but i doubt it will work

sudden geyser
#

You never know until you try.

restive notch
#

can i define something in a command handler?

#

looks like it

sudden geyser
#

It's a function. Of course you can

restive notch
#

hmm it still leaves pong in the line but that might be glitch not refreshing although i think it refreshed

#

i had a terminal with the example on it and it was running thats why it said pong. but now it doesnt say anything

#

welp there goes another few hours on command handler

#

try again tomorro

#

because spagheti code is no good for bots with a lot of commands

earnest phoenix
#

-vps

#

!vps

fathom topaz
#

hey

boreal flume
#

What is a good permission to require for a warn command?

opal plank
#

huh?

#

warn command doesnt need any perms other than send messages

sudden geyser
#

manage messages, but what would be better is if someone in power could configure it via roles or users

opal plank
#

i mean

#

its a warn

sudden geyser
#

I think they mean what the user should have

opal plank
#

MANAGE_MESSAGES is my lowest perm

#

if you have the ability to delete messages you likely at least a mod

boreal flume
#

Ok

#

Thanks

#

Also, how do I obtain the fancy 'developer' role

sudden geyser
opal plank
#

?

#

oh

#

that

boreal flume
#

Well, my bot is sadly not close to being finished yet.... I only have 27/64 commands done...

opal plank
#

while i dont recommend submitting unfinished bots, remmebr that it usually takes 3-5 weeks to get approved

boreal flume
#

I know

#

I read all about it

#

I still have a good couple days at least until i finish my bot

opal plank
#

its awfully specific for you to say you have 64 commands though

sudden geyser
#

A few days to finish 37 commands?

boreal flume
#

I have them all planned out on a 'drawing board' of sorts

sudden geyser
#

Unless a second to you is a minute, I don't see how that'll happen.

opal plank
#

hmm i see

#

planned bot, i can praise that

boreal flume
#

A few days to finish 37 commands?
@sudden geyser It was an extreme exaggeration lol

#

Also, if I am going to release it to the public, it must be propperly planned

earnest phoenix
#

cough cough ctrl c ctrl v cough cough

boreal flume
#

NO!

opal plank
boreal flume
#

You must pour your heart and sole into everything you code

opal plank
#

a whitename who dislikes copy paste and enjoys coding!

#

we found em!

#

its no legend, they exist! im crying

boreal flume
#

Lol

earnest phoenix
#

Or he is actin

boreal flume
#

Nope, I only copy and paste when making kick and ban, because they are literally identical

opal plank
#

nothing wrong with that

#

my honest praise, properly planned bot and good dev practices

boreal flume
#

Anyway, not only do I have to make all of these commands, but I have to go through the long process of adding each one and a description to the config.json file

opal plank
#

what for?

boreal flume
#

Because I don't know how to use command handlers

opal plank
#

use the guide

#

trust me

#

you WANT command handlers

boreal flume
#
"commands": {
        "help": "**help {command/module}** Display the help embed",
        "ping": "**ping** Show the bot latency",
        "bot": "**bot** Show info on the bot",
        "user": "**user {user/userID}** Show stats on a user",
        "server": "**server** Show info on the guild",
        "uptime": "**uptime** Show the time since the last update(ms)",
        "invite": "**invite** Displays the bot invite link and the invite to the official discord server",
        "role": "**role <role/roleID>** Show info on a role",
        "set-reminder": "**reminder <time> <content>** Set yourself a reminder",
        "suggest": "**suggest <suggestion>** Make a suggestion on the bot(only available in the official server)",
        "support": "**support** Show the link to become a patreon to the bot team",

        "color": "**color {color}** Set or view the color used for all server embeds\n**REQUIRES `MANAGE_SERVER` PERMISSION**",
        "kick": "**kick <member> {reason}** Kick a member from the guild\n**REQUIRES `KICK_MEMBERS` PERMISSION**",
        "ban": "**ban <member> {reason}** Ban a member from the guild\n**REQUIRES `BAN_MEMBERS` PERMISSION**",
        "mute": "**mute <member> {reason}** Mute a member in the guild\n**REQUIRES `MANAGE_ROLES` PERMISSION**",
        "warn": "**warn <member> {reason}** Warn a member of the guild\n**REQUIRES `MANAGE_MESSAGES` PERMISSION**"
    },
opal plank
#

its like refusing to use VSC cuz you dont know how to use it,and then use notepad instead to code

boreal flume
#

My JSON file^^

#

I use VS Code

opal plank
earnest phoenix
#

Wouldnt it be better to just put the description into the export

opal plank
#

take a look at this

#

indeed, but they mentioned they dont know how to do a command handler

boreal flume
#

I don't use exports

opal plank
#

start doing it

#

trust me

#

its an unevaluable tool

boreal flume
#

How I do commands:

//PING
    if(cmd === 'ping'){
        message.channel.send('Pinging...').then(mess => {
            let ping = mess.createdAt - Date.now();
            let embed = new MessageEmbed()
            .setTitle(`${ping}ms is the bot latency`)
            .setColor(color)
            mess.edit('Done!', embed)
            mess.react('🏓');
        })
    }
//BOT
    if(cmd === 'bot'){
        let u = message.guild.members.cache.get(bot.user.id)
        let embed = new MessageEmbed()
        .setTitle(`${bot.user.tag}`)
        .setThumbnail(bot.user.avatarURL())
        .setColor(config.defaults.color)
        .setDescription(`
            **ID:** ${bot.user.id}
            **Invite Link:** ${config.invite}
            **Highest Role:** ${u.roles.cache.first()}
            **Creation Date:** ${new Date(u.user.createdAt).toUTCString()}
            **Server Join:** ${new Date(u.joinedAt).toUTCString()}
        `)

        message.channel.send(embed);
    }
opal plank
#

no

#

bad

earnest phoenix
#

No

#

Bad

#

Bad

opal plank
boreal flume
#

lol

earnest phoenix
#

Atleast if you do that use switch

opal plank
#

use command handler

earnest phoenix
#

Or make a proper command gandler

opal plank
#

for your own sake

earnest phoenix
#

Gandler

#

Jandler

#

Yandler

#

Handlrr

#

Handler

boreal flume
#

Its not like index.js is already 866 lines of code or anything 👀

opal plank
#

should i call an ambulance?

#

go fix

#

i dont wanna see index's with more than 250 lines

boreal flume
#

But then I have to rewrite the commands I have

opal plank
#

not at all

#

the code runs the same,you just providing what it needs dynamically

#

imagine modules as big json's

#

they are objects

boreal flume
#

Hmmmm.... I think I will start command handlers next project

opal plank
#

trust me

#

start now

#

to put it very shitty

#
module.exports = {
name:,
description,
function(parameters here  that your code needs like Discord) {
// your code here
}

}```
#

thats it

thick gull
#

that’s not as long as one of the ones I’ve seen

#

500 lines of just var

opal plank
#

on //your code here thats where you put it.Like, not joking, its the same code you've been doing so far

#

you'll just copy paste it

earnest phoenix
#

/*

*/

opal plank
#

you're simply objectifying your code per command

boreal flume
#

How would I pass in discord if I don't use discord

#

or rather, not pure discord

opal plank
#

you dont pass it then, or pass and ignore it

boreal flume
#
const {
    Client,
    MessageEmbed,
    WebhookClient,
} = require('discord.js');
opal plank
#

bad

boreal flume
#

That is my discord

#

The only three I use

opal plank
#

do const Discord= require('discord-js');
Discord.Client
Discord.MessageEmbed
Discord.Webhook.... etc...

boreal flume
#

BUT

opal plank
#

you know what {} means right/

#

you're accessing the property of the exported object

boreal flume
#

Then I have to go through and change every instance of MessageEmbed to discord.MessageEmbed

opal plank
#

those all exist within discord-js

#

Oh noooo

boreal flume
#

I use the set because it is easier lol

opal plank
#

ctrl +f / replace MessageEmbed with Discord.MessageEmbed

sudden geyser
#

Why use Discord.x over const { x } = require("discord.js")

boreal flume
#

exactly

opal plank
#

everytime you require something newyou'll have to require it

#

also for practicallity

boreal flume
#

I don't need anything new tho

sudden geyser
#

You'll just have to add one additon/line to it.

opal plank
#

its better to just send over Discord over as parameter or require it right away

sudden geyser
#

It's very small and more bound by the programmer's prefernce.

opal plank
#

then stay with a chain of if as your commands

boreal flume
#

Also, what is the point of command handlers?

sudden geyser
#

Like how I could say I don't have to keep the Discord top variable since I don't use it afterall

boreal flume
#

They don't make it easier

opal plank
#

dynamically adding commands without having to restart the bot?

#

being able to re-require chache?

#

organization?

#

good practice?

#

modularity?

#

idk, i can think of nothing tbh

boreal flume
#

Alright

#

Though, none of that is important

opal plank
#

~~that was massive sarcasm if it didnt go thru ~~

#

having to restart your bot every addition is

#

fidelity with uptime

#

you'll lose everything you have on memory stored when you restart it

#

intervals,loops,cronjobs

boreal flume
#

I dont store on memory

opal plank
#

its bad to be restarting your bot on every addition/error

boreal flume
#

And I dont use intervals

opal plank
#

look dude, your bot, not mine, im giving you advice on good pratices, you can choose to ignore if you so wish

boreal flume
#

What bot's have you made?

sudden geyser
#

Command handlers are great to use if you have many commands.

opal plank
#

@earnest phoenix

boreal flume
#

Leviathan.... what does it do?

opal plank
#

plenty of things

#

including cross platform pipelines

boreal flume
#

How do you make a bot dashboard?

lament meteor
#

@opal plank why...

opal plank
#

by coding it in html

boreal flume
#

I know that

opal plank
#

cuz being able to talk in your stream chat/discord in one place is handy,specially with people without multiplemonitors?

#

also cross currency between platforms?

#

minigames carry their value over twitch/discord/youtube

#

no matter where you go

lament meteor
#

thats cool

boreal flume
#

What coding language?

opal plank
#

Typescript

boreal flume
#

What is typescript?

sudden geyser
#

javascript but safer

opal plank
#

javascript wbut ++++++

#

its strong typed

#

meaning you have to declare your variables types

boreal flume
#

How safer?

#

So it's like a combination of java and javascript?

opal plank
#

let count = args[0] * 100

#

shit like this would be caught on TS

#

Js just runs it,even though string cant be multiplied by number

#

thats a bug right there that JS doesnt catch

boreal flume
#

String can be multiplied in python though...

opal plank
#

JS runs it

#

but its a bug nonetheless

lament meteor
#

its type guarding

opal plank
#

also tooling

#

Ts tooling and intellisense

lament meteor
#

it isnt a bug lol... its a feature but its buggy as fuck

earnest phoenix
#

Imagine maging a command to mutiply stucf send output

#

Expection 1000
Reality 10101010101010101010101010x1000

thick gull
#

w_goosewalk i heard typescript

lament meteor
#

tbf erwin... i hate how people meme js cuz 1 + "1" = 11 or smthn

#

like... why are u adding a string to a number? there isnt any real usecase of that

opal plank
#

typescript is an unvaluable tool in my book

boreal flume
#

lol

opal plank
#

just like vsc

#

its another tool ontop to prevent oopsies

#

but its quite a bit more of work

lament meteor
#

vsc is kinda thicc ngl

#

i need a supercomputer to run it

opal plank
#

as the name suggest,TYPE script,expect to be typing a lot

boreal flume
#

tbf erwin... i hate how people meme js cuz 1 + "1" = 11 or smthn
@lament meteor 1 + "1" = "11"

opal plank
#

i mean true + true = 2

#

false+ false = 0

#

stored binary is fun

boreal flume
#

Why does false = 0 tho... dont you think it should equal -1?

opal plank
#

0 is false

#

1 is true

boreal flume
#

I know

opal plank
#

its due to how its stored

thick gull
#

binary

opal plank
#

0 + 0 = false + false

thick gull
boreal flume
#

!0 = true, and !true = false

lament meteor
#

!0 is 1 if u consider factorials

finite kite
#

does anyone know a course on how to code a bot from scratch so im a beginner i know nothing about coding

boreal flume
#

But in js it's just true

lament meteor
#

but if it is just considering not then yea

opal plank
#

0, empty string, null,undefined all return falsy

#

empty array

#

what else/

#

there are more things that return falsey

earnest phoenix
#

Hello i want to ask if i submit a verify request now i wont get a badge right?

opal plank
#

i forgot what though

boreal flume
#

parseInt(false) = NaN

thick gull
#

o

opal plank
#

NaN returns falsey too iirc

thick gull
#

yeah I forgot about the FAQ

lament meteor
#

my love towards erwin returns false ngl

twilit rapids
#

Let them choose their own coding language smh

thick gull
#

no smh

#

we need more js devs

boreal flume
#

But if false is 0 dont you think it should return 0 if you want the integer value?

thick gull
opal plank
earnest phoenix
#

Hello i want to ask if i submit a verify request now i wont get a badge right?

lament meteor
#

nope

twilit rapids
#

You mean more kids flexing their copied evals

opal plank
#

sad

lament meteor
#

dont badge huntin...

thick gull
#

Nah hes trying to flex

boreal flume
#

You mean more kids flexing their copied evals
@twilit rapids wdym copied evals?

thick gull
#

when you copy someone else’s code

opal plank
thick gull
#

like

boreal flume
#

Ohhh

opal plank
#

copied evals has to be some of the most copied shit in discord

earnest phoenix
#

i submit my verify request the day before the badge is gone lol

boreal flume
#

Makes sense lol

thick gull
earnest phoenix
#

and i got my badge
today

lament meteor
#

copied ping cmd KEKW

earnest phoenix
#

@thick gull no

#

Bad

thick gull
#

i m joking

boreal flume
#

A ping commands isn't hard to make

opal plank
#

indeed its quite simple

boreal flume
#

even though my first ping command gave me a negative number lol

opal plank
#

here

earnest phoenix
#

my friend said she want a badge lol

thick gull
#

education purposes only @earnest phoenix

lament meteor
#

go to discord's door and ask them for it

earnest phoenix
#

ahh

#

😂

thick gull
#

make your own chat app

#

Free badges

lament meteor
#

tbf erwin how optimized is ur bot?

opal plank
#

quite a bit

#

specially cuz im webscaling it

#

so every small thing that i can optimize im doing

#

i need to handle traffic from discord twitch and youtube altogether

lament meteor
#

i have a suggestion

opal plank
#

shit code will clog in no time

lament meteor
#

dont use js KEKW

opal plank
#

js good and quick

#

i like it

lament meteor
#

i mean true

#

but it isnt the best at scaling

opal plank
#

thats within 4h uptime

#

175 bil tuples

lament meteor
#

wut is tuples?

opal plank
#

to put it very bluntly, an array

lament meteor
#

whats the diff?

opal plank
#

tuples are ordered

#

arrays is just a type

lament meteor
#

i see...

#

so a more classy array

opal plank
#

yeah

#

typescript can accomplish that too

#

let array:[string, number, string] = ['a', 2, 'b'];

#

let array:['a' | 'b', number, string] = ['a', 2, 'b'];

lament meteor
#

hmm

#

wut do u mean by ordered btw?

#

like [3, 1, 2] -> [1, 2, 3]

opal plank
#

not necessariy

#

tuples are usually used with indexes

#

if you want them to be ordered like 3,2,1 you can

lament meteor
#

o

opal plank
#

or 3,1,2

lament meteor
#

i see

#

quite interesting

opal plank
#

enum would be a good example on it

#

order is important

#

its a row basically

lament meteor
#

hmm might look into it in the future but gonna keep that in mind

opal plank
#

imagine a table

lament meteor
#

i see

#

o wait

#

ok ok

#

sql memes

opal plank
#

|name|adress |city |
erwin | somewhere | san diego
telk | usa | san domingos

#

those 2 rows are tuples

lament meteor
#

o

#

so like a schema

opal plank
#

they retain the order name => adress => city on each row

lament meteor
#

for arrays

opal plank
#

yeah

lament meteor
#

ok cool

#

ty

opal plank
#

bye bye 100mil cached messages

lament meteor
#

i dont see

twilit rapids
#

Why would you cache 100m messages

opal plank
#

stress testing

twilit rapids
#

How many servers is the bot in

opal plank
#

currently or all/

#

?

twilit rapids
#

wdym all

opal plank
#

well there are the ones that are on rn and the ones that are off

twilit rapids
#

All I guess

vague wigeon
opal plank
twilit rapids
#

You said it was in Discord as well no? How many Discord servers is it in

opal plank
#

lemme pull metrics rq

#

59

twilit rapids
#

I see

royal laurel
#

hey so im trying to make a bot that whenever i type the command ^makecache (pinged user) it will first check if there is a pinged member, then make a role and assign it to the pinged member then send a MessageEmbed() when its finished saying its done but its not getting past the point where its checking for a pinged user even tho im pinging my test account

#
client.on('message', msg => {
if(msg.author.id === '388931035607597057')
{
    if(msg.content.startsWith(`${prefix}makecache`))
    {
        console.log(msg.mentions)
        const member = msg.mentions.members.first()
        if(!member) return msg.channel.send("No member specified")
        else{
            const cacheRole = msg.guild.roles.create({
                data: {
                    name: 'CacheRole',
                    color: '#ff0000',
                },
            })
            .catch(console.error)
            if(!member.roles.cache.get(cacheRole))
            {
                member.roles.add(cacheRole)
            }
            const embedSuccess = new Discord.MessageEmbed()
            //Set the title of the Embed
            .setTitle("Cache created!")
            //Set the color of the Embed
            .setColor("#ff0000")
            //Set the description of the Embed
            .setDescription(`Sunglasses successfully made a meme cache for ${member.user.username}`)
    
            msg.channel.send(embedSuccess)
        }
        


    }
}
else{

}```
#

but its giving me the error

#
Launched!
MessageMentions {
  everyone: false,
  users: Collection [Map] {},
  roles: Collection [Map] {},
  _members: null,
  _channels: null,
  crosspostedChannels: Collection [Map] {} }
#

im not sure why its doing that tho

#

it just says in the channel "No member specified"

opal plank
#

your members is null

royal laurel
#

would it maybe be my alt has no roles or anything

#

?

opal plank
#

idk why the heck you creating a role before even checking

royal laurel
#

its going to be creating private channels for each role and it'll give tat channel access only,

opal plank
#

you creating a role everytime someone uses that command

royal laurel
#

ik

#

thats the point

opal plank
#

why tho?

#

once you run that command once you already have that role avaliable

royal laurel
#

each user will get a private channel

opal plank
#

just need to assign

royal laurel
#

ik

#

thats what i did

opal plank
#

no

#

you creating a new role

#

everytime you use command

royal laurel
#

then assigning it

opal plank
#

you do know there are limits right?

royal laurel
#

there are?

opal plank
#

yes

#

rate limits and guild limits

twilit rapids
#

250 roles per guild iirc

#

or 500

royal laurel
#

didnt know that, also cant i just assign the user to then channel then?

opal plank
royal laurel
#

k

#

as i said cant i just add the user instead of a role

opal plank
#

instead of doing that

#

why not simply doing a channel override?

royal laurel
#

yeah

#

channel override?

opal plank
#

allow that user to access channel rather than that messy role thing you going for

royal laurel
#

theres going to be multiple channels

opal plank
#

you can assign permissions specifically for a user in that channel

royal laurel
#

ok

opal plank
#

rather than needing a role

royal laurel
#

so i could just remove most of those lines and change it with creatinga channel and assigning perms to the user?

opal plank
#

either that or once the channel is not needed anymore, repurpose it

royal laurel
#

mkay

earnest phoenix
#

My bot co-owner made an awesome AF command handler and i understand nothing of it mmLol

pure lion
#

@earnest phoenix want to be teach'd?

earnest phoenix
#

uhh no

#

i'll feegur it aut on mai oun

valid frigate
#

hey so im trying to call a database query (mongodb) in rust using the mongodb driver and i get this incredibly confusing error: error[E0277]: the trait bound std::option::Option<mongodb::options::FindOneAndUpdateOptions>: std::convert::From<mongodb::options::TypedBuilder_BuilderFor_FindOneAndUpdateOptions<(), (), (), (), (std::option::Option<mongodb::options::ReturnDocument>,), (), (std::option::Option<bool>,), (), (), ()>> s not satisfied

and it says the error occurs in the following line (image attached)

#

he problem is that im using an extremely basic query but it gives an unhelpful error, ive referenced the doc for e0277 but it doesn't make sense in this context

#

also this hasnt happened to be before ever so im curious if anyone else running the mongo driver has the same issue

earnest phoenix
#

yo

#

guyz

misty sigil
earnest phoenix
#

@misty sigil when you become verified?

misty sigil
#

when I became verified

earnest phoenix
#

yep

misty sigil
#

like 4 days ago or something

earnest phoenix
#

oh

#

and what is your bot name?

#

-bots @misty sigil

gilded plankBOT
misty sigil
#

damn that was f a s t

earnest phoenix
#

-bots @earnest phoenix

gilded plankBOT
misty sigil
earnest phoenix
#

k

carmine summit
#

I just realized something stupid

#

message.content.args[0]
is not a thing

earnest phoenix
#

lol

#

args is not a discord.js function

carmine summit
#

well...

#

i just thought. "Hey, its source is a message. Why not include message.content"

earnest phoenix
#

a property*

opal plank
#

thats not a bad idea actually

#

i might extend the interface to allow that

earnest phoenix
#

content is a string though

#

thonk

carmine summit
#


elem.textContent = elem.textContent.split('').map((v) =>
  Math.round(Math.random()) ? v.toUpperCase() : v.toLowerCase()
).join('');```
uhh
#

this not working?

#

uh

#

i got it to wrk

#

but i dont know why it says that discord cannot send it

earnest phoenix
#

what's the point of that split

carmine summit
#
async function random(elem) {
var eh = elem.split('').map((v) => Math.round(Math.random()) ? v.toUpperCase() : v.toLowerCase()).join('');
console.log(eh)
return eh
}

if (command == 'test'){
      message.channel.send(random(message.content))
    }
earnest phoenix
#

what in the literal fuck are you doing

carmine summit
#

uh

pale vessel
#

sOmEthIng lIke thIs

earnest phoenix
#

oh mock command

pale vessel
#

exactly

earnest phoenix
#

you're sending a promise

#

because you made your function async for whatever reason

carmine summit
#

i dont even know what a promise is

pale vessel
#

try removing async from the function

#

it doesn't even need to be async

carmine summit
#

thanks

#

but why

earnest phoenix
#

why make it async in the first place

pale vessel
#

if you make a function async, it returns a promise so you need to resolve it but you don't need it

carmine summit
#

how do i resolve it

pale vessel
#

dude

#

remove async

carmine summit
#

im just gon learn

#

i removed it

#

i need to learn bruh

pale vessel
#

you don't need it, you're not using any promise inside the function

carmine summit
#

but what if there is a case that i actually need it

pale vessel
#

then you need to use await

#

or .then()

carmine summit
#

i know that.. but what do you mean by

you need to resolve

pale vessel
#

that's exactly what it means

carmine summit
#

oh

#

ok thanks again

earnest phoenix
#

if you want to learn about promises and asynchronous programming

earnest phoenix
#

@pale vessel how you doin'

#

canvas is a bit slow tbh

pale vessel
#

use sharp then

cinder patio
#

Image manipulation is slow in general

earnest phoenix
#

not if you do it properly mmLol

#

node isn't the best if you're targeting speed in general

#

yeah

#

smh my gay command which literally just adds a transparent image on top the user avatar is WAY SLOWER than my profile command which has a hell lot of things going on

#

take a lower res avatar

#

x128 or x256

pale vessel
#

i use x512 and it's pretty fast

earnest phoenix
#

ewwwwww

#

i use 1024

#

lemme go use 512

placid iron
#

512 is large enough tbh

pale vessel
#

it's in the middle for me

#

not too small, not too big

earnest phoenix
#

kool

placid iron
#

Oop, I meant to put enough

pale vessel
#

xD

earnest phoenix
#

im reading asynchronous shit on MDN

earnest phoenix
#

@pale vessel is it a good idea to make a profile command with > 35 lines of code

#

can you change font? @earnest phoenix

#

why

#

oh nvm I think you are writing onto an image

#

comic sans is cool
HAIL COMIC SANS THE MOST HATED FONT

#

oh nvm I think you are writing onto an image
@earnest phoenix yes i am

#

I hate cursive

#

there is a background

#

everything is drawn on top of it

#

oh alright

#

one second imma change font

#

looks great

#

@earnest phoenix the license is not suitable for a botum

#

it literally has no license

#

I'd only use this for titles, it looks too cramped to me

#

ok

#

I'll use the Impact one for the username and comic sans for the user info

#

gtg

slender thistle
#

What would an optimal image manipulation package be for C#?

earnest phoenix
slender thistle
#

Any significant cons in either for a beginner?

earnest phoenix
#

they're both well documented and have simple apis

#

so not really

slender thistle
#

Splendid, thanks

weak rain
#

how can i make a command in which the bot will edit the embed message

earnest phoenix
#

that's like asking "how to make a car that goes vroom 200km/h"

#

provide context with your question

#

what else he can say

#

it's simple

#

library, language, what is your goal (and what have you tried so far)

#

ok what's the lib @weak rain

weak rain
#

i m using js

earnest phoenix
#

I dunno about discord.js

weak rain
#

hm ohk

earnest phoenix
#

discordjs

fathom topaz
#

someone

#

adcs

earnest phoenix
#

@earnest phoenix Less Lines !== Better
More Lines !== Better

delicate shore
#

Just a quick question

#

Can't access docs rn

slender thistle
#

for webhooks, it's vote.user to get the ID