#development

1 messages Ā· Page 1885 of 1

vocal elk
#

how to start?

solemn latch
#

youll need a database, and some very basic commands

vocal elk
wheat mesa
#

Do you know how to make a discord bot with a programming language of your choice?

#

Or do you just not know how to implement such features with a language that you already know

high crown
#

node v16....discord.js v13 what now?

#

anyone pls help

#

where are you'll

#

šŸ‘€

pale vessel
#

Ah yes

#

You can't extend structures anymore

high crown
pale vessel
#

It's your code isn't it?

high crown
#

yea but....

#

I have updates

#

just now

#

to v13

#

ahhh...ok..thanks

solemn latch
#

ah, yeah youll need to change things if you want to update to v13

#

as v13 has breaking changes

high crown
#

i have to

wheat mesa
#

Also it’s worth noting that a version of djs commando made for v12 probably doesn’t work on v13 šŸ˜›

high crown
#

indeed

high crown
#

🄲

wheat mesa
#

But why...

solemn latch
#

v12 will stop functioning eventually

wheat mesa
#

^^

solemn latch
#

at some point you will have to move to v13

wheat mesa
#

Plus v13 is designed for complying with the new message intent features

high crown
wheat mesa
#

If you’re gonna use djs, you might as well use djs v13

high crown
#

yea

#

so should I leave commando?

#

and start fresh

solemn latch
#

I dont think commando is updated yet, so if you want to use v13 youll need to

high crown
#

ahhh

#

ok thanks for help

#

u guys are awesome

lament rock
#

Alternatively, update commando yourself

high crown
#

structures have been removed

#

so I'm doing that only

wooden kindle
#

what does this mean

#

i just dont get it

boreal iron
#

data is undefined

high crown
#

have u defined data?

#

and idk why discord.js is making its code complex

wooden kindle
#

it is defined

#

im trying to host on repl for the day or so why i fix my pi

#

but console is just waffling

high crown
wooden kindle
#

idk im not the one tracking any data its my other dev lemme go ask him

high crown
urban slate
#

is there anything i can do if someone copies my bot?

boreal iron
#

Not publishing the code

urban slate
#

?

#

if someone copies my bot

#

like they have already copied

#

but kinda made a replica of my code without me providing it to them

boreal iron
#

How can he make a replication of your code if he hasn’t access to it?

pale vessel
#

feature and design wise?

boreal iron
#

Even if he would take the same name for his bot and profile picture there’s not much you can do against

urban slate
pale vessel
#

Make something unique that's hard to replicate then

#

otherwise it just shows that your bot isn't anything "special"

earnest phoenix
#

Does anyone have the same problem as me that when I save changes on the page Top.gg It do not save them?

#

I'm trying to save changes to the bot long description

pale vessel
boreal iron
#

Do you have multiple webservers running? Or how does the site render if you have Apache removed?

earnest phoenix
#

How fix it?

boreal iron
#

That’s what I thought. You don’t need Apache as second webserver then.

vocal elk
#

can anyone help me with glitch ide?

#

i mean

#

the console

boreal iron
#

Does the website maybe rely on different source it fetches?

vocal elk
#

i cant find the console in glitch ide

#

and replit is not opnening

boreal iron
#

Then use your browser inspection tool, head to the network debugger and take a look how long each script you fetch takes.

tulip ledge
#

I'm not allowed to take programming class in school anymore KEKW

quartz kindle
#

what did you do?

shadow frigate
#

what shard are user dm's in?

#

or does it depend on what shard of a server they're in?

#

trying to make an autoposting command to user DM's but seems to send them it multiple times depending on if it finds them on a shard

#

So for example, it finds a user on shard 1 and shard 3, so it sends it to them twice

quartz kindle
#

but only for receiving

#

for sending doesnt matter

shadow frigate
#

So I can send the user a DM through any shard?

quartz kindle
#

yes

shadow frigate
#

cheers

grim aspen
#

i have a question

#

will interactions be enforced with message intents too?

wheat mesa
#

What?

tulip ledge
earnest phoenix
#

what does this mean?

#

in bot votes

grim aspen
#

Looks like it’s trying to find who is supposed to receive the credits but can’t find them

earnest phoenix
#

hmm

#

how good receive credits?

#

and how does it work?

grim aspen
#

Ooohhh wait

#

I think it goes to your team member for the bot or whatever if you have one

earnest phoenix
#

hmm

grim aspen
#

Or like a split amount

earnest phoenix
#

is this real money?

grim aspen
#

To be honest I have no idea

earnest phoenix
#

uhh

grim aspen
#

I think

#

I think it is

quartz kindle
#

no

#

its not real money

earnest phoenix
#

where does it go? how to pick them up?

quartz kindle
#

its used to pay for ads in the auctions system

earnest phoenix
#

hmm

#

where can I see how many credits I have?

#

thx

#

hmm

#

yea you need the auction role

#

i request access

eternal osprey
#

hey!

#
if(message.member.roles.cache.some(role => role.name === "Yakuza Elite")){
    po = "Yakuza Elite"
  }
  if(message.member.roles.cache.some(role => role.name === "Yakuza Aniki")){
   po = "Yakuza Aniki"
  }if(message.member.roles.cache.some(role => role.name === "Yakuza Shatei")){
   po = "Yakuza Shatei"
  }if(message.member.roles.cache.some(role => role.name === "Yakuza OG")){
  po = "Yakuza OG"
  }
  if(!message.member.roles.cache.some(role => role.name === "Yakuza OG") && !message.member.roles.cache.some(role => role.name === "Yakuza Elite") && !message.member.roles.cache.some(role => role.name === "Yakuza Shatei") && !message.member.roles.cache.some(role => role.name === "Yakuza Aniki")){
  po = 'Normal Member'
}
  database[message.author.id].wallet = args[0][1]
  database[message.author.id].type = po
  fs.writeFile("./database.json", JSON.stringify(database), (err) => {
    if (err) console.log(err)
  });```this code needs to be restricted by return statements!
#

So it will only write the po to the user once

#

Owh wait!

boreal iron
#

3.2 min lol

timid fog
#

i need help

#

my python html

#

file

#

shows a white screen

boreal iron
#

python html

waitWhat

simple stump
#

Whenever I try to check if an user used a button, it says ā€œInteraction failed.ā€ When I log the collection, it says ā€œCollected 0 items.ā€

Code: https://sourceb.in/gmOmUUoPKA

boreal iron
#

Why do you use a collector?

#

An interaction event is being send if someone is pressing the button

simple stump
signal estuary
#

What does restTimeOffset: 0 do when defining the client?

solemn latch
#

Extra time in milliseconds to wait before continuing to make REST requests (higher values will reduce rate-limiting errors on bad connections)

boreal iron
#

after checking if it's a button of course as you already do

boreal iron
simple stump
#

Aight

#

Ty

dense hinge
#

is there a way in the newest discord.js to make my bot type and then stop typing when he sended the message?

simple stump
dense hinge
#

thanks!

simple stump
#

I’m confused on what deferring is sorry

grim aspen
solemn latch
#

KuuHaKu told you what defering is 2 days ago, i told you what defering is yesterday.

grim aspen
#

i think of it as a timer for responding back on another command sent right after

#

as said in the docs: As previously mentioned, you have three seconds to respond to an interaction before its token becomes invalid. But what if you have a command that performs a task which takes longer than three seconds before being able to reply?

simple stump
grim aspen
#

that's not a question, it was part of the sentence taken

simple stump
#

Alr

#

Ty. I’ll take a look at the docs

eternal osprey
#
for (const key in database){
    z = await message.guild.members.cache.get(key)

    if(message.member.roles.cache.some(role => role.name === "Yakuza Elite")){ // first  one
    all = (database[key].wallet);
    d += `User: ${z.user.tag} Wallet: ${all} Type: ${database[key].type}\n`
    }
  }
  for (const key in database){
    z1 = await message.guild.members.cache.get(key)
    if(message.member.roles.cache.some(role => role.name === "Yakuza Aniki")){ // second one
    all1 = (database[key].wallet);
    d1 += `User: ${z1.user.tag} Wallet: ${all1} Type: ${database[key].type}\n`
    }
  }``` hey how would i make sure that it will only get the highest role, as if a user now has these 2 roles it will fire the code twice!
eternal osprey
#

I basically just want the code to stop after the first role in order was found

#

OMG WAIT I KNOW SOMETHING!

#

i can check if a user has a role and then use an if else!

#

no that doesn't work

eternal osprey
#

so in this order it would be Yakuza Elite, Yakuze Aniki

solemn latch
#

first as in, in the manager of the member, check the highest? because im pretter sure member.highest is that.

solemn latch
#

sorry, member.roles.highest, not member.highest

eternal osprey
#

check the snippet, i have provided some info

solemn latch
#

.first() is the first by insertion afaik, but highest checks the position

eternal osprey
#

but i still don't want it that way ahahhaha

#

i want to stop once the first role is found

#

ordered by code

#

not discord hierarchy or postitions

woeful pike
#

cringe regex:

const emoji = text.match(/^:(.*?):$/)[1]

chad parsers

colon :: Parser Char
colon = char ':'

notColons :: Parser T.Text
notColons = takeWhileP (/= ':')

emoji :: Parser T.Text
emoji = colon *> notColons <* colon

ez

eternal osprey
#

because if i now have the elite and other role it performs the code twice

#

I want to stop the next cycle if the first role was found

#

do you understand?

#

let me show you another snippet:

 for (const key in database){
    z3 = await message.guild.members.cache.get(key)
    console.log(z3)
    if(message.member.roles.cache.some(role => role.name === "Yakuza OG")){
    all3 = (database[key].wallet);
    d3 += `User: ${z3.user.tag} Wallet: ${all3} Type: ${database[key].type}\n`
    }
  }
  for (const key in database){
    z4 = await message.guild.members.cache.get(key)
    if(!message.member.roles.cache.some(role => role.name === "Yakuza OG") && !message.member.roles.cache.some(role => role.name === "Yakuza Elite") && !message.member.roles.cache.some(role => role.name === "Yakuza Shatei") && !message.member.roles.cache.some(role => role.name === "Yakuza Aniki")){
    all4 = (database[key].wallet);
    d4 += `User: ${z4.user.tag} Wallet: ${all4} Type: ${database[key].type}\n`
    }
  }
  let g = d + "\n"+ d1 + "\n" + d2 + "\n" + d3 + "\n" + d4 + "\n"
  fs.writeFile("./wallets.txt", (g), (err) => {
    if (err) console.log(err)
  });```
#

This should clarify it more.

solemn latch
#

so you dont care about order of submission, or where they appear in cache, just the first one you happen to find?

message.member.roles.cache.find(role => role.name === 'Bob' || role.name === 'jerry');

will return the first one it finds.

#

or are you just looking to break?

#

break; will stop executing the loop when you use it.

urban slate
#

Lads anything I should make sure about before applying for discord bot verification?

#

Cause i have never done this so idk shit

solemn latch
#

make sure you follow the discord tos KEKW

#

and respect the api

urban slate
#

Thats it?

solemn latch
#

pretty much

urban slate
#

Respect?

quartz kindle
#

be as disrespectful as you can in the form

#

:^)

urban slate
#

Lol

solemn latch
urban slate
#

Oh yea ratelimit

#

I had a question about it

quartz kindle
#

the rat limit

#

the limit of how many rats you can have

solemn latch
#

im very ratty, so i cant submit for verification šŸ˜”

urban slate
#

So its like 50 msgs per second right?

quartz kindle
#

the global limit is 50 requests of any kind per second

urban slate
quartz kindle
#

then each route has its own limit

solemn latch
#

kek

quartz kindle
#

for example sending messages is 5 messages per 5 seconds per channel

urban slate
#

Like mee6 and all

modest maple
#

they dont

quartz kindle
#

but you dont need to worry too much, the library you're using should handle it for you

modest maple
#

they get it increased

urban slate
#

Oh

#

Oh nice

modest maple
#

upto about 500/s

solemn latch
#

500/s topggPog

#

imagine handling 500/s

urban slate
#

Well thnx lads imma bore myself by reading the tos now lol

quartz kindle
#

i've never read them

#

too long

solemn latch
#

you know them though

#

tos is all common sense stuff imo

quartz kindle
#

exactly

#

its basically just "dont be an asshole towards our system"

solemn latch
#

"hey dont do things with user info they dont expect!"

urban slate
#

Oh fuck it then

#

Oh

#

So dont be zuckerberg

solemn latch
#

tbh, zuckerberg(facebook) probably would be allowed via discord TOS, as facebook privacy policy states most of what they do.

quartz kindle
#

does it state they sell your data to the nsa/cia/steve bannon?

#

lmao

#

does it state zuckerberg is not human?

eternal osprey
#

how would i remove duplicates in txt files? Like this: ```js
User: helloboys#9094 Wallet: etstsafa Type: Yakuza Shatei
User: ChittyKat#6366 Wallet: 25252 Type: Normal Member

User: helloboys#9094 Wallet: etstsafa Type: Yakuza Shatei
User: ChittyKat#6366 Wallet: 25252 Type: Normal Member

quartz kindle
#

why are you using text files?

eternal osprey
#

i am using a database

#

this is just for the human eyes

quartz kindle
#

then the database should take care of avoiding duplicates

#

also why are you not using user IDs

eternal osprey
#

kinda hard as my code loops through it and checks for roles.

quartz kindle
#

what database are you using?

eternal osprey
#
for (const key in database){
    z3 = await message.guild.members.cache.get(key)
    console.log(z3)
    if(message.member.roles.cache.some(role => role.name === "Yakuza OG")){
    all3 = (database[key].wallet);
    d3 += `User: ${z3.user.tag} Wallet: ${all3} Type: ${database[key].type}\n`
    }
  }
  for (const key in database){
    z4 = await message.guild.members.cache.get(key)
    if(message.member.roles.cache.some(role => role.name === "Yakuza Aniki")){
    all4 = (database[key].wallet);
    d4 += `User: ${z4.user.tag} Wallet: ${all4} Type: ${database[key].type}\n`
    }
  }
  let g = d + "\n"+ d1 + "\n" + d2 + "\n" + d3 + "\n" + d4 + "\n"
  fs.writeFile("./wallets.txt", (g), (err) => {
    if (err) console.log(err)
  });```
#

if someone has both roles, it will add the user to d4 and d3

quartz kindle
#

because you have 2 loops

eternal osprey
#

and it joins them

quartz kindle
#

.cache.get does not need awaiting

eternal osprey
#

so that's why i am asking how i can just remove the duplicates in the text file

quartz kindle
#

you dont remove them

#

just dont write them in the first place

#

there is no reason to have 2 loops eitherway

earnest phoenix
#

txt.db thonkku

eternal osprey
#

I am just trying to make it easier for me, so i can just open the txt and see all the info's.

#

Instead of having a clusterfuck of arrays

quartz kindle
#
for(key in db) {
  if(member....some(...)) {
    ...
  } else if(member....some(...)) {
    ...
  }
}
earnest phoenix
#

You can't

quartz kindle
#

in your discord developer portal

#

literally login into your discord developer portal

#

and open your bot app

#

and set description

earnest phoenix
torpid otter
#

Is there a problem with top.gg api

solemn latch
torpid otter
#

Same thing just came up again

pale vessel
#

What same "thing"?

solemn latch
#

šŸ¤” is there no status code to seperare no auth provided and unknown auth provided?

#

Would that just be a 400?

#

No auth provided I mean

pale vessel
#

@rose warren good for u, it's possible to respond with attachments on initial message now

rose warren
pale vessel
#

Guess not

#

use rose :)

rose warren
#

I've never looked at rose

pale vessel
#

Detritus probs has it already cuz cake is always fast with updates

rose warren
#

I've already started my djs v13 rewrite anyway

pale vessel
#

Oof

solemn latch
#

šŸ¤” couldnt you just do the request yourself to do this, while keeping djs

pale vessel
#

guess you could optimize it now that there's those cache factory or something

rose warren
#

Yeah I could but I'd rather use the lib tbh

pale vessel
#

flashbacks to v12 client.api() for buttons

rose warren
pale vessel
#

now they use @discordjs/rest or somethign?

rose warren
#

Yeah

#

Even Tim was saying his lib will prob be obsolete when v14 comes out

#

djs caching is getting better

solemn latch
#

his djs lib?
is he even maintaining it anymore?

rose warren
#

Yeah he updated it when v13 came out

#

I tried it out before I started my rewrite. I may or may not use it. Idk yet.

late hill
#

anyone know if there's like a limit on how many users can join a thread?

#

or any other known issue/bug that might be preventing using certain threads? šŸ‘€

main trench
#

hey im working on a starboard feature and does anyone know why im getting this error?
error:

if(reaction.emoji.name  === '⭐') {
                      ^

TypeError: Cannot read property 'name' of undefined

even though its supposed to be used like this?

code:

const db = require('quick.db');

const { MessageEmbed } = require('discord.js');

module.exports = async (reaction, user, message) => {
    const handlerStarboard = async () => {
        let SBChannel = db.get(`starboardop_${reaction.guild.id}`);

        if (SBChannel === null) {
            return;
        }

        const msgs = await SBChannel.message.fetch({ limit: 100 });

        const SentMessage = msgs.find(msg => msg.embeds.length === 1 ? (msg.embeds[0].footer.text.startsWith(`${reaction.message.id}`) ? true : false) : false);
            
            if(SentMessage) {
                SentMessage.edit(`${reaction.count} - ⭐`)
            }else {

                const embed = new MessageEmbed()
                    .setAuthor(`${reaction.message.author.tag}`,  reaction.message.author.displayAvatarURL({ dynamic: true }))
                    .setDescription(`**[Jump!](${reaction.message.url})**`)
                    .addField("Message", `${reaction.message.content}`)
                    .setColor("YELLOW")
                    .setFooter(`${reaction.message.id}`)
                    .setTimestamp()

                    client.channels.cache.get(SBChannel).send({ content: "1 - :star:", embeds: [embed] });
            }
 
    }

    if(reaction.emoji.name  === ':star:') {
        if(reaction.message.channel.id === SBChannel) return;

        if(reaction.message.partial) {
            await reaction.fetch();
            await reaction.message.fetch();
            handlerStarboard();
        } else handlerStarboard();
        
    }
}
earnest phoenix
#
lol = discord.utils.get(guild.channels, name=f"{ctx.author.name.lower()}-ticket").id

Hey, im trying to get a channel by its name and turn it into an id. Im getting an error that is saying 'send' is not a valid request. So it makes me think that its not changing into an id. Anyone know whats wrong?

grim aspen
#

I don’t think there’s such thing as emoji.name

main trench
#

the docs use it

grim aspen
#

You would have to grab the emoji by it’s ID

main trench
#

i could try that ig

tacit heath
grim aspen
tacit heath
#

With?

lyric mountain
solemn latch
#

šŸ˜” our issue tracker has so many things happening in it all the time.

tacit heath
#

rip

main trench
#

is it 'EMOJI' or something?

lament rock
lyric mountain
#

reaction something

#

REACTION_EMOTE ig

lament rock
#

or at least members will not be synced after 50

main trench
#

guess that dont exist

RangeError [BITFIELD_INVALID]: Invalid bitfield flag or number: REACTION_EMOTE.

but i have 'GUILD_MESSAGE_REACTIONS' so idk

lyric mountain
#

that's the only thing I can think of

main trench
#

and you cant even get basic emojis with thier id so i cant even test that idea

#

why must v13 be this way

#

Am I like the only person having this issue? I literally went into the docs and my code should be working

quartz kindle
#

show the code where you call that function

#

you might be passing your parameters wrong

wheat mesa
#

looks like intellij ide

pale vessel
wheat mesa
#

I think rider melon or something like that theme-wise

#

yeah that

sullen crater
#

ooh neat ty :3

pale vessel
earnest phoenix
#
lol = discord.utils.get(guild.channels, name=f"{ctx.author.name.lower()}-ticket").id

Hey, im trying to get a channel by its name and turn it into an id. Im getting an error that is saying 'send' is not a valid request. So it makes me think that its not changing into an id. Anyone know whats wrong?

pale vessel
#

Do you have the full error?

stark abyss
#

postgress stores everything locally right?

#

if so why is that a good choice storing data on my own laptop

solemn latch
#

On a laptop? No local database is good(imo, due to no local backup ability)
But all databases can be remote. So if the concern is location the database probably doesn't matter.

lament rock
#

Whatever database offers you the features you need is what you should use

lyric mountain
#

You aren't supposed to use postgres on ur own machine for long-term data anyway

#

Actually, that's true for every single database out there

stark abyss
#

I think I should consider a career change

warm crypt
#

guys what are these called ? like the bars on top with text that you can x out of . and if you know how do i make it in html and css LOL

torpid latch
#

Ł†Ų§ŁŠŲ³ šŸ™‚

#

ŁƒŁŠŁŁƒŁ… بعرف Ł…Ų“ ŁŲ§Ł‡Ł…ŁŠŁ† šŸ™‚šŸ¤£

errant flax
#

i see that u r checking it but u r only checking it at the last thing on ur code

#

put that if statement at first line of the function

main trench
#

Wouldn't that just throw a "cannot execute thing since it's under the code" error?

warm crypt
lethal trout
wheat mesa
# lethal trout

What's the question here? I don't think anyone is gonna do your homework for you if that's what you're wanting šŸ˜›

lethal trout
#

How is a Byte code different from Native Executable Code in java?

quartz kindle
#

something(reaction, user, message)

lethal trout
#

Arrange the following operator in ascending order of precedence
i)+ ii) * iii)++ iv) ?: v) <= vi) && v) = vi) ! vii) % viii) >

this is java pls help

wheat mesa
#

precedence means which operator will be executed before the others

#

You can find a precedence chart easily online for Java, but if you're required to learn it for future assignments (I'm going to assume this isn't a test because you're already asking on discord), I recommend you study it

lethal trout
#

how to do this?

wheat mesa
#

You have a math expression casted to a float, but assigned to an int type

#

Cast it to an int instead

#

(Or make the int a float, but I think the question is asking you to change the type it’s casted to)

lament rock
#

does anyone know of any npm libs that can decode and encode opus besides prism-media

#

This is for node. Not a web env

old cliff
#

Just make the int a float or the float an int

#

Also that seems like an exam question hmm....

sinful night
#

hi

#

how can i enable slash command?

small tangle
#

You need the application scope in your bots application and need to register the commands via code

whole surge
#

yes

frail pollen
#

is there a way that i can detect specific words in embeds? my bad word filter ignores the embeds

this is my code:

async def badwords(message):
    if 'bad word' in message.content.lower:
        await message.delete()```
sinful night
#

hey how can i make slash commands on discord.py on cog

errant flax
#

use nextcord i heard its gud

errant flax
sinful night
errant flax
#

?

sinful night
errant flax
#

still repl.it isn't a hosting service

sinful night
errant flax
earnest phoenix
errant flax
#

use google cloud or something

sinful night
earnest phoenix
errant flax
earnest phoenix
#

does it say that its a hosting?

errant flax
sinful night
earnest phoenix
#

its a IDE, not a hosting

sinful night
errant flax
#

itll crash immediately

sinful night
sinful night
errant flax
earnest phoenix
errant flax
#

repl.it doesny even have v16+ except if u use npx or some script

#

doesn't*

#

talking about djs bte

#

btw*

#

typo go brr

outer perch
#

what's that method in JS which compares if at least a percentage of a string is like a another one

outer perch
#

nah

errant flax
#

dont understand on wym

outer perch
#

like "opress" = "apress"

#

similar words, but one has a typo

#

so probably "apress" is 90% similar to "opress"

errant flax
#

my best bet is like split all the string

#

then loop it then uhh ye

outer perch
#

but I know there's a method for this

errant flax
#

nah there isnt afaik

outer perch
#

probably a module

errant flax
#

i dont even see a reason on why nodejs/js will add it

errant flax
errant flax
#

aight thats fine to me DogKek

errant flax
#

"YES IT IS"

#

and also replying to "its an IDE and not a hosting"

sinful night
errant flax
#

u got fooled dance

outer perch
#

repl.it itself is not a hosting platform

#

but they have hosting services I think

errant flax
outer perch
#

check the link

#

and this

errant flax
#

ah now i understand

#

so they like host the code in there db/server

outer perch
#

still, not a hosting platform

#

xD

errant flax
#

main*

errant flax
misty sigil
#

Did you know it’s not designed for 24/7

#

and not exactly the best service

earnest phoenix
#

canot send an empty mesage

#

now whats wrong in my code

#
const command = require(`.././Structures/command`);
const {discord, Client, Message, MessageEmbed} = require('discord.js');

module.exports = new command({

    /**
     * @param { Client } client;
     * @param { Message } message;
     * @param {string[]} args; 
     */
    name: "avatar" || 'av' || 'pfp',
    description: 'This command sends the author avatar.',
    async run(message, args, client){
        let member = message.mentions.members.first();

        if(!member){
            let member = message.user;
        }

        try{
            const embed = new MessageEmbed()
            .setTitle(`Avatar for ${message.author.username}`)
            .setImage(`${message.author.avatarURL}`)
            .setTimestamp()
            .setColor('DARK_GOLD');
            message.channel.send(embed);
        } catch(e){
            console.log(e);
            message.channel.send(`There was an error executing the command.`)
        }
    }
})```
mint rain
#

@opaque fern

#

But still can’t?

earnest phoenix
#

help ,me

earnest phoenix
earnest phoenix
#

and let me do that real quick

#

and

#

Invalid Form Body

dense hinge
#

is there a way to get a combined member count of all servers my bot is in?

earnest phoenix
#

why is this error showing up

earnest phoenix
earnest phoenix
#
const command = require(`.././Structures/command`);
const {discord, Client, Message, MessageEmbed} = require('discord.js');

module.exports = new command({

    /**
     * @param { Client } client;
     * @param { Message } message;
     * @param {string[]} args; 
     */
    name: "avatar" || 'av' || 'pfp',
    description: 'This command sends the author avatar.',
    async run(message, args, client){
        let member = message.mentions.members.first();

        if(!member){
            let member = message.user;
        }

        try{
            const embed = new MessageEmbed()
            .setTitle(`Avatar for ${message.author.username}`)
            .setImage(`${message.author.displayAvatarURL}`)
            .setTimestamp()
            .setColor('DARK_GOLD');
            message.channel.send({embeds: [embed]})
        } catch(e){
            console.log(e);
            message.channel.send(`There was an error executing the command.`)
        }
    }
})```
old cliff
#

Oof

#

Change the one in catch to message.channel.send({content: "..."})

main trench
old cliff
#

Nvm old message

quartz kindle
#

where do you require this file?

main trench
#

In my event handler

quartz kindle
#

then show that

main trench
#

The handler works if that's what you're wondering

#

I have like 7 other events in that folder

quartz kindle
#

no im not wondering, just asking to see it

main trench
#

I'm on mobile so it'll take a sec

#
const evtFiles = await readdir('./events')
    console.log(`Loading a total of ${evtFiles.length} events`)
    klaw('./events').on("data", (item) => {
        const evtFile = path.parse(item.path);
        if (!evtFile.ext || evtFile.ext !== ".js") return;
        const event = require(`../events/${evtFile.name}${evtFile.ext}`);
        client.on(evtFile.name, event.bind(null, client));
        client.log('EVENT BIND', `Event ${evtFile.name.green} was linked to file ${(evtFile.name + evtFile.ext).green}`)
    });
}

utils/handler.js

quartz kindle
#

there's your problem

#
module.exports = async (reaction, user, message) => {
main trench
#

Somedays I wonder why I do bot dev lmfao

#

Thanks I'll try it when I get home

quartz kindle
#

šŸ‘

woeful pike
#

get good at communicating with a compiler, not being a God programmer who can catch all mistakes by themselves

main trench
#

I'd rather not switch to ts when I'm this far with js šŸ’€

woeful pike
#

you can switch incrementally

#

youll catch stuff just by turning the typescript compiler on without even moving to ts files

dense hinge
#

so my bot is still running on discord.jsV11, whats the best way to get all the members of all the server my bot is in? rn using bot.user.size but that one is inacurate

urban slate
#

yo guys when i give my bot for verification should i be worried if my bots code has stuff like this? console.log(`pinged in ${message.guild.name} in ${message.channel.name} by ${message.author.tag}`)

#

like its just to make sure that the cmd was passed

tardy hornet
#

hey i have a question, my bot is in discord.js -12,
what will happen if i wont make the bot discord.js -13?

will it make the bot unusable?

errant flax
#

and in general u should use the latest version of djs

tardy hornet
#

but idk where to start to make it v13

errant flax
#

theres a channel called "djs-updating-to-v12" channel in the djs server

earnest phoenix
#

how do i draw an image with a shape in canvas?
i wanna draw a circular image

spark flint
#

I'm getting AttributeError: 'coroutine' object has no attribute 'get'

#

userid = await request.form.get('userid')

#

I have post data called "userid" which is sent over in a form post request

#

how do i get data from a post request in flask python

tardy hornet
#

const ms = require("parse-ms");
^

Error [ERR_REQUIRE_ESM]: require() of ES Module

earnest phoenix
#

hello, does someone have code for massrole in js?

azure lark
#

how can i make my bot always be deafened

lyric mountain
lyric mountain
azure lark
#

idk, why not

lyric mountain
#

iirc, when deafened ur also muted

azure lark
#

ah ye

lyric mountain
#

and it's not like bots can hear anything anyway

azure lark
#

forgot bout that

#

ye

lyric mountain
#

you forgor šŸ’€

plucky geyser
pale vessel
#

Yes and it saves you bandwidth if it's server deafen

lyric mountain
#

hm, ig so

tardy hornet
#

const ms = require("parse-ms");
^

Error [ERR_REQUIRE_ESM]: require() of ES Module C:\v13globaleco\node_modules\parse-ms\index.js from C:\v13globaleco\index.js not supported.
Instead change the require of C:\v13globaleco\node_modules\parse-ms\index.js in C:\v13globaleco\index.js to a dynamic import() which is available in all CommonJS modules.
at Object.<anonymous> (C:\v13globaleco\index.js:97:12) {
code: 'ERR_REQUIRE_ESM'
}

lyric mountain
#

use import instead of require

#

oh wait

#

that's inside a package

#

welp, time to find an updated alternative

rose warren
#

Sometimes checking the github PRs can offer a solution.

lyric mountain
#

no open prs

#

last update was 5 months ago

rose warren
#

Welp

#

This is why I try and avoid packages if I can tbh. Looks like you're try to make a bot eco. Not that hard to just make it yourself.

lyric mountain
#

it's just a millis-to-readable package

#

not that hard to make one

wheat mesa
#

Just use moment

#

If you’re against making your own

rose warren
#

You don't even need moment. I do that with a simple function in my code. It's just a few lines of code.

lyric mountain
#

me 2, I also use that on postgres bcuz reasons

rose warren
#

disgruntled database noises

lyric mountain
rose warren
#

I hate my db

lyric mountain
#

had to write it myself

rose warren
#

Yeah

#

My db has just had stuff added to it little by little as my bot developed and it's just a bit of a mess. Needs a rehaul tbh and that's why I hate it šŸ˜…

lyric mountain
#

lul

earnest phoenix
#

does someone know how can i check if the role is above bot?

lyric mountain
#

check the first role index

#

first role is always the highest role user has

#

if index is higher then the role is higher

earnest phoenix
#

can anyone tell me how do it make the bot respond when someone mentions it ? i'm in cogs btw and discord.py

lyric mountain
earnest phoenix
#

i mean wanna see my code?

lyric mountain
#

or just get message mentions

#

nah, I'm bad at python

earnest phoenix
#

lol

whole surge
#

hey how i can make my bot status to "Watching over 2000 peoples"

solemn latch
#

depends, bot library?

whole surge
quartz kindle
#

dicksword.js

spark flint
#

This may make me sound retarded ,but how do i get data from a dict as data["userid"] isn't working

boreal iron
#

Do I read dick in a non-nswf channel?
We thought you can do better, Tim tzzz.

spark flint
#

Using Quart I get the data from request.form, then i try to get data but it says it is a coroutine

spark flint
#
{"g-recaptcha-response":"hidden output code","serverid":"858252051653197835","userid":"471409054594498561"}```
#

how do i get the userid from that

boreal iron
# solemn latch beaned!

Imagine Tim would be banned off development only allowed to access general anymore.
chaos would begin

spark flint
#

its saying that the type is <class: coroutine>

solemn latch
#

could try dict.get("userid")

spark flint
#

alr

spark flint
solemn latch
#

Thonk love trying to debug languages I dont know kek.

earnest phoenix
#

does that work

rose warren
#

No that doesn't accomplish the same thing

whole surge
#

client.on('ready', async() => {
  let server = await client.guilds.cache.reduce((a, b) => a + b.memberCount, 0)
  client.user.setPresence({
    activity: {
      name: '${server} members.',
      type: "WATCHING"
    },
    status: "online"
  })```
earnest phoenix
solemn latch
solemn latch
boreal iron
spark flint
#

nope still doesn't work

boreal iron
#

You told him to use setActivity() not setPresence, Mr. Woo!

spark flint
#

i awaited but no luck

#

still same error

solemn latch
#

heck, musta miss clicked topggFlushed

solemn latch
spark flint
#

alr ill open a channel on it

spark flint
whole surge
#

lol

#

me too

#

code useless shit

#

this is 1 of my useless shit

spark flint
#

now i can't get it to dm

whole surge
spark flint
#

i get the userid from the request, then it does user = client.get_user(int(data.get("userid"))

#

then await user.send("Thanks for verifying!")

#

but im getting AttributeError: 'NoneType' object has no attribute 'send' as an error

whole surge
spark flint
#

good idea

whole surge
#

ur welcome

solemn latch
#

i thought py uses strings for ids too

spark flint
#

i do share a server with it before you ask

solemn latch
#

ok, but is the user cached KEKW

spark flint
#

who knows

#

it won't tell me

solemn latch
spark flint
#

alr that worked

#

ty

tardy hornet
#
const { Discord, Client, Intents } = require('discord.js');
const myIntents = new Intents();
myIntents.add(Intents.FLAGS.INVITE_CREATE);
myIntents.add(Intents.FLAGS.WEBHOOKS_UPDATE)
myIntents.add(Intents.FLAGS.INVITE_CREATE)
myIntents.add(Intents.FLAGS.MESSAGE_CREATE)
myIntents.add(Intents.FLAGS.MESSAGE_UPDATE)
myIntents.add(Intents.FLAGS.MESSAGE_DELETE)
myIntents.add(Intents.FLAGS.MESSAGE_REACTION_ADD)
myIntents.add(Intents.FLAGS.MESSAGE_REACTION_REMOVE)
myIntents.add(Intents.FLAGS.MESSAGE_CREATE)
myIntents.add(Intents.FLAGS.MESSAGE_UPDATE)
myIntents.add(Intents.FLAGS.MESSAGE_DELETE)
myIntents.add(Intents.FLAGS.MESSAGE_REACTION_ADD)
myIntents.add(Intents.FLAGS.MESSAGE_REACTION_REMOVE)

const bot = new Client({ intents: myIntents });

throw new RangeError('BITFIELD_INVALID', bit);

hybrid cargo
#

Also quick heads up. Intents != gateway events

tardy hornet
# hybrid cargo Well all intents are invalid <:okeh:585884138314137600>

what about now?

const { Discord, Client, Intents } = require('discord.js');
const bot = new Client({
  intents: [
      "CREATE_INSTANT_INVITE",
      "MANAGE_WEBHOOKS",
      "SPEAK",
      "CONNECT",
      "USE_EXTERNAL_EMOJIS",
      "MANAGE_MESSAGES",
      "SEND_MESSAGES",
      "VIEW_CHANNEL",
      "PRIORITY_SPEAKER",
      "ADMINISTRATOR",
      "ADD_REACTIONS",
      "USE_APPLICATION_COMMANDS",
      "USE_EXTERNAL_STICKERS",

  ],
});

solemn latch
#

those are permissions

#

not intents

hybrid cargo
#

The intents itself is invalid

#

^^^

tardy hornet
#

o my bad

lament rock
modest maple
#

Because they're considerably more memory efficient in bulk

#

So its a JS and lua moment to the people who use string ids mmLul

lyric mountain
#

aren't strings lighter than longs for that matter?

modern sable
#

starry Server Lockdown

Hey guys, we've gone ahead and locked down this server due to a recent surge in bot accounts joining and spamming. If you get any scam ads in your DMs please DM a mod to report it. Once the raid has been mitigated we'll reopen the server.

urban slate
#

sus

quartz kindle
spark flint
#

how do i remove a json entry

#

for example, i would need to remove "testcode" from my json in python

#
{
    "testcode": {
        "userid": 471409054594498561,
        "serverid":822059901568024616
    }
}```
#

so that the entry is deleted

cinder patio
#

read the json and load in memory > update json > write the new json to the file

spark flint
#

but how tho-

#

i tried and it said something about it being a string

modest maple
#

so fun fun

#

if strings were lighter

#

no one would use native ints lol

feral aspen
#

Hey all! šŸ‘‹

#

I'd like to ask, how can I make a terminal finish its process before it closes, pause doesn't work, apparently.

simple stump
#

I’m trying to check whether the user who clicked a button is not the person sending the command, however I get the error ā€œInteraction has already been deferred!ā€ When another user clicks a button a second time (or when the user who clicked the button isn’t in the voided array).
Code: https://sourceb.in/JnZcVnEJvD

feral aspen
feral aspen
sinful belfry
# feral aspen How can I prevent it from closing?

it'll close as soon as the script has finished running if you start it like that, so instead you could open up cmd or windows terminal or whatever your preferred console program is, navigate to the directory which the file is located in and run it from the command line

feral aspen
sinful belfry
#

or you could just add a line to make the program wait for input

feral aspen
sinful belfry
#

yep

#

the console doesnt close until everything has finished running

feral aspen
sinful belfry
#

so if you add something at the end where it waits for user input etc then it won't close

#

how did you do it at the beginning of the program?

feral aspen
#

.. but doesn't pause when it returns the output.

#

Unfortunately, I'm trying to figure out how it can "pause" when it returns the output.

sinful belfry
#

i don't know of any way which you can do an indefinite pause safely

sinful belfry
#

lots of console-based programs have something at the end where it says "click any key to close"

#

something like that could work

lyric mountain
#

at least wait for starman to leave the chat smh

feral aspen
feral aspen
sinful belfry
#

huh is that actual syntax?

lyric mountain
#

ye

#

batch

feral aspen
#

.bat

quartz kindle
sinful belfry
#

i saw the node_modules and assumed js kek

#

but yeah using the bat file to stop the program from ending sounds reasonable

sinful belfry
#

oh is this channel locked zoomeyes

feral aspen
#

First back. šŸ‘‹

earnest phoenix
#

no

feral aspen
simple stump
#

As in like why does that cause the issue

sinful belfry
#

whenever that button is clicked, no matter what, you're trying to "defer" the reply

#

but you can only defer it once

#

so i think what you'd want to do is to do the check first, then defer after

simple stump
#

Ohh I see. Tysm.

sinful belfry
#

or even just do the check and straight up send the message, you don't appear to be doing any fetching so the stuff you're trying to do will take basically no time at all

simple stump
#

Ah okay. Thanks for the help šŸ‘

reef stag
#

@quartz kindle come back

quartz kindle
#

???

split hazel
#

@quartz kindle come back

#

how does js include array method work thanks

#

sounds inefficient but it's more efficient than my morning routine

lyric mountain
#

it iterates over the array and find the first match

quartz kindle
#

@_@

split hazel
#

really?

modest maple
#

Yes

split hazel
#

I thought google again had some kind of magic to make it lightening speed

modest maple
#

Thats how all programming lanuages do it

split hazel
#

fair enough

#

I never tested it on huge arrays

lyric mountain
#

there's not much u can do that'll be faster than first-match-exit method

modest maple
#

If you want it for big massive lists then generally a set is used

lyric mountain
#

well, except if it's a sorted array

quartz kindle
#

or if its text-searchable

modest maple
#

Or a btreeset

#

Which is a tradeoff

lyric mountain
split hazel
#

laughs in 20 different types in a single array

quartz kindle
#

yes big massive tits

#

fastest iteration method

split hazel
modest maple
#

I love me some massive tits iteration

lyric mountain
modest maple
#

Well actually

split hazel
#

yeah includes is usually o(n)

#

js is diabolical

modest maple
#

😩 when people go "oh no its O(n)"

split hazel
#

me doing your mother is usually o(1)

modest maple
#

🤣 pain my mother's dead

split hazel
#

yeah

#

that's why it takes the same amount of time each time

#

there's no external factors

modest maple
#

Well you do you ig

boreal iron
#

I better don’t ask what’s going on

tired panther
#

šŸ‘€

spark flint
#

help

#

data[verifycode]["used"] = 1

#

returns KeyError: None

#

ohhh

#

i returned verifycode

#

and its returning "none"

eternal osprey
#
client.on('message', async message => {

const guild = client.guilds.cache.get('814988539334230017')
let vip = guild.roles.cache.find(r => r.name === "participants")
console.log(vip)```
#

while in fact 2 users have the role equipped atm

#

Really straneg!

#

If both users type a message it will show 2 users, otherwise only 1???

lyric mountain
#

indeed straneg

spark flint
#

straneg

eternal osprey
#

strange*.

#

does anyone know the answer tho

#

let me know please

#

someone told me it's because i have no cache messaegs set

#

how would i ever do it tho?

green kestrel
#

the idea is to guide a complete newcomer to configuring visual studio ready to make a bot

#

they can either spend 5 mins following the tut, or for the REALLY lazy i made a template project lol

#

for those of you who havent ever done C++ does it look reasonable or is anything about it too confusing and could be reworded/etc?

main trench
#

yay new error that doesnt make sense why its happening for star board!

error:

 const msgs = await starboard.messages.fetch({ limit: 100 });
                                              ^

TypeError: Cannot read property 'fetch' of undefined

code:

const { MessageEmbed } = require('discord.js');

const db = require('quick.db');

module.exports = async (client, reaction) => {
    
    const handleStarboard = async () => {
        const starboard = db.fetch(`starboardop_${reaction.message.guild.id}`);
        if (starboard === null) {
                return;
            }
        const msgs = await starboard.messages.fetch({ limit: 100 });
        const existingMsg = msgs.find(msg => 
            msg.embeds.length === 1 ?
            (msg.embeds[0].footer.text.startsWith(reaction.message.id) ? true : false) : false);
        if(existingMsg) existingMsg.edit(`${reaction.count} - 🌟`);
        else {
            const embed = new MessageEmbed()
            .setAuthor(`${reaction.message.author.tag}`, reaction.message.author.displayAvatarURL({ dynamic: true }))
            .setDescription(`**[Jump!](${reaction.message.url})**`)
            .addField("Message", `${reaction.message.content}`)
            .setColor("YELLOW")
            .setFooter(`${reaction.message.id}`)
            .setTimestamp()
            if(starboard)
            client.channels.cache.get(starboard).send({ content: '1 - 🌟', embeds: [embed] });
        }
    }
    if(reaction.emoji.name === '⭐') {
        const starboard = db.fetch(`starboardop_${reaction.message.guild.id}`);

        if (reaction.message.channel.id === starboard) return;
        if(reaction.message.partial) {
            await reaction.fetch();
            await reaction.message.fetch();
            handleStarboard();
        }
        else
            handleStarboard();
    }

}
#

the channel has messages so idk why its saying undefined

#

ok that error fixed now just this one:

 (msg.embeds[0].footer.text.startsWith(reaction.message.id) ? true : false) : false);
                                  ^

TypeError: Cannot read property 'text' of null
pale vessel
#

what do u do if a property is nullable

#

go go

main trench
#
msg.embeds.length === 1 ?
            (msg.embeds[0].footer.text.startsWith(reaction.message.id) ? true : false) : false);
        if(existingMsg) existingMsg.edit(`${reaction.count} - 🌟`);
        else {
            const embed = new MessageEmbed()
            .setAuthor(`${reaction.message.author.tag}`, reaction.message.author.displayAvatarURL({ dynamic: true }))
            .setDescription(`**[Jump!](${reaction.message.url})**`)
            .addField("Message", `${reaction.message.content}`)
            .setColor("YELLOW")
            .setFooter(`${reaction.message.id}`)
            .setTimestamp()
            if(starboard)
            client.channels.cache.get(starboard).send({ content: '1 - 🌟', embeds: [embed] });
        }
#

makes a new embed

pale vessel
#

that's a useless ternary

main trench
#

ah shiz read that wrong

#

though you were asking what im doing if its null kekw

pale vessel
#

check if footer.text exists first

main trench
#

i could try re-ordering it

#

honestly have no faith in this code working at this point

hexed sedge
#

Hey! I am having an error with my wrapper, or axios. Cant exactly decide. I want to grab the final result of the request, and save it in a let variable so I can use it outside of the .then statement. Here is the code I am using:

const wrapper = require('./utils/wrapper.js');

let data;

wrapper.getUserData('http://127.0.0.1/', 'no peeking', 7358).then(res => {
    console.log(res);
    data = res;
});

console.log(data);

data is returning undefined

main trench
#
  const existingMsg = msgs.find(msg => 
            msg.embeds.length === 1 ?
            (msg.embeds[0].footer.text.startsWith(`${reaction.message.id}`) ? true : false) : false);

this is checking if it exists so šŸ¤·ā€ā™‚ļø

#

looks like "embeds[0].footer.text.startsWith" just doesnt exist

pale vessel
hexed sedge
boreal iron
#

Maybe it’s the 2nd embed having a footer not the first?

main trench
#

well right no 0 embeds are in that chat but ill change it šŸ¤·ā€ā™‚ļø

#
 msg.embeds.length === 1 ? (msg.embeds[2].footer.text.startsWith(`${reaction.message.id}`) ? true : false) : false);
                                                     ^

TypeError: Cannot read property 'footer' of undefined

im botta give up with this

earnest phoenix
#

Hi

solemn latch
#

just to clarify its a message with atleast 3 embeds right?
arrays start at 0, so 2 = 3

earnest phoenix
#

I am also bet developer

boreal iron
#

If 2 embed are in embed number 2 has the key 1 not 2

earnest phoenix
#

@solemn latch how i get bot developer role?

solemn latch
earnest phoenix
#

How it will get approved?

#

When it will get approved?

solemn latch
#

1+ week

earnest phoenix
#

Uhh

#

Ok

#

@solemn latch how will i get to know that its approved?

main trench
main trench
#

saying that it got approved

earnest phoenix
#

Oh ok

main trench
#

nice

boreal iron
#

Your statement doesn’t make any sense at all, if embed.length === 1 the key embed[2] can’t exist anyways

main trench
#

so just change the length value?

quartz kindle
#

??

boreal iron
#

I’m not even sure what you wanna do anymore

main trench
#

hey tim shit still aint working kekw

main trench
quartz kindle
#

how many embeds did you send?

main trench
#

0 are in that channel rn

quartz kindle
#

wut

main trench
#

0 embeds are in the channel

#

so it should sending a new one

solemn latch
#

you cannot check the footer of and embed that doesnt exist

boreal iron
#

Then check if !embeds || !embeds.length send embed else update the last

main trench
#

ill try

boreal iron
#

I’m sorry I hate mobile formatting

#

if(!msg.embeds || !msg.embeds.length) send embed else update one

quartz kindle
#

embeds belong to messages, not to channels directly

#

you cannot check how many embeds are in a channel

#

you need to get their messages first

boreal iron
#

If the channel is empty there won’t be a message obj anyways oldEyes

#

Keep that in mind

#

Whatever fetch returns… an empty collection or null

#

Idk

#

@boreal iron You’re talking to yourself, Sir

#

I know nobody ain’t here anymore

#

pepowot šŸ”«

main trench
#

just had to change it to:

const existingMsg = msgs.find(msg => {
            if(msg.embeds.length === 1){
                if(msg.embeds[0].footer.text.startsWith(`${reaction.message.id}`)) {
                    return true;
                } return false;
            } return false;
        })
#

and it works now

pale vessel
#

Mmm spaghet

boreal iron
#

You will suffer the consequences if two embeds will exist once a beautiful day

main trench
#

hmmm

#

lemme try and see how it reacts

pale vessel
#

why not just return the startsWith statement

#

it returns a boolean

main trench
#

2 embeds in so far so good

boreal iron
#

It will return false if there’s more than 1 embed

main trench
#

the channel will be locked to that bot only so it should hopefully be good

#

ill do a try catch and ez fix

boreal iron
#

Just remove the condition

#

If(msg.embeds.length) …

main trench
#

guess i could try that lol

#

didnt fix anything šŸ¤·ā€ā™‚ļø

boreal iron
#

It just doesn’t return false if there’s more than 1 existing embed

main trench
#

looks like channels with old messages is the issue

boreal iron
#

If a message ever has more than one, who knows

main trench
#

cant even make this code actually good

#

damn

#

Works fine here šŸ¤·ā€ā™‚ļø

#

But if it has older messages it has a stroke

#

Working fine here šŸ¤·ā€ā™‚ļø

pale vessel
#

why not use a self-invoking function ```js
(async () => {

const res = await wrapper.getUserData('http://127.0.0.1/', 'no peeking', 7358);

// do something with res

})();```

hexed sedge
#

oh no hold on

pale vessel
#

do you like need to export res

#

is that why

hexed sedge
#

nope

main trench
#

Is there anyway to check if the message is a image and then send that image in a embed?

errant flax
main trench
#

I'll see if I can get what I want to work

#

I'm trying to make my starboard work like luca where it can be used on images

main trench
#

And got it

drifting wedge
#

help me with logic here pls lol
py if user["gemstones"]["Ruby"] >= ((user["tools"]["pickaxe"]["tier"] + 1) * 20): user["tools"]["pickaxe"]["tier"] += 1 user["gemstones"]["Ruby"] -= ((user["tools"]["pickaxe"]["tier"] + 1) * 20) mongo["db1"]["gemstones"].update_one({"_id": ctx.author.id}, {"$set": user})
just logic
so:
if amt of rubies >= pickaxe tier
+1) * 20
which is the formula
then i make tier + 1
then make ruby count - formula for upgrade
but it goes into the negaitves sometimes

boreal iron
#

I’ve got no fucking clue what u wanna do but one thing.
pickaxe tier got increased by one,
After doing so Ruby is decreased by pickaxe tier (adding another 1 to it)

drifting wedge
#

fixed

#

all good

#

yeah yeah

#

ty

#

thats the issue

#

alr

#

ty

boreal iron
#

šŸ‘

earnest phoenix
#

how setup

#

i am making my website my html and css

boreal iron
#

Yes HTML and CSS is the way to go.
Keep in mind JS isn’t available.

#

Including an external website is also possible using an iFrame for example

rich copper
#

style tag isn't working in my bot page

#

how can I do it?

rich copper
#

nvm working

feral aspen
#

How can I prevent this?

reef stag
#

what do you want to prevent

feral aspen
#

Do I do if (interaction.author.bot) return; in the interactionCreate file?

eternal elbow
#

In discord.js v13, guild.members.cache return max 2 member. Any one know why ?

spark flint
#

You need member intents for that

eternal elbow
spark flint
#

Yeah

eternal elbow
#

Already have

#

Oh my bad

feral aspen
#

This has never made sense.

earnest phoenix
feral aspen
#

How can I prevent that?

errant flax
#

bots cant execute slash commands?

#

afaik

tired panther
pearl reef
#

where is the channel for queries?

spark flint
#

@rustic nova

feral aspen
#

Damn.

feral aspen
#

I usually do interaction.followUp(), I didn't understand your point.

tired panther
spark flint
#

whats the best way of adding microsoft authantication to my Quart/Flask site?

feral aspen
eternal osprey
#

how do i make a channelr ead only for 1 user specific

#

and later on clear it for each user again

tardy hornet
#
const filter2 = response => {
             return array2[Random2].toLowerCase().replace(" ", "") === response.content.replace(" ", "").toLowerCase() && response.author.id == message.member.id;
    
      };

this filter worked on v12 but now on v13 it isnt and i cant find why

sinful night
#

i removed cogs and this is what happen. (discordpy)

tired panther
feral aspen
#

I want it to return the first embed only, how can I prevent the second one from sending?

#

Since I don't understand why it does so.

tired panther
feral aspen
#

The style I did in the code works for all the other commands without having the second embed to show, not sure why so here. :/

#

.. but alright. šŸ¤·ā€ā™‚ļø

slow ibex
#

Thats a huge If/else Chain you have right there

severe dawn
#

Please fix this problem. There are no mentions that enter the history mentions. This has been happening since the last update yesterday.

#

I can't see who tagged me

pale vessel
#

This isn't discord support :c

severe dawn
#

Oh, so where i can get discord support?

feral aspen
slow ibex
feral aspen
severe dawn
feral aspen
severe dawn
feral aspen
#

šŸ‘

eternal osprey
#

is there a way to get the time a user reacted to a message collector? (WIHTOUT the use of collector.end)

slow ibex
#

Uuuh,.. How often does it happen that a bot literally freezes?

#

nvm.. a blow torch helped

earnest phoenix
#

TypeError: Cannot use 'in' operator to search for 'color' in Pong.

#
const { MessageEmbed } = require('discord.js');
const Command = require('.././Structures/command');

module.exports = new Command({
    name: 'ping',
    description: 'This command tells the bot ping.',
    async run(message, args, client){
        message.reply(`Pong!`).then( message => 
            {
                const embed = new MessageEmbed('Pong.')
                .setTimestamp()
                .addField('-> Client latency:', `${Date.now() - message.createdTimestamp}ms`, false)
                .addField('-> Api latency:', `${client.ws.ping}ms`, false);
                message.edit({embeds: [embed]});
            })
    }
})```
#

.././Structures/command

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

/**
 * @param {Discord.Client} client 
 * @param {Discord.Message} message 
 * @param {string[]} args 
 */
function runFunction(client, message, args){}
class command{
    /**
     * @type{{name: string, description: string, run: runFunction}} CommandOptions;
     * @param {CommandOptions} options;
     */
    constructor(options){
        this.name = options.name;
        this.description = options.description;
        this.run = options.run;
    }
}

module.exports = command;
errant flax
#

?

errant flax
errant flax
earnest phoenix
#

hold up

#

ok

#

i am getting the error again @errant flax

#
const { MessageEmbed } = require('discord.js');
const Command = require('.././Structures/command');

module.exports = new Command({
    name: 'ping',
    description: 'This command tells the bot ping.',
    async run(message, args, client){
        message.reply(`Pong!`).then( msg => 
            {
                const embed = new MessageEmbed('Pong.')
                .setTimestamp()
                .addField('-> Client latency:', `${Date.now() - message.createdTimestamp}ms`, false)
                .addField('-> Api latency:', `${client.ws.ping}ms`, false);
                msg.edit({embeds: [embed]});
            })
    }
})
errant flax
earnest phoenix
errant flax
#

wait what does the in thing do anyways

earnest phoenix
#

it is up to date

errant flax
#

do
console.log(process.version)

#

@earnest phoenix ^

#

ah

earnest phoenix
errant flax
#

so its like an .includes method but in an object

#

does it uses the index or the value?

#

k

earnest phoenix
#

@errant flax

errant flax
#

latest is v16.9.1

#

install that

slow ibex
#

Uh.

#

I use v14.17.1 and its working fine with embed

#

just saying

#

But my Embeds are a bit different.

errant flax
earnest phoenix
errant flax
#

just checked

errant flax
slow ibex
#
const embed = new Discord.MessageEmbed()
            .setTitle("DJ Strawdong // PLAYBACK ERROR")
            .setColor(0x00AE86)
            .setFooter(`DJ Strawdong - Version ${version}`, client.user.displayAvatarURL())
            .setThumbnail(client.user.displayAvatarURL();
            .setTimestamp()
            .setDescription('I was not able to find any song! Maybe try playing it with the URL')
        message.channel.send(embed);

Thats why i wondered why he has 'Pong' in the Head of his/her embed

#

stfu

errant flax
#

@flat pelican

flat pelican
#

smh

earnest phoenix
errant flax
earnest phoenix
#

and its his*

slow ibex
#

idk if thats a problem.. but it works for me and i never saw it different than that.

eternal osprey
#
client.on("guildMemberAdd", async (member) => {
    console.log(member)```why is this code not logging?
#

it's v12

solemn latch
#

Do you have the intent for that?

eternal osprey
#

probably one sec

outer perch
#

I was thinking of a ranking command for my bot. it's based on the XP received. but the only way I see to make this command work, is through iterating the whole DB and ordering a top 10 into an object which caches this data. the iteration should be limited per hour.

Is there any better way?

eternal osprey
#

eehhe no

#

i fixed it!

subtle kiln
#

Nevermind, I just forgot the response_type=code parameter

hollow token
#

Hi, I have a discord bot (https://github.com/Ladvace/WiseMan-DiscordBot), the main feature is that the rank of a user is based on the time he spends in a vocal channel and not only on how much he writes in a channel, right now the bot it's not online and I didn't work on it for a while but I'm working on it again, I also made a dashboard that can allow users to manage the bot directly from it, the dashboard is not completed yet but I already implemented the login and some basic feature such as changing the command prefix.

I'm would be happy to find someone that could be interested in helping me developing and supporting the bot, my plan is to add more features to the bot, fix all the bugs, and probably adding some premium plan through the dashboard.

The bot is written in nodejs and the dashboard in react + nodejs (the backend), if anyone is interested feel free to open an issue on the repo or contacting me šŸ™‚

slow ibex
#

So.. hey

#

uh

#

I have a kinda huge problem with one of my Bots rn.

#

First was the EPIPE Event

#

Then the bot didnt start playing the song so i called the skip function (Thats on line 36), called it again and checked the "Log"

quartz kindle
#

show your index.js