#development

1 messages · Page 1089 of 1

solemn latch
#

^ as segregated as you want

opal plank
#

why would you go back to commands that dont error/dont need ot be worked on?

quaint hound
#

it's not that fact that in most cases exporting modules would have more advantages that bothers me

opal plank
#

theyy DO have advantages

#

i told you some

#

you can delete their cache and re-require

#

you cant do that with everythin on one index

quaint hound
#

its the fact that any advantages one file has that i prefer having are dismissed as wrong

opal plank
#

gotta restart bot for every change

#

its so shit way to doing things

solemn latch
#

if its a bot you program once, forget about, drop it, never come back to it.
i dont really see an issue.

quaint hound
#

ofc they have a lot of advantages

opal plank
#

then WHY NOT USE IT?

quaint hound
#

because those aren't advantages that I want or need right now compared to the loss of natural ease of use for me

opal plank
#

you're exchanging functionallity and performance for stubbornness

quaint hound
#

if I don't use any of that functionality, it might as well not be there

earnest phoenix
#

reee

quaint hound
#

by dont use i mean the code doesn't require it, not dont use because I dont feel like it

opal plank
#

stubborn's the word you looking for

torn ravine
#

restart for every change = discord resets your token for logging in too much

sudden geyser
#

good luck doing that 1000 times

opal plank
#

you're simply refusing to change to a better way due to laziness

quaint hound
#

that would matter if I was making a lot of changes

opal plank
#

ANY lines that you change you need to restart your bot

torn ravine
#

what’s he doing?

quaint hound
#

It's not better if none of the advantages end up mattering

opal plank
#

he refuses to put his commands outside of his index, man's got a 1800 line index@torn ravine

#

cuz he stubborn

quaint hound
#

I might make changes in the future idk

#

cause I have nothing to gain from it right now

solemn latch
#

changes are easier to do now

opal plank
#

you do

#

a LOT actually

torn ravine
#

why not split it into separate files. and reload so you don’t have to restart your bot

opal plank
#

or make it easier for debugging?

solemn latch
#

understanding exports really well takes like an hour to do

opal plank
#

stack trace is a miracle

sudden geyser
#

or for organization in general

solemn latch
#

by this afternoon you could have it done.

quaint hound
#

you're correct it would be hard to switch

opal plank
#

by the time we started agruing he would've learned it

solemn latch
#

im saying easy

#

lol

quaint hound
#

like I said I might switch at some point, definitely will when sharding comes along

opal plank
#

if he spent said time just looking at module exports throughout this whole chat he'd have it learned and already started working on it

quaint hound
#

I know 90% of how module exports work

solemn latch
#

exports are a week one concept of js

opal plank
#

if you already know , its even worse

#

you could've ported it already

quaint hound
#

If I don't prefer them because of personal preference, then it's my "loss"

opal plank
#

if you refused to change cuz you didnt know, i'd give a bit of credit for being afraid of trying new things

#

but you already know it, and still dont do it

quaint hound
#

i have a reason, that reason is just completely invalid to you

solemn latch
#

its completely invalid to anyone

opal plank
#

'in general'

#

^^

quaint hound
#

its completely invalid to anyone but me

opal plank
#

its the other way aroundt

quaint hound
#

thats how preference works

opal plank
#

the reason is only valid to you

quaint hound
#

yeah agreed

#

but that fact doesnt change that I think its easier to maintain one file without exports and find it more enjoyable to code

solemn latch
#

self taught developers have to learn to work well with standardization

#

by rejecting standardization your only making work harder on yourself

quaint hound
#

I would totally standardize if this had to stand up to any standard whatsoever

#

I have no issue with using standards when I have to

solemn latch
#

but thats not how learning works 🤔

opal plank
#

if you are already rejecting standards cuz 'you dont like it', i cant imagine you fitting when you need to, at all

solemn latch
#

every project is learning, even personal projects.

quaint hound
#

I'm not completely rejecting them

solemn latch
#

no, your just learning both

quaint hound
#

I recognize that they have many advantages, but also some disadvantages

solemn latch
#

wasting your time when you do have to standardize

opal plank
#

there arent disadvantages

#

you simply dont want to

quaint hound
#

Personal preference matters to the person who's preference it is

solemn latch
#

you already admit youll do it in the future

#

when theres more commands and code to do it to

opal plank
#

i can already imagine in a week or 2 his index growing to 3-4k lines

quaint hound
#

since thats the only person who's preference matters in my project, that's the one I'm going with, despite losing some advantages

opal plank
#

gonna be spending 5 minutes scrolling down

#

even collapsed

quaint hound
#

nah lmao if anything itll get shorter with optimization

earnest phoenix
#
message.author.roles.cache.has(role.id)
#

why cache of undefiened

quaint hound
#

the bot is completely done and functional at this point

solemn latch
#

author doesnt have roles

sudden geyser
#

.roles is not a property of a User instance

quaint hound
#

i'm not still working on it

earnest phoenix
#

so how i can fix it

#

@earnest phoenix not author

#

member

quaint hound
#

message.member instead

sudden geyser
#

use member instead

earnest phoenix
#

:0

opal plank
#

oh shit its working

#

fuck yeah, took a while to load but i got it

solemn latch
opal plank
#

self highfive

jagged crater
#

const commandFiles = fs.readdirSync('./commands/').filter(file => file.endsWith())```
Anyone know what I need to press to open this like I thought it would auto open but i am not sure
solemn latch
#

i dont understand the question

opal plank
solemn latch
#

o wth

opal plank
#

connected to discord and twitch IRC

#

cross platform chat lmao

solemn latch
#

with a user?

opal plank
#

wdym?:

jagged crater
#

okay so I am trying to open my commands into a separate folder but i am not sure if theres something i need to press to open it or if i coded something wrong.

solemn latch
#

does the bot login to irc as the user?

opal plank
#

nah, anything said in the channel goes over to twitch, and anything said on twitch goes to that channel on discord

#

yeah

#

its a bot

#

has to log as user

solemn latch
#

ive not worked with irc in so long

opal plank
#

twitch doesnt have a bot/user difference

#

twitch IRC is so shit

#

youtubes is a bit more complicated but equally as shit for streaming

solemn latch
#

twitch uses irc?

#

not twitch

opal plank
#

yup

solemn latch
#

youtube

opal plank
#

no

#

youtube isnt IRC

#

which is problematic af

opal plank
#

google apis + manual fetch requests

#

yeah

#

that

solemn latch
#

oh yeah, youtube looks like a pain

opal plank
#

it is

desert ice
#

Hi
So how do I define a embed?

opal plank
#

you gotta auth and do a fuck ton of more stupid stuff

#

const = embed

#

?

desert ice
#

but look

opal plank
#

though i doubt thats what you wanted

solemn latch
#

defining embeds depends on your language/lib

opal plank
#

assume everyone is d.js unless told otherwise lul

solemn latch
#

lool

opal plank
#

im looking

desert ice
solemn latch
#

looks like what you put in your embed is undefined

#

not the embed

opal plank
#

those are fields

desert ice
#

so how am I supposed to define

opal plank
#

define them

#

its name: and value: keys

#

you are only defining name:

#

define both

desert ice
#

can I have an example?

opal plank
#

sec

desert ice
#

Oh ok

opal plank
#

i was gonna get the docs

desert ice
#

ok

opal plank
desert ice
#

ok thanks

jagged crater
#

Okay so I am trying to convert my commands over to a command folder, but someone told me to type this for it to work "const commandFiles = fs.readdirSync('./commands/').filter(file => file.endsWith())" then I was told to open it but i am not sure how to do so

#

i am not sure if that makes any sense

tight plinth
#

spoonfeed bad

keen gull
#

command handler? ^

solemn latch
#

open it, as in execute it?

short ember
#

Hi guys

jagged crater
#

yes

short ember
#

So some one can help me?

jagged crater
#

execute it but i am not sure how to do so

keen gull
#

this channel is for asking questions, go for it

short ember
#

Tanks

keen gull
#

@jagged crater a command handler?

solemn latch
#

youd want to get one command from commandFiles
and then run the function(whatever you named it) from that command.

command.exectute()
would run the function execute of command

short ember
#

So I wana register my Server on Discord website

jagged crater
#

hmm okay i will try thanks

short ember
#

But i dont now how to do this

keen gull
#

register your server as in like verifying or?

solemn latch
#

I never have submitted a server, im not sure

short ember
#

@keen gull Just to show my server

keen gull
#

oh

short ember
feral aspen
#

Hey guys

keen gull
#

I never really added a server, so I'm not sure about that, but what does it say once you click it?

short ember
#

I need to invite the boot tô my Server?

feral aspen
#

It coming below it

short ember
#

@keen gull right

feral aspen
#

how can I make it next to it?

#

any help?

solemn latch
#

pretty sure, yes @short ember

short ember
#

Tanks

feral aspen
#

?

solemn latch
#

whats below what

keen gull
#

how can I make it next to it?
@feral aspen make what next to it? the Invite our bot thing?

short ember
#

@feral aspen sorry mas but I realy dont now

feral aspen
#

Yes @keen gull

#

I dont want it below it

#

I want it next to it

#

And I have two .addfields

solemn latch
#

inline needs to be true

#

in your fields

feral aspen
#

Oh.

#

I forgot about that.

keen gull
feral aspen
#

true on the first online only right>

#

?

#

or both

solemn latch
#

both need to be inline

feral aspen
#

Hm. okay!

#

Thanks

#

Sorry

#

Another question..

#

Oof me.

#

I have a picture that I want to upload to my !help command, and when someone performs this command, it will show the picture in the .addimage

#

how can I upload the image from my desktop?

keen gull
#

read this and let me know if you still have a question

#

@feral aspen

restive furnace
#

yes

solemn latch
#

does djs not send activity updates if its the same thing its already set to?

misty sigil
#

how do i fill entire background black in canvas

solemn latch
#

updating every 60 seconds when you might have no changes seems useless

#
        ctx.fillStyle = "#477148";
        ctx.fillRect(0, 0, canvas.width, canvas.height);
#

that color is green

#

not black

#

but you get the idea

earnest phoenix
#

How can i list every object stored in a mongo db collection?

lusty quest
#

so you want to retrive every Document at once?

earnest phoenix
#

Yea

#

Every document of that collection

lusty quest
#

i think if you use find() and add some filtering to it should work. never needed to do it bcs it can create massive lags if you retrive like 200k docs

solemn latch
#

empty find() should get all i would think

earnest phoenix
#

There has to be some kind of filter?

#

Oh

#

Lemme try then

solemn latch
#

o

#

just yeah, be aware, will probably be laggy

karmic compass
#

trying to make a ban command, trying to evade errors, how do i make it so that way if it is missing permissions (the bot not the user) it says "cannot ban that member"

solemn latch
#

.catch it

earnest phoenix
#

Idk i just try this but it returns just a massive cursur object which none of the wanted documents were returns

_eval bot.db.collection("prefixes").find({})```
ocean trout
#

hi

earnest phoenix
#

@Woo#3304

#

When pings don't actually ping

#

Bruh moment

solemn latch
#

weird

karmic compass
#

.catch it
@solemn latch example? (discord.js btw)

earnest phoenix
#

Just check if that member is bannable

karmic compass
#

how is that executed

earnest phoenix
#

<Member>.bannable

#

Returns a boolean if the member is bannable or not

#

If true, the bot can ban the member, if false, it can't ban the member

karmic compass
#

if(!member.bannable) {
message.channel.send("Member is not bannable!")

#

alr alr

earnest phoenix
#

Yea but return it

#
if(!member.bannable) {
return message.channel.send("Member is not bannable!");
}```
karmic compass
#

does member.kickable work too?

earnest phoenix
#

Yea

karmic compass
#

kk

solemn latch
#

all properties are listed on the docs

earnest phoenix
#

@solemn latch Come to testing-1, i'll show ya what the find() returns

#

@earnest phoenix bro its says bannable of null

#

What

#

lol

#

idk

#

I'm confused wot

torn ravine
#

if I want add blacklisted words as an array, how would I access it?

earnest phoenix
#

Add it as global

#

really..

sonic mango
#

🙂

earnest phoenix
#

borgarmunch borgar xD

solemn latch
#

im not sure why it would return that @earnest phoenix

#

is it because you did find({})?

karmic compass
#

one more question:
how do i make it so if i do !ban (user) without putting a mention in there instead of giving me an error it says to put in a mention instead of nothing

karmic compass
#

im using message.users.mentions.first(); (or smthn like that)

solemn latch
#

if (!args[0])

#

will run if args 0 is empty

#

if your using args

karmic compass
#

im using message.users.mentions.first(); (or smthn like that)
@karmic compass

solemn latch
#

if (!message.users.mentions)

karmic compass
#

o

#

well i just did let bannedUser = message.users.mentions.first()
if(!bannedUser)

#

would that work too

solemn latch
#

yes of course

#

if it doesnt error because reading first from undefined

#

which i dont think it does, im not sure tho

karmic compass
#

oh tyty

honest perch
#

noob question here

#

but how would i check if an argument is a number

amber fractal
#

in js, !isNaN(x)

pure lion
#

*slams keyboard*

amber fractal
#

NaN means not a number, that checks for it not being not a number

honest perch
#

whats the difference between Int

amber fractal
#

int doesnt even check if something is a number

#

isNaN returns a boolean

#

wait lmao for what lang

honest perch
#

js

pure lion
#

Scriptjava

amber fractal
#

yeah, !isNaN(x) should work

honest perch
#

uwu.script

pure lion
#

No thank you

digital ibex
#

^

amber fractal
pure lion
#

So this basically sexy parsein-

amber fractal
#

no

#

parseInt doesnt return a boolean

#

isNaN actually checks if something is or isnt a number

#

parseInt can return NaN

#

or you could use typeof x == "number" too

digital ibex
#

\n ?

#

ok

#

u can just make a new line by pressing enter

#

oh

#

mb

#

use css

solemn latch
#

🤔

digital ibex
#

nodejs is used for server side js, not client side lul

#

and u cant edit or whatever u wanna call it in the backend, afaik

strange trout
#

You'd need to render an HTML file with that information

#

With styles

honest perch
#

yes that worked

#

thanks

solemn latch
#

150

#

rip eardrums

digital ibex
#

lol

strange trout
#

With a template engine like handlebars, ejs, or pug

digital ibex
#

pug is a template engine?

honest perch
#

rip eardrums
atleast its lavalink not ytdl

strange trout
#

Yes

digital ibex
#

lmao

honest perch
#

thats the real drum blaster

digital ibex
#

never knew that

#

i thought it was a framework or something

strange trout
#

Pug is pretty good. Most people don't like the syntax though

digital ibex
#

like me :/

strange trout
#

A frontend framework would be something like vue or react

digital ibex
#

your bots dashboard frontend is written in pug, isnt it?

strange trout
#

Nuxt

digital ibex
#

oh

#

was the first version of it in pug?

#

or.. before u rewritten it or something

strange trout
#

Yup

digital ibex
#

cool

#

i wanna learn either vue or nuxt 😩

strange trout
#

It's pretty simple

lime jungle
#

what is the Discord.js permission to kick members from vc ?

digital ibex
#

3 of my websites frontend is ejs 🥴

quartz kindle
#

vash > ejs

feral heath
#

Vue is super fun

digital ibex
#

yeah, i heard vue is simple. which one do you recommend, vue or nuxt?

feral heath
#

Coming from react I was super surprised

strange trout
#

I prefer nuxt

digital ibex
#

oh

strange trout
#

Routing is super simple

digital ibex
#

oh

next escarp
#

yo, what can API can i use to fetch text instead of images

#

or package

solemn latch
#

those typically are quite expensive

next escarp
#

? what expensive?

solemn latch
next escarp
#

?

solemn latch
#

$1.50 for 1000 OCR operations

next escarp
#

i am talking bout what can API can i use to fetch text instead of images or package

solemn latch
#

unless your doing OCR with a known font

#

oh 🤔

next escarp
#

like from reddit

solemn latch
#

reddit's api gives text does it not?

next escarp
#

what is that?

solemn latch
#

reddits api?

#
#

🤔

next escarp
#

hmm

#

oj

pure lion
#

Can someone help me with C and legacy openGL (ping for details)

#

Yeah

solemn latch
#

you can request the data separately, or use a template engine

pure lion
#

<%- variable %>

solemn latch
#

^ ejs

#

ejs is dumb simple

pure lion
#

Dumb simply

#

Get the express package

#

Sexy

#

Make an app.js for your express stuff

digital ibex
#

just like

#

app.set('view engine', 'ejs');

#

yeah

#

and ofc download it

#

and just render the correct path and stuff

pure lion
#

Also res.send/res.render

digital ibex
#

yes

restive lily
#

how do you make a gif play in an embed

digital ibex
#

u can access the data in the frontend using res.send afaik

restive lily
#

!coro asked

digital ibex
#

it shows, nothing happens, like u cant manipulate it

restive lily
#

buh

digital ibex
#

what

#

wrong channel sir

restive lily
#

@earnest phoenix how do u set an image

solemn latch
#

.setImage

restive lily
#

embed.add_image?

digital ibex
#

are you using python?

restive lily
#

yes

digital ibex
#

its

#
embed = Embed()
embed.set_image= ''
restive lily
#

:/

#

@digital ibex

slender thistle
#

@digital ibex no

solemn latch
#

()

digital ibex
#

oof

restive lily
#

doesnt work with () wither

slender thistle
#

@restive lily set_image is a method of a discord.Embed instance

restive lily
#

*either

slender thistle
#

show your code

solemn latch
#

(url='yoururlinhttps')

#

right?

restive lily
#
@commands.command()
    async def asked(self, ctx):
        embed = discord.Embed(colour=ctx.author.colour)
        embed.set_author(name='Who asked?', icon_url=f"{ctx.guild.icon_url}")
        embed.set_image('https://tenor.com/view/nobody-asked-nasa-satellite-nasa-asked-nobody-cares-gif-16192897')
        embed.set_footer(text=f'Requested by: {ctx.author.name}', icon_url='{}'.format(ctx.author.avatar_url))

        await ctx.send(embed=embed)```
solemn latch
#

like the docs say

slender thistle
#

let me open the docs

slender thistle
#

yup

restive lily
slender thistle
#

it's a kwarg

#

put url= before the link

solemn latch
#

im getting better at python pogey never will use it for anything

earnest phoenix
#

How i do to add my bot here

slender thistle
#

-faq 1

gilded plankBOT
slender thistle
#

it must be approved on top.gg first

pure lion
#

*cough*

opal plank
#

*sneeze*

pure lion
#

*hiccough*

solemn latch
#

im outa here, corona spreading

pure lion
#

No

#

You will be Corona'd

solemn latch
#

pretty sure i am pandasad

pure lion
#

Btw I gotta learn py for school

6th Lang yaaaaaaay

#

Any reccomended tutorials and shit?

solemn latch
#

shiv we need your copy pasta

opal plank
#

hmmm

#

sending embeds on client is against ToS

#

though is using postman to do such without modifying the client also against tos?

#

slap token, send POST request, boom

mystic orbit
#

.d

digital ibex
#

what does it output?

solemn latch
#

you dont seem to be passing roar

digital ibex
#

you've also got that code in a html file

#

moyai

#

change .html to .ejs

#

and you're passing root, not roar

solemn latch
#

you can send root, and roar

digital ibex
#

moyai

solemn latch
#

if you need root

#

🤔

strange trout
#

You need to render it

solemn latch
#

you need to pass roar

#

in the object

#

same way you pass root

#

{ root: __dirname, roar: roar }

pure lion
#

Roar

solemn latch
#

you can also do forloops and stuff

pure lion
#

Why would you ever use a for loop x)

solemn latch
#

user objects

pure lion
#

What about them

solemn latch
#

can for loop through users

tight plinth
#

erm

#

do you know how js works in general

#

because u dont

#

you literally created a function

#

just use it

solemn latch
#

🤔

tight plinth
#

do you know how programming works in general

solemn latch
#

you didnt have to delete it, its really not hard to see how you made that mistake

#

exports can be confusing at first.

tight plinth
#

stop dissing him
@earnest phoenix oh sry

strange trout
#

Loops are very useful

opal plank
#

why am i not there? AngeryBoye

solemn latch
#

pretty sure your on the list somewhere

#

ive yet to add the top numbers

opal plank
#

imma be sad if im not top 15

strange trout
#

I wanna add a progress bar to my online leaderboard

#

Dunno where though

solemn latch
#

I dont see you top 20 🤔

tight plinth
#

where am o

#

erm

solemn latch
#

you should set roar in the ready event

tight plinth
#

^

#

let roar;
client.on('ready',() => {
roar=...
}):

strange trout
#

I'd separate the bot and the express app

tight plinth
#

same

opal plank
#

@solemn latch i cry

strange trout
#

Into separate folders/files

solemn latch
#

im 29th, your 28th @opal plank

#

lmao

#

ive yet to add requests to see past the first 20

#

when scrolling down

#

had to check the db for this KEKW

opal plank
#

im not saying you should admin abuse and give me extra points to get to top 20

#

im just saying that if it were to happen i wouldnt complain

strange trout
#

Epic

solemn latch
#

iirc, you can only send one embed per message

strange trout
#

Webhooks can send multiple I think

solemn latch
#

you can just directly send bot.guilds.cache.size

#

roar: bot.guilds.cache.size

ember oak
#

Hey, is there a way to make bot custom status? (without Watching, Streaming or Playing)

My code for now is:

    console.log(`[READY] Logged in as ${client.user.tag}! ID: ${client.user.id}`);
    let statuses = [
        "dev: Justas#4513",
        "-help"
    ]
    setInterval(function() {
        let status = statuses[Math.floor(Math.random() * statuses.length)];
        client.user.setActivity(status, {
            type: "WATCHING"
        })

    }, 3000) //Seconds to Random
});```
solemn latch
#

type: is optional isnt it?

tight plinth
#

read docs

digital ibex
#

type is optional ya, but the default is playing, and you cant give it a custom status

solemn latch
#

custom_status doesnt work?

#

oh duh

tight plinth
#

nope

solemn latch
#

it literally says

#

i dont even know what my bots is

#

@loud bison

#

playing ah

pulsar forge
#

What kid of cool text do yall know how to add tk html

tight plinth
#

use guides

#

and wdym by cool text

solemn latch
#

comic sans, best cool text font

pure lion
#

HAHA IM GREEN

digital ibex
#

oop

solemn latch
#

green boi

digital ibex
#

it looks weird for u o.o

pure lion
#

You forgot how I was when I had aleBot

digital ibex
#

but u got it removed oop

pure lion
#

Yeah I added back

#

But aleBot wasn't approved

sudden geyser
#

@slender thistle pls

slender thistle
#

how cute

green kestrel
#

anyone here got a bot with nice looking rank cards?

misty sigil
#

@cursive adder's rank card is pretty good @green kestrel

celest schooner
#

My bot got declined because of a bug, but I cant reproduce it

misty sigil
#

oh wait its development

#

not off-topic KEKW

green kestrel
#

you think its dev would share with me how they created the rank card, e.g. are they artistically minded or did they outsource it?

#

i tend to outsource artwork usually

tight plinth
#

anyone here got a bot with nice looking rank cards?
@green kestrel approximatively 90% of bots with levelink system

solemn latch
#

rank cards are artistic?

green kestrel
#

im thinking of adding rank cards to triviabot for !rank instead of just the basic 'you are x of y players to have played today'

tight plinth
#

but they all use canva

green kestrel
#

imho a good rank card can be a work of art

#

i'd be using GD, most likely

#

in the php part, server side of my bot

#

api will generate the image, and pass it to the bot to display in the embed

celest schooner
#

Can I DM the mod that reviewed my bot for more info about the bug

green kestrel
#

@celest schooner that would be a good idea, just ask first if you can dm

#

🙂

celest schooner
#

wdym like tag em here?

green kestrel
#

they might not answer straight away

celest schooner
#

Should i just mention them

#

okay

astral birch
#

Is it forbidden to change the status on the bot, I read that it is api abuse, and some say that it can if the delay is not less than 30 seconds

solemn latch
#

you can change it, you cannot change it rapidly

astral birch
#

i set delay to 30 seconds

#

okay

#

thanks

solemn latch
#

mine wont even change once every 10 minutes

#

🤷‍♂️

#

status's dont need to change often

misty sigil
#

mine changes every 10 mins yea

astral birch
#

thats 100 000?

#

10000 is 10sec

#

no

#

what is it

solemn latch
#

600,000
10 minutes
60 seconds each
1000 ms each
10x60x1000

astral birch
#

ye thanks

opal plank
#

@solemn latch yoinking that img btw

solemn latch
#

got it from pins @opal plank

opal plank
#

i had only the content, not the pic

#

just attached it to the bottom

solemn latch
#

ah

#

how do you have less members than server count

#

🤔

opal plank
#

they share servers?

#

wait

#

hmm

#

the dash makes it highly misleading towards negative values btw

#

-21

#

put an = sign

solemn latch
#

or :

opal plank
#

indeed

#

yeah i was right

#

if im in 2 servers

#

you're going to have 1 less server count

#

cuz im in both server

#

1 user, 2 server

#

makes sense member being lower

solemn latch
#

thats a ton of duplicate users

sudden geyser
#

11

opal plank
#

so, you have 21 servers and 9 members in those 21 servers?

misty sigil
#

one word

#

merasmus

honest perch
#

Its jesus

sudden hedge
#

How do you make trigger words for your bot?

digital ibex
#

ello

#

what language?

sudden hedge
#

js

#

LOL, I was about to say english

digital ibex
#

if (message.content == 'ur mom') { do whatever }

sudden hedge
#

Aa alright thanks

digital ibex
#

np

#

anyone know why im getting this error: TypeError: ws.once is not a function ?

#

the code is just: js try { console.log(ws.createWebSocketStream(constants.GATEWAY)); } catch (e) { console.error(e); } }

sudden hedge
opal plank
#

best bot

#

can a mod approve this one already?

restive lily
#

how do you make a command where u can see on ur host how much memory, cpu, and disc space it uses python

opal plank
#

@sudden hedge you need to listen to message events

#

one sec i'll give you a guide

restive lily
#

ok ty

opal plank
#

i tagged myself

sudden hedge
#

Wgars tgar

#

Whats that

opal plank
#

a guide

sudden hedge
#

for..?

opal plank
#

cuz you clearly dont know what you doing, read the guide

#

you need to listen to message events

#

not load a class from discord.js

sudden hedge
#

What-

opal plank
#

@restive lily unfortunately i dont know py

sudden hedge
#

Thanks for the guide!

opal plank
torn ravine
#

@opal plank need help with the thing from yesterday

sudden hedge
#

Alright

opal plank
#

@torn ravine wutup

torn ravine
#

sending myself a DM when I join a server

opal plank
#

send me what you got so far

#

so i have a rough idea of where you stuck

torn ravine
#

is it guild_create when the bot joins a server?

opal plank
#

no

#

its an event

#

guildCreate

sudden hedge
#

@opal plank There's nothing here about trigger words :/

#

The closest thing is message reactions

opal plank
#

its not about trigger words

#

its about learning how to the get basics

#

before you even do that

#

those 3 lines show you dont know the basics of a bot

torn ravine
#

how would I get data on the newly joined server?

opal plank
#

@torn ravine when the event is emitted, it emits the guild object. from there you can get id or whatever you want

torn ravine
#

nice

#

ok

sudden hedge
#

Is it possible to make a vote for your bot?

solemn latch
#

like a vote page?

#

you need to have a functional bot first

sudden hedge
#

Yeah, I know

#

like a vote page?
@solemn latch Yes

solemn latch
#

yeah, once you have that. you can submit your bot

sudden hedge
#

its not for my bot, its for a bot that was already functioned/accepted

#

Like, can you makea vote page for your bot?

solemn latch
#

would be the vote page

#

🤔

sudden hedge
#

Ah ok

opal plank
#

block code

#

pls

torn ravine
#

@halcyon ember use hastebin

halcyon ember
#
      collector.on('collect', msg => {
        if(msg.embeds[0].description.startsWith("Congratulations")){
            wins += 1
            lossstreak = 0
            balance += amount*multiplier-amount
            amount = amounts
        } else {
            losses += 1
            balance -= amount
            lossstreak += 1
            console.log(lossstreak)
            if (lossstreak == 1){
              amount = amounts*lossmultiplier
            } else if (lossstreak == 2){
              amount = amounts*lossmultiplier*lossmultiplier
            }else if (lossstreak == 3){
              amount = amounts*lossmultiplier*lossmultiplier*lossmultiplier
            }
          }
      });
      resolve();
    });```
#

im doing this

torn ravine
#

USE HASTEBIN

halcyon ember
#

but it adds to lossstreak 2-3 times each time the else is called

torn ravine
solemn latch
#

can we get a rule hastebin for anything over 5 lines

#

🤔

opal plank
#

3 lines

#

take it or leave

torn ravine
#

how do I get guild member size from guildcreate event

opal plank
#

so, why you using collectors like that again?

solemn latch
#

guild.memberCount

#

i think?

opal plank
#

you can set filters on collectors for when they finish @halcyon ember

#

no need to promisify them

halcyon ember
#

its inside of a while loop

#

i forgot to put the while loop at the top

opal plank
#

so, why you reacting to embeds again?

#

users cant send embeds, so you either reacting to your own bot(which is stupid since you can pass values around) or reacting to someone elses bot(which is also stupid)

celest schooner
#

pog dylan

halcyon ember
#

im not recting

#

its interacting with other bots

opal plank
#

you are tho

halcyon ember
#

thats checking if it starts with it

opal plank
#

thats reacting to an embed

#

reacting in this scenario means triggering, activating

#

not replying

halcyon ember
#

ohhh

#

i thought you meant this

opal plank
#

nah

halcyon ember
#

yea

#

its interacting with a bot

#

not user

opal plank
#

the other bot is yours?

halcyon ember
#

ye

opal plank
#

would recommend IPC

sudden hedge
#

How do you create a vote page

#

For a bot

solemn latch
#

you submit a bot, once its done

sudden hedge
solemn latch
#

only once its done

#

yes

halcyon ember
#

oh

opal plank
#

instead of parsing values, just send them over to the different bot via IPC

sudden hedge
#

Yeah that steps done

#

What now?

halcyon ember
#

im testing it with my own but i want it to work with other bots later

solemn latch
#

how are you done

earnest phoenix
#

Can someone help me make my own music bot 🙂

solemn latch
#

🤔

halcyon ember
#

plus thats not the problem

sudden hedge
#

I said its not for my bot :/

halcyon ember
#

the probelm is its running from the top over and over regardless if its completed or now

#

not*

sudden hedge
#

Its not for that* bot

opal plank
#

whats your while statement?

solemn latch
halcyon ember
#

while (runs > 0) {}

solemn latch
#

and it will take 3+ closer to 4+ weeks to review

halcyon ember
#

and at the end theres runs -= 1

#

3-4 now?

#

damn

opal plank
#

also your arent returning anything in that promise

sudden hedge
#

It was reviewed. The bots on top.gg

opal plank
#

you are defining objects which gets voided @halcyon ember

solemn latch
#

then its already got a vote page

torn ravine
#

@opal plank I created an embed

solemn latch
#

i gave you the link

#

lmao

opal plank
#

@torn ravine nicee

torn ravine
sudden hedge
opal plank
#

thats correct

solemn latch
#

what doesnt work

#

upvote?

sudden hedge
#

ye

solemn latch
#

it works for everyone else

torn ravine
#

now how would I fetch myself?

sudden hedge
#

I mean, usually it doesnt let you click anymore

opal plank
#

you already did it IF6, just add your id

solemn latch
#

it does for me

sonic lodge
#

am i dumb or is that not top.gg

halcyon ember
#

wait

#

so whats wrong with it

solemn latch
#

lol

halcyon ember
#

everything else in it works fine

#

just the thing gets ran over and over and over again

solemn latch
#

i think your right @sonic lodge

opal plank
halcyon ember
#

regardless if its finished

opal plank
#

where are all these variables?

halcyon ember
#

they are set at the top

solemn latch
#

whats the url your using @sudden hedge

halcyon ember
#

at way beginning theres var wins = 0

opal plank
#

im not sure if promises have private variables

#

lemme check rq

jagged crater
#

So i am back again but this time my purge is not working and i was wondering if anyone noticed something wrong with my code

    if(message.content.startsWith('${prefix}purge')){
        if(message.member.hasPermission("MANAGE_MESSAGES")){
            const command = "@purge@";
            let deletecount = message.content.slice(command.length)
            if(!deletecount || deletecount > 100 || deletecount < 2)return message.channel.send('Please provide a number of messages to delete between **2 and 100**');
            message.delete();
            message.channel.bulkDelete(deletecount)
            message.channel.send('Successfully deleted **${deletecount}** messages!');
        }
    }
})```
solemn latch
#

whats not working?

torn ravine
#

error?

jagged crater
#

so this is supposed to be a purge command

halcyon ember
#

no the variables work correctly

jagged crater
#

but nothing happens

halcyon ember
#

the stuff in the else {} aren't

sudden hedge
#

Is it possible to make a code like when someone votes the bot it automatically gives them a coin

solemn latch
#

yes, using the dbl api, and webhooks

halcyon ember
#

two is added to lossstreak instead of once

#

and it gets ran over and over

solemn latch
#

but like was discussed, the vote page you showed doesnt look like dbls vote page

#

🤔

torn ravine
#

@opal plank like dis?

opal plank
#

almost there

#

owner is already a user

#

owner.send()

torn ravine
#

oh

jagged crater
#

So do i need to add a else variable?

torn ravine
#

@opal plank oh yeah you're right because there's no message event

opal plank
#

yup

torn ravine
#

well there is but this isn't it

opal plank
#

well, yeah, im going by what you're showing me

#

i would append that method onto the returned user btw

torn ravine
opal plank
#

instead of defining it

torn ravine
#

I don't think I really need async here do I?

opal plank
#

nto really

quartz kindle
#

you're defining "async" as the guild variable that guildCreate gives you lol

opal plank
#

was about to mention that

quartz kindle
#

idk if it even allows you to do that since async is a reserved word

opal plank
#

oye tim

#

rate my new toy

#

will switch to webhooks later

quartz kindle
#

nice

opal plank
#

IRC relay lul

solemn latch
#

@jagged crater im not quite sure whats even going on in your command.
command is = to @prefix@
slicing that from content
your not checking if the remaining content is an int, or parsing it into an int.

opal plank
#

relayCeption

torn ravine
#

anyway

jagged crater
#

alright thanks

opal plank
#

i should go back to coding tbh, parsing those messages are going to be a pain

solemn latch
#

then theres me, not coding for days.
but sitting here

opal plank
#

well, you providing help

#

at least you helping in some way

#

technically 'being productive'

torn ravine
opal plank
#

erm...

#

the fact that this is not highlighted should indicate to you this is an unused declared variable

torn ravine
#

hm

solemn latch
#

guildCreate gives type Guild

opal plank
glacial knot
#

my bot in top.gg dont show online or offline ? status

opal plank
#

guildcreate isnt

sonic lodge
#

your bot must be approved

glacial knot
#

@sonic lodge need how much time ?

opal plank
#

3+ weeks

sonic lodge
glacial knot
#

can u come dm

sonic lodge
#

what do you need help with

glacial knot
#

dm !

sonic lodge
#

just ask here

torn ravine
solemn latch
#

we did it reddit pogey

opal plank
#

@torn ravine ASMarisaWink

#

shoo, off my dm's

fossil token
#

hello,

Little error
(node:13) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'get' of undefined at Finish (/home/container/commands/play.js:73:38)

CODE https://hastebin.com/yuyufimepo.js

(this going about a queue for music)

  • Keanu
earnest phoenix
#

!eval msg.guild.members.filter(mem => mem.user.bot === true).size; => msg.guild.members.filter is not a function

sudden geyser
#

@earnest phoenix if you're using Discord.js, it's .members.cache.filter on v12.

earnest phoenix
#

ofc ty

sudden geyser
#

As for your first error, it could be options.active.get(dispatcher.guildID); with .active being undefined.

opal plank
#

var fetchedData = options.active.get(dispatcher.guildID);

fossil token
#

here the whole code

opal plank
#

also, where did you copy that code from?

fossil token
#

i didnt copy the code haha

torn ravine
#

would this count as collecting data from an API?

fossil token
#

a good friend helped me with a tutoriol

torn ravine
opal plank
#

var

#

you use vars all over your code

fossil token
#

yea

opal plank
#

bad

fossil token
#

ok

opal plank
#

let/const

fossil token
#

i will say i to him!

opal plank
#

so your friend gave you code?

torn ravine
#

use const every once in a while or let

opal plank
#

you arent even coding?

fossil token
#

iam coding! haha

opal plank
#

const is for constant, stuff that doesnt change

fossil token
#

a friend helped me with music

opal plank
#

let values can be changed

sudden geyser
#

I like using const to represent important variables

opal plank
#

its not about important variables

torn ravine
#

var will be used when the value is going to be changed

opal plank
#

const are constant

#

they cannot be changed

sudden geyser
#

I know

fossil token
#

i will change it to my own code than haha like i would do it

opal plank
#

you can use let instead of const

#

as long as you dont change it

torn ravine
#

if you try to change a const it will say 'x is already defined'

opal plank
#

^^

fossil token
#

yea i know

opal plank
#

switch everything to let if you really that lazy

fossil token
#

im not lazy haha

sudden geyser
#

using let is fine

opal plank
#

start by fixing all those vars

#

vars ignore scopes

#

which is really bad

#

so, first thing, patch all that and re-run code

fossil token
#

yea did it already haha

opal plank
#

same error?

fossil token
#

lets test

opal plank
#

||should give same error||

fossil token
#

same error

opal plank
#

also functions should be declared before they are called

fossil token
#

aha

#

the thing is everything worked on my friends side that helped me so strange

#

but yea

opal plank
#

¯_(ツ)_/¯

fossil token
#

so where do i need to declare it?? im new to YTDL and functions

solemn latch
#

wait wth

#

var ignores scope?

opal plank
#

var indeed ignores scope

solemn latch
#

like var is always global?

opal plank
solemn latch
#

i have so many questions now

opal plank
#

dont use vars basically

sonic lodge
#

oops

solemn latch
#

like okay.
if you var something in an exports, and require that export, but not that var(just somewhere else)
is it acessable

fossil token
#

never used functions got a whole team behind me for my official bot so yea we are putted into teams one does this one does that etc, and yea i wanted to learn some music but sadley its a bit harder than i thought, where do i need to declare the functions??

solemn latch
#

i got some science to do

opal plank
#

imagine sending links

solemn latch
#

lol

opal plank
#

who was it?

fossil token
#

lol

opal plank
#

imagine

sonic lodge
#

damn there's var all over my code

opal plank
fossil token
#

oopled me3

#

me2

opal plank
#

use let/const

solemn latch
#

its luckily an easy fix

fossil token
#

but yea now iam stuck to declare that erwin said haha

opal plank
#

imagine this

sonic lodge
#

replace \bvar\b with let

opal plank
#

replace with const

#

and fix the errors as they come

#
console.log(a)
const a = 1;

@fossil token what would happen here?

fossil token
#

ow shit! haha its late let me think haha

twin wadi
#

I wont let me add Carl bot in my server

fossil token
#

iam still learning btw so you know

opal plank
#

thats the most basic example i could give dude

fossil token
#

i know

opal plank
#

if you dont know that i'll foward you to the d.js guide

solemn latch
#

its a trick question. a is an actor

opal plank
#

shhh dont help em'

solemn latch
#

lol

sudden hedge
fossil token
#

but is almost 4 o clock here in the netherlands so my brain isnt working 100%

solemn latch
#

looks like a json

opal plank
#

bruh, its a 2 line code

fossil token
#

yea bruh i know

#

but iam already awake for 24 hours

opal plank
#

you'd need 1 functioning braincell to awnser that

fossil token
#

so

sonic lodge
#

but it makes sense to var variables tha tshould be accessible anywhere in the file right

fossil token
#

im half sleeping

#

i just want to fix this error and go to bed

#

haha

opal plank
#

just awnser the question or come back tomorrow

twin wadi
#

I cant add Carl bot and others when it has let me add them before

sudden hedge
#

I have a config.json file but it the eror says:

  throw err;
  ^

Error: Cannot find module 'config.json'
Require stack:
- /Users/kamolkhon/Desktop/DiscordBot/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
    at Function.Module._load (internal/modules/cjs/loader.js:841:27)
    at Module.require (internal/modules/cjs/loader.js:1025:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/Users/kamolkhon/Desktop/DiscordBot/index.js:3:16)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Function.Module._load (internal/modules/cjs/loader.js:878:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/Users/kamolkhon/Desktop/DiscordBot/index.js' ]
}```
opal plank
#

nobody is going to spoonfeed you

#

if you expecting that, give up

fossil token
#

im not giving up

#

haha

sonic lodge
#

ask in their server @twin wadi

clever garnet
#

im using discord.js and i have a command where i have it like two settings
one is for one webhook
another is for the other trigger
how i do that like make it detect stuff like

webhooksend (option) then text lol

opal plank
#

if you ask for spoonfeeded code remember mods will give you warnings about it

twin wadi
#

I cant get in it

opal plank
#

its in the rules

fossil token
#

i know

#

just a little help only haha

opal plank
#

thats what i was trying to do

#

but i got excuses rather than an answer

fossil token
#

yea sorry buddy but its late 🤔

opal plank
#

then come back tomorrow

fossil token
#

i will come back tomorrow

#

haha

opal plank
solemn latch
#

ngl, i thought it was a trick question at first

opal plank
#

its a very simple thing about how js code is ran

solemn latch
#

yeah

opal plank
#

if he 'coded' all that, it would be easy for him to anwser

#

im assuming all that was copy pasted

fossil token
#

im still here btw it isnt copy an pasted! so as i said iam still learning! and i used a tut for music of my friend!

opal plank
#

so... you copied it and didnt understand what this did

#

you are using async, one would assume you know what syncronous and async code is

sudden hedge
#

Bruh what's this. I have a config.json file but the error says:

  throw err;
  ^

Error: Cannot find module 'config.json'
Require stack:
- /Users/kamolkhon/Desktop/DiscordBot/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
    at Function.Module._load (internal/modules/cjs/loader.js:841:27)
    at Module.require (internal/modules/cjs/loader.js:1025:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/Users/kamolkhon/Desktop/DiscordBot/index.js:3:16)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Function.Module._load (internal/modules/cjs/loader.js:878:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/Users/kamolkhon/Desktop/DiscordBot/index.js' ]
}internal/modules/cjs/loader.js:968
  throw err;
  ^```
solemn latch
#

config.json needs a path

opal plank
#

^^

#

its not a module