#development

1 messages ยท Page 1375 of 1

rocky hearth
#

Someone knows why the bot is giving me the error that the addFields could not be empty, apparently the bot can't make the .push to the array
@ember lodge client.user.avatarURL is a function not property

ember lodge
#

It is v11

#

I still using it perrito

rocky hearth
#

O_o then should have mentioned it in first place. We are normal people

#

Ooh u need to set the fields in the promise

#

the servers still have its default value on bottom part of the code

earnest phoenix
#

i was looking on a stack overflow thread for checking memory usage, and the top reply was this

#

process.memoryUsage().heapUsed / 1024 / 1024;

#

why are they dividing it by 1024 twice

sonic lodge
#

process.memoryUsage().heapUsed gives the amount in bytes

#

divide by 1024 twice and you get megabytes

earnest phoenix
#

is 8.069923400878906 bad?

sonic lodge
#

depends

rocky hearth
#

y r u so worried about, memory usage?

earnest phoenix
#

because im hosting it from my pc

sonic lodge
#

yeah you probably have nothing to worry about with that little usage

earnest phoenix
#

and i dont want my bot effecting my preformance

rocky hearth
#

I also host my bot on my own laptop. 24/7

earnest phoenix
#

does it ever effect ur preformance?

#

like slow down ur pc and stuff

rocky hearth
#

obviously not.

earnest phoenix
#

oh

rocky hearth
#

node handles that stuff automatically

#

also if you are coming from c#, you can code ur bot in typescript. For type checkings and stuff. Normal js is so bad in that

earnest phoenix
#

i prefer discord.asm

rocky hearth
#

but that is built on python. Previously u said, ur working in js

earnest phoenix
#

dude

#

its a joke

#

discord.assembly

#

i was making a joke that i scripted bots in assembly

rocky hearth
#

LOL, and I started googling, about discord.asm

earnest phoenix
#

wait

#

if process.memoryUsage().heapUsed returns byte memory

#

and divided by 1024 2 times = mb

#

what is it divided by 1024 1 time

#

kilo byte?

rocky hearth
#

yes

earnest phoenix
#

so

#

byte > kb > mb > gb > tb > stuff not used in modern pc's

#

right?

rocky hearth
#

wdym

silver lintel
rustic nova
#

Use invisible characters instead of spaces

carmine summit
#

if (!message.member.hasPermission("MANAGE_GUILD")) return is not working anymore suddenly

earnest phoenix
#

Hello, i want to change vanity invite using a bot, it is possible?

My code

fetch = require('node-fetch')

fetch('https://www.discord.com/api/v6/guilds/762359120031907871/vanity-url', {
                method: 'POST',
                headers: { 'Authorization': 'Bot ' + client.token, 'Content-Type': 'application/json'},
                payload: JSON.stringify({
                        "code":"test458"
                      })
            })
            .then(res => res.json())
            .then(json => { console.log(json)})

i have tried with a request, but it returning only the code

{ code: 'invitecode', uses: 0 }
#

i think it's the PATCH method, but the api returning 405: Method Not Allowed so i'm not the sure on the method i need to use

carmine summit
#

WTF DUDE HAVENT YOU HEARD OF DISCORD.JS?

earnest phoenix
#

?

carmine summit
#

There is an npm package for discord bots

#

and you're here trying to run a discord bot using node-fetch

rocky hearth
#

:xd:

earnest phoenix
#

No i'm trying to change the vanity invite

#

using the rest api

#

Because discord.js doesn't have the changeVanity function

carmine summit
#

ah

#

that makes sense

#

haven't found anything about changing the code on the docs

#

but i think guild.edit can help?

earnest phoenix
#

oh

#

maybe

#

i'm trying

carmine summit
#

create an invite then if it does not mathces the string, it will delete the invite, then creates another one until you hit the perfect code?

#

yes that will take years

earnest phoenix
#

Wow

#

It worked with http request

#

Nice

tawdry arrow
#

I would like if someone teach me to learn programs in order to make bot

#

I'm newbie

#

It's my job to make programming

rocky hearth
tawdry arrow
#

K

steep sun
#

How do you code Discord Bot using Lua??

pale vessel
#

learn lua and use a library like discordia

tawdry arrow
#

@rocky hearth thanks i have to learn javascript i might buy javasxript from amazon

pale vessel
#

js is expensive on amazon

tawdry arrow
#

I'll check

pale vessel
#

pirate js

slender thistle
#

Why why why

rocky hearth
#

I learnt complete js in 1 month without spending a single penny. I was having prior knowledge of C++ though.

pale vessel
slender thistle
#

@tawdry arrow You might as well spend money on personal JS lessons at this rate. You can learn JS from multiple sources without spending a single cent

#

I've learned Python, C#, basic JS, HTML and CSS by relying on multiple free sources instead of buying stuf

tawdry arrow
#

@slender thistle is python better ?

slender thistle
#

Strongly depends on what you want to use it for

gilded ice
#

i have some code that checks if a member can be kicked with a catch block and it catches but the rest of the code still runs (sending the kicked embed and saving the case into the database)

vernal rivet
#

did you add a return keyword?

gilded ice
#

yup

vernal rivet
#

can you show the code?

gilded ice
#

heres the relevant code

#
        person.kick(reason ? reason : "No reason given").catch(e => {
            console.log(e);
            return msg.channel.send({embed: {
                title: "Uh oh...",
                description: "A' was unable te kick that member",
                color: "#FB524F",
                footer: {text: msg.author.tag, icon_url: msg.author.displayAvatarURL()},
                timestamp: msg.createdTimestamp
            }});
        });

        msg.channel.send({embed:{
            title: "Kick",
            description: `${person} has been Kicked | Moderator: ${msg.author}\nReason: ${reason ? reason : "No reason given"}`,
            color: "#FB524F",
            footer: {text: msg.author.tag, icon_url: msg.author.displayAvatarURL()},
            timestamp: msg.createdTimestamp
        }});
    
        const kick = new Case({
            findID: msg.guild.id + person.id,
            userID: person.id,
            guildID: msg.guild.id,
            caseType: "Kick",
            reason: reason
        });
        const kicked = await kick.save();
        console.log(kicked);
#

unless i cant see it and its super obvious

vernal rivet
#

so the problem is that it is executing when it is not supposed to?

gilded ice
#

yeah

vernal rivet
#

js is wack sometimes

gilded ice
vernal rivet
#

oh did you try putting the kick embed in a .then() instead of the .catch()?

#

the .catch() is used for error handling. so if there is problems it will skip the .then(), and execute the catch method, else it would run the .then() and skip the .catch()

rocky hearth
#

@gilded ice use try/catch intead of thenable. The rest of the code will run irrespective of the catch method

vernal rivet
#

I mean either option is workable, just depends on what they choose to do it. From what I remember .kick() is a promise so .then().catch(). If it wasn't a promise then yes a try catch would be better. Like I said either one is workable

rocky hearth
#

???.... try/catch do work with promises too

vernal rivet
#

Yes I didn't say it doesn't

rocky hearth
#

I mostly use try/catch when I immediately want to return, when there is an error. ๐Ÿ™‚

surreal sage
#

What is the response from dbl.getVotes()?

vernal rivet
#

Yes, but at the same time it would do that with a thenable, since usually you just error handle in it, or your logging it. If you want an immediate return then if statements is the way to go FLdogekek

upper crescent
#

hey

#

can anyone tell me how can i make a mute command that supports limit like after that much time the user will be unmuted again ??

rocky hearth
#

@upper crescent You can create a Mute role in ur server. And have that assigned to the member. And remove it after some time

upper crescent
#

first two part i have done

#

i am consern about the last part

rocky hearth
#
client.setTimeout(() => member.roles.remove(<RoleResolvable>), 60000);
#

it will unmute the member after 1min

upper crescent
#

but if i stop my bot then ??

rocky hearth
#

then it wont work

upper crescent
#

i am using golang btw

rocky hearth
#

for that u need to setup a database

upper crescent
#

yeah i thought that earlier

#

so what do i have to store in the database

#

the time at which the user will be unmuted ??

rocky hearth
#

yes. Then you u've to calculate and create the timeouts again in ready event
For each user in the database

upper crescent
#

hmmm

#

for each user in the database
so i have to add handlers at ready event handler function and call it for each user who is muted ??

hazy sparrow
#

Yo is there any way to fimd a server by it's id in the cache of the bot?

rocky hearth
#

client.guilds.cache.get()

pale vessel
#

you don't remove the cache

#

you remove the role itself, roles.remove(role)

#

it's an API call so it has nothing to do with cache

rocky hearth
#

ooh sorry, there's also no method on cache to remove anything ๐Ÿ˜„

earnest phoenix
#

Where can I add my bot soru

pale vessel
#

there is, since it's a collection. it takes an id but it only removes the role from the cache

#

it's not what you want to do

rocky hearth
#

@earnest phoenix Most probably in your own server

earnest phoenix
#

No

#

I say
Can I add my bot in this server soru

rocky hearth
#

Don't lie, u didn't say that

earnest phoenix
#

๐Ÿ˜„

#

So, Can I this โ˜๐Ÿผ soru

rocky hearth
#

Yes, you can. But you've to ask the moderators

earnest phoenix
#

<@&304313580025544704> Help me plz

twilit rapids
#

-atmods @earnest phoenix

gilded plankBOT
#

@earnest phoenix

Please do not mention (ping) more than one or two moderators for help, unless there is an emergency.

Here are some examples of emergencies:

  • Raids / Multiple members mass spamming.
  • Severe disruption of Discord's ToS (NSFW content, etc)
  • Anything that requires more than 2 moderators to handle.
earnest phoenix
#

I want to add my bot

tame kestrel
#

grr

twilit rapids
#

And fill out the fields

earnest phoenix
#

Thank

flat pelican
#

@modern sable is it too late to ask to get demoted

dense karma
#

Hey people i am having problem in discord developer portal (the caching issue and the assets appearing after a long time) y'all got any idea how to fix it
I know not a top.gg problem, but if y'all can help

rocky hearth
#

I feel pity. ๐Ÿ˜ฆ sorry

dense karma
#

I feel pity. ๐Ÿ˜ฆ sorry
@rocky hearth yeah man, this is a problem from discord's side, searched the whole net and found nothing, what a shame

#

Alright if someone has a solution Pls ping me or dm,
Both open!

earnest phoenix
#

@dense karma right click on the reload button in chrome then press clear cache and hard reload

knotty basin
#

i need help for these

earnest phoenix
#

๐Ÿ™ˆ

knotty basin
#

do u know how?

#

lol i just do orders

earnest phoenix
#

Light mode

#

We will die if we try to help you with a screenshot in light mode

knotty basin
#

thats pic is old

rocky hearth
#

I'm using that image, to find my key. Its too dark here

earnest phoenix
#

I'm using that image, to find my key. Its too dark here
@rocky hearth you fucking smartass that is an illegal use for light mode

knotty basin
#

can I get someone to help me :>

zealous sable
#

What language are you using

knotty basin
#

english

rocky hearth
#

LOL

zealous sable
#

Coding language ๐Ÿ™‚

knotty basin
#

everyone understands english i think

#

ok so?

#

you can help me with this kind of embed?

zealous sable
#

What programming language

#

Are you using

#

To make the bot

knotty basin
#

hm

#

visul

#

visual

#

i installed visual and node

rocky hearth
#

visual studio code?

knotty basin
#

yes

rocky hearth
#

wow great move

zealous sable
#

Okay visual studio code is great

#

But what language are you using

knotty basin
#

english

zealous sable
#

Python,js

knotty basin
#

discord.js

zealous sable
#

Okay so JavaScript

knotty basin
#

oki

zealous sable
#

Great place to start for discord bots

earnest phoenix
#

What language are you using

english

Coding language ๐Ÿ™‚

everyone understands english i think

you can help me with this kind of embed?

What programming language

hm
visual
i installed visual and node
@knotty basin ahhh yes you are definetely mr genius

zealous sable
#

However If you donโ€™t have knowledge of the actual js language

earnest phoenix
#

This is now going on reddit

zealous sable
#

Then id start somewhere far away from discord bots

rocky hearth
zealous sable
#

Ah yes now the guy has 2 different documentations

#

This is going to be great

knotty basin
#

so i the one make the field?

#

oki

zealous sable
#

You have to code an embed in a bot yes

hazy sparrow
rocky hearth
#

making a discord bot, requires you to have knowledge of some programming language @knotty basin

earnest phoenix
#

how do i remove the "8ball" in the question section thingy
@hazy sparrow splice out 8ball from args

hazy sparrow
#

splice?

#

oh

#

got it

knotty basin
#

so you guys help me for the commands or just me?

crystal wigeon
#

hey guys how do you find the indexes of documents in a collection? in mongodb

zealous sable
#

Unfortunately we wonโ€™t spoon feed you a tutorial but all the info is on the docs

crystal wigeon
#

its returning only 1 index

#
    console.log("indexes:", indexes);
    // ...
}).catch(console.error);``` im using this
hazy sparrow
#

so you guys help me for the commands or just me?
@knotty basin We will help if you have questions or errors, we will NOT spoonfeed you code

earnest phoenix
zealous sable
#

When creating a file I believe you put it like folder/file

#

But this will cover more than my 5 second google knowledge

ivory seal
#

why are u using glitch but?

earnest phoenix
#

Glitch does not like discord bots@earnest phoenix

#

And vice versa

crystal wigeon
#

true

#

;-;

#

but it gives better ping for Asia. heroku is just way too much ping

knotty basin
#

i think glitch is only for roblox and stuff

earnest phoenix
#

@knotty basin bro do you even know how programming works

knotty basin
#

no?

crystal wigeon
#

lol

knotty basin
#

yah ill do my best

crystal wigeon
#

there's a learning curve ๐Ÿ˜„

earnest phoenix
#

then it's not a good idea to start bot development now

crystal wigeon
#

even for us haha

knotty basin
#

ill do research

earnest phoenix
#

learn programming for a few days or weeks then when you're confident get into bot development

knotty basin
#

google is beside me

earnest phoenix
#

trust me it will be a lot better

ionic dawn
#

You can learn by making discord bots

knotty basin
#

im tryna making bots like rn

ionic dawn
#

you'll find a lot of problems and challenges but

#

you can always read docs while coding

earnest phoenix
#

You can learn by making discord bots
@ionic dawn yes but this guy literally has no experience with programming so it will probably be a lot worse for them

knotty basin
#

wait what code again for the prefix?

ionic dawn
#

You don't need to take any course before starting with bots (even tho is better), but you'll need to learn javascript while coding your bot in order to complete your bot functions

#

like, if you want to make a moderation bot and want to store x data you'll learn sql/mongo and some specific javascript

earnest phoenix
#

wait what code again for the prefix?
@knotty basin there is no single "code" for prefix there are only examples. Your own method you figure out on your own

knotty basin
#

like const idk

#

is it const prefix = "!" ?

ionic dawn
#

@earnest phoenix I first started with python/javascript with 0 idea, and learning while making the bot make it easier, you learn what you need/want

#

its less frustrating or bored.

earnest phoenix
#

@earnest phoenix I first started with python/javascript with 0 idea, and learning while making the bot make it easier, you learn what you need/want
@ionic dawn does that mean i wasted my time learning javascript for 8 months cuz i wanted to make a bot?

ionic dawn
#

No

knotty basin
#

is it const prefix = "!" ?

ionic dawn
#

that means you take another way to learn

knotty basin
#

is that right or nah?

earnest phoenix
#

@knotty basin read my message again

knotty basin
#

kk

earnest phoenix
knotty basin
#

k fine

#

ty

ionic dawn
#

In my case I didn't want to learn much of javascript cause I was at school and I was just having fun with bots, but if you want to work in a real project yeah you should learn general javascript

ivory seal
#

again it doesn't really help you if we give u the code directly

ionic dawn
#

Studying while coding is the best way to learn "In my experience", you'll keep more information if you put it on practice

#

reading docs randomly dsnt make any sense and you wont remember everything

vivid oar
#

Do you guys can reference me some links where I can learn how to customize my top.gg page on my Discord bot?

earnest phoenix
#

also im saying this again, you should have at least a little bit of experience with programming before trying to make a bot. how would you do practical stuff (like bot development) and improve yourself if you don't even know anything in the first place?

ionic dawn
#

Do you guys can reference me some links where I can learn how to customize my top.gg page on my Discord bot?
@vivid oar Its just basics CSS, you can watch a simple tutorial of css at youtube and implement it at the top.gg description with style tags.

earnest phoenix
#

Studying while coding is the best way to learn "In my experience", you'll keep more information if you put it on practice
@ionic dawn this is where the scrimba ad comes in

vivid oar
#

Yes I know, but when I use CSS no changes are taken...

#

And that is a little bit frustrating.

earnest phoenix
#

Yes I know, but when I use CSS no changes are taken...
@vivid oar send your short description here

#

*long

vivid oar
#

ok

ionic dawn
#

@earnest phoenix send your paste

vivid oar
#

But no

earnest phoenix
#

it's fucked rn cuz express is weird

vivid oar
#

It's too long to send it here xD

earnest phoenix
#

@vivid oar then use haste bin

vivid oar
#

k

ionic dawn
#

@vivid oar you can use a paste tool yo share your code

vivid oar
#

here you go

earnest phoenix
vivid oar
#

that's weird

#

never worked in xml before.

#

That's why it didn't worked.

earnest phoenix
#

wow did you just send everything BUT the css which was the only thing i actually needed

sterile ridge
#

how can I know the numbrer of all guilds where my bot is in? (python)

vivid oar
#

Let it be now

earnest phoenix
#

reload page

vivid oar
#

ok then

tribal skiff
vivid oar
earnest phoenix
#

i literally said the css is what matters

vivid oar
#

Can you explain me step by step
I just copied the code from top.gg, where I put my description there.
I am just beginner with top.gg description styling.
What CSS do I need to bring to you?

earnest phoenix
#

What CSS do I need to bring to you?
Your own CSS

vivid oar
#

Ohhhh.
Appologise, I will start making it after my courses..
Nevermind that.
If I have my CSS made, how can I make it work with my top.gg description?
Like others?
That's what I want to know.

#

To customize my bot page

earnest phoenix
#

When your CSS is made just put it inside the style tags in head of HTML

vivid oar
#

Ok, thanks!

earnest phoenix
#

:+1:

silver lintel
#

How to check if a string only has certain letters in js?

earnest phoenix
#

How to check if a string only has certain letters in js?
@silver lintel string.split ("").includes (char);

ionic dawn
#

๐Ÿ‹ AmongUs_ComfyCry

knotty basin
#

does my bot needs noblox.js to add roblox photo?

warm marsh
#

You're the Genius, shouldn't you know?

knotty basin
#

having the name MRGENIUS doesnt mean im too smart

earnest phoenix
#

having the name MRGENIUS doesnt mean im too smart
@knotty basin just like how having bot developer role does not make you a programmer who is so funny everybody loves his bot and it got approved

quartz jewel
#

Change it to "callmemrretard" then so matches you.

earnest phoenix
#

Change it to "callmemrretard" then so matches you.
@quartz jewel that's rude man

knotty basin
#

i thought they gonna help me if i have questions i aint asking for code im figuring it out how to make it

earnest phoenix
#

i thought they gonna help me if i have questions i aint asking for code im figuring it out how to make it
@knotty basin because you're breaking the rules of programming chat

knotty basin
#

@knotty basin We will help if you have questions or errors, we will NOT spoonfeed you code
.

#

but im just asking if it needs a novblox

#

noblox*

earnest phoenix
#

idk

#

try looking at roblox's API

warm marsh
#

What is inside of the noblox.js?

knotty basin
#

noblox.js needs cookie can be use for group ranking

#

something like that

earnest phoenix
#

Why not try reading their docs to figure it out? We can't help you with everything. If no one is willling to help there is no reason to keep begging for help.

#

I was thinking of making a userinfo to find the personโ€™s name

#

its like

#

message.guild.members.cache.get(a=> a.name === args.join(" "))

#

would that work?

warm marsh
#

get takes a string not a callback

earnest phoenix
#

Oh I understood

#

I will test with other variables

warm marsh
#

you can use find

#

it takes a callback

earnest phoenix
#

ok sir

#

thank u

quartz jewel
#

Get is just the same as Map.get(), takes a key.

warm marsh
#

cache is a collection which is an extension of map, so therefore ^

earnest phoenix
#

okok

#

i make this

#

message.guild.members.cache.find(a=> a.name === args.join(" "))

warm marsh
#

okay.

earnest phoenix
#

but nothing returns

low shard
#

@earnest phoenix what you trying to make

warm marsh
#

I was thinking of making a userinfo to find the personโ€™s name

earnest phoenix
#

avatar command

#

this too

arctic hare
#

@earnest phoenix you could do

    const member =  this.getMemberFromMention(message, args[0]) || 
      message.guild.members.cache.get(args[0]) || 
      message.member;```
warm marsh
#

That's cool and all but the first would only work if the extension was default

earnest phoenix
#

@arctic hare oh ok

quartz jewel
#

KABOOM said the server when you got near it.

arctic hare
#

member.user.displayAvatarURL()
for avatar

low shard
#

you can to do like this const member = message.mentions.users.first()
.setImage(member.user.avatarURL)

#

@earnest phoenix

earnest phoenix
#

could i take this rest?

arctic hare
#

You can dm me.

earnest phoenix
#

ok

low shard
#

@earnest phoenix dm

earnest phoenix
#

Hi guys, im trying to change my bot max deleting messages from 100 to 500, i changed the number but it says some errors: limit: int value should be less than or equal to 100., i changed it to: if (parseInt(args[0]) > 500) {, but still problems

warm marsh
#

bulkDelete is only 100 msg / time

earnest phoenix
#

uhh

#

any way to fix it to be 500?

warm marsh
#

do it 5 times

#

just make sure to have a delay

earnest phoenix
#

} else {
deleteAmount = parseInt(args[0]);
}

#

After this right?

quartz jewel
#

Should also check if deleteAmount is NaN.

#

As parseInt if a string is passed that isn't a number will be NaN.

lean wing
#

how can i do this with embed

var players = 12;

${players}
and it will send the value but the text will be like this example

split hazel
#

format?

near stratus
#

use something like this @lean wing

let emb = new Discord.MessageEmbed()
    			.setColor("any color hex")
    			.setTitle("Players")
    			.setDescription(`The number of players are ${players}`)
message.channel.send(emb)
split hazel
#

You can split the players however you want to with players.join(", ")

#

but assuming the players are an object you'd need to map them first

#

unless you want mentions

quartz kindle
#

He wants that the value 12 contained in the variable player appears in the embed with the backticks quote so its darker than the rest of the text

#

He has to either escape the backticks or use concatenation

#
.setDescription(`bla bla bla \`${player}\``)

Or

.setDescription("bla bla bla`" + player + "`")
hazy sparrow
#

in the message event i did message.react() so now is it newMember.react() or something else?

quartz kindle
#

newMember is a member, not a message

#

You cant react to a member

hazy sparrow
#

KEKW so how do i react to the message that is sent when a person leaves the guild?

quartz kindle
#

Await the message then react to it

#

Let msg = await channel.send()
msg.react()

hazy sparrow
#

ah okay thanks!

#

oh wait

#

\๐Ÿ‡ซ

sweet orchid
#

new bot creator @here. need someone to test my creation out. thx

hazy sparrow
#

@here pings doesesnt work

sweet orchid
#

k thx

rustic nova
#

@sweet orchid we are not your test Guinea pigs

#

Test it yourself, we have to do so ourselves too

ivory seal
#

or creat a alt and test it lmao

rustic nova
#

That too

sweet orchid
#

@rustic nova sorry

hazy sparrow
#

it keeps saying undefined

client.on("guildMemberRemove", (newMember) => {
      
     const welcomeChannel = newMember.guild.channels.cache.find(channel => channel.name == 'welcome')
     
     welcomeChannel.send(`Press F for ${newMember.usertag}. We are now back to ${newMember.guild.memberCount} :/`)
     
  })
umbral zealot
#

member.usertag isn't a thing.

#

look at the actual properties of GuildMember here: https://discord.js.org/#/docs/main/stable/class/GuildMember

hazy sparrow
#

okay thanks

#

hmm so how do i get the usertag of it? like Name#6969

worthy pine
#

<user>.tag

ivory seal
#

member.tag or u can do ${member.username}#${member.discriminator}

pale vessel
#

member.user.tag

#

member.user.username member.user.discriminator

clever dust
umbral zealot
#

Don't import an entire CSS library into your bot page

#

It modifies the entire base CSS. Bad idea.

clever dust
#

how would i only import just the one that i need?

umbral zealot
#

Just write actual CSS directly, and only for the things you need.

earnest phoenix
#

It's possible to stop a prune when she started, as i know the prune is not a one-time kick, but it's a massive kick, so, if the user got kicked before the prune has ended did they stop?

sudden geyser
#

I don't think so.

#

The prune endpoint is only one API request to my knowledge, which wouldn't allow you to cancel in the middle.

#

Unless you wanted to kick each member one by one, which is not efficient.

quaint hornet
#

theres a way to disable the default css to be more easy to just create other css?

earnest phoenix
#

can anyone give me a code for when my bot join a guild, it send a dm message to server owner pls

rustic nova
earnest phoenix
#

as Koya or other bots

rustic nova
#

i can tell you how to do it, but not give you the code

earnest phoenix
#

ok

#

dm ?

#

or here ?

rustic nova
#

here

earnest phoenix
#

ok

#

how ?

rustic nova
#

I don't remember what the event is called Sweats I don't code in js and only remember a portion of it

earnest phoenix
#

๐Ÿ˜ญ

umbral zealot
#

Depends on the library

#

it would be something like guildCreate or on_guild_create or something like that.

earnest phoenix
#

thks

summer acorn
viscid gale
#

service unavailable??

brittle hazel
#

can you ask html questions here? related to a website of bot?

viscid gale
#

anything?

brittle hazel
#

related to html stuff

viscid gale
#

omfg

#

ok

#

small msgs

crystal wigeon
#

what shappening to discord

viscid gale
#

so much msgs fail

solemn latch
#

What always happens

crystal wigeon
#

service unavailable?

brittle hazel
viscid gale
#

happening to my bot too

tribal siren
#

if(cmd === `${prefix}ban`){ if(!message.member.hasPermission('BAN_MEMBERS')) message.channel.send("Required permission to use that command: ``BAN_MEMBERS``"); else { let member = message.mentions.members.first(); let reason = message.content.split(" ").slice(1).join(" "); if(member) { try { await member.ban(reason= `${message.author.username}: ${reason}`); console.log(`${member} is banned by ${message.author} in ${message.guild}`); message.react('โœ…'); } catch(err) { console.log(err); } } } }

#

what could i do wrong?

#

just started to think about reasons

rocky hearth
#

How do we know. Only you can see the errors

tribal siren
#

that's the problem

#

it gives no errors

#

but it doesn't do it's job

rocky hearth
#

in reason=, replace = to : and surround it with braces

solemn latch
#

Your code does a handful of things.
What works what doesnt?

tribal siren
#

so it worked properly before i started to code the reason stuff

tender crag
#

tour

tribal siren
#

now i did this

#

**if(cmd === `${prefix}ban`){ if(!message.member.hasPermission('BAN_MEMBERS')) message.channel.send("Required permission to use that command: ``BAN_MEMBERS``"); else { let member = message.mentions.members.first(); let reason = message.content.split(" ").slice(1).join(" "); if(member) { try { await member.ban(reason: `${message.author.username}: ${reason}`); console.log(`${member} is banned by ${message.author} in ${message.guild}`); message.react('โœ…'); } catch(err) { console.log(err); } } } }

#

it finally showed error

rocky hearth
#

ban takes an object

tribal siren
#

SyntaxError: missing ) after argument list

#

i just can't understand where should i put the )

solemn latch
#

After the argument list

tribal siren
#

After the argument list
@solemn latch cool

rocky hearth
#

await member.ban({ reason: `${message.author.username}: ${reason}`} )

tribal siren
#

oh

#

lemme try

tribal siren
#

yea

#

also

formal gust
#

Same with me

tribal siren
#

i now tried doing like curiosbasant showed

#

it gave me this error

#

SyntaxError: Unexpected token '{'

umbral zealot
solemn latch
#

Blame discord

halcyon kite
#

disocrds dying hard for me

solemn latch
#

It has been

halcyon kite
#

I have to literary reload every message

tribal siren
#

yea me too

rocky hearth
#

did you surround it with braces

#

the message was not delivering, so! ๐Ÿ˜ฆ

#

@tribal siren

tribal siren
#

yes i fixed it

#

it works

#

thank you!

balmy knoll
#

In node.js, how can I create charts in image form (JPEG or PNG)?

quartz kindle
#

depends on how you create the charts

#

most chart generation libraries can output them as images

balmy knoll
#

Some libraries example?

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

delicate shore
#

Which privileged intent needed for guildMemberAdd event

crystal wigeon
#

How do you make your emojis private, so that others using your bot can't just use them?

#

Like enter your server and steal them

solemn latch
#

Make a private server just for emojis?

delicate shore
#

^

crystal wigeon
#

How? I can't create private server ;-;

#

I can make a private channel

delicate shore
#

Wait what

#

Make a server

crystal wigeon
#

It's kinda confusing tho

delicate shore
#

New server

#

Add your bot

cinder patio
#

A server is private when you don't give the invite to anybody... lol

delicate shore
#

Don't invite anyone else

crystal wigeon
#

Yeah and then restrict all permissions

delicate shore
#

And keep on adding emoji to it

#

Yeah and then restrict all permissions
@crystal wigeon
No because only you and your bot in server

#

Are in*

crystal wigeon
#

I see. Thanks, I'm dumb got kinda confused with it ;-;

uncut juniper
vale garden
#

hi

#
@bot.command()
async def math(ctx, arg1, arg2, arg3):
  if not(arg1):
    await ctx.send("You need to enter the operation to be performed")

  elif not(arg3):
    await ctx.send("You need to enter the 2 numbers on which the operation is to be performed as well")

  else:

    if arg1 == "add":
      ans = int(arg2) + int(arg3)
      await ctx.send(f'The sum of {arg2} and {arg3} is {ans}')

    elif arg1 == "subtract":
      ans = int(arg2) - int(arg3)
      await ctx.send(f'The difference of {arg2} and {arg3} is {ans}')

    elif arg1 == "multiply":
      ans = int(arg2) * int(arg3)
      await ctx.send(f'The product of {arg2} and {arg3} is {ans}')

    elif arg1 == "divide":
      ans = int(arg2) / int(arg3)
      await ctx.send(f'The quotient of {arg2} and {arg3} is {ans}')

    elif arg1 == "mod":
      ans = int(arg2) % int(arg3)
      await ctx.send(f'The remainder of {arg2} and {arg3} is {ans}')
#

i have all this

#

and for some reason it sends an error when the arg1 isnt specified

#

instead of excuting the if block

#

btw i started py today so yea

sonic lodge
#

the function expects four arguments and has to get four arguments

gusty quest
#

can someone help me with something in dm ?

solemn latch
#

"something"

stable eagle
#

dont ask to ask

solemn latch
#

could be anything, could be something we dont know

gusty quest
#

help me with TypeError: Cannot read property 'send' of undefined

#

msg.channel.send(embed);

clever dust
#

msg.channel is undefined

gusty quest
#

wdym

#

?

solemn latch
#

channel can be nulled? since when ๐Ÿค”

gusty quest
#

??????

solemn latch
#

how is msg being defined

gusty quest
#

Here is entire code:
`const Discord = require('discord.js');

module.exports = {
name: 'penis',
description: "Penis Komanda",
execute(bot, msg, args){

    let responses = [
        "8=D",
        "8==D",
        "8===D",
        "8====D",
        "8=====D",
        "8======D",
        "8=======D",
        "8========D",
        "8=========D",
        "8==========D",

    ]
    let response = responses[Math.floor(Math.random() * responses.lenght )];
    let embed = new Discord.MessageEmbed()
    .setAuthor(`$(msg.author.username)'s pp`)
    .setColor('RANDOM')
    .setDescription(response)
    msg.channel.send(embed);
}

}`

#

Lmao

solemn latch
#

do you mind trying to log msg somewhere in this code?

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

gusty quest
#

wut

sage bobcat
#

One message removed from a suspended account.

solemn latch
#

.setAuthor($(msg.author.username)'s pp)
$(msg.author.username) should be using {}

earnest phoenix
#

who pinged Blob_rage

sage bobcat
#

One message removed from a suspended account.

gusty quest
#

okay

solemn latch
#

probably a few others, but im blind to these things.

gusty quest
#

now i have other errors

sage bobcat
#

One message removed from a suspended account.

gusty quest
#

here

#

TypeError: Cannot read property 'username' of undefined

#

.setAuthor(${msg.author.username}'s pp)

solemn latch
#

i think your msg variable isnt actually a message object

#

which is why i asked for it to be logged.

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

solemn latch
#

also, msg.channel was undefined

#

which is not nullable

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

hey

#

i tried to make an "lyrics command"

#

i used the Genius api

gusty quest
#

}else if(command === 'penis'){ client.commands.get('penis').execute(msg, args);

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

idk ๐Ÿ‘

solemn latch
#

your execute is sending (msg, args)
but your code is trying to get (bot, msg, args) @gusty quest

earnest phoenix
#

I tried something but not worked

#

G.tracks there is undefined

#

oh so

#

so how i can define 'search'

#

or 'G.tracks'

gusty quest
#

@solemn latch

#

now its say bot is not deifned

#

defined

earnest phoenix
#

What's G in the first place

solemn latch
#

is your bot defined as client ๐Ÿค”

gusty quest
#

no

earnest phoenix
#

i have the api key in an .env file

#

so

#

Log what G returns

#

console.log(G)

#

oh ok

solemn latch
#

then just dont send bot at all, remove bot from your
execute(bot, msg, args){
since you dont use bot in this command anyway.

gusty quest
#

@solemn latch

#

Now i have this error

#

ReferenceError: msg is not defined

solemn latch
#

kek

earnest phoenix
#

so

gusty quest
#

client.commands.get('penis').execute(msg, args);

solemn latch
#

how are you running this code

gusty quest
#

um

#

what

solemn latch
#

whats your message event look like

crimson vapor
#

client.commands.get('penis').execute(client, msg, args)

earnest phoenix
#

@gusty quest try to put execute(client, message, args){

#

๐Ÿ‘

#

Pablo

solemn latch
#

he said he isnt using client as his bot variable

#

๐Ÿคทโ€โ™‚๏ธ

crimson vapor
#

client.commands tho

earnest phoenix
#

so @gusty quest try to change msg to message

crimson vapor
#

why????

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

He uses msg as his message object

solemn latch
#

i am just going off what he is telling me.

prisma oriole
#

i love just waking up, hoping to have a productive developing day, and all I see is a penis command

crimson vapor
#

they aren't passing through enough variables

#

LOL

earnest phoenix
#

You mean parameters?

gusty quest
#

OMG

#

it works

#

thank u guys

crimson vapor
#

sure

#

maybe I do

earnest phoenix
#

๐Ÿ‘

gusty quest
#

โค๏ธ

earnest phoenix
#

SO

#

how can

solemn latch
#

just a heads up, you gotta give correct info when we ask

#

lying makes the process 10x harder

earnest phoenix
#

@earnest phoenix Bruv, what was the output

#

the same as the other

#

search is not defined

#

What

#

I told you to log G?

#

yeah

#

but

#

i put

#

console.log

#

Where did you put it

#

And it throws the same result

#

wait

#

let me send an ss

crimson vapor
#

and what is the error?

earnest phoenix
#

wait

#

Uhh, where did you even put the console.log(G);?

prisma oriole
#

not the error, but I think you're missing the ${song.url} for the string literal

earnest phoenix
#

That's not his error

#

He showed his error above

prisma oriole
#

thats why I said 'not the error'

earnest phoenix
#

๐Ÿ‘

#

the same

#

Uhh, where did you even put the console.log(G);?

#

in

#

wait

#

sorry if my english is bad XD

#

then console.log(G)

viscid gale
#

btw how to put a custom status on ur bot.. i tried several ways

bot.on('ready', function(){console.log(1)
  bot.user.setActivity("to use me", {"type": "ping me"})
  bot.user.setStatus("Invisible")
  bot.user.setPresence({status:"online", game:{name:"to use me",type:"ping me"}})
})
#

none work

#

in anyway

earnest phoenix
#

You have to put it under const G = new genius.Client(process.env.GENIUS_API)

#

Oh ok

#

@viscid gale i tried the same but i use client not bot

#

Bots can't have a custom status

#

??

viscid gale
#

i mean

#

"playing _help"

earnest phoenix
#

yeah

viscid gale
#

i've seen it too many times.. so they can

earnest phoenix
#

That's an activity not custom status

viscid gale
#

did u see everything i tried

earnest phoenix
#

The type has to be PLAYING

viscid gale
earnest phoenix
#

this is like

viscid gale
#

hmm

earnest phoenix
#

activity playing to the otis mom

viscid gale
#

i shall try that

earnest phoenix
#

๐Ÿ‘

#

That's not... megafacepalm

prisma oriole
#

brain

#

melting

earnest phoenix
#

@earnest phoenix Mate did you try what i said

viscid gale
#

btw client is = new Discord.Client(); right?

prisma oriole
#

did he properly set up dotenv?

earnest phoenix
#

He didn't even log G for us to see what it's

#

@earnest phoenix Mate did you try what i said
@earnest phoenix Yeah

#

wait

#

So?

#

wait a sec

prisma oriole
#

i was wondering because idk if the library populates G.tracks only after the client is successfully authenicated via the api key

#

but yeah still console.log(G)

earnest phoenix
#

Oh my god, wtf are you doing

#

Dies

prisma oriole
#

read the error...

#

you're doing

console.log(G) // accessing it before it's even a thing
const G = g.clientwhatever()
earnest phoenix
#

Just put console.log(G), not wrap it inside a .then()

#

no

#

let me show you

#

Did you try that?

prisma oriole
#

isnt that diffrent lol

#

the error has a .then

viscid gale
#

@earnest phoenix ur example works.. but how do i change the Playing part of the status to some text of your choice?

blazing ravine
earnest phoenix
#

You can't, as i said bots can't have a custom status

blazing ravine
snow urchin
#

Is it possible to attach a text file inside an embed, instead of sending it as a separate message

earnest phoenix
#

๐Ÿ‘

#

yeah

prisma oriole
#

oh my god

earnest phoenix
#

Is it possible to attach a text file inside an embed, instead of sending it as a separate message
@snow urchin yeah

#

wait

#

It has to be either PLAYING | LISTENING | WATCHING | COMPETING @viscid gale

prisma oriole
#

console.log doesnt fix an error pepeFacepalm

earnest phoenix
#

@snow urchin No

prisma oriole
#

see what it logged G as

viscid gale
#

It has to be either PLAYING | LISTENING | WATCHING | COMPETING @viscid gale
@earnest phoenix oohhhh that's y i cud never say "ping me to use me"

#

i see i see

prisma oriole
#

@earnest phoenix what did it log G as

#

read what it says before the error

earnest phoenix
#

It throws me the api key

#

And?

#

wait let me send you an ss

prisma oriole
#

i assume it returns the client object

earnest phoenix
whole knot
#

Hey, someone here know how could I check that the music bot and the requester are in the same channel?

earnest phoenix
#

The entire thing

snow urchin
prisma oriole
#

whats above it

earnest phoenix
#

Not just the bottom of the object

#

@snow urchin Yes

snow urchin
#

How new is new

#

and what exactly does it do

#

console.log(G)

earnest phoenix
#

The hell, is that even a valid object

#

Or Client object is different from the one above

prisma oriole
#

why did you just expose the api key

earnest phoenix
#

Welp, you're trying to access a property that doesn't exist

prisma oriole
#

what even is that library it shouldnt just return the key

earnest phoenix
#

idk

#

๐Ÿ‘

prisma oriole
#

unless theres a method

solemn latch
#

this lib isnt very genius KEKW

earnest phoenix
#

The client is either not logged in or you have to search for a song then view the tracks

#

oK ๐Ÿ‘

prisma oriole
#

well

#

theres a getter

#
    /**
     * Songs Fetcher
     * @type {SongsClient}
     */
    get songs() {
        return new SongsClient(this.key);
    }
#

try client.songs

earnest phoenix
#

Oh ok ๐Ÿ‘

rocky hearth
#

To remove a reaction from a message. which permission is required?

earnest phoenix
#

MANAGE_MESSAGES

#

@rocky hearth

rocky hearth
#

Aah, that is misleading
There should be a MANAGE_REACTIONS

summer acorn
#

ok I am a bit stuck now, using JS how would I do something like {something.that: "does this"}, I need this in order to check for a certain value inside of a value in a object in my db.

rocky hearth
#

that's invalid

summer acorn
#

I know that, hence why I am asking for the proper method of doing it

rocky hearth
#

something.that == "does this"

summer acorn
#

that is not how the db works mate

#

the db uses objects to search

#

hence why I need to do it using an object

rocky hearth
#

Then I didn't get, what are you trying to ask

summer acorn
stray sinew
#

What do you need to verify youโ€™re bot?

rocky hearth
#

To verify my bot, I need 73 more servers to join.

earnest phoenix
#

@summer acorn MongoDB?

summer acorn
#

yes

earnest phoenix
#

@summer acorn js <MongoDBCollection>.findOne({ "something.that": // something });

#

Properties can be a string

summer acorn
#

oh I see

#

thank you

earnest phoenix
#

Np

modest smelt
glacial ridge
#

How do I make commands that depend on the user using reactions to confirm an action with Discord.js?

#

Exist some tutorial or docs?

summer acorn
#

use the awaitReactions method

glacial ridge
#

Could you give an example?

earnest phoenix
#

Discord.js documentation already gives you an example

summer acorn
glacial ridge
#

Ok, i will look

#

Thx

earnest phoenix
#

It's more efficient to use collectors than awaitReactions

#

Because awaitReactions() is just promise based which isn't a good idea

glacial ridge
#

Ok @earnest phoenix

earnest phoenix
#

hi

atomic parcel
#

Hello, in discord.js, does channel.overwritePermissions() overwrite everything?
I'm trying to set a permission for a role on a channel, and all channel permissions get reset in the process.

quartz kindle
#

yes, it overwrites everything

#

to overwrite a single one, use .updateOverwrite()

atomic parcel
#

Thank you!

rocky hearth
haughty bough
#

What should I use to get all the information in a video, such as length, channel name and title?

glacial ridge
earnest phoenix
#

What should I use to get all the information in a video, such as length, channel name and title?
@haughty bough you mean youtube video?

#

or normal video?

haughty bough
#

youtube video

earnest phoenix
#

it's probably in the meta data of the HTML iirc

haughty bough
#

it's probably in the meta data of the HTML iirc
@earnest phoenix I am currently using the YouTube API to be able to search for a video with the title the user gave, but it does not provide all the information I need (time of the video, for example). I may also be missing something, but I can't see

vague imp
#

Official api?

haughty bough
#

yes

gilded ice
#

so im trying to use a package (g-i-s) for image search but it doesnt seem to be finding anything with any query

sudden geyser
#

On the README, it says the library works as of June 2018

#

Maybe it broke during then, because it just looks like a Google images scraper.

quaint hornet
#

i use ytsr

#

to do the search

#

it returns the url of thumb duration title author if the author is verifyed the description of the video

#

views

#

and other things

#

but you have to install the wip branch

rocky hearth
#

@haughty bough You need to make one more request for the duration

  static async search ( query: string, addedBy: GuildMember, maxResults = 1, searchType = 'video' ) {
    if (!query) throw new Error('No query provided!');

    const results: SearchedVideo[] = await youtube.search.list( {
      // @ts-ignore
      key: YOUTUBE_API_KEY,
      part: 'snippet',
      q: query + ', music',
      type: searchType,
      maxResults
      // @ts-ignore
    }).then(response => response.data.items)
      .catch(console.error);

    const videoIDs = results.map( result => result.id.videoId );
    const durations = await youtube.videos.list( {
      key: YOUTUBE_API_KEY,
      part: ['contentDetails'],
      id: videoIDs
    })
      .then(response => response.data.items!.map(item => item.contentDetails?.duration?.slice(2).toLowerCase()))
      .catch(console.error);

    const final = results.map((data, i) => new Song(data, query, durations[i] || '0m00s', addedBy));
    console.log( final );
    return final;
  }
haughty bough
#

Obrigado! Thanks! I will look for more on @quaint hornet

#

@haughty bough

  static async search ( query: string, addedBy: GuildMember, maxResults = 1, searchType = 'video' ) {
    if (!query) throw new Error('No query provided!');

    const results: SearchedVideo[] = await youtube.search.list( {
      // @ts-ignore
      key: YOUTUBE_API_KEY,
      part: 'snippet',
      q: query + ', music',
      type: searchType,
      maxResults
      // @ts-ignore
    }).then(response => response.data.items)
      .catch(console.error);

    const videoIDs = results.map( result => result.id.videoId );
    const durations = await youtube.videos.list( {
      key: YOUTUBE_API_KEY,
      part: ['contentDetails'],
      id: videoIDs
    })
      .then(response => response.data.items!.map(item => item.contentDetails?.duration?.slice(2).toLowerCase()))
      .catch(console.error);

    const final = results.map((data, i) => new Song(data, query, durations[i] || '0m00s', addedBy));
    console.log( final );
    return final;
  }

@rocky hearth Is this used youtube api? Interesting, it will save me time. Thanks!

vivid oar
#

@earnest phoenix
Hi again, I just made a simple css code to put in my top.gg bot description and it looks like I don't really know how to import my own css there
https://hasteb.in/fakuhino.css

rustic nova
#

use <style> tags inside your long description

earnest phoenix
#

Error: MANAGER_DESTROYED
at WebSocketManager.destroy (C:\Users\Administrator\Desktop\CalypsoBot-develop\node_modules\discord.js\src\client\websocket\WebSocketManager.js:333:54)
at Client.destroy (C:\Users\Administrator\Desktop\CalypsoBot-develop\node_modules\discord.js\src\client\Client.js:236:13)
at Client.login (C:\Users\Administrator\Desktop\CalypsoBot-develop\node_modules\discord.js\src\client\Client.js:225:12)
at processTicksAndRejections (node:internal/process/task_queues:93:5)
2020-11-09 12:18:47 - debug [app.js]: [WS => Shard 0] WS State: CLOSED
2020-11-09 12:18:47 - error [app.js]: Privileged intent provided is not enabled or whitelisted.
{
"stack": "Error [DISALLOWED_INTENTS]: Privileged intent provided is not enabled or whitelisted.

#

Help meeeeeeeee

#

!

rustic nova
#

enabled the privileged intent

earnest phoenix
#

enabled the privileged intent
@rustic nova Me ?

cinder sandal
#

"privileged inteny provided is not enabled or whitelisted"

rustic nova
#

nah the dude 300 message above you

earnest phoenix
#

Help Me

rustic nova
#

of course i meant you

#

read your error

cinder sandal
#

enable privileged intents

#

also you need to read errors sometimes

earnest phoenix
#

I do not realize the error

cinder sandal
#

enable privileged intents
@cinder sandal

earnest phoenix
#

From which part should I do this ??

cinder sandal
#

go to the page where you created your bot

#

search the settings

#

and enable privileged intents

earnest phoenix
#

I did not find such an option

#

@cinder sandal I did not find such an option

cinder sandal
#

uh

#

google it

#

"how to enable privileged intents"

hollow iris
#

hello @everyone i want add the bot on this image to my serv ! Someone can help me ?

#

can we create a bot to directly join a game from discord ?

earnest phoenix
#

no

#

that's rich presence

#

totally unrelated to bots

hollow iris
#

ok so it's possible to directly join a game from discord ?

earnest phoenix
#

yes, if you integrate it into your game

hollow iris
#

it does work on all games ?

earnest phoenix
#

yes, if you integrate it into your game

#

lmfao you can't make it work with any game you want

#

that's not how anything works

#

the code for the discord game sdk needs to be in the game (among other things like the party secret etc.)

#

that's why i explicitly said your game

tardy hornet
#

how many ms are in 30m?

earnest phoenix
#

calculate it

hollow iris
#

ok !

tardy hornet
#

bad at math

hollow iris
#

Thanks man i got it !

earnest phoenix
#

luckily for you there's this thing called google

#

don't know if you ever heard of it

tardy hornet
#

i didnt, is it like a food?

earnest phoenix
#

yeah

tardy hornet
#

oh okay

#

let me go eat it real quick

earnest phoenix
#

your browser is also able to calculate that on the go i think

#

at least firefox does

tardy hornet
#

o god

#

this food is smart

earnest phoenix
#

you could've also used SI conversion

tardy hornet
#

is it a drink?

earnest phoenix
#

30(minutes) * 60 (seconds) * 1000 (milliseconds)

tardy hornet
#

so yeah a drink

blissful coral
#

Anyone have a good guide to learning how to listen to a webhook request, trying to learn how to do it for DSL webhooks.

earnest phoenix
#

a webhook isn't a connection

#

it's just an automated request

blissful coral
#

I said connection

#

Fuck

#

LMAO

earnest phoenix
#

lol

blissful coral
#

But anyone have a guide

#

As to how to receive them

earnest phoenix
#

basically it's a simple as opening a webserver and making an endpoint

blissful coral
#

K

#

Oh

#

I just gotta make a endpoint?

#

Damn ok

earnest phoenix
#

yeah

blissful coral
#

Ez

earnest phoenix
#

then, iirc, top.gg POSTs to the endpoint with JSON data

#

and you can parse that

blissful coral
#

Yeah I can just parse the json file

#

k

earnest phoenix
#

well uh file is an incorrect term but yes

#

the JSON is in the body of the request

blissful coral
#

Ok so

#

All I gotta say

#

Is

#

I am TIRED

#

LMAO

drifting spruce
#

so if my bot does not need any server member or presence intents, does it need to get verified to grow over 100 servers?

blissful coral
#

Yes

#

Intents are just another part of it

drifting spruce
#

i have invited bots that are over 100 but not verified

#

u sure?

rose thunder
#

You kiss leafy

drifting spruce
#

@blissful coral do you know how i could have invited bots that are over 100 servers but not verified?

blissful coral
#

Cna't

#

Can't

drifting spruce
#

look

earnest phoenix
#

you could've, but not anymore

#

someone have cool bot for community server

#

not the channel for it

#

if you have dm me plewase

drifting spruce
#

@blissful coral

blissful coral
#

uh

drifting spruce
#

know why?

umbral zealot
#

That's possible

drifting spruce
#

how

umbral zealot
#

A bot with suspicious growth can go up to 250 until it settles down and they can apply for verification

drifting spruce
#

wdym by suspicious

umbral zealot
#

Means "growing too fast"

#

for example if they were added to, y'know, multiple bot lists. ๐Ÿ˜‚

drifting spruce
#

yeah

earnest phoenix
#

There's a failure message in verification called "suspicious growth" he meant that

umbral zealot
#

Oh I'm sure they're aware of that, if they tried to apply

blissful coral
#
app.post('/', (req, res) => {
    // check if verification token is correct
    if (req.query.token !== token) {
        return res.sendStatus(401);
    }

    // print request body
    console.log(req.body);

    // return a text response
    const data = {
        responses: [
            {
                type: 'text',
                elements: ['Hi', 'Hello']
            }
        ]
    };

    res.json(data);
});
#

GET / 401 Unauthorized

umbral zealot
#

clearly req.query.token isn't equal token

#

have you tried logging them both and looking at them?

pale vessel
#

always debug

blissful coral
#

Token isn't even a returned value

ionic dawn
#

When 5 servers match with the same owner ID the verification goes brrr

blissful coral
#

Authorization is tho

tulip ledge
#
    if (!webhook) webhook = await channel.createWebhook(name, {
      avatar: avatar
    });

My code just stops here and does nothing

pale vessel
#

you need the GUILD_WEBHOOKS intent, do you have that?

#

actually, i'm not sure since it barely has anything to do with events

#

but you can try adding that intent if you haven't already

blissful coral
#

Anyone have experience with "ngrok"

#

?

steep socket
warm cloud
#

i think that aiohttp's json interpreter does convert things to bools

#

so == "false" will never be true

#

because the value is a bool

steep socket
#

oh

warm cloud
#

should be if not res["data"]....["over_18"]:

steep socket
#

so it would be == False?

#

should be if not res["data"]....["over_18"]:
@warm cloud oh

warm cloud
#

yes, or if not

steep socket
#

time to test!

sudden geyser
#

@steep socket for the record, it's recommended you don't create a client session for a one-time use.

#

I'd recommend you keep it saved to a variable.

earnest phoenix
#

anyone here help me with canvas real quick?

gentle oxide
#

Help me

earnest phoenix
#

how can I send a msg to a channel that is cached on an unknown shard?

blissful coral
#

You just fetch the channel with broadcastEval

indigo flax
#

discord.js v12

#

what is an eval command i can use

#

to make the bot leave the server

#

um

#

@earnest phoenix no..

earnest phoenix
#

how would i break the text to a new line if its big?

indigo flax
#

that wont make it leave the server

#

@earnest phoenix addField

earnest phoenix
#

no its canvas

indigo flax
#

\n

earnest phoenix
#

bruh

#

how @blissful coral

#
client.shard.broadcastEval("(channelID).fetch()");
blissful coral
#
<client>.shard.broadcastEval(`this.channels.cache.fetch('${<channel>.id}')`).then(c => {
//Code here
})```
earnest phoenix
#

thanks

#

but i think im just gonna use webhooks

#

its for logging joined/left guilds

blissful coral
#

Ah

earnest phoenix
#

but thanks anyways !! ๐Ÿ™‚

indigo flax
#

help

#

what is the eval to leave a server

blissful coral
#

Could do

#
client.guilds.cache.get(`id`).leave().catch(() => message.channel.send(`Could not leave`))```
indigo flax
#

ok

earnest phoenix
#

how can i send a msg to a webhook if i have the url?

blissful coral
#

you make a webhook client and then do <webhook>.send()

earnest phoenix
#

ah thanks!!

tame kestrel
#

Is there an easy way to check if a user has permission to edit a role in discord.js? I know I can do it manually by checking a users perms and then checking if they are above the role

earnest phoenix
#

I want a command debounce per user ok

#

But having an array of every user in the server would be a pretty bad on resources

#

so is there a more effective way i can do client debounce?

sudden geyser
#

Is there an easy way to check if a user has permission to edit a role in discord.js? I know I can do it manually by checking a users perms and then checking if they are above the role
@tame kestrel I don't think there's an easier way to do it. Though, the implementation is very simple like you outlined manually: js get editable() { if (this.managed) return false; const clientMember = this.guild.member(this.client.user); if (!clientMember.permissions.has(Permissions.FLAGS.MANAGE_ROLES)) return false; return clientMember.roles.highest.comparePositionTo(this) > 0; }