#development

1 messages · Page 953 of 1

earnest phoenix
#

hi

#

my glitch project doesnt open

golden condor
#

Is there any internal way of doing it?

tranquil drum
#

internal to what?

#

net is built in to node

golden condor
#

Like shards communicating?

earnest phoenix
golden condor
#

I'm not sure about how to use that

tranquil drum
#

i mean it sounds like djs has broadcastEval

cinder patio
#

Discord.js sharding already uses IPC

golden condor
#

Huh

#

Weird

earnest phoenix
#

yos

tranquil drum
#

yeah it looks like broadcastEval already does it for you

#

fetchClientValues etc

earnest phoenix
#

fixed it yayy

honest perch
#

glitch has been down for the past couple of days

earnest phoenix
#

just cleared the elements

honest perch
#

i would also recommend getting a vps or self hosting

earnest phoenix
#

@honest perch heroku

#

._.

honest perch
#

heroku is bad

tranquil drum
#

why?

honest perch
#

because it is lol

tranquil drum
#

can't argue with that lol

honest perch
earnest phoenix
#

-__-

#

how

#

did u found my bot

honest perch
#

user id

earnest phoenix
#

wut

#

command ?

honest perch
earnest phoenix
#

oh

#

@honest perch u have 2 bots

#

why

honest perch
#

because i made 2 bots

earnest phoenix
#

but nice css

honest perch
shut wolf
#

o

nocturne grove
#

To test with the new rate limit for channel updates, I renamed a channel to 1, then 2, until 5 using eval command. The name was 1 and then it was waiting for the rate limit. Then, it renamed to 5 and then 4. Isn't that really weird?

tight forum
nocturne grove
#

It renamed to an earlier given name

earnest phoenix
#

when my ping is high that mean it is bad or good

#

(100ms)

#

🤔

modest maple
#

thats the delay between the connections

#

how long it takes to go to and back

earnest phoenix
#

oh

#

so it is bad

#

😮

modest maple
#

its pretty meh

#

100ms is 1/10th of a sec

earnest phoenix
#

:0

modest maple
#

thats WS latency btw

earnest phoenix
#

so it is good in someway

earnest phoenix
#

Hello

tight forum
earnest phoenix
#

Does anyone know how to get your bot online 24/7

pale vessel
#

get a vps

earnest phoenix
#

Without that

pale vessel
#

impossible

earnest phoenix
#

For free

#

U could use pm2

#

Thanks

#

Is pm2 good

#

Or not

#

Or not

#

Ok

summer torrent
#

yes it is good

earnest phoenix
#

Try it , it’s from your cmd or powrshell and then your set

#

Maybe that’s I

#

I didn’t try it yet

#

But it processes our bot

#

What else

summer torrent
#

PM2 is a process manager that will keep your application online 24/7

#

yes

earnest phoenix
#

Hello guys

#

Add my bot to test it pls

#

Codelyon

#

It’s not online now

#

It will be in 20mins

summer torrent
#

approval can take 2 weeks

earnest phoenix
#

I know but pls add to test it

summer torrent
#

no

tight forum
#

lol

slender thistle
#

-faq 2

gilded plankBOT
earnest phoenix
#

Why

summer torrent
#

because you're not alone

slender thistle
#

-upto

gilded plankBOT
#

The FAQ clearly states that it will take UP TO 1 week or more.
This does not mean it will take a week and does not mean it will take less than a week.
There is no set time for how long bot approval will take.
There is a queue and you're not first, nor are you last.

summer torrent
#

other bots are waiting to be reviewed before your bot

earnest phoenix
#

No

summer torrent
#

there is a queue.

earnest phoenix
#

I said that I need someone to test my bot

#

Not approval

tight forum
#

if you just want someone to test your bot

#

you can tell one of your friends

earnest phoenix
#

But my friends don’t have discord

slender thistle
#

Generally, we don't test people's bots on request here. Chances of finding someone willing to test your bot here are quite low

earnest phoenix
#

Ok 😕

ripe epoch
#

i made a bit of a mistake with my bot. i am using the outdated way for commands. i am trying to make these work with the commands extension. In the docs it says to add await bot.process_commands(message) on the end of the on_message event. do i have to do this after every message.content.startswith or just that one on_message event?

slender thistle
#

Are you doing your commands in on_message

ripe epoch
#

yep. thats the issue. and i have too many to go back and change them all

#

plus a few of them wont work on the command extension

slender thistle
#

bot.process_commands is for internal commands created by discord.py's commands extension

#

You don't even need it if you are using on_message for commands nekothinking

ripe epoch
#

oh ok. but i want to add some more commands using the commands extension along side it if possible

#

is there not a way for that?

slender thistle
#

I don't see a reason to use both at the same time tbh

#

You can do that though, just put the process_commands thing in the end of your on_message event

ripe epoch
#

thanks

astral remnant
#

yep. thats the issue. and i have too many to go back and change them all
@ripe epoch I had too many, I changed them all xD

#

I didn't mind using on_message but I needed to make the prefix cutomisable

ripe epoch
#

fair enough

nocturne grove
#

is there a way to get the time your bot was offline? Or better: is there a way to know when the client is not active anymore (isn't reacting to commands etc.)? And for that, I also mean things like the host that goes offline etc.

earnest phoenix
#

use some bot which tracks other bots uptime (that bot can have downtime too so keep that in mind) or use a professional service like sentry

nocturne grove
#

okay thank you

earnest phoenix
#

in the guild invites thing is it total uses or uses of people still in the server

#

wait nvm

#

i needa do the tracking and everything myself

#

how can i solve this error ('SSL is not supported.') in python

#

do research on the issue

#

i searched i dont found anything useful

#

tldr certs on windows expired and you need install new ones

#

i know but where i need to install is it root certifaces or something

#

yes

#

oh

#

root certifaces

#

Hello

#

hello

pale vessel
#

uhh

earnest phoenix
#

no its not expired

#

Ok

#

Just trying to help

#

thanks

#

Anytime

radiant estuary
#

how can i get the access token (discord oauth2)?

earnest phoenix
#

what do you mean wtih accsess token

radiant estuary
#

i want to make a 'login with discord' button, and i read some articles in thze web. And there stans something with access_token

earnest phoenix
#

idk

radiant estuary
#

i use the discord-oauth2 api for node.js

cinder patio
#

I believe you get the access_token as a query parameter after the person authorizes

golden condor
#

Try follow the discordjs.guide tutorial on it

cinder patio
#

Actually you get granted an authorization token which then you must exchange for an access token

earnest phoenix
lyric mountain
#

and remember that discord oauth2 does not accept json as request, but an url encoded string

golden condor
#

There is a useful discordjs tutorial on it

#

You may not use discordjs

#

But it's still valud

pale vessel
#

implicit grant tho

lyric mountain
#

for a site, implicit grant is a bad idea

pale vessel
#

^

golden condor
#

Wdym by implicit grant

lyric mountain
#

an implicit grant is an oauth2 request withing the url

#

the difference between implicit and normal grant is basically GET vs POST

#

one is easier, the other is more secure

slender thistle
#

@ocean socket

ocean socket
#

Hey

misty sigil
#

so I’d assume it’s just a dB of all guild IDs and a prefix

slender thistle
#
def func(bot, msg):
    return bot.prefixes[msg.guild.id]

bot = commands.Bot(command_prefix=func)```
#

discord.py internally calls func and gives it the bot and msg arguments respectively

ocean socket
#

Ohhhhhhh

#

Like that

slender thistle
#

bot.prefixes is a dictionary that you create right after declaring bot

ocean socket
#

Let me try it out

#

Could you use guild name instead of id?

onyx summit
#

You could, but that would be stupid

#

change your guilds name and your prefix is gone

ocean socket
#

Yea makes sense

#

But like what do I pass into the function as parameters?

slender thistle
#

You don't call it yourself

#

You just pass the function object itself

ocean socket
#

Oh command.Bot does that itself?

slender thistle
#

discord.py internally calls func and gives it the bot and msg arguments respectively

#

Yeah, it uses the function object and calls it

#

All you need to do is return the prefix you need

ocean socket
#

Holy shit it works

#

Thank you so much

#

Wait how do I have a standard prefix then?

earnest phoenix
#

whats problem

#

fixed ok

ocean socket
#

Nvm figured it out myself

hardy vector
#

how can i limit the amount of songs in a playlist so people can only play playlists with like 6 songs in them and not 200, so i dont get ratelimited

#

i use erela.js for my lavalink client btw

golden condor
#

check the length of the playlist

hardy vector
#

ik but how do i check if they play a playlist

golden condor
#

try using yt-search

hardy vector
#

ok

golden condor
#

wrong channel

red terrace
#

Sorry.

golden condor
#

np

slender wagon
#

do u guys know any random cat ap

#

api

earnest phoenix
#

i (was) know

slender wagon
#

?

hardy vector
#

youtube-playlist will returns an array with the items, then you can just do if (array.length > 6) // do something. [@hardy vector]
@earnest phoenix isnt that for ytdl?

#

i use lavalink

carmine steeple
earnest phoenix
#

just set the title to a zero width space

carmine steeple
#

0-

#

smart, ty! :)

pale vessel
#

that's that addBlankField do in v11

carmine steeple
#

oh

pale vessel
#

you have to do it manually now because it was removed in v12

carmine steeple
#

ah

earnest phoenix
#

how is that possible to put reactions so fast as @earnest phoenix? try §help

gilded plankBOT
#

tickNo Bots don't have bots, silly

earnest phoenix
#

ping me if anybody answer

unborn steeple
#

im using quick.db but like version 6.3.2 or 6.3.1 and im trying to get something using db.fetch('userItems', { target: ".achievements" }); but it returns as [object Object]

earnest phoenix
#

show part of code

unborn steeple
#

@earnest phoenix hold on

quartz kindle
#

@earnest phoenix the rate limit for reactions is 1 per 250ms

#

but most discord libraries dont let you fully use this

earnest phoenix
quartz kindle
#

to prevent potential timing issues that could cause it to hit the rate limit

earnest phoenix
#

okay may i edit src of lib? xd

astral remnant
mossy vine
#

yes

#

go ahead

quartz kindle
#

discord.js allows you to set a restOffset in the client options

#

idk about python

astral remnant
#

I see.

quartz kindle
unborn steeple
#

im trying to get this to semd the stuff in the achievememts table

#

[ { achievements: 'Noobie' } ] is what it returns

#

I want it to return just Noobie, etc

astral remnant
#

I gave up on db and use json :)

mossy vine
#

yeah dont use json :)

#

just learn a db its not hard :)

unborn steeple
#

how do if fix this

astral remnant
#

Oh well I made a currency system using json

amber fractal
#

and you'll have many problems later down the line

unborn steeple
#

true

amber fractal
#

mainly corrupted data and slow response times

mossy vine
#

mainly corrupted data

astral remnant
#

Hmm

unborn steeple
#

@quartz kindle hey man u usually help me out could u help me with somethin

astral remnant
#

I think you exaggerate

amber fractal
#

No

earnest phoenix
#

you're thinking wrong then

astral remnant
#

Didn't encounter any problem

earnest phoenix
#

you're writing to a file which is a blocking I/O operation

astral remnant
#

bal, give, rob, made everything

quartz kindle
#

@unborn steeple fetcher[0].achievements

honest perch
#

dont use json

astral remnant
#

Got it

honest perch
#

my json shit corrupted

#

it isnt nice trust me

earnest phoenix
#

plus good luck maintaining size on disk with a json database lol

#

actual databases compress their data

astral remnant
#

Damn, Ty for enlightening me

quartz kindle
#

my json database was 10mb big

#

xd

honest perch
#

i had like 12 prefixes and it corrupted

astral remnant
#

Never happened but I got it.

honest perch
#

ive been playing around with mongodb and mongoose and its great

astral remnant
#

I will rewrite everything to work with a db ×_×

honest perch
#

tbh saving to mongoose is easy.

astral remnant
#

"MongoDB stores data in JSON-like documents"

earnest phoenix
#

yes but mongo isn't json

golden condor
#

Yeah

#

It's similar to JSON but isn't JSON

honest perch
#

the chances of mongo corrupting are very low

earnest phoenix
#

mongo stores in bson iirc

summer torrent
#

mongo is bson iirc

honest perch
#

json files corrupt very easily

golden condor
#

mongo stores in bson iirc
@earnest phoenix yeah that's what gets exported if you mongodump

summer torrent
honest perch
#

also mongo is easy to manage

earnest phoenix
#

plus, since mongo is an actual database, it does more than just store data, it handles concurrent connections and more

astral remnant
#

I will start right away then, ty for suggesting me that.

#

Good that I didn't face any corruptions yet xD

unborn steeple
#

@quartz kindle fetcher[0].achievements would only show the first achievement tho wouldnt it?

#

im tryna get it to list all

summer torrent
#

use loop

golden condor
#

That would be the first fetcher's achievements

#

If you want all of them use a for or forEach loop

#

Or map them

summer torrent
#

for...of

unborn steeple
#

lol i think ima map them

golden condor
#

like fetcher.map(f => f.achievements)

summer torrent
#

^

golden condor
#

It's an array right?

timid anvil
#

who can help me

golden condor
#

What do you need help with

timid anvil
#

I want people who don't have 1 command or 2 invitations on my bot

golden condor
#

Wdym

summer torrent
#

your ⛵

timid anvil
#

lol

golden condor
#

Lel

timid anvil
#

i am changed message content

golden condor
#

It's fine man, it is just a joke

timid anvil
#

not joke

#

I want people who don't have 1 command or 2 invitations on my bot

golden condor
#

What do you mean by 1 command of 2 invitations

summer torrent
#

wdym by "don't have 1 command"

golden condor
#

@flat pelican are we allowed to talk in other languages here?

timid anvil
#

I want people without 2 invitations not to use my bot's commands

honest perch
#

huh

timid anvil
#

i am translating xD

honest perch
#

what invitations

earnest phoenix
#

people without 2 invite links?
people who hadn't invited 2 other people?

honest perch
#

what language do you speak

golden condor
#

sen Türksün?

timid anvil
#

i am turkish

golden condor
#

Ah

flat pelican
#

no

golden condor
#

Oh ok

flat pelican
#

No other languages here

golden condor
#

I didn't know

#

Sorry

flat pelican
#

English only

honest perch
golden condor
#

Or dms

hasty lotus
#

hey, does anyone know how to make a progression bar using canvas (in js) ?

timid anvil
#

who can help me

golden condor
#

We can't really understand you

timid anvil
#

google translate sending error xD

earnest phoenix
#

what do you want to do

#

check if a user has invited 2 other people

#

or check if a user has 2 invite links

golden condor
#

We need someone who speaks Turkish

pale vessel
#

egg

#

egg's not here

timid anvil
#

ı want people with 2 invitations to be able to use the / js command, how can I do

pale vessel
#

cry gave you the concept

#

you do the coding

#

not us

earnest phoenix
#

i still don't get what is your goal

#

i asked you two times

golden condor
#

Is it like an invite manager thing?

#

That tracks invites

#

And you get rewarded with a command?

spice smelt
#

hey there!! I need some help quick. I got 1 stable bot and 1 beta bot. The stable one is currently offline because the code keeps logging in with the beta bot. But there is no other token than the stable one's in the code! how to fiw that? is that cache? thank you!

#

and the token isn't from another file

earnest phoenix
#

read your token from an environmental variable / .env file

spice smelt
#

Im lost

#

I've already tried this

golden condor
#

Where do you store the token?

spice smelt
#

in the code.

unborn steeple
#

@golden condor it throws an error Cannot read 'map' of null or something like that

spice smelt
#

is that bad?

pale vessel
#

show code @unborn steeple

earnest phoenix
#

kind of

golden condor
#

No, I mean just where do you store ir

#

Send code without the token

clever tree
earnest phoenix
#

it's not suggested to hardcode tokens because you might leak your token when sharing code

#

you're sending an empty message

unborn steeple
#

@pale vessel nah im asking @golden condor

#

he was helping me b4

pale vessel
#

oh ok

spice smelt
#

simple: js token = 'token....'

honest perch
#

yes but where

pale vessel
#

the array you're mapping is null, just saying

honest perch
#

and is there a token there

golden condor
#

What is it defined as @unborn steeple

spice smelt
#

in the top of the code

honest perch
#

also refresh it

unborn steeple
#

the map?

honest perch
#

so stop the code @spice smelt

golden condor
#

I mean the thing you are tryna map

pale vessel
#

should be an array/collection

unborn steeple
#

im tryna map this hold on

spice smelt
#

oh f*ck

#

i found the issue

unborn steeple
golden condor
#

should be an array/collection
^

unborn steeple
#

the fetcher

spice smelt
#

I wasn't editing the right document XDDDDD

pale vessel
#

it returned an object

#

you said it

#

not an array

golden condor
#

Ok

#

Log it

pale vessel
#

still null though

unborn steeple
#

that code is old its been chanegd

#

let me get the new code :|

golden condor
#

Log the thing your tryna map (debugging 101)

unborn steeple
pale vessel
#

console.log(fetcher)

#

I can't read smh

golden condor
#

console.log(fetcher) first

#

Nvm flaze already said that

tight plinth
#

with discordjs v12, how can I get the channels that are in a category? Do I have to hard code it and check for every parentID of every channel in the guild or is there a property somewhere that I missed?

pale vessel
#

i said fetcher and edited it to award and then changed it back to fetcher lmao

golden condor
#

with discordjs v12, how can I get the channels that are in a category? Do I have to hard code it and check for every parentID of every channel in the guild or is there a property somewhere that I missed?
I'll check docs sec

amber fractal
#

You can get all the channels and filter by category name or id

pale vessel
#

you can filter them by channel type

golden condor
#

Actually, you could filter the channels with the parentID of the category

tight plinth
#

ok

golden condor
#

Wait you can get this

pale vessel
#

just get parent name

golden condor
#

<CategoryChannel>.children

pale vessel
#

nah

golden condor
#

Which is a collection of GuildChannel

pale vessel
#

previous one was easier

golden condor
#

They both work

pale vessel
#

they wanted channels that are in a category

#

might as well see if parentID exists

golden condor
#

Yeah, .children gives you that

pale vessel
#

yes but-

#

it's too much work

amber fractal
#

what?

golden condor
#

Surely if you have the Category object you should use that

amber fractal
#

it's less work than filtering

golden condor
#

^

pale vessel
#

we're not filtering

#

just check the channel

amber fractal
#

but they wanted all channels

golden condor
#

Yeah but Lumap wanted all channels inside a category

amber fractal
#

that's one channel

pale vessel
golden condor
#

how can I get the channels inside a category?

pale vessel
#

you can easily use map for that

amber fractal
#

and that's less work than client.channels.get(categorychannelid).children?

golden condor
#

<GuildCategory>.children is easier

tight plinth
#

yes

golden condor
#

It's djs V12 btw

amber fractal
#

but instead it's just a function call instead of coding it yourself

pale vessel
#

dude

golden condor
#

It works kthanksbye

pale vessel
#

message.guild.channels.cache.filter(x => x.parentID) no?

golden condor
#

What

earnest phoenix
#

that works

#

but it's slower

pale vessel
#

those are channels that is inside a category

earnest phoenix
#

filter needs to run the condition for each channel

pale vessel
#

you have a point

earnest phoenix
#

get(..).children is a cache lookup

golden condor
#

^

pale vessel
golden condor
#

Anyway this is pointless Lumap is gone anyways lel

pale vessel
#

even that uses filter

earnest phoenix
#

oh

#

it's the same thing

#

lol

pale vessel
#

god damn it

#

i hate you lmao

golden condor
#

Yeah but this.guild is the thing in the cache

#

Actually no

#

Nvm

earnest phoenix
#

no wonder why d.js is so poor in performance omegalul

amber fractal
#

It's literally the same thing lmao

pale vessel
#

yeah

#

but the code is much shorter

#

is my point

#

thanks for coming to my ted talk

golden condor
#

You are the one who was arguing to use a filter this whole time

pale vessel
#

?

unborn steeple
#

i fixed my mapping issue but ifo rgot how to add spaces inbetween each think in thr map

golden condor
#

In map you can do .join at the end to add spaces

pale vessel
#

map returns an array

earnest phoenix
#

so get(..).children would actually be slower since it's O(1) lookup omegalul

golden condor
#

what

pale vessel
#

it is

golden condor
#

No it's the same

pale vessel
#

wtf

golden condor
#

Surely it's the same no?

pale vessel
#

you're doing that for every category instead of just ONCE

earnest phoenix
#

how to get an emoji from id ?

pale vessel
#

get it from guild/client

earnest phoenix
#

get(..) needs to find the channel first which is one lookup
children is another lookup

golden condor
#

It really doesn't matter anymore

earnest phoenix
#

instead of calling filter directly on the channels collection which is O(n)

slender wagon
#
                                                             ^

TypeError: Cannot read property 'users' of undefined```
i tried working with "klasa" package but it gave me this error inside the package
earnest phoenix
#

oh performance matters especially when using d.js

pale vessel
#

klasa?

slender wagon
#

yeah

golden condor
#

Like commando

slender wagon
#

const { Command } = require("klasa");

pale vessel
#

ic

digital ibex
#

i wonder why people still use d.js 🤔

golden condor
#

Cos it's well maintained and has good support

pale vessel
#

¯_(ツ)_/¯

#

easier to use

golden condor
#

And that

sudden geyser
#

Discord.js makes a lot of things easier to work with. It's also JavaScript and that shit's popular.

earnest phoenix
#

it's easy for people who have little to no programming knowledge and their goal is "if it works it works"

digital ibex
#

won't ur host like

pale vessel
#

everybody gangsta until discord.js eats 50% of your memory

digital ibex
#

be soooo expensive lmao

#

cuz of ^^

golden condor
#

Eris is good aswell

#

Basically the same stuff

#

Just better

pale vessel
#

eris is much simpler

earnest phoenix
#

there are libs to stop d.js' aggressive caching

pale vessel
#

discord.js-light

golden condor
#

there are libs to stop d.js' aggressive caching
@earnest phoenix excuse me what

earnest phoenix
#

not that node.js should be used at all if you're targeting performance lol

digital ibex
#

i want to switch to detrtius, but i kinda am liking eris, its cool

pale vessel
#

hopefully discord.js next will be better

#

or not

golden condor
#

v13 the end of caching

digital ibex
#

no

#

wel

earnest phoenix
#

discord enforcing intents will kill most of caching in all libs

digital ibex
#

if they remove it people r gonna be so pissed lol

earnest phoenix
#

all libs will pretty much have to switch to stateless design

pale vessel
#

i would honestly prefer no caching

earnest phoenix
#

i mean

#

it's useful

pale vessel
#

sometimes not

earnest phoenix
#

it prevents you from hitting ratelimits and blocking on your commands for example

#

if the lib has shitty caching and performance

#

well that's a you problem

slender wagon
#
        const embed = new MessageEmbed()
        .setTimestamp()
        .setAuthor(`${role.name} | ${role.id}`)
        .setColor(role.hexColor)
        .addField("Position:", (message.guild.roles.cache.size - role.position), true)
        .addField("Hex Colour:", role.hexColor, true)
        .addField("User Count:", role.members.size, true)
        .addField("Hoisted", role.hoist, true)
        .addField("Managed", role.managed, true)
        .addField("Mentionable", role.mentionable, true)
        .setFooter(message.guild.name, message.guild.iconURL());

        message.channel.send({embed});

#

Cannot read property 'size' of undefined

earnest phoenix
#

i wonder what that could mean

golden condor
#

Good

pale vessel
#

undefined lmao

digital ibex
#

theres 'size' 2 times ee

pale vessel
#

you forgot something

digital ibex
#

o yes

slender wagon
#

oh

pale vessel
#

i wonder what that is

golden condor
#

You on discordjs v12?

pale vessel
#

he knows

slender wagon
#

ye

#

u can see the cache lol

golden condor
#

Just checking

pale vessel
#

what about the second size

slender wagon
#

oh shit

pale vessel
#

nah it returns a collection

slender wagon
#

i'll have a look, i always mess things up

pale vessel
#

by the way you can just use send(embed); since you used the embed builder

slender wagon
#

oh yeah ik

golden condor
#

It's .cache.size iirc

pale vessel
#

it doesn't return a manager

golden condor
#

oh I'm just stupid then

slender wagon
#

tried

#

Cannot read property 'cache' of undefined

pale vessel
#

well

#

it's undefined

golden condor
#

Then members is undefined

pale vessel
#

or role no

amber fractal
#

I wonder if it's partial for some reason

#

I don't think roles return partials though

#

so I have no idea why that'd happen

pale vessel
#

you know, debugging is always an option

#

just check the role

slender wagon
#

yeah i'm checking oof

earnest phoenix
#

roles can be partial

pale vessel
#

you have to check it manually then

earnest phoenix
#

i just don't know how, because even if you fetched the role from REST, it would still be in cache from the gateway so i am confusion awhat

amber fractal
#

Usually partials have the partial property then right?

pale vessel
#

yeah but role doesn't

amber fractal
#

d.js doesnt say role has partial

pale vessel
#

exactly

#

so idk

slender wagon
#

how tf do i define role

pale vessel
#

what

#

don't tell me

slender wagon
#

XD

earnest phoenix
#

inb4 they somehow created a new instance of a role manager

slender wagon
#

shit i forgot abt the rolemanager

#

at least i got it to work by removing the thing that was giving th errors, now i just have to define the roles

pale vessel
#

oh

golden condor
#

That's something

pale vessel
#

i doubted that would happen because it didn't say id of undefined or something

#

looks like i was wrong

golden condor
#

Try console log role

slender wagon
#

ah yes

#

brb

pale vessel
#

that's a nice ready message

slender wagon
#

mhm XD

copper cradle
#

oh

#

you literally used the role string hoping it'll get every property

#

by magik

#

it's big bran time

tight plinth
#

is there any way to get emoji info with something like msg.mentions.emojis.first() in discordjs? or i have to use a package or to hardcode it

slender wagon
#

lmao

honest perch
#

right so i read documentation

#

await member.ban(user, { reason: reason }); this bans but doesnt provide a reason

earnest phoenix
#

use ``

tight plinth
#

show the reason

honest perch
#

reason works, but even if i do await member.ban(user, { reason: "test" }); it doesnt work

river terrace
#

i need help making an invite command, i cant figure out what im doing wrong but what i have so far is not working

honest perch
#

message.channel.send("invite here")

river terrace
#
            .setTitle(":6093_Animated_Checkmark: Invite Glitch")
            .setColor(#6f00ff)
        
            .addField("[Click me to invite Glitch!](https://discord.com/api/oauth2/authorize?client_id=716538261572419625&permissions=8&scope=bot)"

            .setFooter(message.member.user.tag + " | Created By Jeremy#6414")
        
        if (!list.includes(message.member.user.id)) {
            return message.channel.send(embed).then( () => {
                message.react('717201156681629737');
            }).catch( () => {
                message.channel.send(embed).catch(() => {
                    return message.channel.send("> :n: i may be lacking permission: 'EMBED_LINKS'");
                   });
            });
        }
        
        message.channel.send(embed).catch(() => {
            return message.channel.send("> :n: i may be lacking permission: 'EMBED_LINKS'");
        });
    }```
tight plinth
#

@honest perch hmmmmm i have no idea why it dont work

river terrace
#

thats what i have

honest perch
#

same, it should work

#

so idk why lmao

tight plinth
#

@river terrace what exactly dont work

river terrace
#

it says at the end a , was epxected and when i run the command it doesnt work at all

honest perch
#

welp, i guess i will rely off of the web dashboard lmao

#

any errors in the console

river terrace
#

uh let me check

#

says the color is wrong

#

cant have a # apparently

honest perch
#

try 0xcolorcode

#

so like 0xffff

river terrace
#

ok

#
                                                                            ^

SyntaxError: missing ) after argument list```
#

error

#

thats the error i get

tight plinth
#

look at the end

river terrace
#

uh what am i looking for

tight plinth
#

you forgot a )

river terrace
#

oh

#

OHHH

#

wait

#

so there is supposed to be 2?

tight plinth
#

erm no

honest perch
#

")

river terrace
#

oh

honest perch
#

not )"

river terrace
#

ohhhhhhh

#

ok let me try that

tight plinth
honest perch
#

good spot @tight plinth lol

#

i wouldnt of seen that

river terrace
#
  
  ^

SyntaxError: Unexpected token '}'```
#

ok now what

#

lol

#

what on earth does it want

sinful harness
#

Screeen of the code

river terrace
#

ok

sinful harness
#

Where is the error

tight plinth
#

what the fuck is the } at the end supposed to close

honest perch
#

lmao

river terrace
#

the code ^

tight plinth
#

delete the } at the end

sinful harness
river terrace
#

ok

tight plinth
#

and try

honest perch
#

it marks things like that with the red underline

#

usually means you have an error, but dont trust that with css

tight plinth
#

^

river terrace
#

ok wtf is it doing, its telling me MessageEmbed is not defined

surreal notch
#

How to solve this in discord.js

earnest phoenix
#

Use Math.floor

surreal notch
#

i m using this addField("🤖 API Latency", ${this.client.ping}ms)

tight plinth
#

@river terrace learn how to use js

sinful harness
#

Define the MessageEmbed

river terrace
#

well im trying

tight plinth
#

use Math.round @river terrace

surreal notch
#

lol

river terrace
#

idk what that is

honest perch
#

learn how to use an ide

tight plinth
#

@river terrace how are your other commands coded?

river terrace
#

not very good

sinful harness
#
const { MessageEmbed } = require("discord.js")

@river terrace

river terrace
#

oh

#

ty

tight plinth
#

can you show me a screenshot of, let's say, your ping commabd?

#

i just want to check smth

river terrace
#

i dont have one

#

lol

tight plinth
#

well the help one?

river terrace
#

the help command?

#

thats written in my index.js

tight plinth
#

ye

river terrace
#

idk where it starts and ends i forgot

honest perch
#

hmmm

#

so did you make them?

river terrace
#

some no

#

some yes

digital ibex
#

ello

river terrace
#

hi there

surreal notch
#

but how to use math.round in this code ````${this.client.ping}ms`)```

tight plinth
#

learn js

surreal notch
#

thanks for the advice

digital ibex
#

any idea why guild is undefined? js getMember(guild, query) { guild.members /* irrelevant stuff */ } ? i do client.getMember(message.channel.guild.id, 'user'); but it returns undefined

tight plinth
#

and im completely serious @surreal notch

earnest phoenix
#

Remove id @digital ibex ?

digital ibex
#

oh yes, 🤦‍♂️

#

ok, now i do client.getMember(message.channel.guild, 'part of the users name') but it returns undefined

#

even w/ all of the username

honest perch
#

@river terrace its Discord.MessageEmbed() not just MessageEmbed()

river terrace
#

oh is it

#

let me try that

#

what do i define const discord as

#

const Discord = require('discord.js')

#

is that right?

honest perch
#

yes

river terrace
#

kk ty

#

do i put it in single quotes

#

or double

#

bc the other const has double quotes

honest perch
#

it doesnt matter lmao

river terrace
#

ok cool thanks

honest perch
#

"" '' are the same thing

digital ibex
#

if u learn js, u wont hav to ask simple questions

#

🤷

honest perch
#

^

river terrace
#

yes i know but for now im asking them bc im trying to learn

#

in order to learn u ask questions

#

its apart of learning anyways

digital ibex
#

ur making a discord bot which is throwing everything at u at the same time

#

which is why its not recommended to make a bot for learning js

#

and it also says it on the documentation on the welcome page

honest perch
#

tf is a hbs file

digital ibex
#

start with something simple, learn js a bit more, node.js and then make a bot

river terrace
#

ok says message is not defined

#

what do i make message =

digital ibex
#

no

river terrace
#

please just let me do this 1 command

#

then ill learn

#

i just wanna make this one single command

#

ok

#

please

honest perch
#

make it more simple for your self, just make a single embed

river terrace
#

im already this far into what i got

#

i wanna finish it

still merlin
#

u can still finish it once u learn

honest perch
#

so just

let embed = new Discord.MessageEmbed()
// the embed stuff here

message.channel.send(embed)

river terrace
#

i mean yea but its not clickable text is it?

digital ibex
#

dude

honest perch
river terrace
#

fine

#

ill try it

honest perch
#

hyperlink is just text

#

tbh i preferred Discord.RichEmbed

river terrace
#

thats v11

#

im coding in v12

honest perch
#

yes i know

river terrace
#

also this happened

#
.setTitle("Invite Glitch!")
.addField([Click here to invite Glitch!](https://discord.com/api/oauth2/authorize?client_id=716538261572419625&permissions=8&scope=bot))

message.channel.send(embed)```
#

says thats wrong

#

yet agian

#

ugh

#

why cant this just be easier

honest perch
#

""

river terrace
#

where

#

oh

honest perch
#

in the field

#

why cant this just be easier
@river terrace it is easy

#

just have to learn js

sinful harness
#

("[Click here to invite Glitch!](https://discord.com/api/oauth2/authorize?client_id=716538261572419625&permissions=8&scope=bot)")

honest perch
#

youre trying to make a bot without any knowledge of js

river terrace
#

ok i did that now

digital ibex
#

anyone know how to resolve my issue? js getMember (guild, query) { guild.members /* irrelevent stuff */ } guild is undefined for some reason when i do client.getMember(message.channel.guild, 'member here')

quartz kindle
#

fields require a title and a value

river terrace
#

well i have a title

#

whats a value

sinful harness
#

message.guild*

quartz kindle
#

i mean

#

addField(title,value)

#

the field title

river terrace
#

OHHH

#

wait, the title is the Click here to invite Glitch

#

is it not?

quartz kindle
#

thats the url text

honest perch
pale vessel
#

@digital ibex log message and see

river terrace
#

hm

digital ibex
#

just message?

honest perch
#

excuse my handwriting

pale vessel
#

sure

river terrace
#

its good lol misly

pale vessel
#

message and message.channel, i guess

river terrace
#

misly

#

what do i add in the .addField

pale vessel
#

name, value, inline?

honest perch
#

like this

#

title and value

river terrace
#

oh

#

don't i have to define reason tho

#

since its not in quotes

pale vessel
#

yes

river terrace
#

yeah

pale vessel
#

wait

honest perch
#

yes but you can just do "invite"

quartz kindle
#

addField("YOURTITLEHERE","YOURCONTENTHERE")

river terrace
#

and then paste the link where the word "reason" is

quartz kindle
#

basically that

river terrace
#

oh

honest perch
#

what tim said

river terrace
#

ok

honest perch
#

just a . before addfield

digital ibex
#

it logs message

#

@pale vessel ^^

pale vessel
#

try channel next

river terrace
#
.setTitle("Invite Glitch!")
.addField("Invite", invite)

message.channel.send(embed)```
honest perch
river terrace
#

like that?

#

oh ok

#

thank you

still merlin
#

the //'s dont work

#

it just goes to a code note

digital ibex
#

it logs message.channel

honest perch
#

dont bother defining it just add the invite in ""

pale vessel
#

can you show me the output?

digital ibex
#

kk

honest perch
#
let embed = new Discord.MessageEmbed()
.setTitle("Invite Glitch!")
.addField("Invite", "[Here!](https://discord.com/api)")

message.channel.send(embed)
river terrace
#

ill try that

#

i have to define discord still right

honest perch
#

yes

#

const Discord = require("discord.js")

river terrace
#

let Discord = require('discord.js')

#

yeah

#

oh

#

const

#

my bad

pale vessel
#

just define MessageEmbed if you only use that

#

(or use an object and don't define anything)

digital ibex
pale vessel
#

no guild?

digital ibex
#

thats only part of it

pale vessel
#

that's fine but can you find guild?

digital ibex
#

lemme get it

river terrace
#

message is still not defined

#

i dont get what the hell its asking

#

it said that on the last one

honest perch
#

code?

river terrace
#

code???

#

what???

#

it said that on the last set of code where i had the bigger message embed

digital ibex
river terrace
#

that was more complex

pale vessel
#

and finally; can you find members in guild?

digital ibex
#

yeah

pale vessel
#

damn bro that's crazy

#

how is members undefined

#

can you show the function + where you execute it?

digital ibex
#

kk

river terrace
#
let embed = new Discord.MessageEmbed()
.setTitle("Invite Glitch!")
.addField("Invite", "[Click Here!](https://discord.com/api)")

message.channel.send(embed)```
#

asking for message

#

what the fuck do i define message as

#

misly wont respond

#

they are "busy"

#

they said to send them the code

#

oh my god

surreal notch
#

what to use in quick.db to show balance

pale vessel
#

jeremy can you show the whole file?

river terrace
#

that is the whole fiel

#

file

digital ibex
#
 /* where i execute it: */
client.getMember(message.channel.guild, args.join(' '));

/* and what 'getMember' is: */
getMember(guild, query) {
        guild.members.find((e) => e.username === query); /* <--- error  and some extra stuff which is irrelevant */
    }
river terrace
#

its litterally called invite.js and its supposed to send an embed with clickable text to get redirected to a link that will invite my bot

#

and its not working and i don get it

pale vessel
#

do you have a command handler?

river terrace
#

i dont fuckin know, i copied half of this code

#

so

digital ibex
#

uh

pale vessel
#

isn't it client.getMember(guild, query) {}?

river terrace
#

im bad at coding, i want a discord bot, idea pops into my head, copy a bot and edit it since i understand how to EDIT code, and then turn it into something of my own by adding other unique things making it different fromt he original

#

i did that

#

now i cant code a simple invite command

pale vessel
#

i'm so sorry jeremy

#

you should try making a one file bot first

digital ibex
#

no, i just made 'getMember' but idk why its not working properly

pale vessel
#

then why is client.getMember(message.channel.guild, args.join(' '));?

river terrace
#

flazepe please can u just help me fix this

pale vessel
#

i can't, sorry

quartz kindle
#

is args.join(" ") exactly the username of the person? including case?

river terrace
#

oh my god

#

whyyyyy

#

nobody every helps me ever

#

with any code

#

ever

surreal notch
#

Go to stackoverflow @river terrace

river terrace
#

tried that

pale vessel
#

because you lack basic knowledge, it's the truth

#

i'm so sorry

quartz kindle
#

@river terrace show your code

digital ibex
#

cuz guild is the guild its executed in, and query is which args to look for

river terrace
#

already did tim ill just DM u bc everyone else here says they wont help

digital ibex
#

its not tim,

pale vessel
#

why did you use client.getMember()?

#

you defined it as getMember()

digital ibex
#

but even when i put the name of a normal members username, it returns undefined as well

quartz kindle
#

@digital ibex your function is looking for an exact match

digital ibex
#

lemme show u all of it

pale vessel
#

oh my

digital ibex
#

i'm using a class

#

whats why i'm using classes cuz i don't want to do that every time for when i'm looking for a member

quartz kindle
#

@digital ibex return

pale vessel
#

lmao

#

i'm stupid

river terrace
#

oh my goddddd whyyyyyyyy

#

nobody responds to anything

pale vessel
river terrace
#

2 dms and they both said to send code and neither responded

pale vessel
#

read this

quartz kindle
#

stop screaming and be patient

#

i'll get to you soon

river terrace
#

how soon bc i have to GO

#

im falling behind on chores

pale vessel
#

they don't even have a command handler and they have a file named invite.js

#

not even an export

quartz kindle
#

then go do your chores and come back later

river terrace
#

no i do

#

i have a command handler

#

yes

#

i do

pale vessel
#

oh god

river terrace
#

i just dont know what the hell it is

digital ibex
#

oh... i'm so dumb. thanks a lot guys :)

river terrace
#

flaz

arctic juniper
#

Hi

river terrace
#

i told u i copied a bot

#

i told u that

#

i cant code worth shit and i copied a discord bot ok, i also am trying to figure this out

#

i just want help on this 1 command and then im litterally gone forever

pale vessel
sudden geyser
#

If you copy without knowing what you're doing, the issue you're having will come back for you like a ghost.

pale vessel
#

or you should learn a programming language first

river terrace
#

yes i know

arctic juniper
#

My bot is now approved on top.gg

river terrace
#

congrats man

sudden geyser
#

congrats

pale vessel
#

it doesn't look like it

digital ibex
#

congratulations

arctic juniper
#

So why i dont get bot developer role?

quartz kindle
#

@river terrace the code you showed me is not the problem. the problem is that you're trying to use message somewhere where it doesnt exist. All code that is based on message must be placed within the context of message for example inside the client.on("message") event, which is the only place where a message is generated and processed by your code

slender thistle
#

-bots 705864187695333378

gilded plankBOT
arctic juniper
#

Thanks every one

pale vessel
#

luca borked

golden condor
#

Luca is broken

river terrace
#

ok and thats really cool tim but i dont understand what that means

#

what is the issue

quartz kindle
#

to put it simply

river terrace
#

yes

#

do that

golden condor
#

message is not defined

river terrace
#

obviously

#

i dont know how to define it tho

#

thats my issue

quartz kindle
#
client.on("message", message => {
  // message exists here
})
// message does not exist here
river terrace
#

🤦‍♂️

pale vessel
#

he has another file

river terrace
#

tim i dont know where to put that

pale vessel
#

it should be an export and he said he "has" a command handler

quartz kindle
#

its in your main file

#

you probably already have it

river terrace
#

yeah im sure i do

quartz kindle
#

so you have to check that, and you have to see where that message is being sent to

#

you need to get it to show up in your file

#

thats essentially what a command handler does

river terrace
#

im trying to send an embed in a channel though

quartz kindle
#

all commands start from a message

#

you're trying to make a command where message doesnt exist, thats the problem

river terrace
#

i dont have a clue what any of that means tim, im a shitty coder, and im bad at this, i just want to figure out an invite command and this is so stupid bc i cant code a simple fucking command

#

i hate everything

#

why do i even try

quartz kindle
#

well you have to figure it out

river terrace
#

oh my god

#

I DONt KNOW HOW

quartz kindle
#

if you want help, you will need to show more code

river terrace
#

thats all the code i have in that file

#

i know i have an idea

#

DM me tim i got an idea

quartz kindle
#

do you have other commands?

#

a command that works?

turbid bough
#

why u need an invite command thonk

arctic juniper
#

Who has best music bot code ??

digital ibex
#

thank u @quartz kindle @pale vessel, it works :)

golden condor
magic jackal
#

If I have a try...catch can someone point me in the right direction to throw an error that will add data to the error so I can catch it if it fails?

#

idk what I'm trying to do

#

I'm trying to do this currently but I'd rather throw an error and be able to catch it in the function

#

should I use new Error()

#

oh wait

#

its a promise

copper cradle
#

@river terrace what you're doing is kinda unnecessary, if you're giving admin perms to your bot why are you even checking if it has a permission, that's just unnecessary

gritty bolt
#

Honestly not sure whats wrong here, all of the files are formatted the same, anyone know whats wrong?

    at C:\Users\Samst\IdeaProjects\ClockMaster\index.js:64:41
    at Array.forEach (<anonymous>)
    at C:\Users\Samst\IdeaProjects\ClockMaster\index.js:61:16
    at FSReqCallback.oncomplete (fs.js:155:23)```

```js
 jsfile.forEach((f, i) => {
            let props = require(`./Commands/${f}`);
            console.log(`${f} loaded!`);
            bot.commands.set(props.help.name, props)
        })
    });```
```js
module.exports.help = {
name: "wcsetup"
}
module.exports.help = {
name: "convert"
}```
copper cradle
#

oh and you seem to have 0 knowledge about js

#

not you Sbss1111

#

I meant jeremy

river terrace
#

im not?

magic jackal
#

wot

#

@copper cradle Is this the correct way of doing this?

copper cradle
#

no

magic jackal
copper cradle
#

if you declared it as _cb

#

or wait

magic jackal
#

I just wanna make a callback it sounds like

copper cradle
#

ik

#

you declared the callback ad _cb

magic jackal
#

yeah

#

should I rename it?

copper cradle
#

then use _cb

#

cb is undefined