#development

1 messages ยท Page 868 of 1

earnest phoenix
#

I also tried MANAGE_ROLES
@earnest phoenix

quartz kindle
#

so thats exactly what you have to do

heavy marsh
#
client.shard.broadcastEval(`
    (async () => {
        let channel = this.channels.get('id');
        let msg;
        if (channel) {
            msg = await channel.fetchMessage('id').then(m => m.id);
        }
        return msg;
    })();
`);
#

Like this

quartz kindle
#
broadcastEval(`
  (async function() {
    if(<guild exists>) {
      await <create invite>
      return <inviteCode>
    }
  })()
`)```
heavy marsh
#

Hmm ok I will re make the code an see

#

thank you

cinder patio
#

Hmm, on discord.js, how would I get a guild member object without having access to the client object/any discord objects at al? I guess I'd have to make the request myself?

quartz kindle
#

ye

wheat jolt
#

how does cache works in discord.js v12?

#

eg bot.guilds.cache

#

what's the catch?

summer torrent
royal portal
#

what are listeners

#

in discord.js

#

because it gave me error

#

memory leak thing

quartz kindle
#

event listener

royal portal
#

it said i have to increase the size

#

is it because I had client.on for every cmd?

quartz kindle
#

client.on("message", message => {}) - "message" is the event, "client.on()" is the listener

royal portal
#

how would I increase the size

quartz kindle
#

the warning exists for a reason

#

its to warn you that you're likely doing something wrong

royal portal
#

its gone now

#

because i put }

#

so if command

#

then code

quartz kindle
#

such as adding too many listeners in a loop

royal portal
#

then }

#

would this be a cause

#

client.on('message', msg => {
if (msg.content === 'ping') {
msg.reply('Pong!');
}
});

client.on('message', msg => {
if (msg.content === 'ping2') {
msg.reply('Pong!');
}
});

client.on('message', msg => {
if (msg.content === 'ping3') {
msg.reply('Pong!');
}
});

quartz kindle
#

possibly

#

you should not repeat listeners for the same event, its a waste of resources

royal portal
#

ah okay

lyric mountain
#

instead use else-if

quartz kindle
#

you should do this instead: ```js
client.on('message', msg => {
if(msg.content === 'ping1') {
msg.reply('Pong!');
} else if(msg.content === 'ping2') {
msg.reply('Pong!');
} else if(msg.content === 'ping3') {
msg.reply('Pong!');
}
});

lyric mountain
#

it'll do the same work with less resources

quartz kindle
#

or use switch

#

or a command handler

royal portal
#

I just use }

#

for if command

quartz kindle
#

but did you understand what i showed?

#

all commands should go inside the same listener

royal portal
#

yeah

#

will that stop the error

lyric mountain
#

if you're doing something similar in lots of commands then yes, it will

#

you hardly need more than 15 listeners tho

#

unless you have something like a role-per-mention command

spare goblet
#

What's a role per mention command

royal portal
#

idk

lyric mountain
#

something like this:

royal portal
#

@quartz kindle how do I make it so if the people are userid and userid then they can use the cmd

#

because i know how to do it for one person

lyric mountain
#

you click on a reaction -> you get a role

spare goblet
#

Why would that require more than fifteen listeners

lyric mountain
#

it'll not

spare goblet
#

Wouldn't that just be one lidtenr

lyric mountain
#

unless you have a bunch on those

spare goblet
#

Listener

lyric mountain
#

....now that you say

#

good idea

spare goblet
#

Oh fair enough
Raw events then xD

royal portal
#

how would i do this

lyric mountain
#

it'll be a bit more work, but I didn't considered adding one event to handle all buttons

royal portal
#

so

#

im making a command

#

for just two users

#

me and a friend

#

and i added

lyric mountain
#

then put your ids inside an array

royal portal
quartz kindle
#

if(message.author.id === "ID HERE" || message.author.id === "ANOTHER ID HERE")

lyric mountain
#

you used a single =

#

which means assignment

royal portal
#

ah

lyric mountain
#

you gotta use 3 =

royal portal
#

not !==

warm marsh
#

Yes

royal portal
#

ah

#

good to know

warm marsh
#
if (id != "id" || id != "id 2") return;
lyric mountain
#
if (id != "id" || id != "id 2") return;

gotta use !==

royal portal
#

but

warm marsh
#

You don't have to use !==

royal portal
#

uhm

#

it lets anyone use it

#

help

warm marsh
#

Send code

royal portal
#

k

amber fractal
#

you need &&

warm marsh
#

You probably done something wrong

#

No you don't.

#

He's checking if it's id 1 or id 2

#

not both

amber fractal
#

id != x || id != x is always true as one will always return false

blazing portal
#

if you check for your ids, and then return, you excluded both of you, but everyone else can use it obviously

amber fractal
#

Yes

#

That's logic

warm marsh
#

Both can be false in an or statement

royal portal
#
client.on("message", message => {
  if (message.author.bot) return;
  if(message.channel.type === "dm") return;
  if (message.author.id !== '364836696149458944' || message.author.id !== '390969718535618561');
 
  let prefix = "-";
  if (message.content.indexOf(prefix) !== 0) return;
 
  const args = message.content.slice(prefix.length).trim().split(/ +/g);
  const command = args.shift().toLowerCase();

 if (command === "restart") {
   
  const embed = new Discord.MessageEmbed()
  .setDescription(":computer: Restarted.")
  .setColor(0x00AE86)
  message.channel.send(embed).then(() => process.exit());
    }
});
amber fractal
#

wait

#

No I'm getting logic wrong

warm marsh
#

0 | 0 = 0
0 | 1 = 1
1 | 1 - 1

royal portal
#

there

#

i sent

warm marsh
#

No wonder

lyric mountain
#
ID = 3

ID != 1 || ID != 2 -> true
ID != 1 && ID != 2 -> false
blazing portal
#

yeah in this case && instead of ||

royal portal
#

is that the problem

warm marsh
#

No

blazing portal
#

yes

warm marsh
#

The problem is the if (id == id);

royal portal
#

so what do I change

warm marsh
#

the semi-colon to a return;

royal portal
#

but then if I execute the command then I won't be able to use it

blazing portal
#

there is no command behind your if. the whole if has no point at the moment

warm marsh
#

People use the whole event as a command which is stupid.

royal portal
#

I'm not sure what to do to make it so only those IDs can use the cmd

heavy marsh
#

Doesn any one know why my bot is offline but the console says the bot is online. But no errors in the console ... discord.js v11

warm marsh
#
client.on('message', function(msg) {
  if ( id != 'your_id' || id != 'your_other_id' ) return;
});```
royal portal
#

but then i wont be able to use the command

warm marsh
#

Can you read?

#

!= means doesn't equal

blazing portal
#

@royal portal if (message.author.id !== '364836696149458944' && message.author.id !== '390969718535618561') return;

warm marsh
#

It will return every time

#

Because no-one has two ids.

blazing portal
#

no

warm marsh
#

Yes

#

Go try it

blazing portal
#

as soon as one of those IDs is present, the if statement is wrong therefor we do NOT return

warm marsh
#

if (message.author.id != '364836696149458944' || message.author.id != '390969718535618561') return;

royal portal
#

i tried that

#

and it wouldnt work for me

blazing portal
#

then try mine

warm marsh
#

Neither will the &&

royal portal
#

i didnt even use the &&

blazing portal
#

try it

warm marsh
#

true & true -> true

royal portal
#

im just gonna use my old way

heavy marsh
#
if (!['xxx', 'xxx'].includes(message.author.id)) return

@royal portal try this

blazing portal
#

thats exactly what we want paradox, please stop confusing everybody

#

Director's way works too

warm marsh
#

Use the console. Prove me wrong.

blazing portal
#

I'm not here to prove anything to you. You just have to rethink the situation then it is obvious.

heavy marsh
#

Doesn any one know why my bot is offline but the console says the bot is online. But no errors in the console ... discord.js v11

royal portal
#

@heavy marsh's way worked

heavy marsh
#

๐Ÿ™‚

royal portal
#

thank you guys

#

@heavy marsh not sure if this is possible but maybe use if client disconnects then

#

process exit

#

and it restarts

#

pm2

heavy marsh
#

I tied it's still the same

royal portal
#

@heavy marsh maybe your connection

heavy marsh
#

I guess so to

warm marsh
#

bannable

blazing portal
royal portal
#

but discord.js would automatically reconnect

#

@heavy marsh if i were you, i would just install latest version of node.js and discord.js

heavy marsh
#

I have on my v2.0.0

#

I dont want to make any changes to my v1

royal portal
#

well update v11 to v12

heavy marsh
#

my v2 is in discord.js v 12.1.2

next mica
royal portal
#

I guess its just connection

#

@next mica embeds

next mica
#

ok

#

thanks

royal portal
#

need help on them?

next mica
#

a little

royal portal
#

ok

next mica
#

havent done that

heavy marsh
#

embeds

royal portal
#

discord.js?

next mica
#

yes

heavy marsh
royal portal
#

^

next mica
#

ok thanks

heavy marsh
#

v11 or v12?

next mica
#

12

heavy marsh
#

ooh ok then use the link I sent

next mica
#

ok

indigo folio
#

does anyone know if there is a discord.js function that just checks if the member is bannable by the bot or do i have to make a manual check

elder vine
#

You can use .bannable on a guildMember

heavy marsh
#

its here

indigo folio
#

thanks

royal portal
#
client.on('message', msg => {
  if (msg.content === 'ok') {
const embed = new Discord.MessageEmbed()
  .setTitle("ok")
  .setColor(0x00AE86)
  message.channel.send(embed)
}
});
elder vine
#

.then()?

blazing portal
#

there is no point in adding .then() you can just catch immediately

royal portal
#

@next mica

next mica
#

yes

elder vine
#

Why is .then() there?

royal portal
#

use that example

#

@elder vine idk

warm marsh
#

Remove the .then()

royal portal
#

i did

warm marsh
#

The catch was fine

royal portal
#

so

next mica
#

and i put what i want to say in the (embed) part

royal portal
#

after embed i write

#

yes

#

no

#

no

#

no

next mica
#

ok

royal portal
#

in the setTitle("here")

next mica
#

ok

royal portal
#

i wrote ok for you

#

@warm marsh so instead of .then I do .catch(console.error); ?

elder vine
#

You should read up the docs on embeds, and find out what you can do with them. Since there is a lot.

#

Yes. @royal portal

warm marsh
#

If you need to access the promise resolve that a promise returns use .then((response) => do something)

royal portal
#

is there a difference

warm marsh
#

or using an async function

next mica
#

that example craashed my bot blox

warm marsh
#

let resp = await promise

#

.catch is the same as doing

try { message.channel.send('content'); } catch(e) { console.error(e); } ```
quartz kindle
#

^ not really

royal portal
#

wait can i do something like

quartz kindle
#

unless you await it

warm marsh
#

Yes.

royal portal
#

msg.reply("hi").catch(console.error);

#

like that?

next mica
#

?

warm marsh
#

If the bot encounters an error the .catch will be called

royal portal
#

so is my code correct

#

msg.reply("hi").catch(console.error);

quartz kindle
#

@royal portal yes

royal portal
#

okay

warm marsh
#

Actually let me rephrase, It would be constantly true thus make nothing else work.

quartz kindle
#

if id is not ID1 AND id is not ID2 -> return

warm marsh
#

Considering a user can only have 1 ID it will always return, Yes?

quartz kindle
#

no

#

if the author id is not equal to that id AND if its not equal to the other id, return

#

so it will only not return if the author id is one of those two

warm marsh
#

Lmao.

#

Sleep is vital I guess.

quartz kindle
#

i got confused for a sec too lol

warm marsh
#

Yeah I tried doing it in the console must have done something wrong so it was constantly returning.

#

probably missed the !

#

on one statement or something.

#

But thanks!

#

I feel kinda stupid for arguing with that guy.

quartz kindle
#

it happens xd

warm marsh
#

:\

royal portal
#

@quartz kindle if setActivity stops working or something in pm2 then will it restart bot

warm marsh
#

Stops working?

royal portal
#

yes it used to

#

but i wasnt using pm2 at the time

warm marsh
#

Explain

royal portal
#

setActivity stopped working for others too

warm marsh
#

My brain is crashing

#

Stopped working is very vague

quartz kindle
#

pm2 has nothing to do with your bot's code or with discord's api

#

pm2 will only restart if the process crashes or exits

#

and if running in --watch mode, it will also restart if your code changes, ie: if one of your bot's files gets updated

royal portal
#

yeah

#

I have --watch

warm marsh
#

Does pm2 run cluster by default?

quartz kindle
#

no

warm marsh
#

Ah I think I enabled it for running Python

earnest phoenix
#

So i have a warn command that it works and adds + 1 to the amount of warns they've got... But how can i make it so it has 0 warns for every different guild that the user was not warned on?

warm marsh
#

What are you using to store?

royal portal
#

well

earnest phoenix
#

A json file lol

warm marsh
#

Oof

royal portal
#

I think he's trying to do warns for that server

warm marsh
#

change it before trying to do that.

royal portal
#

so if a user has 1 warning, it'll only be for that server

#

not for all

warm marsh
#

I know what he wants

#

JSON will get very slow the more entries it has

earnest phoenix
#

Hmm... Ik that a db is better than a json file but imma switch things up later...

warm marsh
#

but you'd do something like

warns[guildID][userID] = {};
blazing portal
#

I feel kinda stupid for arguing with that guy.
@warm marsh happens to the best of us. don't worry bout it

warm marsh
#

But change to an actual database first as changing it later will be a pain

#

Sorry @blazing portal ๐Ÿ˜

earnest phoenix
#

Oh... I did it like this instead lmao:
warns[message.guild.id, warnM.id] = {}; lol @warm marsh

warm marsh
#

oof

earnest phoenix
#

So imma do it like that as you said

#

Let's see if it works

warm marsh
#

It'll be laid out like this in the json file which you don't need to worry about as long as your current code works.


{
  "guildID_1": {
    "userID": {}
  }
}```
#

But that's nothing to worry about.

earnest phoenix
#

guys

warm marsh
#

don't ask to ask

#

What's the problem?

earnest phoenix
#

line 28

slender thistle
#

get_user isn't a coroutine

earnest phoenix
#
TypeError: object User can't be used in 'await' expression```
slender thistle
#

Yeah

warm marsh
#

remove the await

slender thistle
#

You don't await something that isn't a coroutine

earnest phoenix
#

ok

#

i'll try

slender thistle
#

In last discord.py version you don't await anything that starts with get
Instead, whatever that starts with fetch is to be awaited

earnest phoenix
#

Does anyone have tips for prefix or syntax for in-message commands ? Like a command where the prefix is allowed inside a message?

warm marsh
#

Like this? please delete the last 10 messages.

#

Or something completely different?

earnest phoenix
#

More like !command this

warm marsh
#

Search for the prefix and check if it has anything after it?

earnest phoenix
#

Where you have symbol to indicate the command the it's arguments

warm marsh
#

Language?

earnest phoenix
#

But I don't think only a prefix is sufficient maybe

warm marsh
#

No it will be

earnest phoenix
#

Because the prefix symbol may also appear out of context where nothing is meant to happen

warm marsh
#

Like I said just check if there is content after wards.

earnest phoenix
#

Idunno just trying to eliminate false positives of the command being called

warm marsh
#

Then take that as a command and check against it.

earnest phoenix
#

But what symbol though

warm marsh
#

Any you wish to use for the prefix

#

It doesn't matter.

earnest phoenix
#

The less it's used in regular messages the less the chance is for a false positive?

warm marsh
#

Yeah

#

for instance

#

using a longer prefix will lower the chances

#

like botname?!

#

or something stupid but even still it won't matter if you've got a proper command handler it should just return anyway

earnest phoenix
#

Hmm actually reminds me i heard of ppl using @bot as prefix

warm marsh
#

Yeah that's fairly common

#

But also causes problems when using mentions in commands

earnest phoenix
#

@warm marsh the thing you said:
warns[guildID][message.mentions.members.users.first().id]
Didn't work lol

#

OOF

warm marsh
#

Is warns an object?

earnest phoenix
#

warns โ†“
let warns = require('./warns.json');
@warm marsh

warm marsh
#

Ok

#

inside the json it looks like {}

#

?

earnest phoenix
#

Yup

#

@warm marsh lemme show you the error

warm marsh
#

Okay

earnest phoenix
warm marsh
#

You might require another variable idk though

earnest phoenix
#

I switched the guildID'place with the user id and replaced that error's id with the guild's id

warm marsh
#
let guild_warns = warns[guild_id] || {};```
#

something like this might work although probably isn't recommended

(warns[guild_id] || {})[user_id].prop = val;
earnest phoenix
#

Wait... Where would that be placed though?

warm marsh
#

@earnest phoenix if you use js you could do something like

if (content.indexOf(prefix) == -1) return;

let args = content.substring(content.indexOf(prefix) + 1).trim().split(/\s+/);
let cmd = args.shift().toLowerCase();
quartz kindle
#

(warns[guildID] || {})[message.mentions.members.first().id] is fine

warm marsh
#

But even still you're probably best doing it another way.

earnest phoenix
#

@quartz kindle hmm so that code would be placed where lol?

warm marsh
#

In replacement of the old code

#

That's how you'd get or set the amount of warns a user has per guild

earnest phoenix
#

Oh i see... Wait lemme show you something real quick

quartz kindle
#

instead of warns[guildID][message.mentions...]

earnest phoenix
warm marsh
#

If you require a json file do you need to run JSON.parse()

#

That's almost impossible to see.

late hill
#

No

quartz kindle
#

requiring a json file already does it for you

earnest phoenix
#

Lol

quartz kindle
#

you would need to if you loaded the json file with fs

earnest phoenix
#

@warm marsh lemme get you the telescope

warm marsh
#

Thanks

#

I don't understand how people can create bots, I lack creativity and just get burnt out instantly so give up.

earnest phoenix
quartz kindle
#

better than making generic bots lul

#

@earnest phoenix the thing is

#

you have a data structure with nested variable keys

warm marsh
#

You don't need the if statement check if !warns[]

quartz kindle
#

your data looks like this, right? data.somethingOrNothing.somethingOrNothing

earnest phoenix
#

@quartz kindle in the json file?

quartz kindle
#

if the first key doesnt exist, the second key will throw an error, because you cant get a value from nothing

#

yes

earnest phoenix
#

Hmm lemme show you how one of them looks like lmao

quartz kindle
#

so every time you try to access such data structure, you will ALWAYS need to check if the first key exists, before attempting to get the second key

warm marsh
#

Node now supports the ? feature

#

obj?.prop?.prop2

quartz kindle
#

you cant ever do something[a][b] you will always need to check if something[a] exists before doing something[a][b]

warm marsh
#

But doesn't seem practical in that situation.

earnest phoenix
amber fractal
#

you mean ternary?

warm marsh
#

I don't think it's called that.

#

It might be though.

#

I just know you can do

let obj = { prop: {  } };

obj.prop?.someprop
#

and it won't throw an error.

#

Just returns undefined.

quartz kindle
#

never seen that before

earnest phoenix
#

Hmm

warm marsh
#

Yeah it was something added with 2020 JS

#

or wip features.

#

iirc

earnest phoenix
#

Welp imma try my best... Thx for the help guys...

warm marsh
#

Okay.

quartz kindle
#

interesting

#

its called optional chaining

amber fractal
#

Yeah I've never seen that before either

warm marsh
#

Well I never knew it's name but knew of it.

amber fractal
#

works with objects, arrays and functions

warm marsh
#

array?[index]

#

or?

amber fractal
#

?.[index]

warm marsh
#

Yeah I don't think node supports it yet.

#

Or requires the enabled features thing

quartz kindle
warm marsh
#

Also, Is this very in-efficient? I've Googled for ages and found no other way.

  async commandLoader () {
    const DIR = path.join(__dirname, '..', 'Commands');
    const _ = await readdir(DIR);
    if (_.constructor.name == 'Array' && _.length > 0) {
      for (const file of _) {
        let { name, ext } = path.parse(file);
        if (ext == '.js') {
          const $ = new (require(path.join(DIR, file)))(this);
          const m = getInstanceNamesFromClass($);
          m.forEach(cmd => {
            this.commands.set(cmd.toLowerCase(), {
              run: $[cmd],
              category: name,
              cls: $
            });
          });
        }
      }
      return true;
    }
    else return false;
  }```
amber fractal
warm marsh
#

it gets all custom methods from a class and returns them

quartz kindle
#

According to node.green, optional chaining will be supported starting with Node 14, but will still require the --harmony flag.

warm marsh
quartz kindle
#

does readdir ever not return an array?

warm marsh
#

Idk probably not but just incase

#

it's promisify(fs.readdir)

quartz kindle
#

more likely to return an error than a non-array lol

warm marsh
#

RIP

#

So far no errors though

#

Reason I'm asking is it just seems very long winded and overly complicated. Due to lack of decorators I couldn't do it the way I'd do it in other languages.

quartz kindle
#

it does indeed seem overly complicated

warm marsh
#

It gets the classes dynamically and each have their own methods with different names which are cmd names

quartz kindle
#

looks cool haha

warm marsh
#

Yeah font-ligatures

#

At first when I started using Fira Code I was so confused

#

due to the symbols

quartz kindle
#

so you're basically requiring a class and loading each class method as a command

warm marsh
#

Yeah

quartz kindle
#

what if you need private methods tho?

#

they would get loaded too

warm marsh
#

I just end up using a function below the class declaration

quartz kindle
#

i think you could export an object/list of methods or something instead of iterating through property names

#

would give you more control over what gets exported and make it less complicated

#

the class is already instantiated before being exported?

warm marsh
#

No

#

It gets instantced during the loading

quartz kindle
#

ah yes i saw it

warm marsh
#

Then stored in the map as .cls

#

So I can call the method later and still have access to its properties

quartz kindle
#

then you could do an exporting method that returns a list of methods

warm marsh
#

cmd.run.call(cmd.cls)

quartz kindle
#

const $ = new class()
const m = $.getMethods()

warm marsh
#

I'll implement that for hiding methods.

#

My naming convention is really bad.

#

Probably should change it.

quartz kindle
#

i do stuff like that too lol

#

gives the illusion that the code is smaller/lighter/faster lmao

warm marsh
#

Omg I'm not the only one that thinks that

quartz kindle
#

hahaha

warm marsh
#

Is the harmony flag what enables wip features ?

quartz kindle
#

i think so

#

look at this naming convention lmao

winged mulch
#

Cannot access '<init>': it is package private in 'Inbox'

#

Does anyone know what this means?

#

And how I can fix it?

quartz kindle
#

where does that error come from?

winged mulch
#
        println(Telephony.Sms.Inbox())
warm marsh
#

Most of those are kind of meaningful which is more than I can say for stuff I code.

winged mulch
#

@quartz kindle

quartz kindle
#

is that for android?

#

or what package/language is that?

winged mulch
#

Yes, it is for Android.

#

Kotlin

quartz kindle
#

i have no experience with that

#

i checked the docs, and it looks like its supposed to be used as a property, not a method

#

but im not sure

winged mulch
#

I don't know what a property is. I'm coming from Python and Kotlin is confusing.

quartz kindle
#

ie: Telephony.Sms.Inbox

#

without ()

winged mulch
#

It says it has to be initalized

#

So it needs the ()

warm marsh
#

Kotlin doesn't use the 'new' keyword?

winged mulch
#

I don't think so

warm marsh
#

So it's like python.

#

I'm glad I only ever used plain java

quartz kindle
#

i found this example code

#

from what i understood, Telephony.Sms.Inbox only contains the URI address to be used with contextResolver

#

Telephony.Sms.Inbox.CONTENT_URI

#

but then again, i dont even know java, let alone android lul

winged mulch
#

So he doesn't use ()

#

Thanks for trying to help me though.

earnest phoenix
#

So i have a userinfo command that works completely fine but in the currently playing field... It shows the game that the user is playing but when the user has a custom status... It only shows custom status...
How can i make it so it shows what the custom status actually is?

elder vine
#

Play with eval, and go far down into the code and you will find it.

earnest phoenix
#

I did lol... No luck

#

Been trying for 2 hours

elder vine
#

lemme check for you :P

earnest phoenix
#

Okie...

#

hey, how can i make my bot avatar circular on top.gg?

#

You can't i guess... You just have to make the avatar circle and then the other areas to be completely transparent... @earnest phoenix

elder vine
#

F, forgot. Now gimme a sec

earnest phoenix
#

K

#

@earnest phoenix thanks

#

Np

elder vine
#

@earnest phoenix I think you need the presence intent from verification on Discord to do it

#

Since I can't do it anymore

earnest phoenix
#

Hmm... I will look at that and see how it works

digital ibex
#

@wide wharf no im not

quartz kindle
#

@earnest phoenix you can

#

use border-radius in your css

normal temple
#

Is there a better api than Nekos.life that doesn't require a minimum number of guilds?

earnest phoenix
#

You can just parse the image from the home page?

#

If they won't let you use the actual API shrug

normal temple
#

Nah actually I don't want to use this api

#

It has a really bad reputation

quartz kindle
#

@earnest phoenix should be either name, details or state

warm marsh
#

Would it be worth moving to TS so I could use decorators or is it un-necessary ?

earnest phoenix
quartz kindle
#

yes there

earnest phoenix
#

@quartz kindle idk how to do that lol

warm marsh
#

embed.color?

quartz kindle
#

@warm marsh depends, if you are used to typed languages, maybe you'll feel more comfortable with typescript

earnest phoenix
#

.setColor('#HEXCODE OF THE COLOR'); @vivid cargo

warm marsh
#

Typescript uses the same kind of syntax as Kotlin which I think is kinda disgusting but at least it's typed.

#

Well, I guess Python, Rust and a bunch of other languages use it too.

earnest phoenix
#

Hmm

warm marsh
#

No?

#

<style>
all styling done here
</style>

earnest phoenix
#

Can't find any way to get my bot server size in v12

#

Anyone have ?

warm marsh
#

guilds.cache.size

earnest phoenix
#

fast ๐Ÿ˜‚

warm marsh
#

It's asked frequently here

#

Due to the recent update of stable

earnest phoenix
#

haha these update are so useless for us ๐Ÿ˜‚

#

Just making everything usefull on internet outdated asf

warm marsh
#

Yeah

#

That's why you should use the docs.

#

They're always up-to-date

earnest phoenix
#

@earnest phoenix thanks

#

@earnest phoenix wdum my friend

#

Its like

#

so harder

#

for us

#

u like forced abs' everyone to change they way to code and made old one outdated

warm marsh
#

They didn't change much

earnest phoenix
#

They did damn bro

#

i tried to fix my old codes

#

that was pain

warm marsh
earnest phoenix
#

I have that

#

didn't managed to find what u gave me

warm marsh
#

Ah fair

earnest phoenix
#

Cuz there is no real examples

warm marsh
earnest phoenix
#

U just have some pieces of things but not a real context

#

not everything needs an example

#

@earnest phoenix true but some of them would need

#

the library expects you to already know the language

#

When u create a new different version

#

u don't automaticly know the language

#

yes you do

#

U need to learn the news, and if its not well explained then ur like forced ๐Ÿ˜‚

warm marsh
#

The language never changes.

#

Well, All the main stuff.

earnest phoenix
#

Paradox i mean the key words

warm marsh
#

The library on the other-hand does.

#

Fair.

earnest phoenix
#

Anyway probably usefull for discord optimisation

#

but on devs side if ur not like really into developpment

#

u will have some troubles for sure :)

#

I coded many advanced bots and i know what i did

#

Paradox also didn't found the guild users size on the doc
tried newclient.clients.cache.size but nope

#

i mean the bot users size*

warm marsh
#

it's the same as the prior

#

And it's on the first page I sent.

#

You just need to look.

earnest phoenix
#

every collection that had contained cached entities is now in a cache manager object, the actual collection is now found in a .cache property

quartz kindle
#

any half-decent developer will read over the changes and quickly understand exactly what he needs to do, without much examples

#

because the basics of the language never change

earnest phoenix
#

Yeah i didnt explained myself proprely

warm marsh
#

Does discordjs have an exception for LoginFailure

earnest phoenix
#

yes

warm marsh
#

like import { LoginFailure } from 'discord.js';

earnest phoenix
#

newclient.login(data).catch(O_o => {message.channel.send("โ›” Error : Provided token is not valid anymore.");return;})

quartz kindle
#

if you know what keywords such as "property", "method", "array", "object", "class", "promise", etc... means, you should be able to quickly pick it up

warm marsh
#

How are you supposed to send to the channel if the bot doesn't come online?

earnest phoenix
#

Its a bot in a bot

#

๐Ÿ˜‰

#

If newclient isn't working then main client inform the discord

#

How are you supposed to send to the channel if the bot doesn't come online?
you can

warm marsh
#

I'm not doing that also isn't fully what I asked for.

earnest phoenix
#

websocket != REST

quartz kindle
#

@warm marsh client.login().catch(error => {})

#

will give you the login failure

warm marsh
#

I'm using a try catch

#

I've moved to typescript

quartz kindle
#

with a try catch you have to await it

#

await client.login()

earnest phoenix
#

the bot needs to only login once in the entire lifetime of the application in order to send messages while not logged in

warm marsh
#

Yeah it'll be using await

quartz kindle
#

@earnest phoenix thats a good idea, but a bad idea using discord.js

warm marsh
#

Single threaded being one of the reasons

earnest phoenix
#

I mean i do that cuz im interacting from my discord to insert the token ๐Ÿ˜‰

quartz kindle
#

discord.js eating ram for breakfast being the main reason

warm marsh
#

Oh and that I guess.

earnest phoenix
#

Hmm... How can i fetch all the uncached members of a guild then filter them?

quartz kindle
#

you can do guild.members.fetch() in v12

#

if you leave .fetch() empty, it will fetch all members

earnest phoenix
#

Won't show my precious admin mp code

#

you censored everything but the thing that needs to be censored in the token lol

#

the last part of the token is the most important thing

#

didn't show as much as u will need ๐Ÿ˜‰

#

to get control of my bot haha

#

@quartz kindle then after that gets fetched... How can i filter it to show them like if they're actual users or bots?

#

(With fetching them all way)

warm marsh
#

it returns a collection of MemberObjects or UserObjects

quartz kindle
#

await guild.members.fetch()
let bots = guild.members.filter(member => member.user.bot)

earnest phoenix
#

or if member.bot {} else {}

#

Oh i see...

#

Something like that

#

But much cleaner like tim showed

#

Ik how to filter them lol i was just asking if it's different with the fetch them all way or the normal cache way

quartz kindle
#

once they are fetched, they will be saved in the cache

warm marsh
#

Isn't it a required argument in-order to save?

earnest phoenix
#

Hmm so the cache has to added into that line after let bots = ?

quartz kindle
#

just for fun, try using it on discord bot list lmao

#

see how your memory usage climbs

#

there is an argument to not cache

#

cache is the default

earnest phoenix
#

Oh lol

warm marsh
#
let members = await guild.members.fetch();
let bots = members.filter(...);
earnest phoenix
#

Does u guys have any ideas of more stats i could give ?

embed.addField("Actual token : " , token)
embed.addField("Total Servers : " , newclient.guilds.cache.size)
embed.addField("Total Members : " , newclient.users.cache.size)
embed.addField("Discord Latency : " , client.ws.ping)
embed.addField("Bot ID  : " , newclient.id)
embed.addField("Bot Name  : " ,newclient.user.tag)
warm marsh
#

Or use guild.members.cache.filter...

#

Both work.

earnest phoenix
#

Nice

quartz kindle
#

yeah members.cache.filter()

#

forgot about that

nocturne dagger
#

Maybe dont add a token..

quartz kindle
#

looks like a fake token

#

lmao

nocturne dagger
#

even fake tokens..

quartz kindle
#

i mean, why not Actual Token: "haha noob"

#

:^)

earnest phoenix
#

Its a real token

nocturne dagger
#

if it looks legit it can cause confusion if its something like that thats fine

earnest phoenix
#

how to explain

#

its a like customer pannel

#

and customer have a bot session

#

to manage their bot

#

And they can select the bot to handle

warm marsh
#

That bot will probably kill your host

earnest phoenix
#

Wdum kill our host ?

nocturne dagger
#

so your bot hosts other bots cz_cool_think

earnest phoenix
#

Yeah ๐Ÿ˜Ž

nocturne dagger
#

is it like BotGhost?

earnest phoenix
#

BotGhost ??

quartz kindle
#

a bot that hosts bots... INTeresting

earnest phoenix
#

Its kinda complexe to create but i like that

warm marsh
#

Complex

earnest phoenix
#

im french sorry ๐Ÿ˜‚

warm marsh
#

You're using DJS it'll die fast.

#

Yeah I accidentally typed it too.

earnest phoenix
#

haha, why die fast ?

warm marsh
#

Ram usage will be through the roof.

quartz kindle
#

discord.js eats ram for breakfast

warm marsh
#

If you've got many bots running.

quartz kindle
#

it also eats cpu for breakfast if you dont use intents

earnest phoenix
#

Won't go more than 10

#

Also well worked

#

Its not running h24 bots

warm marsh
#

How much spare ram have you got?

earnest phoenix
#

3GB

warm marsh
#

RIP

earnest phoenix
#

Its much more than enought

quartz kindle
#

well, 3gb is enough for a while

earnest phoenix
#

Trust me

quartz kindle
#

but it will hit that pretty fast

warm marsh
#

Back in the day my bot would be using 500mb with dbl and my server

earnest phoenix
#

Even with 20bots it won't probably hit that much cuz its not like crazy using

#

Also its not like h24 bots started

#

its idling if the user is not doing anything

warm marsh
#

What's the purposes of these bots?

#

Couldn't you shorten it to be something like a webhook or even just querying the API yourself?

earnest phoenix
#

Its like get statistics, logs , history , managing

#

No because its suposed to be like a free hosting

#

Kinda complex i don't know what i want to end with

quartz kindle
#

well, its an interesting project

#

i dont quite agree with it or think it will work, but i support you and say go for it

earnest phoenix
#

Thanks

#

I hope client.destroy(); will help me slowing things for nothing ๐Ÿ˜‚

quartz kindle
#

client.destroy() is weird af

#

it doesnt even clear the caches

earnest phoenix
#

[Still wondering how to get the custom status of a user to be shown]

quartz kindle
#

it basically just disconnects the client and leaves you with a huge ass zombie client

earnest phoenix
#

Yup lol

#

@quartz kindle so do you know how to do that?

quartz kindle
#

@earnest phoenix i believe i told you

#

either .name .state or .details

earnest phoenix
#

I mean... What's the code before that

#

@earnest phoenix hold on

#

K

quartz kindle
#

user.presence.activity

#

or something like that

earnest phoenix
#

client.on("ready", () => {client.user.setActivity("Manage'Bot users.", {type: "WATCHING",});})

quartz kindle
#

the same thing you're already using

earnest phoenix
#

WATCHING,PLAYING,STREAMING,LISTENING(Maybe removed)

#

@earnest phoenix I didn't meant setting a bot status lol

#

oh like scraping user status

quartz kindle
#

@earnest phoenix what do you have to show the user's game?

earnest phoenix
#

I just did
useri.presence.activities lol @quartz kindle

quartz kindle
earnest phoenix
#

Nothing special ik about the presence game or activity stuff

#

Oh

quartz kindle
#

activities is actually an array

#

so user.presence.activities[0]

#

then you can get .name .state .details etc

#

from it

earnest phoenix
#

I see...what does the state do?

quartz kindle
#

the user's current party status

earnest phoenix
#

Hmm... I see... Welp thx for the help...

quartz kindle
earnest phoenix
#

Nice

quartz kindle
#

so by default it returns name

#

so you probably want details

earnest phoenix
#

Yup lol

#

@quartz kindle wait... What about if the .details returns null?

sick cloud
#

does anybody use mongodb

earnest phoenix
#

Oh nevermind it should have been .state lmao @quartz kindle

quartz kindle
#

yeah it was either details or state

warm marsh
#

Changing language TS is too salty for me.

quartz kindle
#

lmao

frigid sierra
#

@sick cloud i use mongo

#

although i see now i'm about an hour late lul

sick cloud
#

you're fine @frigid sierra

#

i got new issues nowl ol

#

that nobody can help with

frigid sierra
#

i feel that

#

i honestly feel like a lot of mongo's API is pretty inconsistent and has odd naming schemes

sick cloud
#

i'm running into full connection issues at the moment

#

auth issues if i try from my pc, and if i try on the server itself it can't even find it

frigid sierra
#

yeah, don't have a lot of context there but it might be more of a networking issue than anything mongo can pose to you

edgy heron
#

is there any issue with dbl api

ember atlas
#

No, but if you are having trouble posting your server count or any issues with it, feel free to let us know in #topgg-api ๐Ÿ™‚

stable nimbus
#

Could someone point me in the right direction for message dictation? I want my bot to respond to a message regardless of a words position.

gritty night
#

Hi

stable nimbus
#

I'm not sure what you actually mean by that, as a bot prefix should not contribute to a volume of a bot.

#

Some bots allow customization where you can change the prefix of them with a simple command, like Rythm, not sure about other bots but it might be possible through their dashboard.

#

If you're developing a bot that has the same prefix as some, I recommend changing it for now until you're ready to have it released publicly on top.gg, or making a chat where only certain bots can see it.

indigo folio
#

basically all of the symbols

stable nimbus
#

For this server anything with a common prefix can't see chats, any basic symbol that can be typed.

#

My bot is an example, The RP Bot, he has a prefix of /, so it can't ready any of these chats.

indigo folio
#

its usually suggested to use text as a prefix to avoid overlapping. for example, Dank Memer uses the pls prefix

stable nimbus
#

Having a unique prefix will help greatly, and you can set the bots status to display its help command with its prefix.

#

At some points in time my bot will display 'Watching /help', that tells others what my bots prefix is and the command to get its commands list.

#

Exactly.

#

I have mine tied to a symbol because it brings FiveM to consoles that way so.

sick cloud
#

now i have documentation for my API i made

ivory pebble
#

awesome

#

are you finally making your api public?

earnest phoenix
oak cliff
#

check to see if its undefined first and if it is then you can put "none" or something

earnest phoenix
#

Hmm ah yes... That would work... Lemme try that...

oak cliff
#

i cant read that its too small xD

earnest phoenix
#

Lol lemme get you my telescope

oak cliff
#

did it give you an error or it just still says undefined

earnest phoenix
oak cliff
#

maybe it would help if you put the undefined check first

earnest phoenix
#

Hmm so before all that... I would check it first out of all of them? @oak cliff

oak cliff
#

yeah you could try that. when i check if something is undefined i do that first before doing anything else with it

sudden geyser
#

Just put some condition checks for if the user is not playing a game to not include it in the embed

earnest phoenix
#

Hmm... Welp... Brb in a second

oak cliff
#

im not sure then Thonk

earnest phoenix
#

Hmm...

pallid marsh
#

hey, any idea of how can i move my ubuntu server to a new one?

#

like the files and the db and everything

royal laurel
#

@hereWhen i want to update my bot, does it do it automatically or will i have to do it manually. If i have to do it manually, can someone please tell me how?

ember atlas
#

Depends on how youre hosting it @royal laurel

pallid marsh
#

no one?

royal laurel
#

hosting? i ust run it on my computer

#

dont use no servers or anything

ember atlas
#

Then you can just edit the files and node . on it

amber fractal
#

@pallid marsh scp for files, not sure about the db

royal laurel
#

so all i have to do is just edit the code and node . it

#

?

ember atlas
#

Ideally

royal laurel
#

ok

ember atlas
#

If you are in the directory

royal laurel
#

thank you

#

yes

#

i am

#

thank you

#

also

#

how long does it generally take to approve of a bot?

slender thistle
#

1-2 weeks average

royal laurel
#

ok

slender thistle
#

up to 3

royal laurel
#

thank you

#

thats all i needed

pallid marsh
#

um does some1 knows what does it menas

#

and what do i need to fill in here

#

is it like the host i use?

ember atlas
#

Please do not post that image host url here again

pallid marsh
#

ok sorry...

earnest phoenix
pallid marsh
#

ok

earnest phoenix
#

What is this

ember atlas
#

-auctions

gilded plankBOT
slender thistle
#

Also wrong channel to ask

earnest phoenix
#
console.log('Am i a developer yet?');
earnest phoenix
#

"This action cannot be performed because the application is verified. Please contact support."

elder vine
#

What action?

ember atlas
#

@earnest phoenix You gotta contact Discord support, this is not the place. support@discordapp.com

#

Unless its gotta do with DBL, but we don't handle anything with verifications here.

earnest phoenix
#

wuuut im curious now what action?

#

im trynna add my bot into a team lol its not even verified

ember atlas
#

Ya you gotta contact discord support

earnest phoenix
#

yea doing it

cinder patio
#

are you sure because you have the verified developer badge

elder vine
#

"This action cannot be performed because the application is verified. Please contact support."

#

Read again. Because he was verified, he could not perform the action.

cinder patio
#

no but he said the bot isn't verified thonkku

elder vine
#

Maybe he verified before adding to Team?

queen needle
#

10 * 60 * 1000

#

how long is that in miliseconds

golden condor
#

@queen needle mathematics your brain

cinder patio
#

60 * 1000 = 60000 which is 1 minute

queen needle
#

i have a brain??

golden condor
#

Yes

queen needle
#

woah

#

6 hours?

cinder patio
#

10 minutes

queen needle
#

close

#

how would i make it last a day

cinder patio
#

search 24 hours to milliseconds

queen needle
#

8.64e+7

#

or could i times 1 minute by 1440 cause theres 1440 mins in a day

elder vine
#

You can do: 24 * 60 * 60 * 1000

#

If Iโ€™m not wrong

queen needle
#

okay thank you

elder vine
#

No problem

queen needle
#
client.on("message", message => {
  if(message.content.startsWith(PREFIX + "invite")){
    let invite = message.channel.createInvite(
  {
    maxAge:  24 * 60 * 60 * 1000, // maximum time for the invite, in milliseconds
    maxUses: 10000 // maximum times it can be used
  },
      )
      message.channel.send(invite + ' thats your invite it will last for 1 day and 10000 uses')
      }

});```
#

in the message it says [object Promise] not a link?

cinder patio
#

That's because createInvite returns a promise

queen needle
#

oh

spare goblet
#

just resolve the promise and then figure out what property of the object you'd like

#

because an invite object involves several pieces of data

queen needle
#

i thought it just need how long it last and how many people can use it

spare goblet
#

uh

#

yes

#

but like, invite the object promise it retuns needs to be resolved

#

and then it returns an object

earnest phoenix
#

Hi

spare goblet
#

i think invite.code would return the code for the invite but i could be wrong

queen needle
#

the code is the numbers part right?

tight plinth
#

Lemme check my code for my invite command

earnest phoenix
#

I want to raise the bar my right on the site how can I help @spare goblet

tight plinth
#

Just await it

lament meteor
#

just await and if all fail just fallback with .catch

spare goblet
#

idk what youre talking about @earnest phoenix

edgy heron
#

this is really strange. 4 days ago my bot was approved. server count reached to 3300 from 68. every hour 40-50 servers. But last 8 hours no on added it. any issue with top.gg ? is there any special offer that new bot gets bumped?

earnest phoenix
#

how do you get a programmer's rank @spare goblet

queen needle
#
client.on("message", async message => {
  if(message.content.startsWith(PREFIX + "invite")){
    let invite = await message.channel.createInvite(
  {
    maxAge:  24 * 60 * 60 * 1000, // maximum time for the invite, in milliseconds
    maxUses: 10000 // maximum times it can be used
  },
      )
      message.channel.send(invite + ' thats your invite it will last for 1 day and 10000 uses')
      }

});```
#

doesnt work

spare goblet
#

Not server

#

don't send link to your server pls that's advertising

queen needle
#
client.on("message", message => {
  if(message.content.startsWith(PREFIX + "inv")){
    

async function replyWithInvite(message) {
  let invite = await message.channel.createInvite(
  {
    maxAge: 10 * 60 * 1000, // maximum time for the invite, in milliseconds
    maxUses: 1 // maximum times it can be used
  },
  `Requested with command by ${message.author.tag}`
)
.catch(console.log);

  message.reply(invite + `Here's your invite: ${invite}` + "There has been an error during the creation of the invite.");
}
  }
});```
#

doesnt work?

tight plinth
#

async message

#

With the last one

cinder patio
#

you are never calling the function ?

tight plinth
#

^

cinder patio
#

you can remove the function and put async before message like Lumap said

queen needle
#

"message", async message

#

like that

cinder patio
#

yea

queen needle
#
client.on("message", async message => {
  if(message.content.startsWith(PREFIX + "invite")){
    let invite = await message.channel.createInvite(
  {
    maxAge:  24 * 60 * 60 * 1000, // maximum time for the invite, in milliseconds
    maxUses: 10000 // maximum times it can be used
  },
      )
      message.channel.send(invite + ' thats your invite it will last for 1 day and 10000 uses')
      }

});```
#

so that

cinder patio
#

try it

queen needle
#

doesnt work

tight plinth
#

Console ?

queen needle
#

oh yeah give me a minute

#

where would the .catch(console.log);

#

go

tight plinth
#

Just between the) and message.channel.send

queen needle
#

now when i send a message it says undefined

edgy heron
#

this is really strange. 4 days ago my bot was approved. server count reached to 3300 from 68. every hour 40-50 servers. But last 8 hours no on added it. any issue with top.gg ? is there any special offer that new bot gets bumped?

twilit rapids
#

If your bot gets added to our site, it can reach a page called Trending, your bot stays on here until it gets pushed off it

edgy heron
#

what does it mean

#

pushed off it means?

twilit rapids
#

That other bots came to it later than you

#

There are 6 spots

tight plinth
#

Other bots joined

edgy heron
#

didnt get it

twilit rapids
#

You start on 1, and get pushed to 2 if another bot joins it

queen needle
#

when i do the command it says undefined now

twilit rapids
#

This continues until you get pushed off spot 6

edgy heron
#

oh

tight plinth
#

@queen needle hmmm

edgy heron
#

so i lost that 6th spot?

tight plinth
#

Check bot perms

edgy heron
#

i mean i am 7th now?

tight plinth
#

There is no 7th

edgy heron
#

i mean

tight plinth
#

It just disapears

edgy heron
#

i lost my 1,2,3,4,5,6th spots

tight plinth
#

No

edgy heron
#

how trending works, who can see this channel

tight plinth
#

You get pushed off

queen needle
#

my bot has a role that has creat invite permission

tight plinth
#

Interestinggg

#

@edgy heron wrong chan BTW, lets move to general

queen needle
#

so for some reason invite isnt defiend

#

can anyone help?

slate iris
#

Hmm

queen needle
#

i have no clue why it says undefined

trim nexus
#

what's wrong?

queen needle
#
client.on("message", async message => {
  if(message.content.startsWith(PREFIX + "invite")){
    var invite = await message.channel.createInvite(
  {
    maxAge:  24 * 60 * 60 * 1000, // maximum time for the invite, in milliseconds
    maxUses: 10000 // maximum times it can be used
  },
      ).catch(console.log);
      message.channel.send(`${invite}` + ' thats your invite it will last for 1 day and 10000 uses')
      }

});```
#

it says undefined not a invite code

#

idk why

trim nexus
#

no error? log invite

queen needle
#

okay

frail ocean
#

Ensure you have perms to make an invite as well.

queen needle
#

got it to work

#

and i do

#

but it says it cant last longer then a minute

#

it says it cant be greater then 86400 which is 1.44 minutes

earnest phoenix
#
client.on("message", async message => {
  if(message.content.startsWith(PREFIX + "invite")){
    var invite = await message.channel.createInvite(
  {
    maxAge:  24 * 60 * 60 * 1000, // maximum time for the invite, in milliseconds
    maxUses: 10000 // maximum times it can be used
  },
      ).catch(console.log);
      message.channel.send(`${invite}` + ' thats your invite it will last for 1 day and 10000 uses').catch(error => {
  console.count(`${error.message}`)
});
      }

});```
#

error.message will say the issue

queen needle
#

it says maxAge can only be greater then r equal to a 86400

#

so i cant have it last longer then 1.44 minutes

earnest phoenix
#

@blazing portal js if (message.author.id == '364836696149458944' || message.author.id == '390969718535618561') { console.log(`Blacklisted, Skipping...`) // or message.channel.send(`rot buddy`) // or message.channel.delete() // or message.author.ban(`noob`) return; }

#

thats how you do it

#

make sure IDS are correct

queen needle
#

unless it is in seconds

#

um it sends the same invite code eveytime?

earnest phoenix
#

Why has my bot been "awaiting verification" for 2 months now?

summer torrent
#

2 months?????

slender thistle
#

Also wrong channel to ask

summer torrent
#

lmao

queen needle
#

yes 2 months

high bough
tight plinth
#

u cant initialize smth in a "if" condition and using it after

mossy vine
#

what if loop

#

also yea you can if its var

zenith orchid
high bough
#

Oh okay, ty

royal laurel
#

i finally finished my first version of my bot!

#

its called admin bot

#

and

#

i would liek to have some suggestionss for what to put into it

frail ocean
#

But now I'm getting this...
@high bough There is a message that's either undefined or empty.

#

So it can't send a message that has no content.

simple pollen
#

Hi

#

how to check verification lvl of guild using djs v12

summer torrent
wheat jolt
#

how can I use i18n to make my bot multi-language?

#

docs didn't help me

simple pollen
#

ig it doesnt work for v12 anymore

still roost
#

tbh, better to go to discord servers that are really for developing

#

like tsc menu docs

frail ocean
#

Or even the official djs server.

still roost
#

yea

simple pollen
#

yep thnx

still roost
#

and most ppl rly dont read docs

#

or watches tutorial for v11

simple pollen
#

i need latest docs there are many changes in v12

summer torrent
still roost
#

lol docs are up to date

summer torrent
simple pollen
#

Yeh this

#

Ty

#

u r god

still roost
#

v12 is mainly like MessageEmbed() and .cache

simple pollen
#

can u just dm me djs server link

still roost
#

just search discord.js server

#

ppl dont rly search before they ask

simple pollen
#

there are many ๐Ÿ˜‚

#

Nvm

#

ty

#

for help

summer torrent
#

@simple pollen

simple pollen
#

@summer torrent LoVe

#

O those verification 0, 1, 2 are removed

earnest phoenix
#
client.on("guildBanAdd", function(guild, user){
  setTimeout(function () {
    console.log('timeout completed'); 
}, 1000); 
});
#

Does anyone know how i can get the UserID of the guy that banned

golden condor
summer torrent
#

^

golden condor
#

Oh of the guy that banned the person

#

You need to search audit logs for that

summer torrent
#

fetch from audit logs

earnest phoenix
#

How can i do that ?

summer torrent
earnest phoenix
#

Uh where am i suposed to put my filters ?

  .then(audit => console.log(audit.entries.first()))
  .catch(console.error);```