#development

1 messages · Page 1602 of 1

amber quiver
#

yes I do

#

w8

cinder patio
#

If you changed those vars to let or const you'll see the problem

amber quiver
#
client.on("message", message => {
//if starts
  if (message.content === `${prefix}clear`) {
     if (!message.member.hasPermission("MANAGE_MESSAGES")) 
      var embedMessageError = new Discord.MessageEmbed()
      .setColor('#FF0000')
      .setTitle('ERROR')
      .addField('OOPS', 'It\'s look like you have no permission to do that!')
      message.channel.send(embedMessageError)
      .then(msg => {
    msg.delete({ timeout: 5000 })
   })
   if (message.member.hasPermission("MANAGE_MESSAGES")) 
   var embedMessagesuccesful = new Discord.MessageEmbed()
     .setColor('#FF5800')
     .setTitle('succesful command')
     .addField('a^clear', 'the messages got deleted!')
       message.channel.send(embedMessagesuccesful)
       .then(msg => {
     msg.delete({ timeout: 5000 })
    })
//if ends
  }
})```
sacred aurora
#

how can i update a field type with mongoose

cinder patio
#

There are more if statements

near stratus
#

@amber quiver now it works but the error stays

amber quiver
#

or something

amber quiver
cinder patio
#
if (message.member.hasPermission("MANAGE_MESSAGES")) 
   var embedMessagesuccesful = new Discord.MessageEmbed()
     .setColor('#FF5800')
     .setTitle('succesful command')
     .addField('a^clear', 'the messages got deleted!')
       message.channel.send(embedMessagesuccesful)
       .then(msg => {
     msg.delete({ timeout: 5000 })

You need to wrap the code in a code block

amber quiver
#

after 5s

cinder patio
#

There's no code block there

amber quiver
#

you dont need

cinder patio
#

You need to if you want to execute multiple expressions

#

and that's what you are doing

near stratus
#

but the error still shows

amber quiver
cinder patio
#

🤦

amber quiver
#

and it still didnt delete the message

amber quiver
#

ok

#

lemme

#

see

near stratus
amber quiver
#

ok

#

okkkk

#

@cinder patio

#

you were right, the message was delete but still, for some reason It can delete the other messages

#

its just shows the message then deletes it

#

thats it

#

w8

#

and I still getting errors

near stratus
#

@amber quiver

#

see

amber quiver
#

ah yes off course it didnt work

#

I forgot the bulk delete

#

but still

#

if i'll add the bulk delete I still get an error

near stratus
#

It deletes itself

#

It still shows the error

amber quiver
#

I know

#

w8

#

im trying to change the var to const

near stratus
amber quiver
#

now its working without errors but it duplicates my messgaes wth

#

w8

#

brb in 5 minutes I need to solve this

#

stay here

barren solstice
#

i found another purge command

#
    name: 'purge',
    discription: 'discription',
    execute(message, args) {
        if (args[0] == 'help') {
            const testembed = new Discord.MessageEmbed()
                .setColor('RANDOM')
                .setTitle('Purge command.')
                .setDescription('')
                .setThumbnail('')
                .addFields(
                    { name: 'Purge Command", "Usage: `*clear` <amount>' },
                )
                .setTimestamp();
            message.author.send(testembed);
        }
            return;
        }

        message.delete();

        if (!message.member.hasPermission('MANAGE_MESSAGES'))
        {return message.reply('You don\'t have premssions to do that!');}
        if (!args[0])
        {return message.channel.send(
            'Please enter a number of messages to clear! `Usage: .clear <amount>`',
        );}
        const deleteNum = parseInt(args[0]);
        if (isNaN(deleteNum)) return message.reply('that is not a number');
        message.channel.bulkDelete(deleteNum).then(() => {
            message.channel
                .send(`**__Cleared ${args[0]} messages.__**`)
                .then(msg => msg.delete(2000));
        });
    },
};```
#

here

lusty quest
#

would maybe add some error handling to the bulk delete, incase the messages are older than 2 weeks, also iirc its limited to 100 messages

near stratus
#

@amber quiver bro I fixed it
Completely
No errors no shit

#

The complete code

#

you there ?

amber quiver
#

im here

#

which IDE is this?

#

@near stratus

#

this is the exact code that I did rn but without the catch code

#

coz I didnt knew where to put it

#

coz when I put it it says error

barren solstice
amber quiver
#

so I probably put the error in the wrong place

lusty quest
near stratus
#

@amber quiver

const Discord = require("discord.js");
const client = new Discord.Client()

client.on("message", message => {
    if (message.content === `clear`) {
         if (!message.member.hasPermission("MANAGE_MESSAGES")){
             let emb = new Discord.MessageEmbed()
                 .setColor('#FF0000')
                 .setTitle('ERROR')
                 .addField('OOPS', 'It\'s look like you have no permission to do that!')
             message.channel.send(emb)
                 .then(msg => {
                     msg.delete({ timeout: 5000 })
                 }).catch(console.log)
         }
         if (message.member.hasPermission("MANAGE_MESSAGES")){ 
             let emb = new Discord.MessageEmbed()
                 .setColor('#FF5800')
                 //.setDescription("poooooo")
                 .setTitle('succesful command')
                 .addField('a^clear', 'the messages got deleted!')
             message.channel.send(emb)
                 .then(msg => {
                     msg.delete({ timeout: 5000 })
                 }).catch(console.log)
        }
    }
})
lusty quest
#

the one in the index.js is just for not killing the bot if something breaks, on the commands itself i would still add some handling to inform the user that it went wrong and why

barren solstice
#

ight

amber quiver
#

that is the error probably that I got on catch

near stratus
#

IDK
My moto : ** if it just works then don't touch it**

near stratus
amber quiver
amber quiver
#

I also can put everything in try and then do catch

#

not everything

near stratus
near stratus
amber quiver
#

only from the hasPermission if statment

amber quiver
near stratus
#

oh

amber quiver
#

it doesnt matter actually

#

I can put it where I want under the end of the command but I must write console.log in the catch code

#

@near stratus now its just duplicates my embed message

#

when I delete

#

ohhhhhhhh

#

I know why its duplicating my embed message

#

now it should work perfectly

amber quiver
#

btw I cleared my code and now its more readable

near stratus
slender thistle
#

Assembly assignment
A question states that I need to list two identifiers "that will turn into a digit if I add a symbol/character to them"

#

Oh hold on... hexadecimal?

lusty quest
#

probably

slender thistle
#

But the question specifically states "if I add a symbol/character to them"

#

and hexadecimal 5 is still a number

earnest phoenix
#

How to resubmit your application

slender thistle
earnest phoenix
#

@slender thistle no I submitted the application but I want to delete it or edit it

slender thistle
earnest phoenix
slender thistle
#

Then see the available buttons on the bot's page and see if that helps you

earnest phoenix
slender thistle
slender thistle
#

Could you explain how that connects to my case?

lusty quest
#

well if you add a ! to a indentifyer you could use the Binary code of it

earnest phoenix
lusty quest
#

010 0001 is the binary code for !

slender thistle
#

You'll have to resubmit it from scratch, Silent

lusty quest
#

or use the hex code

earnest phoenix
slender thistle
#

Then it seems to have been submitted by someone else

earnest phoenix
slender thistle
earnest phoenix
#

I really need verification fast

#

It is already in 35 servers

slender thistle
#

or do you mean something like 010001b, my_identifier

lusty quest
#

well you wanted a way that makes a identifyer a number if you add a char

#

and if you take the hex or binary code of a char you can get a number from it

slender thistle
#

Why am I asking this, actually. TIAS time!

earnest phoenix
#

@slender thistle can't I verify from here

opaque seal
#

Does anyone know how I can pass a function or a required file to a broadcastEval function?
Like:

const embeds = require('../../../core/aesthetics/embeds')

... // code
const responses = await shardsManager.broadcastEval(`(${sendRegisteredVoteNotification}).call(this, '${userID}', '${coins}', '${botlist}', '${totalVotes}', '${totalCoins}', ${embeds})`)


async function sendRegisteredVoteNotification (userID, coins, botlist, totalVotes, totalCoins, embeds) {
  // code

  try {
    await user.send(embeds.voteRegistered(user, coins, botlist, totalVotes, totalCoins))
    return true
  } catch (e) {
    console.log(e)
    return false
  }
}

Right now embeds throws an unexpected identifier error when passed to that broadcastEval

silver lintel
#

TypeError [ERR_INVALID_ARG_TYPE]: The "id" argument must be of type string. Received undefined i searched online and the most common result was that it was a require isxue but i checked all of my require funcs and they all correct

#

i would show code but the error doesnt say where the error is ;(

amber quiver
amber quiver
atomic walrus
#

is tere any issue with vote count in website?

barren solstice
#
const client = new Discord.Client();

module.exports = {
    name: 'purge',
    discription: 'discription',
    execute(message, args) {
        if (args[0] == 'help') {
            const testembed = new Discord.MessageEmbed()
                .setColor('RANDOM')
                .setTitle('Purge command.')
                .setThumbnail('')
                .addFields(
                    { name: 'Purge Command", "Usage: `*clear` <amount>' },
                )
                .setTimestamp();
            message.author.send(testembed);
        }

        message.delete();

        if (!message.member.hasPermission('MANAGE_MESSAGES'))
        {return message.reply('You don\'t have premssions to do that!');}
        if (!args[0])
        {return message.channel.send(
            'Please enter a number of messages to clear! `Usage: .clear {amount}`',
        );}
        const deleteNum = parseInt(args[0]);
        if (isNaN(deleteNum)) return message.reply('that is not a number');
        message.channel.bulkDelete(deleteNum).then(() => {
            const emb = new Discord.MessageEmbed()
                .setColor('RANDOM')
                .setTitle('Purge successful!')
                .addFields(
                    { name: `${args[0]} messages where deleted!` },
                );
            message.channel.send(emb);
            client.on('channelDelete', (channel) => {
                console.log(channel);
            });then(msg => msg.delete(1000));
        });
    },
};```
#

purge command

near stratus
amber quiver
small tangle
#

Im kinda curious, when your bot wants to use the new slash command , it needs the application.commands scope, can i change somehow the scope, while the bot is already in guilds?

slender thistle
indigo folio
#

hello development friends i havent had a legitimate message in here since october 2020 but thats fine

i need nodejs help ok so i have base64 datafor an image and i want it to be a sendable image. any help would be $$$

small tangle
slender thistle
#

Not sure which bots you may be referring to but they just may be using both bot scope and slash commands

#

or just straight up asking users to reinvite the bot

small tangle
#

But i mean most of the big bots are existing longer than the slash commds / the scope i guess FeelsSmartMan

indigo folio
small tangle
slender thistle
restive furnace
slender thistle
#

That's the last thing I want to worry about rn

indigo folio
#

guess i need some tim-level help

#

i wait for him B)B)B)B)B)

lusty quest
indigo folio
#

like take the data and create a new buffer with it?

#

i try new Buffer(data) and Buffer.from(data)

#

no workie

lusty quest
#
base64 = "your base64 string"
const buffer = Buffer.from(base64, "base64");
fs.writeFileSync("new-path.jpg", buffer);
indigo folio
#

o wtf

earnest phoenix
#

lol

indigo folio
#

i might be a tiny bit braindead dw

#

gimme a sec

cinder patio
#

You might need to remove the data:image\/png;base64, from the string

indigo folio
#

ok i try both

#

wait wait

lusty quest
#

also yea GoogleFeud is right

tired panther
#

Imagine using DIscord as your bot database lol

earnest phoenix
#

what

tired panther
#

jk, but its possible

lusty quest
#

use a text channel as database 1galaxybrain

small tangle
#

@slender thistle i sent a request to the discord dev support, i can let you know about a answer if youre interested peepoHappy

indigo folio
#

bro..... it workie........

lusty quest
#

and you said its a Tim level of issue

indigo folio
#

thank you @lusty quest and @cinder patio

#

u guys have been removed from my global hitlist

lusty quest
indigo folio
#

o fuck

#

well its ok you've already been removed

barren solstice
#

after 2 hrs i fixed the purge command

lusty quest
#

could be worse

barren solstice
#

yea

lusty quest
#

like writing a Scraper for 3 hours and then noticing that they got a API

barren solstice
#

XD

amber quiver
#

@near stratus for some reason my code just duplicates the embed message

barren solstice
#

have you done that before?

lusty quest
#

yes

barren solstice
#

bruh

amber quiver
#

And your code too (they are the same code so it doesnt really matter )

amber quiver
barren solstice
#

i fixed it

amber quiver
#

I'll send

lusty quest
#

did you have 2 instances of the bot Running?

barren solstice
#
const client = new Discord.Client();

module.exports = {
    name: 'purge',
    discription: 'discription',
    execute(message, args) {
        if (args[0] == 'help') {
            const testembed = new Discord.MessageEmbed()
                .setColor('RANDOM')
                .setTitle('Purge command.')
                .setThumbnail('')
                .addFields(
                    { name: 'Purge Command", "Usage: `*clear` <amount>' },
                )
                .setTimestamp();
            message.author.send(testembed);
        }

        message.delete();

        if (!message.member.hasPermission('MANAGE_MESSAGES'))
        {return message.reply('You don\'t have premssions to do that!');}
        if (!args[0])
        {return message.channel.send(
            'Please enter a number of messages to clear! `Usage: .clear {amount}`',
        );}
        const deleteNum = parseInt(args[0]);
        if (isNaN(deleteNum)) return message.reply('that is not a number');
        message.channel.bulkDelete(deleteNum).then(() => {
            if (message.member.hasPermission('MANAGE_MESSAGES')) {
                const emb = new Discord.MessageEmbed()
                    .setColor('#FF5800')
                    .setTitle('succesful command')
                    .addField('**The messages got successfully deleted!**', `**__${args[0]}__** got deleted...`);
                message.channel.send(emb)
                    .then(msg => {
                        msg.delete({ timeout: 5000 });
                    }).catch(console.log);
            }
        });
    },
};```
#

this my code

amber quiver
#
client.on("message", message => {
     if (message.content === `${prefix}clear`) {
        if (!message.member.hasPermission("MANAGE_MESSAGES")) {
          var embedMessageError = new Discord.MessageEmbed()
         .setColor('#FF0000')
         .setTitle('ERROR')
         .addField('OOPS', 'It\'s look like you have no permission to do that!')
         message.channel.send(embedMessageError)
         .then(msg => {
       msg.delete({ timeout: 5000 })
      }).catch(console.log)
   }
      if (message.member.hasPermission("MANAGE_MESSAGES")) {
        message.channel.bulkDelete(20)
         .then(message => {
          var embedMessagesuccesful = new Discord.MessageEmbed()
           .setColor('#FF5800')
           .setTitle('succesful command')
           .addField('Messages Cleared!', 'The messages got deleted!')
             message.channel.send(embedMessagesuccesful)
             .then(msg => {
             msg.delete({ timeout: 5000 })
                }).catch(console.log)
         })

        }
     }
  })```
barren solstice
#

kinda the same

amber quiver
#

super weird

lusty quest
amber quiver
lusty quest
#

are you sure? bcs its quite a common issue for this

barren solstice
#

do u use Git command line?

livid sentinel
#

Does anybody know if it is possible to log in as a bot user on topgg (authenticate the oauth2 with a bot account)

barren solstice
#

idk

amber quiver
#

but this specific command is not

#

@lusty quest

lusty quest
#

also why 2 checks for permissions? i would just use an else if statement

#

if Permission is aviable execute otherwise throw error

amber quiver
#

I can put else and then if

#

I tried

lusty quest
#

well then the issue is somewhere else

amber quiver
#

else with if

#

but not only else

lusty quest
#

does the bot got permissions for it?

amber quiver
#

I need to check it

livid sentinel
#

You could just return after your first check

amber quiver
#
const Discord = require('discord.js');
const client = new Discord.Client();

const prefix = 'a^';

client.once('ready', () => {
    console.log('Ready!');
});

client.on('message', message => {
  client.user.setActivity("some people", {
    type: "WATCHING",
  });
})

client.on("message", message => {
     if (message.content === `${prefix}clear`) {
        if (!message.member.hasPermission("MANAGE_MESSAGES")) {
          var embedMessageError = new Discord.MessageEmbed()
         .setColor('#FF0000')
         .setTitle('ERROR')
         .addField('OOPS', 'It\'s look like you have no permission to do that!')
         message.channel.send(embedMessageError)
         .then(msg => {
       msg.delete({ timeout: 5000 })
      }).catch(console.log)
   }
      if (message.member.hasPermission("MANAGE_MESSAGES")) {
        message.channel.bulkDelete(20)
         .then(message => {
          var embedMessagesuccesful = new Discord.MessageEmbed()
           .setColor('#FF5800')
           .setTitle('succesful command')
           .addField('Messages Cleared!', 'The messages got deleted!')
             message.channel.send(embedMessagesuccesful)
             .then(msg => {
             msg.delete({ timeout: 5000 })
                }).catch(console.log)
         })

        }
     }
  })``` the whole code except of the client.login
lusty quest
#

did you get any error?

amber quiver
#

I think

lusty quest
#

also DONT make a message event listener for every thing you do

cinder patio
#

why are you setting activity in the message listener

lusty quest
#

also you will spam the API with your code

amber quiver
lusty quest
#

your channel is not defined

amber quiver
#

I just removed it

#

U knew something wrong with the message listener and the activity

amber quiver
lusty quest
#

in this one command on this spezific position its not defined

#

also the way you do it wont work bcs the message is deleted so you cant reference it

#

await the delete stuff then send the message

amber quiver
lusty quest
#

but dont use .then in this case

amber quiver
#

but I want the message to self delete

amber quiver
lusty quest
#

bcs you get not the message you want from the bulk delete

quartz kindle
#

why this ```js
client.on('message', message => {
client.user.setActivity("some people", {
type: "WATCHING",
});
})

quartz kindle
#

lul

lusty quest
#

also did you make a client.on("message") event for each command?

amber quiver
#

Cannot read property 'setActivity' of null and this is whats happened

#

but I dont care

amber quiver
#

I just wanna know why my embeds got duplicated

lusty quest
#

did you have the snippet twice in your code?

amber quiver
small tangle
#

try delete all of the second .then

amber quiver
#

ok

#

WHAT SECOND THEN

small tangle
#

message.channel.send(embedMessagesuccesful) should be the alst thing in the if case

amber quiver
#

i HAVE ONE

quartz kindle
#

bulkDelete returns a collection of deleted messages

small tangle
#
  1. bulkdelete.THEN 2) message.channel.send.THEN
quartz kindle
#

if you do bulkDelete.then(message => {}) <--- this message is not a message, its a collection

small tangle
#

or yeah or thats the problem

amber quiver
# small tangle 1) bulkdelete.**THEN** 2) message.channel.send.**THEN**
client.on("message", message => {
     if (message.content === `${prefix}clear`) {
        if (!message.member.hasPermission("MANAGE_MESSAGES")) {
          var embedMessageError = new Discord.MessageEmbed()
         .setColor('#FF0000')
         .setTitle('ERROR')
         .addField('OOPS', 'It\'s look like you have no permission to do that!')
         message.channel.send(embedMessageError)
         .then(msg => {
       msg.delete({ timeout: 5000 })
      }).catch(console.log)
   }
      if (message.member.hasPermission("MANAGE_MESSAGES")) {
        message.channel.bulkDelete(20)
          var embedMessagesuccesful = new Discord.MessageEmbed()
           .setColor('#FF5800')
           .setTitle('succesful command')
           .addField('Messages Cleared!', 'The messages got deleted!')
           message.channel.send(embedMessagesuccesful)
             .then(msg => {
             msg.delete({ timeout: 5000 })
            }).catch(console.log)
        }
     }
  })
#

where

small tangle
#

okay it this dont work?

#

because now your not using mesage of bulkdelete

amber quiver
#

no and where is the second then

#

??

#

its working

#

but

lusty quest
#

also did you get twice the same message or 2 different messages?

amber quiver
#

its duplicates the embed

quartz kindle
#

what embed

amber quiver
#

embed message

cinder patio
#

Why are you using sendMessage?

quartz kindle
#

which one

cinder patio
#

That's no longer a thing

amber quiver
#

coz send didnt worked

#

for me

quartz kindle
#

whats your discord.js version?

cinder patio
#

You're using both send and sendMessage though

amber quiver
quartz kindle
#

sendMessage was removed in 12

small tangle
#

wait is the second permission check inside the message content check?

quartz kindle
#

yes, its just the indentation thats bad

amber quiver
#

Its the IDE mistake

#

which is weird

#

coz Im using v12

lusty quest
#

update your linter and the other stuff

amber quiver
quartz kindle
#

v12 completely removed sendMessage tho, the IDE should not be picking it up

small tangle
#

But which embed is duplicated, error or success?

quartz kindle
#

which version are you actually using?

quartz kindle
#

full version

amber quiver
#

for some reason

quartz kindle
#

do npm ls

amber quiver
#

w8

#

lemme check

quartz kindle
#

or check your package.json

lusty quest
#

its possible that he uses some older version for discord.js snippets and auto completion that still uses V11

amber quiver
#
  "dependencies": {
    "discord.js": "^12.5.1"
  }
}
#

here

quartz kindle
#

weird

amber quiver
#

the IDE fixed that to sendMessage

quartz kindle
#

do you use sendMessage anywhere else? or only there?

amber quiver
#

no

#

I dont use sendMessage

#

its the stupid VS code

quartz kindle
#

¯_(ツ)_/¯

small tangle
#

whats actually the problem right now?

amber quiver
#

Should I make another content check with the true permission check in it?

amber quiver
small tangle
#

you can just do

if (contentCheck) {
  if (!permissionCheck) {
    errorEmbed
  } else {
    successEmbed
  }
}
amber quiver
#

so thats why else didnt work

#

I DIDNT TRIED ELSE ALONE

#

i TRIED HIM WITH IF

#

SO THATS PROBABLY THE PROBLEM

#

wth

#

Im on caps

distant bramble
#

mmmm

amber quiver
#

I'll try the only else method

#

lemme check it

small tangle
#
client.on("message", message => {
     if (message.content === `${prefix}clear`) {
        if (!message.member.hasPermission("MANAGE_MESSAGES")) {
          var embedMessageError = new Discord.MessageEmbed()
               .setColor('#FF0000')
               .setTitle('ERROR')
               .addField('OOPS', 'It\'s look like you have no permission to do that!')

          message.channel.send(embedMessageError)
         }
          else  {
              message.channel.bulkDelete(20)

              var embedMessagesuccesful = new Discord.MessageEmbed()
                   .setColor('#FF5800')
                   .setTitle('succesful command')
                   .addField('Messages Cleared!', 'The messages got deleted!')

             message.channel.send(embedMessagesuccesful)
        }
     }
  })
#

try this

amber quiver
#

now its not duplicating but it also not deleting

cinder patio
#

Also you should use let / const instead of var

amber quiver
#

wth

#

w8

amber quiver
#

and thats why it got duped

#

for the first time

cinder patio
#

Do you save your code?

small tangle
#

does the bot has manage messages perms?

amber quiver
amber quiver
small tangle
#

Are the messages older than 2 weeks?

amber quiver
#
    if (message.content === `${prefix}clear`) {
       if (!message.member.hasPermission("MANAGE_MESSAGES")) {
         const embedMessageError = new Discord.MessageEmbed()
              .setColor('#FF0000')
              .setTitle('ERROR')
              .addField('OOPS', 'It\'s look like you have no permission to do that!')

         message.channel.send(embedMessageError)
        }
         else  {
             message.channel.bulkDelete(20)

             const embedMessagesuccesful = new Discord.MessageEmbed()
                  .setColor('#FF5800')
                  .setTitle('succesful command')
                  .addField('Messages Cleared!', 'The messages got deleted!')

            message.channel.send(embedMessagesuccesful)
       }
    }
 })
cinder patio
amber quiver
#

I mean

#

it wrote me

#

'const' is not a valid token

#

or something

#

so I replaced const

#

with let

#

and it wrote the same thing

cinder patio
#

Yeah, because you didn't have the code blocks {} at that time

amber quiver
#

so I switched to var

amber quiver
#

that was after you told me to

cinder patio
#

Then it cannot give you that error unless you screwed up in some way. Anyways, screenshot your task bar

amber quiver
#

I used {} in the if statment permission check before you told me but I saw that you can use it withou the {} so I removed them

barren solstice
#

?

amber quiver
#

but now Im using them

amber quiver
#

@small tangle your code didnt worked for me so Im switching back to mine

small tangle
#

Any errors?

amber quiver
#

lol somehow its delete the message with out the .then and the timeout

small tangle
#

How old are the messages its trying to delete?

amber quiver
#

1h old I think

#

not 2 weeks

#

w8 brb in 5 minutes I think I have an Idea

small tangle
#

U made me building a js bot god damnit LuL

#

it works now

#
client.on("message", message => {
    if (message.content === `${prefix}clear`) {
        if (!message.member.hasPermission("MANAGE_MESSAGES")) {
            var embedMessageError = new Discord.MessageEmbed()
                .setColor('#FF0000')
                .setTitle('ERROR')
                .addField('OOPS', 'It\'s look like you have no permission to do that!')

            message.channel.send(embedMessageError)
        }
        else  {
            message.channel.bulkDelete(20)
                .then(() => {
                    var embedMessagesuccesful = new Discord.MessageEmbed()
                        .setColor('#FF5800')
                        .setTitle('succesful command')
                        .addField('Messages Cleared!', 'The messages got deleted!')

                    message.channel.send(embedMessagesuccesful)
                })
        }
    }
})
#

u have to do () => in the bulkdelete callback

#

not 100% sure, but i guess when youre doing message => {} youre not make a reference to the original message, therefore the program cant read the property channel

lusty quest
#

told him this a while ago

small tangle
#

yeah this works

lusty quest
#

suggested to await the delete and then just send the message without using .then

small tangle
#

but i mean it was 1 min googling for me... so you could do that yourself the next time peepoHappy

barren solstice
#

are you all still on the purge command?

small tangle
#

jep

amber quiver
#

I need to try this

amber quiver
small tangle
#

it works i tried it by myself

amber quiver
#

thank you

barren solstice
#

ive already solved it

amber quiver
#

so much

amber quiver
barren solstice
#

?

small tangle
#

damn i saw your message now mythical, why are we still here LUL

amber quiver
small tangle
#

its exactly the same

lusty quest
amber quiver
amber quiver
#

and test it and then remove it

small tangle
#

But my Bot is written in Java

amber quiver
#

ohh

#

Im programming in Java but I never programmed a java bot before

#

If you are programming in java, how did you know the write script for the bulk delete in JS

#

?

small tangle
#

1 Min of googling / my first bot was in JS

amber quiver
small tangle
#

literally the first entry

amber quiver
#

And I entered to the "How does bulkDelete" work?

#

Im feeling stupid that I know how to code but I cant solve one stupid bulkDelete command

small tangle
#

i mean if you dont find something that way, just look https://discord.js.org/#/docs/main/stable/general/welcome up

small tangle
amber quiver
#

and btw, I didnt use mythical's command coz I dont want to. I want my command but fixed. Dont ask me why, I just this type of person. I hate to look for help and if when Im looking for some help, Im getting mad if someone not helping me in the way I want to.

amber quiver
small tangle
#

but how, there is exactly one example at the bottom in the docs

amber quiver
#

https://discord.js.org/#/docs/main/stable/general/welcome and this is my third one after youtube

amber quiver
#

but then I wanted to add embeds and then the fun began

small tangle
#

but when you read closer, u see it returns a collection of the deleted messages

#

not the message of the message event

amber quiver
#

so many errors and rages about one stupid script

small tangle
#

that was the problem, because of the compiler said u cant read send of undefined

amber quiver
amber quiver
small tangle
#

happens LuL

#

just pay more attention in the future and youre fine

amber quiver
#

but for something so silly actually

earnest phoenix
#

someone have a script for welcome msg but in dm pls ??

amber quiver
amber quiver
#

I have one

small tangle
amber quiver
#

I'll DM you but I need to go to eat

#

brb

earnest phoenix
#

rainning its possible you send me pls ?

amber quiver
#

but I need to eat

#

so

#

plz w8

earnest phoenix
#

owoomg ty

#

in dm ?

amber quiver
amber quiver
earnest phoenix
#

🙏 thx

amber quiver
#

np

#

brb

small tangle
quartz kindle
#

So the problem was basically what i said an hour ago lmao

small tangle
#

Shrug happens xD

earnest phoenix
#

How can i get the id of a animated emoji without nitro?

small tangle
#

\ before emoji

earnest phoenix
#

Wait how? I dont have a nitro

#

I already know that

small tangle
#
\:peepoHappy: 
#

for example

restive furnace
#

you need to ctrl + shift + i and fetch the message content in the console

small tangle
#

oops you mean codewise?

earnest phoenix
#

Im on mobile

analog imp
earnest phoenix
#

Oh nvm got it i saw a method

small tangle
#

general like i said with backslash

outer perch
#

it's seems it can't be as devDep only

lusty quest
#

can someone tell me why this is again so annoying to do.
i have a object ```js
{
whitelisted_roles: [],
whitelisted_channels: [],
_id: 12,
guildID: '1',
prefix: '!',
kick_threshold: 5,
ban_threshold: 10,
threshold: 0.95,
__v: 10,
setup: true
}

got the object copy/paste above from console.logging the object to make sure it exist.
small tangle
#

i mean if its works for ban it should works for kick too, typo?

#

whats the code snippet?

lusty quest
#

there is no much snipped its just console.log(Object.kick_threshold)

#

also i dont think its a typo, ive copy/pasted it also from the object into the console.log

small tangle
#

so Object.ban... returns the correct int, but Object.kick.. throws an error?

lusty quest
#

kick returns undefined

small tangle
#

and u define the object like you posted?

lusty quest
#

yes, this is what i get when i just console.log(object)

small tangle
#

doesnt makes any sense LuL

lusty quest
#

i know

#

funny enough the same code worked 3 months ago just fine

small tangle
#

so its say the object is undefined or the property?

amber quiver
#

it can be

#

@lusty quest w8 you can ban?

small tangle
#

can u just post the 3 lines

lusty quest
amber quiver
#

if you can ban so you should kick

#

too

small tangle
#

no thats not the case

amber quiver
#

oh

lusty quest
#

i have some weird issues with reading stuff from a object

small tangle
#

it have nothing to do with the perms, its just accessing a property of an object

amber quiver
#

Can you send the full script?

small tangle
#

yes pls

lusty quest
#

console.log(object)-> returns the object like in the snippet
console.log(object. ban_threshold) -> returns 10
console.log(object. kick_threshold) -> returns undefined

small tangle
#

saved your file?

lusty quest
#

yes

amber quiver
#

I have no idea

lusty quest
#

but i cant get the kick value

small tangle
#

nope no idea, that shouldnt happen

#

are you manipulating somehow the object anywhere else?

lyric mountain
amber quiver
#

you should check in google. believe me.... you wanna stuck with wrong code for 2 days?

lusty quest
#

the object is a const and read only

amber quiver
#

like me

lusty quest
#

the code worked 3 months ago, and i havent changed this part

amber quiver
#

w8 no

#

its only works with channels and bots

#

I think

lyric mountain
#

channels, bots, users, guilds

#

except emotes

amber quiver
#

yes

#

its weird

#

they should include emojies

#

too

small tangle
#

sure, that the undefined means something else?

#

whats the console?

lusty quest
#

undefined

small tangle
#

sreenshot the printout

#

just those 3 printouts?

lusty quest
small tangle
#

whats surronded?

umbral zealot
#

Someone loves to get help through teardrop information

lusty quest
#

stuff that doesnt interact with it directly

umbral zealot
#

Why not just post your whole code so people can actually see

small tangle
#

man it would be a lot easier if you just post the code

lusty quest
#

bcs its not really an issue with the code, its just an issue with reading a object

umbral zealot
#

Post the code, bot a screenshot of the code.

#

If you knew what the issue was you wouldn't be here asking for help

small tangle
#

it have to be a issue with the code ortherwise it would work

lusty quest
#

would be a pain in the ass to remove the confident stuff

amber quiver
#

@small tangle brw your code that U send me for the embed message didnt work. Its not deleting messages

outer perch
amber quiver
#

and the messages are not 2 weeks old

umbral zealot
#

If this is confidential then maybe you should ask for internal help then?

#

People be like "but I need this to get paid" and we're like "fine but we don't, kthxbai!"

small tangle
amber quiver
outer perch
#

TS7016: Could not find a declaration file for module 'node-schedule'. '/app/node_modules/node-schedule/lib/schedule.js' implicitly has an 'any' type. this error wasn't happening in local

small tangle
#

perms?

amber quiver
#

w8

#

lemme

#

CHECK

earnest phoenix
#

@strong seal

near stratus
restive furnace
amber quiver
small tangle
#

@lusty quest and u could think about an .env file for secrets

amber quiver
#

sirTimmie

#

timme

#

helped me

small tangle
#

hm?

outer perch
amber quiver
#

I needto check the perms

#

w8

lusty quest
near stratus
outer perch
#

can

small tangle
outer perch
#

but I uploaded my bot as it's in local

#

and in heroku doesn't just work

restive furnace
outer perch
#

but I have everything working in local

small tangle
#

u asked for help, i try to, but i cant, when you dont show me anything

near stratus
amber quiver
#

@small tangle me and the bot got all the perms

small tangle
#

and is there an error?

amber quiver
restive furnace
near stratus
outer perch
#

dw

#

I got it

small tangle
#

@amber quiver whats your current code?

amber quiver
small tangle
#

1 : 1?

amber quiver
#

yep

small tangle
#

sends he the embed?

amber quiver
amber quiver
#

the bot have administrator so it should work and Im the owner

#

so...

small tangle
#

ur bot should never have admin perms, but thats another topic LUL are there any messages left in the channel?

lusty quest
#

found the issue, for some reason it where Mongoose not any other part of the code.

small tangle
#

what? LULW

amber quiver
#

look

#

ah yes, I wanna die

small tangle
#

and no console error?

amber quiver
#

nope

#

but it doesnt matter

small tangle
#

only have one message event listener?

amber quiver
small tangle
#

can u send the full script

amber quiver
#

yep

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

const prefix = 'a^';

client.once('ready', () => {
    console.log('Ready!');
});

  client.user.setActivity("some people", {
    type: "WATCHING",
  });


  client.on("message", message => {
    if (message.content === `${prefix}clear`) {
        if (!message.member.hasPermission("MANAGE_MESSAGES")) {
            var embedMessageError = new Discord.MessageEmbed()
                .setColor('#FF0000')
                .setTitle('ERROR')
                .addField('OOPS', 'It\'s look like you have no permission to do that!')

            message.channel.send(embedMessageError)
        }
        else  {
            message.channel.bulkDelete(20)
                .then(() => {
                    var embedMessagesuccesful = new Discord.MessageEmbed()
                        .setColor('#FF5800')
                        .setTitle('succesful command')
                        .addField('Messages Cleared!', 'The messages got deleted!')

                    message.channel.send(embedMessagesuccesful)
                })
        }
    }
})``` this all the things that you need to check
#

this is not all the bot's code...

small tangle
#

does message.content === 'a!clear' works?

amber quiver
#

a^*

restive furnace
# amber quiver this is not all the bot's code...

Two ways of getting help:
The Hard Way: Ask question with providing just 1-4 lines of code and get partial help.
The Easy Way: Provide the full program/class and get help to your specific problem.

amber quiver
#

and yes

#

but it doesnt clear anything

outer perch
#

UnhandledPromiseRejectionWarning: Error: 504 Gateway Time-out when posting to DBL my server count

small tangle
outer perch
#

so it's supposed to happen until they fix?

amber quiver
amber quiver
small tangle
#

i used exactly that code and it worked for me

outer perch
#

should I remove that from the code? or leave this error like this? xD

amber quiver
small tangle
#

the bot works with message.content === 'a^clear' ?

amber quiver
#

I cant clear but the message is shown

#

and then deletes itself

small tangle
#

the embed is shown?

amber quiver
#

yep

#

its or the clear command or the embed

#

I cant both lol

#

stupid thing

small tangle
#

i guess i know the problem

#

its your cache

#

alt f4 your discord

#

and restart it

amber quiver
#

ok

pale vessel
#

or just ctrl r

amber quiver
#

ohhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh

small tangle
#

or that

lyric mountain
#

ctrl + F5

amber quiver
#

I know wdym

umbral zealot
# amber quiver

This error... Might be just crashing your bot, mate. Like it's not running.

#

All this time you just weren't restarting? Omg.

amber quiver
#

its happened to me with the bot status........ I knew something wrong

#

but

#

its not working at all

umbral zealot
#

Remove that setActivity that's crashing your bot.

small tangle
#

yes

umbral zealot
#

Or put it in the ready event where it belongs.

small tangle
#

comment it out for now

amber quiver
#

maybe thats the problem

umbral zealot
#

Probably.

amber quiver
#

its working!

#

thank you!

#

finally

#

two days of research!!

small tangle
#

or just do

client.on('ready' () => {
  //set activity
}
amber quiver
#

You did it

small tangle
#

its an error, what do u exspect xD

small tangle
#

u should never ignore errors

umbral zealot
small tangle
#

oh

amber quiver
#

client.once

#

?

small tangle
#

i mean you should do it in the ready event iirc

#

but its been a while

amber quiver
#

I'll do it in the ready event

pale vessel
small tangle
#
bot.on("ready", () => {
  bot.user.setActivity("Type !help");
})
#

oke you dont pass any args in the callback

pale vessel
#

If you have a static status just use new Client({ presence: { activity: { name: "!help", type: "PLAYING" } } });

amber quiver
#

its working

#

perfectly

pale vessel
#

don't use .once()

amber quiver
#

@small tangle I just need to add .catch for the bot coz I dont want the bot to shut down when he gets errors and I need to add timeout for the message

#

I even didnt get the code wrong

#

its only because the setActivity

umbral zealot
#

You need to learn how to catch errors, yes.

#

But that error was a syntax error that would be fixed by understanding the error itself. the code was wrong

amber quiver
#

I knew something here is off coz in my previous bot, I used this code (of the bulkDelete and the embeds) and it worked!

#

everything happened because the setActivity

umbral zealot
old cliff
#

yes

amber quiver
old cliff
#

@amber quiver put setActivity code inside once ready

#

then try again

amber quiver
#

I did

#

...

#

read the previous messages

old cliff
#

check the docs...

amber quiver
#

But everything works

old cliff
#

you are doing it incorrectly

#

if it crashes

unborn venture
#

Fontconfig error: Cannot load default config file

#

why?

old cliff
#

code ?

small tangle
unborn venture
#

I get this error and it doesn't start like that

umbral zealot
small tangle
#

then provide more informations

restive furnace
crimson vapor
#

.once only fires once

amber quiver
#

@umbral zealot I should learn again JS but now more properly....

umbral zealot
small tangle
#

questions over questions

unborn venture
#

javascript

#

1 sec

old cliff
#

ok more ?

restive furnace
small tangle
#

@amber quiver so youre good?

amber quiver
#

for now...

small tangle
#

finally LuL

pale vessel
unborn venture
amber quiver
#

lol

umbral zealot
old cliff
umbral zealot
#

what the hell is fontConfig? where does it come from?

unborn venture
#

and wtf bot does not start

old cliff
#

check the path

umbral zealot
#

what are you trying to do?

old cliff
#

send code first

amber quiver
#

I'll blame the setActivity from now on

umbral zealot
outer perch
amber quiver
#

I know that not everything is because of this

#

I was joking.... r/whoooosh moment lol

outer perch
old cliff
#

this is dev channel

#

not the #yeet channel

unborn venture
old cliff
#

show code @unborn venture

small tangle
old cliff
#

do you even know what you are coding ?

unborn venture
#

what code where

old cliff
#

what are you even trying to do ?

unborn venture
#

until now it suddenly stopped

old cliff
#

what stopped ?

unborn venture
#

yes

small tangle
#

? LULW

old cliff
#

show code of the bot

unborn venture
#

index?

old cliff
#

yes

unborn venture
#
const Discord = require('discord.js');
const config = require("./config.json");
const Enmap = require("enmap");
const get = require("get");
const client = new Discord.Client();
const db = require('quick.db');
const fs = require('fs');


client.config = config;

fs.readdir("./events/", (err, files) => {
    if (err) return console.error(err);
    files.forEach(file => {
      const event = require(`./events/${file}`);
      let eventName = file.split(".")[0];
      client.on(eventName, event.bind(null, client));
    });
});


client.commands = new Enmap();


fs.readdir("./commands/info/", (err, files) => {
  if (err) return console.error(err);
  files.forEach(file => {
    if (!file.endsWith(".js")) return;
    let props = require(`./commands/info/${file}`);
    let commandName = file.split(".")[0];
    console.log(`Attempting to load command ${commandName}`);
    client.commands.set(commandName, props);
  });
});


client.login(config.token);

misty sigil
#

enmap to store commands is a bit weird

earnest phoenix
#

^

misty sigil
#

you can just use Discord.Collection()

#

Enmap is a bit like a database if you think about it

small tangle
#

and what exactly is now the error?

misty sigil
#

You don’t want to store commands on disk and on memory

old cliff
quartz kindle
#

you cant really store commands on disk like that anyway

#

they will be serialized to strings, which will lose references and such

unborn venture
#

mhm

quartz kindle
#

the fontconfig error is from canvas, do you use canvas?

umbral zealot
#

are you sure you don't have a super old version of nodejs, also?

quartz kindle
#

show your current line 3 in index.js

umbral zealot
misty sigil
#

yea I do remember seeing a tutorial like that

quartz kindle
#

imagine a world where tutorials didnt exist :^)

small tangle
#

I like to have a visual entry point, but im often modifying it overtime when my understanding is better

quartz kindle
#

ik im just kidding, i also started like that

unborn venture
small tangle
#

and im definitly not a pro or exspect, maybe a better noob LuL

quartz kindle
blissful coral
#

canvas not convas

#

Right?

crimson vapor
#

lol yea

small tangle
#

i mean convas is a npm module

unborn venture
#

yes

quartz kindle
crimson vapor
#

wut

quartz kindle
#

lmao

tender gyro
#

Can someone help me

blissful coral
#

Oh lmao

#

Anyone know how to fix this

unborn venture
#
  "name": "kolax",
  "version": "1.0.0",
  "description": "kolax",
  "main": "index.js",
  "scripts": {
    "test": "$"
  },
  "repository": {
    "type": "git",
    "url": "git"
  },
  "keywords": [
    "$"
  ],
  "author": "Blast & OlteanuAdv",
  "license": "ISC",
  "dependencies": {
    "array-sort": "^1.0.0",
    "axios": "^0.21.1",
    "canvacord": "^5.0.8",
    "chalk": "^4.1.0",
    "convas": "^2.0.0",
    "date-and-time": "^0.14.2",
    "discord-akairo": "^8.1.0",
    "discord-anti-spam": "^2.4.1",
    "discord-giveaways": "^4.3.0",
    "discord-image-generation": "^1.4.5",
    "discord.js": "^12.5.1",
    "discord.js-commando": "^0.10.0",
    "emoji": "^0.3.2",
    "emoji-regex": "^9.2.0",
    "enmap": "^5.8.2",
    "express": "^4.17.1",
    "figlet": "^1.5.0",
    "fivem": "^2.1.5",
    "get": "^1.4.0",
    "hastebin": "^0.2.1",
    "imdb-api": "^4.4.1",
    "index.js": "0.0.3",
    "isgd": "^1.1.3",
    "map": "^1.0.1",
    "moment": "^2.29.1",
    "node-emoji": "^1.10.0",
    "node-opus": "^0.3.3",
    "node-osu": "^2.2.0",
    "node-superfetch": "^0.1.10",
    "novelcovid": "^3.0.0",
    "parse-ms": "^2.1.0",
    "quick.db": "^7.1.3",
    "quick.hook": "^1.5.1",
    "random-puppy": "^1.1.0",
    "relevant-urban": "^2.0.0",
    "request": "^2.88.2",
    "samp-query": "^0.1.5",
    "simple-youtube-api": "^5.2.1",
    "slot-machine": "^2.1.0",
    "snekfetch": "^4.0.4",
    "snowflake-api": "^2.0.0",
    "table": "^6.0.4",
    "to-zalgo": "^1.0.1",
    "twemoji-parser": "^13.0.0",
    "ytdl-core": "^4.4.1"
  }
}
tender gyro
#

Need help adding Oreo to my server

blissful coral
#

I tried all night to fix it

tender gyro
#

Need help adding Oreo to my server

unborn venture
#

pachage

blissful coral
#

Ask in there support server

tender gyro
#

Oh ok

quartz kindle
#

yikes

#

so many unused packages

unborn venture
#

yes

quartz kindle
# blissful coral

that usually happens if there is a problem in a config file. does mongo have any command to test the config file like nginx does?

unborn venture
#

the message does not appear to start the bot and I did not change it, that is, it was working

quartz kindle
#

@unborn venture that error likely happened because you tried to store commands in enmap

blissful coral
tardy hornet
#
    case 'leaderboard':

                    var allMoneys = message.guild.members.cache.map(m => {
                        var cdmoney =   db.fetch(`cdmoney_${m.id}`)
                        var money =   db.fetch(`money_${m.id}`)
                        return {money: (cdmoney + money) , id: m.id, username: m.user.username}
                    })
                    allMoneys.sort((a,b) => a.money- b.money);
    
                    var str = "";
                    var id = 1;
    
                    allMoneys.forEach(a => {
                        if(id <= 10){
                        str += (`${id}. ${a.username} : ${a.money}$\n`)
                        }
                        id++;
                    })


                    console.log(str)
                    const leaderBoardEmbed = new discord.MessageEmbed()
                    .setTitle(`${message.guild.name} Leaderboard`)
                    .setDescription(str)
                    .setColor("BLUE")
                    message.channel.send(leaderBoardEmbed)
    
                    
    
                    break;

error:

DiscordAPIError: Invalid Form Body content: Must be 2000 or fewer in length.

it should show the top 10 users with the most money in the server that it was sent in.

blissful coral
#

Last time this happened I did ```
sudo chown -R mongodb:mongodb /var/lib/mongodb
sudo chown mongodb:mongodb /tmp/mongodb-27017.sock

sudo service mongod restart

warm stone
#

sa

quartz kindle
tardy hornet
#

nothing

#

its not printing it

#

@quartz kindle

quartz kindle
#

console.log(allMoneys)

tardy hornet
#

k 1s

#

didnt print it

quartz kindle
#

console.log(message.guild.members.cache)

tardy hornet
#

it does not console anything

#

maybe its because of the place i console it?

blissful coral
#

Do you have the guild member intents on? @tardy hornet

#

And make sure the ready event is before your doing this event

tardy hornet
#

i did

quartz kindle
#

where did you put the console?

lyric mountain
#

convas, clivas or canvas?

cinder patio
#

isn't it canvos??

drowsy epoch
#

lol

lilac oxide
#

Hello
Can someone help me to find a bot to create custom bets?

earnest phoenix
#

me

drowsy epoch
#

beats?

lilac oxide
#

bet*

drowsy epoch
#

bot?

earnest phoenix
#

xD

lilac oxide
#

I want create in my server one bet with some bot

#

Yes

tardy hornet
# quartz kindle where did you put the console?
case 'leaderboard':

                    var allMoneys = message.guild.members.cache.map(m => {
                        var cdmoney =   db.fetch(`cdmoney_${m.id}`)
                        var money =   db.fetch(`money_${m.id}`)
                        return {money: (cdmoney + money) , id: m.id, username: m.user.username}
                    })
                    allMoneys.sort((a,b) => a.money- b.money);
    
                    var str = "";
                    var id = 1;
    
                    allMoneys.forEach(a => {
                        if(id <= 10){
                        str += (`${id}. ${a.username} : ${a.money}$\n`)
                        }
                        id++;
                    })


                    console.log(str)
                    const leaderBoardEmbed = new discord.MessageEmbed()
                    .setTitle(`${message.guild.name} Leaderboard`)
                    .setDescription(str)
                    .setColor("BLUE")
                    message.channel.send(leaderBoardEmbed)
    
                    
    
                    break;

#

before the embed const

lilac oxide
#

Okay sorry

#

I´m so noob in this world of discord

#

x)

quartz kindle
earnest phoenix
#

I know this ?/

drowsy epoch
#

then coming here and asking for help

drowsy epoch
lilac oxide
drowsy epoch
#

discord.js is good

tardy hornet
#

it just does not show it in the code i sent

blazing sage
tardy hornet
#

nvm tim, i fixed it, ty

#

@quartz kindle

dusky sundial
toxic hearth
#

Hey to all bot devs, probably u know better than me where to host your bot? I mean, where is the best to take a VPS. Looking for a company with cheap prices but reliable with good latency.

quartz kindle
#

digital ocean, ovh, vultr, contabo, galaxygate, upcloud...

#

many options

pale vessel
#

is that a referral link

#

yikes

modest maple
#

all of what tim mentioned are good other than GG

pale vessel
#

ah yes, their support?

modest maple
#

from a professional setup seems very naively setup

earnest phoenix
modest maple
#

and the fact i had to argue the fact of why having to verify your email before you can pay an unlimited amount of money is a good idea vs just letting you sign up with an email that doesnt exist -_-

earnest phoenix
umbral zealot
short siren
#

Hey, I am using webhooks to send a simple message to a channel. http://discord.com/api/webhooks/id/token" I'm sending a post request to this link with a JSON body where i have just set the content property to "Hello". When I send it returns status 200 but the message does not get sent?

#
use std::collections::HashMap;

#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
    let mut embed = HashMap::new();
    embed.insert("content", "This is the default content");

    let client = reqwest::Client::new();
    let res = client.post("http://discord.com/api/webhooks/8122430/WnrBxcDwLP4cDz6rbgvfX")
        .json(&embed)
        .send()
        .await?;
    println!("{:#?}", res);
    Ok(())
}``` This is my code if it helps some of the ID and token are cut out.
river thistle
#

anyone knows why my link preview won't show up on discord ? I've already put the correct meta tags on my index.html file and I've enabled https

#
<head>
<title>Free Bobux</title>
<meta property="og:url" content="https://files.cstef.dev/">
<meta property="og:video" content="https://get-mp4.xyz/videos/rick-astley-never-gonna-give-you-up_362329.mp4">
<meta property="og:video:secure_url" content="https://get-mp4.xyz/videos/rick-astley-never-gonna-give-you-up_362329.mp4">
<meta property="og:video:width" content="896">
<meta property="og:video:height" content="504">
<meta property="og:video:type" content="video/mp4">
<meta property="og:type" content="video.other">
<meta property="og:image" content="https://storage.googleapis.com/afs-prod/media/fc8c2237710cfe8824163e6bfa0fd493/695.jpeg">
<meta name="twitter:domain" content="googleapis.com">
<meta name="twitter:card" content="player">
<meta name="twitter:image" content="https://storage.googleapis.com/afs-prod/media/fc8c2237710cfe8824163e6bfa0fd493/695.jpeg">
<meta name="twitter:player" content="https://get-mp4.xyz/videos/rick-astley-never-gonna-give-you-up_362329.mp4">
<meta name="twitter:player:width" content="896">
<meta name="twitter:player:height" content="504">
<meta name="twitter:player:stream" content="https://get-mp4.xyz/videos/rick-astley-never-gonna-give-you-up_362329.mp4">
<meta name="twitter:player:stream:content_type" content="video/mp4">
<meta property="title" content="Free Bobux">
</head>
honest perch
#

Probably cache

river thistle
#

guess I'll wait then

honest perch
#

Just do domain/?anythinghere

river thistle
#

imma try

snow urchin
river thistle
snow urchin
#

@river thistle send it to me in dm

river thistle
#

what do I have to send you

quartz kindle
snow urchin
#

Send a discord attachment through a post request

quartz kindle
#

why are you creating a write stream?

#

do you want to save the attachment as a file?

snow urchin
#

well its what peole have been suggesting, its confusing the shit out of me lol

quartz kindle
#

you dont need any of that

#

if request() returns a stream, you can pass it to formdata

#

data.append(bla, request(url))

#

is that the request library?

snow urchin
#

mhmm

quartz kindle
#

request is deprecated btw

cinder patio
#

Why are you using both request and axius

fair axle
#

How can I know who is inviter and what is the invite code when a player joins a server?

snow urchin
quartz kindle
#

just use axios for both

#

you can do streams with axios as well

snow urchin
quartz kindle
#

streams on axios are different

snow urchin
#

oh right, how do I need to do it?

quartz kindle
#

the stream is returned in response.data

#

so you have to ```js
let response = await axios({responseType:"stream"});
data.append(name, response.data)

snow urchin
quartz kindle
#

discord requires form-data files to have a filename property

#

you can give it as a string in the 3rd parameter

#

.append("file", stream, "file.png")

quartz kindle
#

oh wait thats not even discord lol

#

so idk, code 500 is server side error

#

but try the same thing, specify the file name in the 3rd parameter

quartz kindle
#

not directly

fair axle
#

I know but another ways?

#

I have a couple idea about that but I'm searching for best

quartz kindle
#

you need to fetch all invites

fair axle
#

and then?

quartz kindle
#

then when a user joins, you need to fetch all invites again

#

and see which invite got its count increased

fair axle
#

Thanks

earnest phoenix
quartz kindle
earnest phoenix
#

what?

#

what is that?

snow urchin
#

Getting this now

quartz kindle
#

ah yes

#

you need to set the form-data headers

#

i thought axios did this automatyticLLY

snow urchin
#

so would ...data.getHeaders() work

quartz kindle
#

{ headers: form.getHeaders() }

#

yes

snow urchin
#

very enthusiastic YES

quartz kindle
#

accidental caps

#

xd

snow urchin
#

🤞

quartz kindle
#

you can use CSS in your bot's detailed description to change the colors and design of your bot page, and change many other things

#

the option to force which theme your bot page uses requires you to use custom CSS

#

so that developers who use CSS to design a custom bot page dont get their page all broken if people use the wrong theme

#

if you dont need custom CSS, then top.gg forces you to let people choose which theme they want

main trench
#

Css is a gift

opal plank
#

code bots in css

misty sigil
#

you dont do that?

blissful coral
#

Anyone know how to fix this error

crimson vapor
#

bro

#

spammer

#

wtf

#

anyway

#

do that

blissful coral
#

Loading

crimson vapor
#

what does it do?

blissful coral
#

Send in a code block

#

Your ss isn’t loading my service is bad

crimson vapor
#
/usr/bin/mongod --config /etc/mongod.conf```
misty sigil
#

shite

#

youre too fast

blissful coral
#

Lul

rigid maple
#

Hello, I'm trying to make a sound stats system, but in this section (attached) it doesn't save to db

#

pls tag me

earnest phoenix
#

ticket?

rigid maple
#

@rigid maple

earnest phoenix
#

nice ticket

#

usually they're in paper form

rigid maple
#

I'm using translation :)

earnest phoenix
#

you're not running whatever voiceInit is

rigid maple
#

what I do ?

earnest phoenix
#

nice one

#

you learn javascript

#

bruh, does someone knows how to save a channel using quick.db or mega.db. its because i want to do a Welcomes system with a "set" command

crimson vapor
#

you save the ID and assuming you are caching all channels, you can just get the channel from cache on the guildMemberAdd event

earnest phoenix
#

ok

#

thanks you bro

#

Hi, I have made a google site, and I want to connect it to https://didi-web.tk can any1 help me link the two?

lyric mountain
#

define "made a google site"

earnest phoenix
earnest phoenix
lyric mountain
earnest phoenix
#

oh

#

so is it possible then??

lyric mountain
#

idk, maybe

earnest phoenix
#

dont i need to proove i own it?

lyric mountain
#

cloudflare would be an option if u had the ip, so it's a no

earnest phoenix
#

how can i?

lyric mountain
#

it's been ages since

earnest phoenix
#

it only accepts www.(something).com

#

and other endings

lyric mountain
#

about tokelau domains, doesn't freenom have its own redirection page?

earnest phoenix
#

like .co.uk and .us

earnest phoenix
#

im new to websites

#

i thought i could put my url in and its tehre

lyric mountain
#

I guess it's the other way around

#

just a sec

earnest phoenix
#

ok thanks

earnest phoenix
#

so i just put my google sites url in the destination?

quartz kindle
#

did you read this?

earnest phoenix
#

but I dont know how I can verify it

lyric mountain
#

do note that freenom domains have the reputation of being...sketchy