#development

1 messages · Page 1372 of 1

restive notch
#

how can i put how many servers my bot is in, in its tag thing

snow urchin
#

OK, I solved the issue I had above, but now.. I am encountering ERROR DiscordAPIError: 405: Method Not Allowed when attempting to delete a message. This occurs every now and again, other times.. it works.

opal plank
#

try with a throw error on the first line is some WOKE level of coding

restive notch
#

@snow urchin if the message it is trying to delete is by a higer role it wont be able to

#

i think

sharp thicket
#

how can i put how many servers my bot is in, in its tag thing
@restive notch <Client>.guilds.cache.size

snow urchin
#

its made by the bot..

quartz kindle
#

method not allowed? thats weird

restive notch
#

ty

sharp thicket
#

Np

opal plank
#

using PATCH rather than POST maybe?

quartz kindle
#

but he said it happens when deleting a message

#

that doesnt look like a message delete error

earnest phoenix
#

@quartz kindle i know, thats what i wanrt

snow urchin
#

I will double check and be sure that is what it is from

earnest phoenix
#

but like

opal plank
#

method not allowed should be wrong type

earnest phoenix
#

it says the same error

opal plank
#

get/post/patch/delete

earnest phoenix
#

no matter if the person is an admin or not

snow urchin
#

What would cause ERROR AbortError: The user aborted a request., I get that a lot too.

sharp thicket
#

@snow urchin maybe you are trying to use a user token instead of a bot token

snow urchin
#

no..

sharp thicket
#

Ok

opal plank
#

bad internet or code stopped/halted being executed, most of the time

quartz kindle
#

@earnest phoenix it will always say 'DiscordAPIError: Missing Permissions' because thats what you told it to say

earnest phoenix
#

aaaa

opal plank
#

try with a throw error on the first line is some WOKE level of coding

earnest phoenix
#

erwin that doesnt help

#

im new to js chill

quartz kindle
#

@snow urchin abort error happens when a request takes too long, or the connection fails for some reason

opal plank
#

should you be coding a bot without programming knownledge beforehand?

snow urchin
#

Could it also be the webhook throwing 405? The webhook does not appear to be sending anymore

earnest phoenix
#

should you be coding a bot without programming knownledge beforehand?
@opal plank ive been scripting for 2 years

#

just not js

#

c# and lua

sharp thicket
#

Cool

earnest phoenix
#

korabi i wasnt talking to you why did u just appear out of nowhere

snow urchin
sharp thicket
#

I was not talking to you

quartz kindle
#

the throw statement will intentionally throw an error, and interrupt the script, so anything after the throw will no longer run

sharp thicket
#

Duh

earnest phoenix
#

so how can i make it so if i get the "DiscordAPIError: Missing Permissions" error, it doesnt actually error

snow urchin
#

remove your throw

quartz kindle
#

you need to catch errors from the discord.js methods, not throw your own error

sharp thicket
#

Lol

quartz kindle
#

in order to catch errors from promises using try catch, you have to await the promises

#

so in your case, you have to await all those lines

#

otherwise the try catch wont catch anything

opal plank
#

i think i have a handy snippet from somewhere

earnest phoenix
#
 try {
                    user.send(`You Have Been Kicked From ${msg.guild.name}: ${reason}`);
                    msg.channel.send(`> ${user.member.tag} Has Been Kicked.`);
                    sleep(500)
                    member.kick();
                    msg.delete();
                } catch(error){
                    if(error === "DiscordAPIError: Missing Permissions") {
                        console.log("Unable to ban other administrators")
                    }
                }```
#

so like this

opal plank
#

sync code cannot wait for async code or wait for promises with .then
async code can wait for sync code but cannot wait for promises .then
promises with .then can wait for async and sync iirc

quartz kindle
#

if(error.message === ...)
and you need to use await

snow urchin
opal plank
sharp thicket
#

Why not rather use the .includes() function instead of a strict operator?

quartz kindle
#

you should also change the order of the calls

#

you should try to kick first, and only send messages after the kicking succeeds

sharp thicket
#

That would not work

snow urchin
#

^

sharp thicket
#

Cuz it would not be in the guild

snow urchin
#

the bot and user no longer have a common guild

sharp thicket
#

Yea

snow urchin
#

therefor screaming "CANNOT SEND MESSAGE TO THIS USER"

earnest phoenix
#
function sleep(milliseconds) {
    const date = Date.now();
    let currentDate = null;
    do {
      currentDate = Date.now();
    } while (currentDate - date < milliseconds);
  }```
#

would this overclock

quartz kindle
#

but then you will tell them they have been kicked, but they were not kicked if it fails

sharp thicket
#

setTimeout() works too you know

quartz kindle
#

@earnest phoenix that will block your code and use 100% cpu

snow urchin
#

but then u cant tell them they have been kicked at all

quartz kindle
#

for that amount of time

sharp thicket
#

Yes

earnest phoenix
#

500

#

as in

#

500 miliseconds

sharp thicket
#

Wair

earnest phoenix
#

so a half of a second

#

not 500 seconds

#

@quartz kindle

quartz kindle
#

enough to cause disconnections

#

from discord

sharp thicket
#

Wait tim what is ur bots name

opal plank
#

recommendation, dont use while, unless you ABSOLUTELY need it

quartz kindle
#

@sharp thicket Astrobot

earnest phoenix
#

i learned that in lua

sharp thicket
#

Use for()

#

Nice.

earnest phoenix
#

for() wouldnt work for this instance

opal plank
#

while is notorious for breaking shit up quite easily without proper breaks

snow urchin
#

this is really weird tbh
@opal plank how so 😄 Blame PreMiD owner

quartz kindle
#

@earnest phoenix the correct way to sleep in js, is using setTimeout

sharp thicket
#

Yes

quartz kindle
#

preferably inside a promise for ease of use

opal plank
#

infinite loops for one

sharp thicket
#

Like i mentioned earlier

opal plank
#

wait

#

thats PreMid code? wot

snow urchin
#

ya

#

LOL

opal plank
#

wtf?

snow urchin
#

I am their bot dev, as of like 3 weeks ago

opal plank
#

premid should be on browser, why you even calling it there?

#

i doubt premid desktop runs on js

earnest phoenix
#
                    user.send(`You Have Been Kicked From ${msg.guild.name}: ${reason}`);
                    msg.channel.send(`> ${user.member.tag} Has Been Kicked.`);
                    setTimeout(function(){
                        member.kick();
                        msg.delete();
                    }, 500)         ```
#

so like this

opal plank
#

the app, i mean

snow urchin
#

no

#

premid is ALLLLL typescript

opal plank
#

thank god

snow urchin
opal plank
#

i assumed its transpiled

#

close

#

xD

quartz kindle
#

@earnest phoenix yes, but you still need to await the promises, or else try catch wont catch anything

earnest phoenix
#

how do i await promise

sharp thicket
#

Isnt ts like js but a bit diff

#

awair

snow urchin
#

ye anyways erin, idk why my webhook aint sending anymore!! this is frustrating LOL

earnest phoenix
#

thanks

sharp thicket
#

await

earnest phoenix
#

im asking how

#

not the keyword name

opal plank
#

its amazing that they have their app in ts

sharp thicket
#

Bruh use await

snow urchin
#

version 3.0 soon omg its sexy

earnest phoenix
#

how do i await promise
@earnest phoenix @quartz kindle

snow urchin
#

ive said too much

opal plank
#

lets get back to the issue at hand

#

did you type that code?

snow urchin
#

mhmm

quartz kindle
#
try {
  await user.send()
  await msg.channel.send()
  setTimeout(() => {
    try {
      await member.kick()
      await msg.delete()
    } catch(error) {
      ...
    }
  },500)
} catch(error) {
  ...
}
snow urchin
#

which code

opal plank
#

or you taking stuff mid way thru?

snow urchin
#

Ye

sharp thicket
#

Thats what i literally told him @quartz kindle

#

Lol

earnest phoenix
#

@quartz kindle what exactly does await do

opal plank
#

hmmm lemme try see, error is something about method not allowed right?

quartz kindle
#

it awaits the promise

sharp thicket
#

Bruh its called await wtf

snow urchin
#

do you have time for liveshare? could help speed things up haha

quartz kindle
#

it forces that specific block of code to not proceed until the promise resolves

#

a promise is an async function, that will eventually complete

opal plank
#

im checking the source first

#

also yes, i do

quartz kindle
#

js is synchronous, it can only do async code by pushing it elsewhere then returning to it later

earnest phoenix
#

Bruh its called await wtf
@sharp thicket thats a stupid argument, thats like saying "its called for, it clearly shows possession"

sharp thicket
#

Example:
const msg = await message.channel.send(“smth”)
msg.edit(1)

#

Bruh its literally self explanatory

earnest phoenix
#

again

#

@sharp thicket thats a stupid argument, thats like saying "its called for, it clearly shows possession"
@earnest phoenix

sharp thicket
#

Bruh

quartz kindle
#

in the above example, if you dont use await, you cant use msg.edit() because the code will immediately try to edit the message before it finishes sending

sharp thicket
#

^^

#

Im just too lazy to explain cuz im on mobile

quartz kindle
#

i'll do it for you lmao

sharp thicket
#

Lol

earnest phoenix
#

so is the promise in js try { await user.send() await msg.channel.send() setTimeout(() => { try { await member.kick() await msg.delete() } catch(error) { ... } },500) } catch(error) { ... } this, the try?

sharp thicket
#

await for me is most used in my eval command

quartz kindle
#

@earnest phoenix user.send() returns a promise, because it needs to connect to discord and ensure the sending process is completed, which takes time, and js cannot wait for this

#

same thing with msg.channel.send()

#

same with member.kick()

#

same with msg.delete()

#

all these functions return a Promise instance

#

which means they initiated the sending process, but did not finish yet, its a promise that will eventually complete at a later time

sharp thicket
#

Since you know lua why dont u just use it btw

#

I think Discordia is on lua

earnest phoenix
#

i dont know how to install the lua thing

#

i tried

sharp thicket
#

Bruh

#

Isnt that basics

earnest phoenix
#

installing external modules isnt exactly basics

sharp thicket
#

Oh

#

Sorry i assumed cuz in js it is

earnest phoenix
#

every lua scripting software ive used is typically part of the ide

#

like

#

you dont require anything

sharp thicket
#

How do you call an event on lua

earnest phoenix
#

you download it as a whole

#

events dont exactly exist in lua

sharp thicket
#

Hm

quartz kindle
#

did this not work?

#

To install Luvit, visit https://luvit.io and follow the instructions provided for your platform.
To install Discordia, run lit install SinisterRectus/discordia
Run your bot script using, for example, luvit bot.lua

earnest phoenix
#
instance.event:Connect(function()

end)```
#

although youd probably do something like that

sharp thicket
#

Whats end for

earnest phoenix
#

thats lua's version of }

#

if condition then

end

sharp thicket
#

Oh

earnest phoenix
#

its a pretty verbose language

sharp thicket
#

To install Luvit, visit https://luvit.io and follow the instructions provided for your platform.
To install Discordia, run lit install SinisterRectus/discordia
Run your bot script using, for example, luvit bot.lua tim said this btw

#

You said you’ve been scripting for 2 years now? You should know how to do this...

#

I think it would be easier for you since u alr know lua

earnest phoenix
#

You said you’ve been scripting for 2 years now? You should know how to do this...
@sharp thicket

#

ive never done things like this

sharp thicket
#

Yes?

#

Oh

#

What dis u do?

earnest phoenix
#

roblox studio and love (its an app)

sharp thicket
#

Did*

#

Oh lol

#

Ik what roblox is

earnest phoenix
#

nono i know u would think roblox scripting would be a stupid simple version of lua

sharp thicket
#

Its a gamw

earnest phoenix
#

its actually suprisingly difficult

sharp thicket
#

Gae

#

Game*

#

Ong stio

#

Ok i cant spell

quartz kindle
#

there are many implementations of Lua and many Lua engines out there

sharp thicket
#

Yes

quartz kindle
#

Luvit is one of the most popular ones, its similar to node.js and includes a package manager

sharp thicket
#

So its a runtime?

quartz kindle
#

its the goto platform for general purpose lua development

#

yes

sharp thicket
#

Oh okay

quartz kindle
#

based on LuaJIT

sharp thicket
#

my gf is texting me and its 3 21 am

quartz kindle
#

why she awake

earnest phoenix
#

ok i installed it on command prompt

quartz kindle
#

why u awake

earnest phoenix
#

now what

sharp thicket
#

~idk

#

We saw a scary movie

quartz kindle
#

after installing luvit in your system, you should be able to access its package manager lit from the command line

sharp thicket
#

Now i have turned into a 10 yr old

quartz kindle
#

so navigate to a folder where you want to run your bot from, and run lit install SinisterRectus/discordia

earnest phoenix
#

oh

quartz kindle
#

did you restart cmd?

sharp thicket
#

after you install a runtime its usually recommended u restart ur pc

earnest phoenix
#

its lets me install it to onedrive but not to my desginated folder

#

what

quartz kindle
#

weird lul

#

but anyway you were able to install discordia right? did it create a folder for installed packages?

sharp thicket
#

Huh

earnest phoenix
#

but anyway you were able to install discordia right? did it create a folder for installed packages?
@quartz kindle where would that folder be

quartz kindle
#

from what i understood, you installed it in /users/james

#

and it created the deps folder

earnest phoenix
#

yo i found it

#

so what now

quartz kindle
#

and a file package.lua

earnest phoenix
quartz kindle
#

so if the install fails elsewhere, you should be able to copy the deps folder and the package.lua to the folder you want, and itshould work

earnest phoenix
#

so do i just ctrlc ctrlv all this stuff in my bot folder

#

ok

quartz kindle
#

ye

earnest phoenix
#

do i take the entire deps folder

#

or just that stuf

quartz kindle
#

i'd take everything

#

i never used lua or luvit before, im just following common sense here

earnest phoenix
#

so like that?

quartz kindle
#

yes

#

was there not a package file outside of the deps folder?

earnest phoenix
#

its inside

quartz kindle
#

ye but there should be one outside too

#

check in /users/james

earnest phoenix
#

is it a folder or a txt

quartz kindle
#

a file, the same as the package file inside the discordia folder

#

but with different contents

earnest phoenix
#

theres 2 txt files inside deps

#

with that name

#

but thats it

quartz kindle
#

nothing in /user/james?

earnest phoenix
#

nope

quartz kindle
#

welp lets try anyway

#

create a file for your bot

#

for example bot.lua

earnest phoenix
#

done

quartz kindle
#

the same you did in js

#

and copy paste the basic discordia code

#
local discordia = require('discordia')
local client = discordia.Client()

client:on('ready', function()
    print('Logged in as '.. client.user.username)
end)

client:on('messageCreate', function(message)
    if message.content == '!ping' then
        message.channel:send('Pong!')
    end
end)

client:run('Bot INSERT_TOKEN_HERE')
#

and then try to run it with luvit bot.lua

earnest phoenix
#

uh

#

i use pm2

quartz kindle
#

try running it without pm2 for now

#

later on you can use pm2

earnest phoenix
#

no autofill suggestions

#

by that i mean i dont think its working

quartz kindle
#

see if you need to install a lua/luvit extension in your ide

#

but that doesnt mean it wont work

earnest phoenix
quartz kindle
#

did you restart cmd after installing luvit

earnest phoenix
#

yes like 20 times

quartz kindle
#

try restarting your pc

earnest phoenix
#

i installed luvit yesterday tho

#

i just didnt know how to use it

#

see i have it downloaded like 3 times

quartz kindle
#

hmm

#

wait

earnest phoenix
#

can someone tell me how I do a ping command without editing the message? The command should display the server latency

quartz kindle
#

or downloading the exe from github?

solemn latch
#

You could run a ping test every once in awhile and save it in a variable.

#

Or if you mean a websocket ping

earnest phoenix
#

@quartz kindle send me link to that website

solemn latch
#

You can use that

earnest phoenix
#

where u saw that

quartz kindle
earnest phoenix
#

ok so i kinda got it working

#

i dont know what that error means

quartz kindle
#

wrong token

earnest phoenix
#

oh

#

no it isnt

#

i have the right token

#

still giving me that error

quartz kindle
#

dont erase the "Bot" part

#

"Bot 9743n9t7v94t9283y05m2uv35u203v5"

earnest phoenix
#

oh

#

client:run('Bot ***)

#

so like that?

quartz kindle
#

ye

earnest phoenix
#

ok

#

hey it works

#

thanks

quartz kindle
#

here's the docs for discordia

#

you should be able to continue from there

earnest phoenix
#

how do you do the live edit thing in vsc

#

i forget

quartz kindle
#

you will need to configure luvit as the runtime

earnest phoenix
#

alright

ivory seal
#

i have seen bots that rename themself to like this (emoji bots) how is this possible?

#

does it create a new instance of the bot?

modest crane
#

webhooks

drifting wedge
#

how can i use js to show html?

ivory seal
#

yes

sudden geyser
#

could you be more specific

drifting wedge
#

how can i show / hide html elements?

opal plank
#

css tags

#

display:none

snow urchin
#

last time I bother ye people

                if (this.acceptedAt) embed.setFooter(`Ticket chat lasted ` + moment.utc(moment(Date.now(), "DD/MM/YYYY HH:mm:ss").diff(moment(this.acceptedAt, "DD/MM/YYYY HH:mm:ss"))) + `.`)

why does this return "NaN" 😄

rocky hearth
#

@snow urchin I'll help you, but first tell me, which terminal are you using?

pale vessel
#

wdym, that looks like vsc

blissful coral
#

that is vsc

#

I think

pale vessel
#

it is

#

never actually used it before tho

rocky hearth
#

ikt, I was asking for that colors on left

earnest phoenix
#

it's just console text background color

rocky hearth
#

but vsc doesn't have that by default. Like, I use zsh terminal in vsc

earnest phoenix
#

i'm aware

#

the text background color is something you programatically set / use ANSI codes

clever vector
#

how to get bot info api

rocky hearth
#

wdym?

clever vector
#

the api

blissful coral
clever vector
#

ik now

lusty sierra
#

? (node:2224) UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token < in JSON at position 0 ? at JSON.parse () ? at module.exports (C:\Users\xxxxxxx\xxxxxxx\Bot File\node_modules\ytsr\lib\main.js:18:23) ? at processTicksAndRejections (internal/process/task_queues.js:97:5) ? (node:2224) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag--unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) ? ? (node:2224) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

#

anyone know why this is happening?

#

it is a discord music bot

clever vector
#

Hey guys i cant make the setImage

#

its doesnt show anything

#

@earnest phoenix

#
const Discord = require('discord.js');

exports.run = async (client, message, args) => {
  const embed = new Discord.MessageEmbed()
    .setTitle(":mdHelp: Information Centre")
    .setColor("RANDOM")
    .setDescription("This is a quite easy to use which contains: **Moderate** | **Information** | **Fun** & more systems.")
    .addField("Invite", `[Click Here](https://discord.com/oauth2/authorize?client_id=727448017799479296&scope=bot&permissions=878181502)`, true)
    .addField("Support", `[Click Here](https://discord.homes/spwoobky)`, true)
    .addField("Developer", `@clever vector @gray sun`, true)
    .addField("Goal", `Our current goal is the let the bot reaches \`75 servers\` and \`Verified Developer Badge\``, true)
    .setImage("https://top.gg/api/widget/727448017799479296.png")
    .setTimestamp()
    .setFooter(`Requested by ${message.author.tag}`, message.author.displayAvatarURL())

    message.channel.send(embed);
}
rocky hearth
#

It looks like u've missed/added a quote somewhere, but y I can't see it

proper bolt
#

thats not a valid image?

#

wait

#

it is

#

hm

ionic dawn
#

If its not popping any error and the embed is showing without the image is probably cuz you cant load the image that way

proper bolt
#

the preview doesnt show up

ionic dawn
#

Maybe because is not an static image on that link, it generates when you check it prob? I dnt really know

proper bolt
#

maybe if you request it with node-fetch or whatever and upload it as an attachment

ionic dawn
#

Yeah

rocky hearth
#

@clever vector

lusty sierra
#

? (node:2224) UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token < in JSON at position 0 ? at JSON.parse () ? at module.exports (C:\Users\xxxxxxx\xxxxxxx\Bot File\node_modules\ytsr\lib\main.js:18:23) ? at processTicksAndRejections (internal/process/task_queues.js:97:5) ? (node:2224) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag--unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) ? ? (node:2224) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

#

^ anyone know how to fix this /

clever vector
#

Its the static image

sudden geyser
#

You're probably trying to parse HTML as JSON.

clever vector
#

How to let it work?

sudden geyser
#

Though, it's coming from a dependency (ytsr)

#

Not you, Cade.

clever vector
#

OHh

pale vessel
#

same problem, it's just ytsr

clever vector
#

Can you help me

#

my bot static api dont show up

remote anvil
#

i need a little help with one of my servers. can someone please help me?

clever vector
#

What can i help you dear?

remote anvil
#

so one of my voice channels is showing as inactive and idk how to fix it. can you please help me?

clever vector
#

Can you invite me to your server

#

i will help you

remote anvil
#

sure!

#

thank you so much!

clever vector
#

Okay

earnest phoenix
#

yo if anyone does discord.py dm me i’m working on sum need some help making an eco function

drifting wedge
#

Sure

#

I know but like what do u need help with?

#

Also no dms lol @earnest phoenix

#

Ping when ur back

grizzled thistle
#

Hi, I wonder how long does it take to my bots to get approved at top.gg?

drifting wedge
#

3 weeks

#

Going down tho

grizzled thistle
#

Wew

#

If there any requirements, like i the bot is too simple then it might not get approved?

drifting wedge
#

I think they’re adding like 50 more bot reviewers

#

ye

#

Read rules

#

U need a couple commands

#

Like 5

#

And u can’t copy bots code

#

U can do same stuff

#

But can’t just rip off code

grizzled thistle
#

my bot just doing some scrapping using puppeteer

#

thank you for your answer, now i think i have to add more functions

ivory seal
#
        console.log('a')
       const emoji= client.emojis.cache.find(emoji => emoji.name="peepoHappy"); 
       message.channel.send(`${emoji}`);

    }``` for some reason, even though i type :peepo: it still doesn't consolw anything pls help
drifting wedge
#

I mean just 5 commands

#

Even if u copy a bot, u can just add 5 cmds

#

@grizzled thistle

ivory seal
#

i mean but why would u copy a bot?

pale vessel
#

if it gets converted to an emoji, then it's not ":peepo:" anymore

#

also, it's emoji.name ===

#

not =

grizzled thistle
#

thank you

ivory seal
#

well it didn't get converted into a emoji @pale vessel and thank u i'll change the emoji.anme

#

but even then

#

it doesn't console

pale vessel
#

show what you sent

ivory seal
#

it isn't a emoji

pale vessel
#

add console.log(message.content) in your message event

ivory seal
#

kk

#

weird it doesn't console that either

#

let me paste my message \event

#
    console.log(message.content);
    if(message.content.includes('!peepo!')){
        console.log('a');
       const emoji= client.emojis.cache.find(emoji => emoji.name==="peepoHappy"); 
       message.channel.send(`${emoji}`);

    }

});```
pale vessel
#

are you sure the event is triggered in the first place

ivory seal
#

isn't the event triggered when u send a mesage?

pale vessel
#

yes

#

but wait you made it !peepo!

ivory seal
#

yep i just changed it

#

the message event doesn't work?

#
    console.log("this works")

});``` i cahnged it to this but it still doesn't console
drifting wedge
#

If anyone needs python help lmk

#

PING MEEEEEEE THO

pale vessel
#

hmm

sudden geyser
#

So you aren't receiving message events

#

There are a few reasons for that, such as disabling intents.

#

Or the scope.

#

Or not logging in

#

But you should receive them typically

sudden geyser
#

For developers who've used Hypixel's API in the past, have any of you dealt with rate limiting? Does Hypixel tell you how much time is left until the rate limit is over (maybe in the headers)?

ivory seal
#

@sudden geyser i have logged in , i can check that with my cleint.on(ready)

#

but i haven't enab;ed intents but i don't need it either

sudden geyser
#

So you have no intents enabled whatsoever?

pale vessel
#

i don't need it either
you NEED it

rocky hearth
#

what's guild.mfaLevel?

pale vessel
rocky hearth
#

what does that stands for, malicious factor authentication level?

sudden geyser
#

multi factor authentication

hazy sparrow
#

how do i make my bot leave all servers?

sudden geyser
#

It's either a 1 or 0 - the user has it or not.

#

how do i make my bot leave all servers?
@hazy sparrow what library

#

though I ask why

hazy sparrow
#

d.js

rocky hearth
#

client.guilds.cache.tap(g => g.leave()) im not sure

sudden geyser
#

that won't work for the record

hazy sparrow
#

No i mean what if i delete the bot acc in the developer portal

sudden geyser
#

that would make it leave all guilds

#

which is what I was going to suggest

hazy sparrow
#

ah yes, thank you!

#

Rip 8 weeks of waiting for it to be approved

rocky hearth
#

how many servers u were in?

ivory seal
#

you NEED it
@pale vessel i need it? ok

hazy sparrow
#

how many servers u were in?
@rocky hearth umm like 81

#

it was a trash bot anyways

#

I wanna start fresh

rocky hearth
#

but y delete the entire bot?? delete project itself

hazy sparrow
#

because i wanna see it grow from start again

#

umm how do you create a bot invite link again

#

I forgot

tribal siren
#

how to make a when mentioned prefix in javascript?

fluid basin
#

if the message starts with a mention

tribal siren
#

ye

#

like

#

@scarlet cradle help

#

i know that it's possible on python

fluid basin
#

well I told you how

#

if the message starts with a mention

tribal siren
#

but i need to know it on javascript too

rocky hearth
tribal siren
#

if the message starts with a mention
@fluid basin is that it

fluid basin
#

yeah so check if the message starts with the mention

tribal siren
#

okay

#

thank you

tardy hornet
#

npm i ms

#

?

ionic dawn
#

parse-ms

tardy hornet
#

okay ty

ionic dawn
earnest phoenix
#

Any buddy know redirect websites without skip button

ionic dawn
#

You mean like adf.ly but auto skip after x seconds?

signal vortex
#

@bitter karma here

bitter karma
#

Ok

signal vortex
#

Ask here, send some info to get helped along

proper maple
#

From Which Channel Can I Add My Bot?

bitter karma
#

Why?

#

@signal vortex

earnest phoenix
#

@proper maple You can add your bot on Top.gg, once you sign into your discord account there’ll be a button that said “Add my bot”, or something like that. The button is located on the top blue bar. From there you’ll need to fill out some information and you’ll be done.

bitter karma
#

I boost it with heroku

earnest phoenix
#

Have you tested your bot to make sure it’s able to turn on?

bitter karma
#

Yes

#

Now i senz you the list of the command

#

Wait here

earnest phoenix
#

Can you explain your problem, because I am having trouble understanding, do you not know why your bot is offline?

tardy hornet
#

for some reason its not letting me download quick.db

bitter karma
#

Can you explain your problem, because I am having trouble understanding, do you not know why your bot is offline?
@earnest phoenix yes

ionic dawn
#

for some reason its not letting me download quick.db
@tardy hornet Do you have any error log?

bitter karma
proper maple
#

not added it gives error

#

@earnest phoenix

bitter karma
#

But now Is off

rose warren
#

Check the error logs

bitter karma
#

Oh and i am italian

earnest phoenix
#

not added it gives error
@proper maple Did you fill out the information it says you to do? Or did you type the character limit in the descriptions?

#

Such as the brief description and the in depth description.

tardy hornet
#

so many of those lines

#

cant fit in 1 image

proper maple
#

Yes

ionic dawn
#

put it here and share the link

earnest phoenix
#

@proper maple What does the error say?

tardy hornet
proper maple
#

@earnest phoenix short description says short

bitter karma
#

now I describe the problem of my bot in Italian, could you translate it into English? Because I don't know English very well @earnest phoenix

earnest phoenix
#

Ah, you have to fill the character limit, you can’t be short.

#

now I describe the problem of my bot in Italian, could you translate it into English? Because I don't know English very well @earnest phoenix
@bitter karma Sure.

bitter karma
#

Ok

proper maple
#

I filled it but it gives an error again@earnest phoenix

earnest phoenix
#

If you filled the character limit you won’t be able to type any more characters.

#

Can someone help me with bots

#

Pws

ionic dawn
#

@tardy hornet py version?

bitter karma
#

È da 2 settimane che provo i comandi del mio bot, funzionano tutti, ma ieri sera quando ho provato a pubblicarlo su Top.gg è andato offline e quando per 1 minuto torna online non funzionano i comandi e torna offline, è possibile che sia in fase di approvazione e devo aspettare qualche giorno? @earnest phoenix

tardy hornet
#

no, i use js

earnest phoenix
#

@earnest phoenix What do you need help with?

proper maple
#

Merhaba

bitter karma
#

And i use Visual Studio Code, Javascript @earnest phoenix

earnest phoenix
#

@earnest phoenix adding bot

#

@earnest phoenix go dms

tardy hornet
#

@tardy hornet py version?
@ionic dawn i use js

ionic dawn
#

But you have python installed?

earnest phoenix
#

I use crosh

#

@earnest phoenix check dms

tardy hornet
#

But you have python installed?
@ionic dawn no

ionic dawn
tardy hornet
#

i dont use python

earnest phoenix
#

@bitter karma I saw you said you hosted the bot on heroku? Is that correct?

bitter karma
#

Yes

ionic dawn
tardy hornet
#

so i need to

#

install something

bitter karma
#

@bitter karma I saw you said you hosted the bot on heroku? Is that correct?
@earnest phoenix yes i Hoosted it with heroku

#

Hoosted

ionic dawn
tardy hornet
#

so i need to

#

npm install sqlite3

earnest phoenix
#

I’d suggest taking it off heroku for now until you know that your bot is stable and would be on 24/7. Try turning it on using VS code and see if the commands work.

bitter karma
#

VS code?

#

how do i do it without eroku? @earnest phoenix

earnest phoenix
#

VS code as an, Visual studio code.

bitter karma
#

OHHH

ionic dawn
#

@tardy hornet You need to install python in your computer/VPS and then run npm install sqlite3 again.

bitter karma
#

ok

#

Vs code Is Visual Studio Code?

earnest phoenix
#

Also, do you have the required files for your bot to work on heroku?

bitter karma
#

I use it

earnest phoenix
#

Vs code Is Visual Studio Code?
@bitter karma Yeah.

bitter karma
#

Also, do you have the required files for your bot to work on heroku?
@earnest phoenix yes

earnest phoenix
#

Has your bot worked with heroku before, as an it has turned on and operable.

bitter karma
#

with Heroku the bot has always worked for me, since last night I put the bot on Top.gg the bot no longer works for me

earnest phoenix
#

Hmm.

#

Well putting the bot on top.gg won’t make your bot not work. It’s either a big issue or software issue, such as the site for updated or something else.

tardy hornet
#

@tardy hornet You need to install python in your computer/VPS and then run npm install sqlite3 again.
@ionic dawn now what?

bitter karma
#

Well putting the bot on top.gg won’t make your bot not work. It’s either a big issue or software issue, such as the site for updated or something else.
@earnest phoenix oh, ok

#

Heroku server Is bugged?

surreal sage
#

You know how these node packages like kinda, show the possibility's with a function

ex: you type:

function(someth

then 'something' should show up, i want that too. how do i do that?

earnest phoenix
#

Try and check the files and make sure it’s up to date.

bitter karma
#

Ok

ionic dawn
#

Now what?

bitter karma
#

Heroku file or Visual Studio Code file?

ionic dawn
#

If you have python installed you shouldnt get any errors again

earnest phoenix
#

Try both. I can’t narrow down the issue though.

surreal sage
bitter karma
#

Try both. I can’t narrow down the issue though.
@earnest phoenix ok, thx

surreal sage
#

what

bitter karma
#

Nothing

tardy hornet
#

If you have python installed you shouldnt get any errors again
@ionic dawn still the same error

bitter karma
slender thistle
#

Did you add Python to PATH

bitter karma
#

did i make some mistake in the script maybe?

earnest phoenix
#

Maybe, check your error logs.

bitter karma
#

Ok

#

Thx

tardy hornet
#

Did you add Python to PATH
@slender thistle how?

slender thistle
#

A checkbox when installing Python

tardy hornet
#

ok im giving up on that thing, how do i make that it will save the user bal so it will be:

it one server he will have 500

and on the other he could have 6000

dawn ether
#

Hello, I'm crurrently using discord.py for my bot but I can't run it from my mac.

#

it gives this error

earnest phoenix
prime cliff
#

holy fuck AHHHHHHHHHHH
Just rewrote an entire Discord lib (discord.net) to use a newer json lib from newtonsoft to C#'s built-in new one in .net 5.0
I can actually kind of get the bot started with no code issues but i need to rewrite the custom json parsers which convert stuff like strings into ulongs 9_Yay nac_yayA nac_yayA

earnest phoenix
#

@dawn ether maybe try running open /Applications/Python\ 3.9/Install\ Certificates.command

dawn ether
#

wow

#

@earnest phoenix THANK YOU so much!

#

u saved my life

rocky hearth
#

@earnest phoenix u dont have config.json in the same folder as of this file.

earnest phoenix
#

Hello please help me.

    if(command === 'send'){
        const allarg = args.join(' ');
        client.channels.cache.find(c => c.name === 'general').send(`**${message.author.username}:** ${allarg}`);
    }```
I wanna send this: (`**${message.author.username}:** ${allarg}`) to all client guilds.
#

How can i do it?
do I need to create a loop?

rocky hearth
#

@earnest phoenix the find method returns one item, which have c.name == 'general`

earnest phoenix
#

How can i fix it?

rocky hearth
#
client.channels.cache.each(c => {
  if(c.type === 'text' && c.name === 'general') c.send(`**${message.author.username}:** ${allarg}`);
})
earnest phoenix
#

I try, thanks

#

The Bot doesn't send anything.

#

@rocky hearth i don't understand

rocky hearth
#

I updated it a bit, try again @earnest phoenix

earnest phoenix
#

I tried

#

oh

#

okay

#

@rocky hearth omg tysm _WumpusDance

#

working

rocky hearth
#

😎

#

The key here is that, u need to first check if the channel is a text channel. Because it has other channel in it too

clever vector
#

Hey guys my bot static api don't work with .setImage

delicate shore
#

hola

bitter karma
#

Hi

shell crystal
#

.

earnest phoenix
#

Hi

#

I need hellup

#

Im making a giveaway edit system; but I want you can change the time in hours, minutes, seconds, days.

But, Im working with 1 argument. So the person could do !gedit <messageid> 1h, and it sets it to one hour, but it could also be possible that they do !gedit <messageid> 1d

rare plume
#

Someone know if there is a way on discord js to add multiple roles once? And when not how hight needs the cooldown in between adding roles to be?

earnest phoenix
#

@earnest phoenix u dont have config.json in the same folder as of this file.
@rocky hearth error solved... I added single . instead of double

fickle sapphire
#

Someone know if there is a way on discord js to add multiple roles once? And when not how hight needs the cooldown in between adding roles to be?
@rare plume like give 2 roles to a person with 1 line?

rare plume
#

Yeah someting like that

fickle sapphire
#

You can give them separetely

rare plume
#

I know but i am not quite sure if its api abuse

rocky hearth
#

wdym shinchan?

rare plume
#

I think i need to add a cooldown in between then

rocky hearth
#

@rare plume u can do that easily

member.roles.cache.add([role1, role2]);
junior kite
#

Any djs bot Dev's who wanna help a fellow coder make a bot from scratch with 0 knowledgecz_sadcatto

rare plume
#

@rocky hearth Really, can u just add via array?

rocky hearth
#

yeah , y not, or it can be a collection also or a string

rare plume
#

Okey, i try that thanks

rocky hearth
#

@junior kite yeah y not

junior kite
#

Noice

#

Can I dm u?

#

@rocky hearth

rocky hearth
#

sure

orchid cobalt
#

I am trying to make a blacklist guild command , where I store guild id and reason by using postgreSQL ,
Code:

    @blacklist.command()
    async def guild(self,ctx, guild_id:int,*, reason:str=None):

        results = await self.bot.db.fetchval("SELECT guild_id from blacklisted_guilds where guild_id = $1", guild_id)
        if results != None:
            return await ctx.send(f"{emote.xmark} | The guild is already blacklisted.")

        await self.bot.db.execute("INSERT INTO blacklisted_guilds (guild_id, reason) VALUES ($1, $2)", guild_id, reason)

        guild = self.bot.get_guild(guild_id)

        if guild is None:
            return await ctx.send(f"{emote.check} | Successfully blacklisted the guild.")

        await ctx.send(f"{emote.check} | Successfully blacklisted the guild.")

        try:
            embed = discord.Embed(description=f"Hello {guild.owner.mention},\nYour Server **{guild.name}** has been blacklisted by **deadshot#7999** for **{str(reason)}**\nI will take a leave from your guild now.\nIf you would like to appeal, feel free to join the [Support Server]({config.support_server})", colour = self.bot.colour)
            embed.timestamp(datetime.utcnow())
            await guild.owner.send(embed=embed)
            await ctx.send(f"{emote.check} | Successfully sent ban news to guild owner!")

        except:
            await ctx.send(f"{emote.xmark} | I couldn't send ban news to guild owner.")

        await guild.leave()
        try:
            await ctx.send(f"{emote.check} | Successfully left {guild.name}.")
        except:
            await ctx.author.send(f"{emote.check} | Successfully left {guild.name}.")

I store guild_id as bigint and reason as text. this command worked fine for 2-3 times than I start getting the following error:

#
Ignoring exception in command blacklist guild:
Traceback (most recent call last):
  File "C:\python38\lib\site-packages\discord\ext\commands\core.py", line 467, in _actual_conversion
    return converter(argument)
ValueError: invalid literal for int() with base 10: 'testing'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\python38\lib\site-packages\discord\ext\commands\bot.py", line 903, in invoke
    await ctx.command.invoke(ctx)
  File "C:\python38\lib\site-packages\discord\ext\commands\core.py", line 1329, in invoke
    await ctx.invoked_subcommand.invoke(ctx)
  File "C:\python38\lib\site-packages\discord\ext\commands\core.py", line 851, in invoke
    await self.prepare(ctx)
  File "C:\python38\lib\site-packages\discord\ext\commands\core.py", line 786, in prepare
    await self._parse_arguments(ctx)
  File "C:\python38\lib\site-packages\discord\ext\commands\core.py", line 697, in _parse_arguments
    transformed = await self.transform(ctx, param)
  File "C:\python38\lib\site-packages\discord\ext\commands\core.py", line 552, in transform
    return await self.do_conversion(ctx, converter, argument, param)
  File "C:\python38\lib\site-packages\discord\ext\commands\core.py", line 505, in do_conversion
    return await self._actual_conversion(ctx, converter, argument, param)
  File "C:\python38\lib\site-packages\discord\ext\commands\core.py", line 476, in _actual_conversion
    raise BadArgument('Converting to "{}" failed for parameter "{}".'.format(name, param.name)) from exc
discord.ext.commands.errors.BadArgument: Converting to "int" failed for parameter "guild_id".
#

i don't see anything wrong with code

#

ping me if you answer

tired panther
#
 client.shard.broadcastEval(`this.channels.cache.has("738409360488661142") ? this.channels.cache.get("738409360488661142").send({
                                    ^^^^

SyntaxError: Unexpected token 'this'
    at wrapSafe (internal/modules/cjs/loader.js:1054:16)
    at Module._compile (internal/modules/cjs/loader.js:1102:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47
``` why is this happening?
boreal iron
#

Doesn’t look like the right syntax to use templates.

tardy hornet
#
case 'work':
  let user3 = message.author;
  let timeout2 = 600000;
  let work = await db.fetch(`work_${message.guild.id}_${user3.id}`);


if(work !== null && timeout2 - (Date.now() - work) > 0){
  let time2 = ms(timeout2 - (Date.now() - work));
  return message.channel.send(`you cant work again for ${time2.minutes}m and ${time2.seconds}s`)
} else {
  let amount2 = Math.floor(Math.random() * 80) + 1; 
  db.add(`money_${message.guild.id}_${user3.id}`, amount2)
  db.set(`daily_${message.guild.id}_${user3.id}`, Date.now());
  const workembed = new Discord.MessageEmbed()
  .setTitle(`${message.author.username} worked hard and earned ${amount2} coins`)
  .setColor("GREEN")
  message.channel.send(workembed)

}
    break;

its letting me use that command every time
and i put a timer
it should not do that

boreal iron
#

timeout - (Date.now() ...
That doesn’t make sense at all.

#

If u save the timestamp in the database and fetch it, then check if ((Date.now() - work) > timeout2)

summer acorn
#

@weak parrot ads

tardy hornet
#

timeout - (Date.now() ...
That doesn’t make sense at all.
@boreal iron i did that with a daily command, and its working fine there

boreal iron
#

Yeah but the math is nonsense
(now - last_runtime) > timeout

#

Is one step less to calculate

#

Just a question... what’s the data val type for the field ur saving the date into?

earnest phoenix
analog kettle
#

can someone help me with a ban command in javascript?

summer acorn
#

I am trying to learn C#, so I am creating a game with it. Although, while trying to create a inventory system, I am getting a bit stuck.
This is how I am setting up the inventory;

        public struct Inventory
        {
            public Items.Potion[] Potions;
            public Items.Weapon[] Weapons;
            public Items.Armor[] Armors;
        }

and this is so far of an equip method

        static void equip(int id, string type)
        {
            if (type == "weapon")
            {
                Items.Weapons /* also tried Inventory.Weapons*/ weapon = Array.Find(Inventory.Weapons, w => w.id == id);
            }
        }

and then I hit an error, CSOI 20: An object reference is required for the non-static field, method, or property 'Player.lnventory.Weapons' I see this when hovering over Inventory.Weapons
I am new to C# so I don't know most of the things in it

queen crescent
#

some data in my mongodb collection keeps getting deleted randomly, not all the data but some. in my code, nothing tells it to delete the data otherwise it would happen to all of them so the db must be deleting them, is there any reason for this to happen

feral furnace
#

Hello, i'm using discord.js library in my bot. Is there a way to set prefix in guild by guild? I want to do a command like ;setprefix that command set bot's prefix in this guild only. Thanks.

slender thistle
#

@orchid cobalt how are you using the command?

#

what are you passing as arguments?

orchid cobalt
#

?blacklist guild 1234566 reason

#

123456 is let's say guild I'd

#

And reason is the reason

slender thistle
#

ValueError: invalid literal for int() with base 10: 'testing'

#

somehow testing was passed

orchid cobalt
#

I got the error the

#

Though*

#

It is the dumbest you can possibly imagine

queen crescent
orchid cobalt
#

Read the cog and you will know

#

If you don't get the what is wrong even after reading the cog , then welcome to the club buddy 😂

slender thistle
#

some data in my mongodb collection keeps getting deleted randomly, not all the data but some. in my code, nothing tells it to delete the data otherwise it would happen to all of them so the db must be deleting them, is there any reason for this to happen
@queen crescent You sure no other process is using those collections?

#

lmfao

queen crescent
#

positive

orchid cobalt
#

I was basically shadowing the guild sub command

earnest phoenix
#

Show me your bots kidos

slender thistle
#

Try to remove the int typehint for guild_id

earnest phoenix
#

how can i create a category, then create a channel, then move the channel into the category

gilded ice
#

is there a way to revoke readWrite access from all people who enter the db (mongodb)

#

unless they have a role

orchid cobalt
#

You still didn't get it , I was using the same guild subcommand for both blacklist group and whitelist group , that was the error and now it's resolved

#

Thanks for asking btw

slender thistle
#

...

#

Can I murder you without your consent?

orchid cobalt
#

😂

#

I am the dumbest person alive

#

Lmfao

slender thistle
#

Eh it happens

ivory seal
#

is therer any way to build an anti raid feature by monitoring join and leaves
if yes, can you link me any guides or documentation?

rocky hearth
#

What is anti raid though?

pale vessel
#

anti...raid...

stable eagle
#

Self explanatory thot

#

Tho

pale vessel
#

ye

#

is it not

rocky hearth
#

but i'm not smart 😕

pale vessel
#

do you know what a raid is?

rocky hearth
#

to attack in large quantity

stable eagle
#

Defenition of raid:

A cult of people who join online groups for bad reasons

pale vessel
#

and do you know what anti is?

ivory seal
#

lmao

#

its a way to prevent raids

rocky hearth
#

Then anti raid means to stop peoples from joining a server at the same time.
Hmmmm if so, then how could a bot prevent them from joining.
By kicking them of again?? or wat

pale vessel
#

probably not "from joining server at the same time"

#

more like preventing multiple users spamming

#

but they either kick or ban them, i guess

ivory seal
#

well cause ik a bot which was able to see if there was many joins in a specified time and ban those mmebers

stable eagle
#

Well, some bots check the date the account was created, with that they can determine alts

ivory seal
#

ah ok

earnest phoenix
#

how can i create a category, then create a channel, then move the channel into the category?

quartz kindle
#

you can skip step 3 by creating a channel inside the category

earnest phoenix
#

how?

rocky hearth
#

there is a method guild.channels.cache.create()

earnest phoenix
#

well this is my code:

message.guild.channels.create('category', {
type: 'category'
})

where do i put it

rocky hearth
earnest phoenix
#

ok

#

thank you

#
:\Users\NoUcantSeeMyNameIdiot\Downloads\bot>npm i mysql2
npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for git@0.1.3: wanted {"os":"linux,darwin,freebsd"} (current: {"os":"win32","arch":"x64"})
npm ERR! notsup Valid OS:    linux,darwin,freebsd
npm ERR! notsup Valid Arch:  undefined
npm ERR! notsup Actual OS:   win32
npm ERR! notsup Actual Arch: x64

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\NoName\AppData\Local\npm-cache\_logs\2020-11-08T13_01_18_776Z-debug.log
``` Im having this error, but in the npm package it litterly says u can download it with windows
ivory seal
#
const client = new Discord.Client();

client.on('message',(message)=>{
    console.log("this works")

});
client.login("a")``` for some reason this message event doesn't work like there is no console
#

pls help

earnest phoenix
#

ur token is wrong

#

or u changed it

#

idk

ivory seal
#

i changed it for this lmao

earnest phoenix
#

K

ivory seal
#

i won't leak my token

earnest phoenix
#

the message event doesnt works??

ivory seal
#

ye

earnest phoenix
#

Is ur bot able to see the channel?

ivory seal
#

it just doesn't trigger

#

yep

earnest phoenix
#

O

ivory seal
#

it has admin so...

earnest phoenix
#

Lol k

#

do you got any errors?

#

add this:

ivory seal
#

nope

earnest phoenix
#

console.log(`${client.user.tag} is logged in!`)
})```
ivory seal
#

ye i already have a ready event

#

that logs

earnest phoenix
#

it logs that its online?

ivory seal
#

yep

earnest phoenix
#

can you send your whole code?

#

In a bin please

maiden locust
#

how to make @earnest phoenix to type what i want

earnest phoenix
#

@maiden locust wrong server

#

we're not support of that bot

ivory seal
#

nvm i found my mistake

#

im just dumb lmfao

earnest phoenix
#

What was the mistake

#

:d

ivory seal
#

I thought i added it to the server but apparently didn't lmao

#

i didn't even notice

#

i added it to the wrong server

earnest phoenix
#

Lmao

maiden locust
#

we're not support of that bot
@earnest phoenix on that bot site this link was there

earnest phoenix
#

yep

#

but thats the support server for this site

#

and not for the bot

#

...

#

-wrongserver

#

uhh

maiden locust
#

oh ok

earnest phoenix
#

@maiden locust

rocky hearth
#

This Luca's dp, seems like a globe and also man wearing a hat to which he is touching

earnest phoenix
#

lmao

dreamy thistle
#
        const channel = member.guild.channels.cache.find(channel => channel.name === `welcome`);
        if (!channel) return;
        const { guild } = member
        const { name, memberCount, owner } = guild
        const joinembed = new Discord.MessageEmbed()
            .setColor('GREEN')
            .setTitle(`Welcome to "${name}"`)
            .setThumbnail(member.user.displayAvatarURL())
            .addFields(
                {
                    name: 'New user!',
                    value: member,
                },
                {
                    name: 'Member count:',
                    value: memberCount,
                }
            )
            .setFooter('Time Joined', member.guild.iconURL())
            .setTimestamp()

        channel.send(joinembed);
    });```

no more working
#

i think api changes or whatever

pale vessel
#

do you have the guild members intent?

#

you need it in order to receive that event

dreamy thistle
#

oh, do I?

pale vessel
#

yes

dreamy thistle
#

thats new

pale vessel
#

enable it in developer portal and in your bot's code

dreamy thistle
#

this?

#

and how do I add it in the code?

pale vessel
#

yes, and what library are you using?

dreamy thistle
#

I'm using node js

pale vessel
#

what library?

#

discord.js?

dreamy thistle
#

ye

#

I just saw people using

const client = new Client({ ws: { intents: Intents.ALL } });```
#

maybe this is it

pale vessel
#

you need to enable the guild presences intent too for that

rocky hearth
#

Can I have my 4 fields inline but in 2 rows?

pale vessel
#

you need to add an inline blank field after every second column

rocky hearth
#

afaik, there are 4 inline fields per row

pale vessel
#

only up to three

rocky hearth
#

if I add a thumbnail then? 2?

pale vessel
#

nope

#

it used to be like that

#

discord fucked it up so its still three even when theres a thumbnail

#

it's annoying

#

why did they do that

rocky hearth
#

I remember I read it in guide, that if there is no thumbnail there can be 4 inline fields

#

but now its not working

pale vessel
#

only three

rocky hearth
vague imp
#

quick question:
fetchAllMember client option goes timeout

#

so i am not able to cache members

#

hence i can't retrieve from cache

#

user user id

#

what should i do

#

if i use fetch to fetch user if the user id is wrong it will take huge amount of time

#

if the server is big

quartz kindle
#

@rocky hearth a hash is a unique identifier, like 3ht973hg9374hg9374g9734h

#

idk the exact structure

#

@vague imp you need to enable the server members intent in the dev portal

vague imp
#

its enabled @quartz kindle

quartz kindle
#

the fetchAllMembers should work

vague imp
#

it get's timeout

earnest phoenix
#

Oof please help xD
how to use custom emojis with the bot? i forget

rocky hearth
#

yes

earnest phoenix
#

Okay

#

uhm

#

Not working

rocky hearth
#

And they work fine without any issue

ivory seal
#

how do you find a specific webhook in discord.js?

#

channel.createWebhook(`${message.author.username}`, { avatar: `${message.author.avatarURL()}`, }) .then(webhook => { webhook.send(message2send); webhook.delete() })
and also if i do this it returns UnhandledPromiseRejectionWarning: DiscordAPIError: Unknown Webhook

#

please help

sudden geyser
#

@ivory seal what you may have is a race condition.

leaden rover
#

How do I make an execute command (an eval command, but it sends a result instead)?

sudden geyser
#

You should await webhook.send(...)

ivory seal
#

ah ok

#

gimme a sec

sudden geyser
#

As there's no guarantee the message will be sent first as .send() and .delete() are promises.

#

So if delete -> send happens, that error will come up

ivory seal
#

well .send works

#

if i don't include webhook.delete

#

it works perfectly

#

but when i include it....

sudden geyser
#

Resolve your promises.

ivory seal
#

got it

sudden geyser
#

Either with async/await or .then and .catch

pale vessel
#

dont break your promises

umbral zealot
#

You've already done it with createWebhook so now do it with send 😉

sudden geyser
#

evie you grabbed the mouth of my words

ivory seal
#

ah ok

sudden geyser
#

now I'm sadge

umbral zealot
#

dont break your promises
Also: 🎶 don't go breaking my heart! 🎵

sudden geyser
#

For the record, you can fetch webhooks with <TextChannel>.fetchWebhooks(...) so you aren't creating a webhook for a one-time operation.

ivory seal
#

is there any way this would work..
let webhook =channel.createWebhook(`${message.author.username}`, { avatar: `${message.author.avatarURL()}`, })

umbral zealot
#

not without async/await

ivory seal
#

oh wait so
let webhook = await channel.createWebhook....?

#

@umbral zealot aren't you the developer of enmap?

umbral zealot
#

I am!

ivory seal
#

oooo awesome

#

i use enmap a ton

umbral zealot
snow urchin
umbral zealot
ivory seal
#

^

snow urchin
#

when I stick it into a string in a footer, iit shows NaN, either way, why Invalid date?

earnest phoenix
#

debug it

#

you stacked so many methods in a one liner

#

split them up and find the method that's causing you trouble

umbral zealot
#

Make sure to print all the values and their types, too, to make sure they're what you're intending. For example, timestamps are integers, usually.

vague imp
#

in client option fetchAllMember is not working. It gives timeout
yes guildMember intent is enabled
https://media.discordapp.net/attachments/402150235071184918/774996146724536340/unknown.png
error:

Error [GUILD_MEMBERS_TIMEOUT]: Members didn't arrive in time.
    at /root/Node Apps/Menhera Chan/node_modules/discord.js/src/managers/GuildMemberManager.js:317:16
    at Timeout._onTimeout (/root/Node Apps/Menhera Chan/node_modules/discord.js/src/client/BaseClient.js:83:7)
    at listOnTimeout (internal/timers.js:554:17)
    at processTimers (internal/timers.js:497:7)```
umbral zealot
#

@vague imp what version of discord.js are you on right now?

vague imp
#

12

#

v12.4.1

#

the latest one

#
const Discord = require('discord.js');
const intents = new Discord.Intents();
intents.add(
  'GUILDS',
  'GUILD_MEMBERS',
  'GUILD_EMOJIS',
  'GUILD_MESSAGES',
  'GUILD_MESSAGE_REACTIONS'
);
const client = new Discord.Client({
    fetchAllMembers:true,
    ws: { intents: intents }    
});```
umbral zealot
#

Hmm. Well, that certainly all looks alright.

#

¯_(ツ)_/¯

earnest phoenix
#

@vague imp the intents.add is formatted incorrectly i think so

#

shouldn't you pass an array?

vague imp
#

thats an array

umbral zealot
#

no... that's a list of arguments though

vague imp
#

i tried the array way too

#

still the same

earnest phoenix
#

smh

vague imp
#
const Discord = require('discord.js');

const client = new Discord.Client({
    fetchAllMembers:true,
    ws: { intents: ['GUILDS',  'GUILD_MEMBERS',  'GUILD_EMOJIS',  'GUILD_MESSAGES','GUILD_MESSAGE_REACTIONS'] }    
});```
#

like this right

#

still the same

#

timeout

pale vessel
#

try intents: new Discord.Intents(['GUILDS', 'GUILD_MEMBERS', 'GUILD_EMOJIS', 'GUILD_MESSAGES','GUILD_MESSAGE_REACTIONS'])

umbral zealot
#

And then go scream at the d.js people to make the docs better on the subject 😄

ivory seal
#

lmao

vague imp
#

i tried that too @pale vessel

#

didn't work

pale vessel
#

all right

#

change it to just 1547

vague imp
#

i have asked many programmers even youtubers who do djs coding no body could helped me

#

change what?

pale vessel
#

if that doesnt work then discord is on drugs

#

the intents

#

that's the bitfield for your intents

vague imp
#

ws: { intents: new Discord.Intents(1547)}

#

?

pale vessel
#

no

#

well, sure

#

but just the number

#

both work iirc

umbral zealot
#

You've asked many programmers but have you asked the discord.js developers that wrote the code you're using? You really should.

pale vessel
#

but why more code

ivory seal
#

i have 2 questions
1)Is there any rate limits for webhooks
2)is it possible to create 2 webhooks with the guildCreate event for each guild and use the same webhooks in the message event?

pale vessel
#

intents: 1547

earnest phoenix
#

🙃

vague imp
#

You've asked many programmers but have you asked the discord.js developers that wrote the code you're using? You really should.
@umbral zealot
staff don't reply and the other programmer couldn't help

earnest phoenix
#

@ivory seal there are rate limits on message sending

ebon kelp
#

That's not what he asked

ivory seal
#

ah ok

#

what abt the second question?

earnest phoenix
#

@earnest phoenix I work with emojies like this
@rocky hearth thanks. Good

hazy sparrow
#

err is not defined what?

#

oh wait

sonic lodge
#

you need to pass a function into .catch()

umbral zealot
#

.catch() takes a function

ivory seal
#

^

hazy sparrow
#

im dumb lol

umbral zealot
#

no, just inexperienced

ivory seal
#

lol today i did a even dumber thing lmao

hazy sparrow
#

both actually

snow urchin
ivory seal
#

i forgot that i never added my bot in a server and i was like why wasn't this working

#

then when i saw it i was like .....

umbral zealot
#

@snow urchin you're trying to do moment.utc() on an object that's already a moment object

#

why

ionic dawn
#

@vague imp by fetching all members you mean to count them or get every single member

vague imp
#

@vague imp by fetching all members you mean to count them or get every single member
@ionic dawn NO it;s a client option to cache all member

snow urchin
ivory seal
#

is there a limit for webhooks in a channel

fair river
#

what is the command to set a badge into an user profile? (already made just forgot command.) eval db.set but from here i am stuck

ivory seal
#

u forgot the command of ur own bot?

fair river
#

eval db.set(` `)

#

i dont usually use eval

#

and databases

umbral zealot
#

We can't tell you how your own code works my friend.

fair river
#

i need a model

#

to give badge

#

on userinfo

drifting wedge
#

ping me for python help!

fair river
#

discord.js

umbral zealot
#

You can't read all the badges of a discord user profile without oauth2 so discord.js cannot provide that

drifting wedge
#

you can run ifs

ivory seal
#

is there any limit for the number of webhooks in a particular channel?

drifting wedge
#

if user has flag

fair river
#

i am not sure if eval db.set(flags_id, name)

#

to set manually

drifting wedge
#

is there any limit for the number of webhooks in a particular channel?
@ivory seal why would u need dis?

#

i thik there r ofc

umbral zealot
#

What is db ? what's flags_id ? what are you even talking about at this point Narcis?

fair river
#

sqlite

#

flags_id = flags_2131230123945 for example

umbral zealot
#

mmkay so what does sqlite have to do with user flags/badges?

fair river
#

that number is an emoji

ivory seal
#

the thing is im creatign webhooks but if i delete the webhook all the messages gets deleted too

drifting wedge
#

you can run a check to see if member has badge flag

umbral zealot
#

So this is your own code and we can't tell you how your own code works

drifting wedge
#

in dpy at least

ivory seal
#

so i thought lets just not delete the webhooks

fair river
drifting wedge
#

so dont delete them lol

fair river
#

this

earnest phoenix
#

My youtube api not support live stream why anyone know

rocky hearth
#

Is there any chance that the ready event handled with on method, could emit more than once?

drifting wedge
#

WELL HOW DO U WANT TO DO IT

earnest phoenix
#

Why

drifting wedge
#

@rocky hearth you can run just on ready

fair river
#

@umbral zealot look at photo

drifting wedge
#

like not on on ready event

#

@rocky hearth