#development

1 messages ยท Page 575 of 1

amber fractal
#

Yeah

#

Thats the issue

#

it hurts

spring ember
#

@amber fractal with images padding doesn't work

#

Because the content here is not centered

amber fractal
#

I set the padding to 0px 0px and it actually worked tho

#

I just need to re make the image

keen drift
#

should just svg it

#

makes it whole a lot easier

amber fractal
#

Okay I guess now

#

not*

#

resizing it did nothing

#

resized it with photoshop and just in the image

#

I literally hate html and css

#

I thought it'd be easier for me

#

but nothing is making any sense

keen drift
#

๐Ÿ˜›

#

Framework is always an option if you don't want to make your own

#

Even if it's just an utility framework

amber fractal
#

I've done way too much to switch

#

I've been doing this since I got up this morning

#

I realize that doesnt sound like much

#

But for me using html

#

it's way too much

keen drift
#

takes time to get use to I suppose

amber fractal
#

I liteally made the picture the exact size of the other elements and it's still too small

#

and if I remove my css its too big

#
  padding: 0px 0px;
}``` but this is all the css is
#

Guess my nav bar isnt having a logo lmao

amber fractal
#

Those extra like 15 pixels

#

Now it works but the image is tiny and it wont let me resize it

compact mauve
#

How would we make a bot send a message in another channel when a command is used for discord.py? Like with a suggestion feature

#

If you have an answer, a ping with it would be appreciated as I have to sleep soon so I might only see it when I wake up

amber fractal
#

If its anything like d.js, it should be like this: Get the channel id, unless you have the channel object somehow, then get the channel object, then send

#

Wait wrong link

#

I think, I'm not a py user tho

#

@compact mauve

compact mauve
#

Oh thanks

unreal junco
#

how can i do a input thingy

#

if someone says "100"

#

and the bots generated number is 100

#

then the user wins

#

how can i do that?

#

i did generated

#

now i need to do input

formal agate
#

Was stuff like this redacted in discord.js because this seems to have broken. js let embed = new Discord.RichEmbed() .setColor(random.color) .addField("Field", value.value) .setFooter(`Made by some kool kid`)

#

UnhandledPromiseRejectionWarning: TypeError: Discord.RichEmbed is not a constructor

unreal junco
#

did u const it?

formal agate
#

yes

unreal junco
#

correctly?

formal agate
#

and did let

#

yes

unreal junco
#

show full script

formal agate
#

havn't changed it

unreal junco
#

if its too big do in haste bin

formal agate
#
let messageAuthorLvlEmbed = new Discord.RichEmbed()
            .setAuthor(message.author.username, message.author.displayAvatarURL)
            .setColor(setting.embedColor)
            .addField("Level", curlvl, true)
            .addField("Xp", curxp, true)
            .addField("Xp to next level up", diffrence, false)
            .setFooter(`User requested is: DEAD BEAT ${user}`);
        
        message.channel.send(messageAuthorLvlEmbed);```
#

i must be stupid

unreal junco
#

it has to do something with the const

#

i cant see anything

smoky spire
#

What version are you using

formal agate
#

latest

#

what ever it is

smoky spire
#

Master or stable?

formal agate
#

i just did npm i discord.js

unreal junco
#

this is my embed

#
let cEmbed = new Discord.RichEmbed()
        .setColor('#5780cd')
        .setAuthor(`Cute CATS!`, message.guild.iconURL)
        .setImage(body.file)
        .setTimestamp()
        .setFooter(`Requested by: ${message.author.username}`, message.author.displayAvatarURL )

        message.channel.send({embed: cEmbed})```
formal agate
#

"discord.js": "^11.4.2",

#

^ from package.json

unreal junco
#

do u have a command handler?

formal agate
#

yes

unreal junco
#

are u 100% sure ```js
const Discord = require("discord.js")

#

is done correctly

formal agate
#

yes

smoky spire
#

Try asking on the djs server

formal agate
#
const Discord = require("discord.js");```
#

^ copy and paste from my code

unreal junco
#

hmmm

#

i cant see anything

formal agate
#

im going nuts

#

and npm is feaking me out to

smoky spire
#

The djs server would know more

unreal junco
#

i want to know how to a args thingy xD

formal agate
#

really?

unreal junco
#

so if someone says 1 and the bots generated number is 1 then the user wins

#

im making a guess bot

formal agate
#
 const args = message.content.slice(prefix.find(p => message.content.startsWith(p)).length).trim().split(/ +/g);
    const cmd = args.shift().toLowerCase();

    //console.log(cmd);
    //console.log(args);

    let cmds = client.commands.get(cmd) || client.commands.get(client.aliases.get(cmd));

    if (cmds) {
      cmds.run(client, message, args, setting, prefix); //checks if command is real, runs said command if so
    }```
#

nice copy and paste found online

unreal junco
#

?

formal agate
#

that is a cmd handler

unreal junco
#

this is mine

#
  let prefix = botconfig.prefix;
    let messageArray = message.content.split(" ")
    let cmd = messageArray[0].toLowerCase();
    let args = messageArray.slice(1);```
formal agate
#

with args

#

....

unreal junco
#

?

formal agate
#

it works

unreal junco
#

yeah

#

but...

#

i'll show u

formal agate
#

has some limits

unreal junco
#
  let guessNum;
    let max = args;
    if(args == "")
    {
      guessNum = Math.floor(Math.random() * 1000) + 1;
      message.channel.send(`${emoji('guess')} **| Generating a new random number!**\nGuess the number between 1 and 1000!`)
      console.log(guessNum)
    }
    else
    {
      guessNum = Math.floor(Math.random() * args) +  1;
      if(isNaN(guessNum))
      {
        message.channel.send(`${message.author}, ${args} is not a valid number`).then(msg => msg.delete(2000));
      }
      else
      {
        message.channel.send(`${emoji('guess')} **| Generating a new random number!**\nGuess the number between 1 and ${max}`)
      }
    }



      if(args == guessNum)
      {
        message.channel.send(`${emoji('hypertada')}**| Hooray! ${author} has guessed the number ${guessNum}`)
      }

    function emoji(name) {return bot.emojis.find(emoji => emoji.name === name)

    }
}```
#

see

formal agate
#

omg

#

ok use my args

unreal junco
#

kk

formal agate
#

you will have to redo your args

#

like a crap ton

#

but it is broken up like such

unreal junco
#

wdym

formal agate
#

PREFIX()COMMAND arg1 arg2 arg3 arg4

unreal junco
#

?

formal agate
#

ok

#

ex

unreal junco
formal agate
#

yes

#
let prefix = [setting.prefix, `<@${client.user.id}> `, `<!@${client.user.id}> `, `<@${client.user.id}>`, `<!@${client.user.id}>`];

    if (!message.content.startsWith(prefix.find(p => message.content.startsWith(p)))) return;
    if (message.author.bot) return;```
#

simple

#

soooo much fun

unreal junco
#
    let prefix = botconfig.prefix;
#

thats mine

formal agate
#

idk why im helping

#

thats kool

#

then remove the prefix.find(p => message.content.startsWith(p))

unreal junco
#

ok

formal agate
#

and replace with preifx

#

args is like args[0] or args[1]

unreal junco
#

now it says create is a invalid number

#

its doing the else

#

how do i fix?

formal agate
#

???

unreal junco
#
  let guessNum;
    let max = args;
    if(args == "")
    {
      guessNum = Math.floor(Math.random() * 1000) + 1;
      message.channel.send(`${emoji('guess')} **| Generating a new random number!**\nGuess the number between 1 and 1000!`)
      console.log(guessNum)
    }
    else
    {
      guessNum = Math.floor(Math.random() * args) +  1;
      if(isNaN(guessNum))
      {
        message.channel.send(`${message.author}, ${args} is not a valid number`).then(msg => msg.delete(2000));
      }```
#

its doing the else

#

when i do -create

formal agate
#

you would replace args == "" with !args[0]

unreal junco
#

ok

formal agate
#

so on so forth

unreal junco
#

i did !args 1

#

!args[1]

#

cause 0 didnt work

formal agate
#

๐Ÿคฆ

unreal junco
#

?

formal agate
#

if(!args[0] || args[0] == "help")

#

would be if

#

. help

#

f

#

me

#

or

#

. help help

#

......

#

so many dms

unreal junco
#

oh

#

it wasnt working so i changed it back

earnest phoenix
#

how would i make something like this for music
|------โšซ-------------------------------|
i use lavalink

compact mauve
#

Ping with answer kthnx

ruby dust
#

You just send the message targeting the user object, it's that simple

compact mauve
#

o

#

that seemed too easy

#

lmao

earnest phoenix
#

How I set thumbnail in richembed in eris?

sick cloud
#

@earnest phoenix add thumbnail: { url: 'url here' } to the embed object

#

ie.

channel.createMessage({
    embed: {
        thumbnail: { url: 'some.site/image.png' },
        title: 'Image'
    }
});
quick matrix
#

Hello , I recently added Music feature in my bot but whenever I use the +play command the bot replying well , all things we select what song to play But the bot joins the voice channel for 3 seconds then the bot left it automatically

#

kindly ping me if you can help me out

flint trellis
#

why don't you try logging actions to console

#

so you can debug the issue

tender steppe
#

yeah

#

or just straight up use a debugger

quick matrix
#

Ok I will do it

earnest phoenix
#

my bot gives error to others

#

my bot gives error to others

#

hello ๐Ÿ˜ƒ I currently have a bot online and deployed, but i want to carry on developing on it whilst it is deployed. I can do this, but if i run a local version of my bot, ill get the responses from my deployed bot and my local version of the bot(which is inconvenient). Is the resolution to this to create a 'dev' version of my bot on discord? or do you guys go about it a different way

flint trellis
#

help vampire?

#

@earnest phoenix um you can make 2 instances and run one as a "test" environment and have on "master" environment

#

oh. make another bot profile

quick matrix
#

What is the eval command to make a bot join a voice channel ( Discord.js?)

#

I forget it

tender steppe
#

VoiceChannel.join()

flint trellis
tender steppe
#

yeah

earnest phoenix
#

my bot gives error to others (does not give myself error) HELP!

quick matrix
#

Example?

flint trellis
#

@earnest phoenix we cannot help you without an example

earnest phoenix
#

I can tailor the connection for you

#

@flint trellis

flint trellis
#

what

#

like what do you mean "my bot gives error to others"

earnest phoenix
#

My friends give me an error, but I don't.

quick matrix
#

Whats the proper command

#

It says voicechannel is not defined

earnest phoenix
#

They encounter 404 Found Error when they enter the site of my work @flint trellis

flint trellis
modern sable
#

@earnest phoenix
If you get an error while viewing a bot on discordbots.org:

404: the bot wasn't submitted/was deleted/doesnt exist
403: the bot has been submitted but still needs to be approved by moderators (only the owner can view the bot during that time)

sick cloud
#

@quick matrix did you define voicechannel

quick matrix
#

@sick cloud no

sick cloud
#

thats ur issue

quick matrix
#

Hmm

#

What's the command ...just tell me that

sick cloud
#

voicechannel.join

tender steppe
#

VoiceChannel.join()

quick matrix
#

Just type this?

tender steppe
#

where VoiceChannel is a voice channel

#

duh

quick matrix
#

๐Ÿ˜‚

#

Voice channel ID?

tender steppe
#

nope

sick cloud
#

get the voice channel

tender steppe
#

the voicechannel itself

quick matrix
#

K

earnest phoenix
#

How long will my website be approved?

coral trellis
earnest phoenix
#

website approved? wot

unreal junco
#
        if(message.content == gussNum){message.channel.send(`${emoji('hypertada')}**| Hooray! ${author} has guessed the number ${guessNum}`)}
#

it wont work

coral trellis
#

What error are you getting?

unreal junco
#

no error

#

the command wont work

#

well not command

#

ill show u the whole command

#

its inside module.exports.run thingy

#
let guessNum;
    let max = args;
    if(args == "")
    {
      guessNum = Math.floor(Math.random() * 1000) + 1;
      message.channel.send(`${emoji('guess')} **| Generating a new random number!**\nGuess the number between 1 and 1000!`)
      console.log(guessNum)
    }
    else
    {
      guessNum = Math.floor(Math.random() * args) +  1;
      if(isNaN(guessNum))
      {
        message.channel.send(`${message.author}, ${args} is not a valid number`).then(msg => msg.delete(2000));
      }
      else
      {
        message.channel.send(`${emoji('guess')} **| Generating a new random number!**\nGuess the number between 1 and ${max}`)
      }
    }




        if(message.content == gussNum){message.channel.send(`${emoji('hypertada')}**| Hooray! ${author} has guessed the number ${guessNum}`)}


    function emoji(name) {return bot.emojis.find(emoji => emoji.name === name)

    }```
#

see

#

idk what i did what

#

it seems fine

earnest phoenix
#

message.content == gussNum

probably should be

message.content === guessNum

#

around 5th line from the bottom

scarlet bane
#

real question is how is he not getting any errors

unreal junco
#

i just got a error now

#

nvm

#

spelling error

#

it wont work

#

if i type the generated number

#

nothing happens

coral trellis
#

Of course it's not working, guessNum returns a false value

#

It's defined but it doesn't do anything

unreal junco
#

then what do i do?

coral trellis
#
let max = args;
if (args == "") {
    guessNum = Math.floor(Math.random() * 1000) + 1;
    message.channel.send(`${emoji('guess')} **| Generating a new random number!**\nGuess the number between 1 and 1000!`)
    console.log(guessNum)
}
else {
    guessNum = Math.floor(Math.random() * args) + 1;
    if (isNaN(guessNum)) {
        message.channel.send(`${message.author}, ${args} is not a valid number`).then(msg => msg.delete(2000));
    }
    else {
        message.channel.send(`${emoji('guess')} **| Generating a new random number!**\nGuess the number between 1 and ${max}`)
    }
}

if (message.content == "gussNum") { message.channel.send(`${emoji('hypertada')}**| Hooray! ${author} has guessed the number ${guessNum}`) }


function emoji(name) {
    return bot.emojis.find(emoji => emoji.name === name)

}```
#

Cleaned up your code and try that

unreal junco
#

ok

coral trellis
#
if (message.content.startWith("gussNum")) ```
#

Is a better way to do it

unreal junco
#

k

#

still nothing happens

coral trellis
#

Does the code even get run at all?

unreal junco
#

yes

#

when i generate the number

#

with -create

#

it says

#

generated number out of 1 - 100- guess it

#

if u say the number

#

nothing happens

#

the generated number is in my console btw

coral trellis
#
if (args == "") {
    guessNum = Math.floor(Math.random() * 1000) + 1;
    message.channel.send(`${emoji('guess')} **| Generating a new random number!**\nGuess the number between 1 and 1000!`)
    console.log(guessNum)
}```
#

So this gets run

unreal junco
#
if (args == "") {
  guessNum = Math.floor(Math.random() * 1000) + 1;
  message.channel.send(`${emoji('guess')} **| Generating a new random number!**\nGuess the number between 1 and 1000!`)
  console.log(guessNum)
}
else {
  guessNum = Math.floor(Math.random() * args) + 1;
  if (isNaN(guessNum)) {
      message.channel.send(`${message.author}, ${args} is not a valid number`).then(msg => msg.delete(2000));
  }
  else {
      message.channel.send(`${emoji('guess')} **| Generating a new random number!**\nGuess the number between 1 and ${max}`)
  }
}```
#

that all runs

#

anything below it doesnt

#

expect the emoji function cause that works

coral trellis
#

Well are you typing guessNum

#

In the channel

unreal junco
#

im typing the generated number

#

which is gussNum

#

guessNum*

restive bough
#

args is an string

coral trellis
#

Lemme just be dumb here

unreal junco
#

ok

coral trellis
#

let guessNum = false;

#

Add that to the top

#

Again

unreal junco
#

the first thing under module.exports.run?

coral trellis
#

Like you had it before

unreal junco
#

ok

#

noting happens still

coral trellis
#

So you want to generate a number and then get them to guess that number? correct?

unreal junco
#

yes

#

the generating i did

coral trellis
#

Are you using stable or master?

unreal junco
#

wdym

coral trellis
#

So you're using the library discord.js?

unreal junco
#

yes

#

npm install discord.js

#

thats what i did

coral trellis
#

Okie

#

Interesting

unreal junco
#

indeed

coral trellis
#

So what you actually need to do is fetch the messages in the channel

#

What you're doing won't work

unreal junco
#

ok

coral trellis
#

I suggest you take a look at that

#

So it gets triggered by !vote and it awaits the given time for a message

unreal junco
#

?

coral trellis
#
// Await !vote messages
const filter = m => m.content.startsWith('!vote');
// Errors: ['time'] treats ending because of the time limit as an error
channel.awaitMessages(filter, { max: 4, time: 60000, errors: ['time'] })
  .then(collected => console.log(collected.size))
  .catch(collected => console.log(`After a minute, only ${collected.size} out of 4 voted.`));```
#

This is the code the docs provde

unreal junco
#

i saw that

#

so what is it trying to say?

coral trellis
#

So what it does is when it gets triggered it waits for a max of 4 messages in the timespan of 6000

unreal junco
#

ohh

#

do i need to define channel?

coral trellis
#

message.channel

unreal junco
#

ok

#

is the time in milliseconds?

coral trellis
#

I would believe so

unreal junco
#

ok

coral trellis
#

So what I would do is

unreal junco
#

i set the time as - 10000000000000000000000000000000000

#

to make it last a long time

coral trellis
#
if (message.content.startsWith("create")  {
    // Await !vote messages
    const filter = m => m.content.startsWith('!vote');
    // Errors: ['time'] treats ending because of the time limit as an error
    message.channel.awaitMessages(filter, { max: 4, time: 60000, errors: ['time'] })
          .then(collected => console.log(collected.size))
          .catch(collected => console.log(`After a minute, only ${collected.size} out of 4 voted.`));
}```
unreal junco
#

what does vote have to do?

coral trellis
#

You can change that

unreal junco
#

define the vote

coral trellis
#

So thats the response you're looking for

unreal junco
#

?

coral trellis
#

const filter = m => m.content.startsWith('!vote');

#

Hold on

unreal junco
#

like this?

#
message.channel.awaitMessages(filter, { max: 10000000000, time: 10000000000000000000000000000000000, errors: ['time'] })
if (message.content.startsWith("gussNum")) { message.channel.send(`${emoji('hypertada')}**| Hooray! ${author} has guessed the number **${guessNum}**`) }

#

or did i do it wrong?

coral trellis
#

One sec

unreal junco
#

i am learning js pretty well

#

yesterday i helped someone

#

ik like 10-15% rn

#

gotta keep learning

coral trellis
#

Let me install stable

unreal junco
#

ok

coral trellis
#

So what you do is set the filter to what you want the answer to be

#
        const filter = m => m.content.startsWith(guessNum);```
unreal junco
#

yeah

#

like this?

#
module.exports.run = async (bot, message, args) => {

  const filter = m => m.content.startsWith(guessNum);```
#

did i do it wrong?

coral trellis
#

One sec

#
module.exports.run = async (bot, message, args) => {

    if (message.content.startsWith('start')) {
        const filter = m => m.content.startsWith(guessNum)
        message.channel.awaitMessages(filter, { max: 1, time: 1000, errors: ['time'] })
            .then(collected => {
                message.channel.send(`${collected.first().author.tag} Got it right`)
            })
            .catch(collected => console.log(`After a minute, only ${collected.size} out of 4 voted.`));
    }
}```
#

So when they say start it will trigger it

#

So create the random number below start

unreal junco
#

ok

#

like this?

#
module.exports.run = async (bot, message, args) => {

  let guessNum = false;
  let max = args;
  if (args == "") {
  guessNum = Math.floor(Math.random() * 1000) + 1;
  message.channel.send(`${emoji('guess')} **| Generating a new random number!**\nGuess the number between 1 and 1000!`)
  console.log(guessNum)
}
else {
  guessNum = Math.floor(Math.random() * args) + 1;
  if (isNaN(guessNum)) {
      message.channel.send(`${message.author}, ${args} is not a valid number`).then(msg => msg.delete(2000));
  }
  else {
      message.channel.send(`${emoji('guess')} **| Generating a new random number!**\nGuess the number between 1 and ${max}`)
  }
}
if (message.content.startsWith("gussNum")) { message.channel.send(`${emoji('hypertada')}**| Hooray! ${author} has guessed the number **${guessNum}**`) }

if (message.content.startsWith('create')) {
    const filter = m => m.content.startsWith(guessNum)
    message.channel.awaitMessages(filter, { max: 10000000000, time: 10000000000000000000000000000000000, errors: ['time'] })
        .then(collected => {
            message.channel.send(`${emoji('hypertada')}**| Hooray! ${author} has guessed the number **${guessNum}**`)
        })
        .catch(collected => console.log(`After a minute, only ${collected.size} out of 4 voted.`));
    }


function emoji(name) {
  return bot.emojis.find(emoji => emoji.name === name)

}
}```
#

is that right?

coral trellis
#

    if (message.content.startsWith('create')) {
        let guessNum = false;
        guessNum = Math.floor(Math.random() * 1000) + 1;
        message.channel.send(`${emoji('guess')} **| Generating a new random number!**\nGuess the number between 1 and 1000!`)
        console.log(guessNum)
        if (message.content.startsWith("gussNum")) { message.channel.send(`${emoji('hypertada')}**| Hooray! ${author} has guessed the number **${guessNum}**`) }

        const filter = m => m.content.startsWith(guessNum)
        message.channel.awaitMessages(filter, { max: 10000000000, time: 10000000000000000000000000000000000, errors: ['time'] })
            .then(collected => {
                message.channel.send(`${emoji('hypertada')}**| Hooray! ${author} has guessed the number **${guessNum}**`)
            })
            .catch(collected => console.log(`After a minute, only ${collected.size} out of 4 voted.`));
    }


    function emoji(name) {
        return bot.emojis.find(emoji => emoji.name === name)

    }
}```
unreal junco
#

ohhh

#
  if (message.content.startsWith('create')) {
       let guessNum = false;
       let max = args;
       if (args == "") {
       guessNum = Math.floor(Math.random() * 1000) + 1;
       message.channel.send(`${emoji('guess')} **| Generating a new random number!**\nGuess the number between 1 and 1000!`)
       console.log(guessNum)
     }
     else {
       guessNum = Math.floor(Math.random() * args) + 1;
       if (isNaN(guessNum)) {
           message.channel.send(`${message.author}, ${args} is not a valid number`).then(msg => msg.delete(2000));
       }
       else {
           message.channel.send(`${emoji('guess')} **| Generating a new random number!**\nGuess the number between 1 and ${max}`)
       }
     }

       const filter = m => m.content.startsWith(guessNum)
       message.channel.awaitMessages(filter, { max: 10000000000, time: 10000000000000000000000000000000000, errors: ['time'] })
           .then(collected => {
               message.channel.send(`${emoji('hypertada')}**| Hooray! ${author} has guessed the number **${guessNum}**`)
           })
           .catch(collected => console.log(`After a minute, only ${collected.size} out of 4 voted.`));
   }


   function emoji(name) {
       return bot.emojis.find(emoji => emoji.name === name)

   }
}```
#

is that right?

coral trellis
#

First of all you're checking if args is "";

#

So args is just an empty message

unreal junco
#

yeah

coral trellis
#

One sec

unreal junco
#

you didnt add this

}
     else {
       guessNum = Math.floor(Math.random() * args) + 1;
       if (isNaN(guessNum)) {
           message.channel.send(`${message.author}, ${args} is not a valid number`).then(msg => msg.delete(2000));
       }
       else {
           message.channel.send(`${emoji('guess')} **| Generating a new random number!**\nGuess the number between 1 and ${max}`)
       }
     }```
coral trellis
#
if (message.content.startsWith('create')) {
    let guessNum = false;
    let max = args;
    if (!args) {
    guessNum = Math.floor(Math.random() * 1000) + 1;
    message.channel.send(`${emoji('guess')} **| Generating a new random number!**\nGuess the number between 1 and 1000!`)
    console.log(guessNum)
  }
  else {
    guessNum = Math.floor(Math.random() * args) + 1;
    if (isNaN(guessNum)) {
        message.channel.send(`${message.author}, ${args} is not a valid number`).then(msg => msg.delete(2000));
    }
    else {
        message.channel.send(`${emoji('guess')} **| Generating a new random number!**\nGuess the number between 1 and ${max}`)
    }
  }

    const filter = m => m.content.startsWith(guessNum)
    message.channel.awaitMessages(filter, { max: 10000000000, time: 10000000000000000000000000000000000, errors: ['time'] })
        .then(collected => {
            message.channel.send(`${emoji('hypertada')}**| Hooray! ${author} has guessed the number **${guessNum}**`)
        })
        .catch(collected => console.log(`After a minute, only ${collected.size} out of 4 voted.`));
}


function emoji(name) {
    return bot.emojis.find(emoji => emoji.name === name)

}
}
unreal junco
#

u know how it says create

#

is it prefix + create?

coral trellis
#

You can add prefix if you want

unreal junco
#

under the command is

module.exports.config = {
    name: "create",
    description: "create a wonderful guessing game for you server!",
    usage: `${prefix}create`,
    accessableby: "Moderators",
    aliases: ["guessmake", "makeguess", "createguess", "funguess"]
}```
coral trellis
#

Oh then no need

unreal junco
#

above command

const Discord = require("discord.js")
const botconfig = require("../botconfig.json");
const prefix = botconfig.prefix


module.exports.run = async (bot, message, args) => {```
coral trellis
#

Ah i see hold on

#

So it already gets run on that

#

Okay so remove

if (message.content.startsWith('create')) {}
#

From your code

unreal junco
#

done that

coral trellis
#

Send all your code rn

unreal junco
#
    let guessNum = false;
    let max = args;
    if (!args) {
    guessNum = Math.floor(Math.random() * 1000) + 1;
    message.channel.send(`${emoji('guess')} **| Generating a new random number!**\nGuess the number between 1 and 1000!`)
    console.log(guessNum)
  }
  else {
    guessNum = Math.floor(Math.random() * args) + 1;
    if (isNaN(guessNum)) {
        message.channel.send(`${message.author}, ${args} is not a valid number`).then(msg => msg.delete(2000));
    }
    else {
        message.channel.send(`${emoji('guess')} **| Generating a new random number!**\nGuess the number between 1 and ${max}`)
    }
  }

    const filter = m => m.content.startsWith(guessNum)
    message.channel.awaitMessages(filter, { max: 10000000000, time: 10000000000000000000000000000000000, errors: ['time'] })
        .then(collected => {
            message.channel.send(`${emoji('hypertada')}**| Hooray! ${author} has guessed the number **${guessNum}**`)
        })
        .catch(collected => console.log(`After a minute, only ${collected.size} out of 4 voted.`));

        function emoji(name) {
            return bot.emojis.find(emoji => emoji.name === name)

        }
}```
coral trellis
#

Try the code

solemn zephyr
#

@keen drift can you give me an invite link for the reaction role bot?

unreal junco
#

for some reason

#

if its default so no args it doesnt say 1 out of 1000

#

just says 1 out of

coral trellis
#

Because args exist

#

So it doesn't run the first part of the code

unreal junco
#

how do i fix?

earnest phoenix
#

Anyone help me!?

unreal junco
#

do i get rid of the first part?

coral trellis
#

let guessNum = false;

guessNum = Math.floor(Math.random() * 1000) + 1;
message.channel.send(`${emoji('guess')} **| Generating a new random number!**\nGuess the number between 1 and 1000!`)
console.log(guessNum)
const filter = m => m.content.startsWith(guessNum)
message.channel.awaitMessages(filter, { max: 10000000000, time: 10000000000000000000000000000000000, errors: ['time'] })
    .then(collected => {
        message.channel.send(`${emoji('hypertada')}**| Hooray! ${author} has guessed the number **${guessNum}**`)
    })
    .catch(collected => console.log(`After a minute, only ${collected.size} out of 4 voted.`));

function emoji(name) {
    return bot.emojis.find(emoji => emoji.name === name)

}
#

Use that

#

First change the time to something smaller

#

Cause it's going to wait forever

#

and change the max to 1

unreal junco
#

wdym?

coral trellis
#

message.channel.awaitMessages(filter, { max: 10000000000, time: 10000000000000000000000000000000000, errors: ['time'] })

earnest phoenix
#

for example, my bot joined the server ooo my founder came to say how? [MY ENGLฤฐSH BAD]

coral trellis
#
message.channel.awaitMessages(filter, { max: 1, time: 5000, errors: ['time'] })```
#

Change it to that

earnest phoenix
#

Or i cant?

coral trellis
#

@earnest phoenix wdym

earnest phoenix
#

what?

coral trellis
#

What do you mean

#

You want your bot to tell you when it joins a new server?

earnest phoenix
#

this is literally spoonfeeding heaven right now for these guys

#

yes

unreal junco
#

if i type the generated number nothing happens though

coral trellis
#

Check console

#

@earnest phoenix What library?

earnest phoenix
#

Discord.js

coral trellis
#

@earnest phoenix Yes

unreal junco
#

why doesnt it make the user win when they say the generated number?

#
  let guessNum = false;
    let max = args;
    if (!args) {
    guessNum = Math.floor(Math.random() * 1000) + 1;
    message.channel.send(`${emoji('guess')} **| Generating a new random number!**\nGuess the number between 1 and 1000!`)
    console.log(guessNum)
  }
  else {
    guessNum = Math.floor(Math.random() * args) + 1;
    if (isNaN(guessNum)) {
        message.channel.send(`${message.author}, ${args} is not a valid number`).then(msg => msg.delete(2000));
    }
    else {
        message.channel.send(`${emoji('guess')} **| Generating a new random number!**\nGuess the number between 1 and ${max}`)
        console.log(guessNum)

    }
  }

    const filter = m => m.content.startsWith(guessNum)
    message.channel.awaitMessages(filter, { max: 1, time: 5000, errors: ['time'] })
        .then(collected => {
            message.channel.send(`${emoji('hypertada')}**| Hooray! ${author} has guessed the number **${guessNum}**`)
        })
        .catch(collected => console.log(`After a minute, only ${collected.size} out of 4 voted.`));

        function emoji(name) {
            return bot.emojis.find(emoji => emoji.name === name)

        }
}```
coral trellis
#
let guessNum = false;
let max = args;

guessNum = Math.floor(Math.random() * 1000) + 1;
message.channel.send(`${emoji('guess')} **| Generating a new random number!**\nGuess the number between 1 and 1000!`)
console.log(guessNum)

const filter = m => m.content.startsWith(guessNum)
message.channel.awaitMessages(filter, { max: 1, time: 5000, errors: ['time'] })
    .then(collected => {
        message.channel.send(`${emoji('hypertada')}**| Hooray! ${author} has guessed the number **${guessNum}**`)
    })
    .catch(collected => console.log(`After a minute, only ${collected.size} out of 4 voted.`));

function emoji(name) {
    return bot.emojis.find(emoji => emoji.name === name)

}
unreal junco
#

what if they input a non number

#

it doesnt say in the code

coral trellis
#

They aren't inputting anything

#

Just test if this works and we can move from there

unreal junco
#

ok

#

the generating โœ…
the correct generated number that the user says โŒ

coral trellis
#

Okay and?

unreal junco
#

so if they say the correct number

#

nothing happens

coral trellis
#

Any errors?

unreal junco
coral trellis
#

Show me your code

unreal junco
#

the code part or whole command?

coral trellis
#

Whole command

unreal junco
#
const Discord = require("discord.js")
const botconfig = require("../botconfig.json");
const prefix = botconfig.prefix


module.exports.run = async (bot, message, args) => {

let guessNum = false;
let max = args;

guessNum = Math.floor(Math.random() * 1000) + 1;
message.channel.send(`${emoji('guess')} **| Generating a new random number!**\nGuess the number between 1 and 1000!`)
console.log(guessNum)

const filter = m => m.content.startsWith(guessNum)
message.channel.awaitMessages(filter, { max: 1, time: 5000, errors: ['time'] })
    .then(collected => {
        message.channel.send(`${emoji('hypertada')}**| Hooray! ${author} has guessed the number **${guessNum}**`)
    })
    .catch(collected => console.log(`After a minute, only ${collected.size} out of 4 voted.`));

function emoji(name) {
    return bot.emojis.find(emoji => emoji.name === name)

}
}



module.exports.config = {
    name: "create",
    description: "create a wonderful guessing game for your server!",
    usage: `${prefix}create`,
    accessableby: "Moderators",
    aliases: ["guessmake", "makeguess", "createguess", "funguess"]
}```
coral trellis
#

One sec

#

So what does the catch function do?

unreal junco
#

it just consoles something

coral trellis
#

You should be able to figure out how to debug this

#

.catch()

#

Catches the error

unreal junco
#

ok

#

so do i do .catch (e)
console.log(e)

coral trellis
#

You already catch the error

#

With .catch

unreal junco
#

ohh

#

then how i console it?

restive bough
#

bruh

#

@coral trellis use the scientific E

coral trellis
#

smh

#

What do you have the error defined as?

unreal junco
#

nothing

coral trellis
#
.catch(collected => console.log(`After a minute, only ${collected.size} out of 4 voted.`));```
#

What do you have the error defined as

unreal junco
#

nothing

earnest phoenix
#

Where are my bot :(

coral trellis
#

You are catching the error with .catch() and you are projecting as?

unreal junco
#
const filter = m => m.content.startsWith(guessNum)
message.channel.awaitMessages(filter, { max: 1, time: 5000, errors: ['time'] })
    .then(collected => {
        message.channel.send(`${emoji('hypertada')}**| Hooray! ${author} has guessed the number **${guessNum}**`)
    })
    .catch(collected => console.log(`After a minute, only ${collected.size} out of 4 voted.`));
earnest phoenix
#

@coral trellis my bot verified but i cant see my bot +_+

coral trellis
#

@unreal junco Read what I have said

unreal junco
#

ok

brave sentinel
#

selamรผn aleykรผm

coral trellis
earnest phoenix
#

Ne alaka ya

coral trellis
unreal junco
#

it makes no scenes

brave sentinel
#

ok

unreal junco
#

i havnt got to learning the catch errors yet

coral trellis
#

Okay

#
promise.catch(this => {})```
#

So here you define the output or whats returned from the catch

unreal junco
#

?

coral trellis
#
channel.send("lol").catch(yes => {channel.send(yes)})
unreal junco
#

is that what i do?

coral trellis
#

I am teaching you

unreal junco
#

ok

#

thx

coral trellis
#

So if there is an error

unreal junco
#

yeah

coral trellis
#

You will catch it with the .catch() as a fallback

unreal junco
#

.catch(e)

coral trellis
#

Right

unreal junco
#

or just .catch()

coral trellis
#

So you're defining the error as e

#

when you do .catch(e)

#

Right?

unreal junco
#

.catch(e)
console.log(e)

coral trellis
#

Right

unreal junco
#

is that what i do?

coral trellis
#

The way I would do it is

.catch(e => console.log(e))```
#

Now look at your code

#
const filter = m => m.content.startsWith(guessNum)
message.channel.awaitMessages(filter, { max: 1, time: 5000, errors: ['time'] })
    .then(collected => {
        message.channel.send(`${emoji('hypertada')}**| Hooray! ${author} has guessed the number **${guessNum}**`)
    })
    .catch(collected => console.log(`After a minute, only ${collected.size} out of 4 voted.`));```
unreal junco
#

i change .catch(collected => console.log(After a minute, only ${collected.size} out of 4 voted.));
to
.catch(e => console.log(e))

#

right?

#

the error says

coral trellis
#
    if (message.content.startsWith('start')) {
        let guessNum = false;

        guessNum = Math.floor(Math.random() * 1000) + 1;
        message.channel.send(`${emoji('guess')} **| Generating a new random number!**\nGuess the number between 1 and 1000!`)
        console.log(guessNum)

        const filter = m => m.content.startsWith(guessNum)
        message.channel.awaitMessages(filter, { max: 1, time: 6000, errors: ['time'] })
            .then(collected => {
                message.channel.send(`${emoji('hypertada')}**| Hooray! ${message.author} has guessed the number **${guessNum}**`)
                console.log(collected)
            })
            .catch(collected => {
                console.log(`After a minute, only ${collected.size} out of 4 voted.`)
                console.log(collected)
            });

        function emoji(name) {
            return client.emojis.find(emoji => emoji.name === name)
        }
    }
unreal junco
#

how do i make the number turn into this number

#
`${emoji('HyperTada')}**| Hooray! ${message.author} has guessed the number ${guessNum}**````
#

but atleast it works though

coral trellis
#
`${emoji('HyperTada')}**| Hooray! ${message.author} has guessed the number` + "`" + guessNum + "`"```
unreal junco
#

i never knew that

#

so that what i do

#

u learn something new everyday

#

i learnt alot today

#

how to catch errors, and that with the `

#

so now thats done how do i do the args stuff?

#

or is it the same i did b4

coral trellis
#

This you should you be able to figure out

unreal junco
#

ok

#

i did IT!!!

#

nvm

#

only works for 1

#

i did half but now its not working ๐Ÿ˜ญ

#

i think i'll do a seperate command

#

to make life easier

#

yep it works

clever wave
#

Error: Cannot find module './mรผzikconfig.js'

#

whats the problem?

#

what

#

my name why no unicode ty#0083 ? <@&304313580025544704>

gleaming glen
#

Because your name has unicode stuff

#

Dont ping all mods for this and this is a development channel.

queen sentinel
#

Dont ping all mods

earnest phoenix
#

@coral trellis i fixed sa-as and auto dm join message

#

pls add my bot again sorry :/

#

@gleaming glen tรผrk misin

gleaming glen
#

Um yea

earnest phoenix
#

@gleaming glen benim botu sa as yanit verdiฤŸi iรงin mutelediler. onu kaldฤฑrdฤฑm. Birde giris mesajฤฑ attฤฑฤŸฤฑ iรงin atmislar onu da kaldrdim tekrar ekleyemzsn?

gleaming glen
#

Dont speak Turkish here oofs

sudden surge
#

eren how are you

earnest phoenix
#

how would i do something like this
โ–ถ โ–ฌโ–ฌ๐Ÿ”˜โ–ฌโ–ฌโ–ฌโ–ฌโ–ฌโ–ฌโ–ฌโ–ฌโ–ฌ [00:36 - 03:19]:loud_sound:
i use lavalink

harsh nova
#

Idk, google it

split hazel
#

How would i save user input on my website (register form) into a sqlite database?

trim saddle
#

@split hazel google

marble needle
#

the viability of that play bar is questionable if you ask me. you throw one request every second at discord's api to edit a message. If 100 people are using your bot at the same time you're already at 100 requests a second just to update a playing timer

quartz kindle
#

i've seen people doing 5 second updates instead, i think its fine with 5 seconds

keen drift
#

the rate limit is per major route

ruby dust
#

reminds me when I forgot to add a sleep on my infinite loop, even the lib was not capable of handling the ratelimits until discord was spamming my console with failed requests

#

that was like a one time thing, and that kinda affected how my bot was functioning in future sessions to the point when not all users were cached or even normal messages were excessively slow

flat hare
#

So can a bot not get accepted because it has a command that changes its result whether or not the channel is NSFW?

amber fractal
#

if it says the command is nsfw locked it should be fine

flat hare
#

It actually has a SFW and NSFW version of it baked into the same command.

#

It just checks the channel type and it's internal guild settings and outputs accordingly.

late hill
#

It's fine if you don't mention the NSFW part on the website

#

Short/long description

flat hare
#

I don't, it only mentions it on my own wiki and if you use the help command.

late hill
#

Should be fine then

flat hare
#

Okay I guess I'll have to try again and probably talk to someone.\

earnest phoenix
#

Who Can help me With add a pages to command?

opaque eagle
#

what?

last hornet
#

Hello, I have a problem with shadbot.

#

What should I do?

opaque eagle
#

then ask in shadbot's server

last hornet
#

ok

opaque eagle
#

this server isn't about whatever that bot does

#

this is where smart nerdy programmers who code discord bots come to hang out

last hornet
#

ok

earnest phoenix
#

Pages Embed...

dusky steeple
#

How would I use an emoji in this?

.setThumbnail()
opaque eagle
#

you need a picture of the emoji then

dusky steeple
#

hm ok. ty

opaque eagle
#

wdym by pages embed, and what library @earnest phoenix

earnest phoenix
#

How can I put the bot on status Do not disturb but is also on the status of listening?

split hazel
#

@earnest phoenix depends on library

#

but on d.js it's
<client>.setStatus("dnd")

#

And for listening

#

<client>.user.setActivity(`to music`, {type: "LISTENING"});

earnest phoenix
#

What This <client>?

split hazel
#

how you defined client

knotty steeple
#

what you defined as your client

earnest phoenix
#

Ok

knotty steeple
#

also always direct to the docs

dull bobcat
#

or he can just actually learn js ^

amber fractal
#

His native language isnt english.

grim aspen
#

fixed the bot i have

#

it was where the client connects

#

nvm

#

mfw i have an error for an unexpected input and i can't find it

zinc pawn
earnest phoenix
#

hi

#

is Visual Studio Code supports discord.js?

zinc pawn
#

visual studio code is a text editor

#

yes facepunch

earnest phoenix
#

how can i make this on visual studio code

mossy vine
#

you install the prerequisites on your computer

neat falcon
#

glitch ew

#

disgusting

earnest phoenix
#

what is the prerquisites

grim aspen
#

visual studio?

mossy vine
#

things you need to install before using discord.js

grim aspen
#

i used to work with visual studio

neat falcon
#

visual studio is nice

#

nuget Yes

earnest phoenix
#

@mossy vine can you come to dm

neat falcon
#

no

zinc pawn
#

oh my.

neat falcon
#

hi elemental why are you saying "oh my."

#

did you detect the glitch i detected?

zinc pawn
#

which glitch?

mossy vine
#

im not going to dms with you when all you need to do is install simple shit on your computer

neat falcon
#

yes

zinc pawn
#

oh i thought you found smth wrong with this:
https://hastebin.com/ililuviwek.js it starts line 12 before line 3-10 is finished, and i can't await since nedb doesn't return promises, i'm not sure what i should do?

gilded prism
#

there should be a how to

neat falcon
#

I can see something wrong with that file, it's missing semicolons in some places

#

what is nedb?

amber fractal
#

probably a db

zinc pawn
#

mongo but local

amber fractal
grim aspen
#

let prefix= false

mossy vine
#

@zinc pawn because its asynchronous or however you spell it

grim aspen
#

that doesn

#

't*

#

look right

neat falcon
#

That's actually spelt correct

mossy vine
#

im mr englishman

neat falcon
#

no im the englishman here

zinc pawn
#

the global prefixes in the array work

#

its just line 3-10 isn't finished by the time line 12 starts

mossy vine
#

yes because its async

zinc pawn
#

how do i prevent that

mossy vine
#

remove async from the lambda function?

zinc pawn
#

that would break everything? its the message event which uses async (bot, message) => {...

mossy vine
#

oh

#

isnt that async by default?
anyways i have no idea, sorry

zinc pawn
#

mk..

grim aspen
#

the ping command was the problem

#

i just straight up removed since

smoky mica
#

hey yall where's the discord.js document where it shows you the perms of a guild

#

like MANAGE_MESSAGES, ADMINISTRATOR etc

amber fractal
smoky mica
#

Thanks! :)

unreal junco
#

help?

#
  let guessNum = false;
  let max = args;
          guessNum = Math.floor(Math.random() * 1000) + 1;
          message.channel.send(`${emoji('guess')} **| Generating a new random number!**\nGuess the number between 1 and 1000!`)
          console.log(guessNum)


          const filter = m => m.content.startsWith(guessNum)
          message.channel.awaitMessages(filter, { max: 1, time: 6000, errors: ['time'] })
              .then(collected => {
                  message.channel.send(`${emoji('HyperTada')}**| Hooray! ${message.author} has guessed the number** ` + "`" + guessNum + "`")
                  console.log(collected)
              })
              .catch(collected => {
                  console.log(`After a minute, only ${collected.size} out of 4 voted.`)
                  console.log(collected)
              });

          function emoji(name) {
              return bot.emojis.find(emoji => emoji.name === name)
          }
      }```
#

this works fine

#

but how can i add the args part in it?

#
  let max = args;
  if(args == "")
    {
          guessNum = Math.floor(Math.random() * args) +  1;
          if(isNaN(guessNum))
          {
            message.channel.send(`${message.author}, ${args} is not a valid number`).then(msg => msg.delete(2000));
          }
          else
          {
            message.channel.send(`${emoji('guess')} **| Generating a new random number!**\nGuess the number between 1 and ${max}`)
            console.log(guessNum)

          }```
#

cause when i try it wont work

cloud peak
#

How can i play a local track using lavaplayer and JDA?

dull bobcat
#

@unreal junco Maybe, if you provide the error, we might help you better anismart

#

@cloud peak You don't

amber fractal
#

The one that's messed up is edge

topaz fjord
#

They use different html renderers

amber fractal
#

I know this, but how would I fix this

cloud peak
#

How can i play a local track using lavaplayer and JDA?

quartz kindle
#

@amber fractal edge has an element inspector, you can use it to figure out whats wrong. possibly some rule that edge doesnt support

amber fractal
#

Im on a chromebook

#

That's one of my users

quartz kindle
#

welp, get a pc with edge

amber fractal
#

Kind of impossible given my current situation

topaz fjord
#

you use browser prefixes

amber fractal
#

And

amber fractal
#

edge doesnt support it

topaz fjord
#

edge does

quartz kindle
#

block-size is an experimental rule

dull bobcat
#

@cloud peak You. Don't.

quartz kindle
#

edge doesnt support it

topaz fjord
#

-ms is for edge

dull bobcat
#

I've already told you

amber fractal
topaz fjord
#

oh

#

then just put an error

#

ez

#

or just forget about edge

#

because edge is moving to chromium

#

so it will use the same renderer as chrome soon

amber fractal
#

How soon?

topaz fjord
#

when msft gets off their ass

quartz kindle
#

what are you trying to use block-size for? im 100% sure you can achieve the same without it

amber fractal
#

So not soon

topaz fjord
#

they're supposed to release an insider preview soon

dull bobcat
#

okay okay hold on hold on

#

My question is

#

Why the fuck does it matter if the site doesn't work on Edge?? Like, no one without old people uses Edge

#

It doesn't matter

topaz fjord
#

people do

dull bobcat
#

No, Edge suuuuucks

amber fractal
topaz fjord
#

just because you don't doesn't mean other don't

dull bobcat
#

Just make sure it works on both Chrome and Firefox, if it does @amber fractal then you're fine

amber fractal
#

It was literally a user of mine that sent me that

#

?

quartz kindle
#

@amber fractal use width/height/padding

amber fractal
#

I tried

quartz kindle
#

with vertical-align?

amber fractal
#

no

#

When I remove block size, I get the same issue they were having, obviously, so just resize the image?

#

That didnt work last time

quartz kindle
#

send link in dms

earnest phoenix
#

just check if their browser is edge or or ie, if it is block them from the site and force them to use a proper browser :^)

amber fractal
#

It was a user of mine, I dont want to do that

earnest phoenix
#

that was sarcasm

quartz kindle
#

@amber fractal percent height and width are relative to closest parent fixed height/width

amber fractal
#

its using percents at the moment

#

a percent and auto

quartz kindle
#

so if parent element is height 50px, height 10% = 5px. if there is no parent element with fixed height, height 10% = 10% of entire page/window

amber fractal
#

like centered

quartz kindle
#

your image is ridiculously oversized, but you should either give the image fixed dimensions, or give the entire top bar a fixed height, so its children can use percentage heights

amber fractal
#

I dont know how to make it respnsive if it's fixed

#

responsive(

lament meteor
#

@amber fractal i presume ur using the w3school navbar

amber fractal
#

You'd be correct

lament meteor
#

they have a responsive nav example iirc

quartz kindle
#

you can use css media queries

amber fractal
#

I do

#

It is responsive

#

if you open it on your phone its a menu instead

sick cloud
#

who uses edge

amber fractal
#

The user who sent me this

sick cloud
#

so what

lament meteor
#

our parents mmLol

sick cloud
#

dbl doesnt support edge

lament meteor
#

^

amber fractal
#

Im not dbl tho

#

I'd like to support my users tbh

lament meteor
#

here is a good question...

#

would u support all outdated stuff

amber fractal
#

Well as of the current moment it isnt outdated.

quartz kindle
#

you should rewrite your top bar

amber fractal
#

for this problem?

quartz kindle
#

you want the icon to not be included in the mobile menu?

#

i can think of a gazillion ways to solve the problem, but it all depends on how exactly you want it to behave

#

because every solution will create a certain outcome that might not be what you want, and will require you to rewrite other things to fix it

#

welcome to css hell

#

but basically try rewriting your top bar using only basic css, and not any kind of experimental css, that will make it more cross browser compatible

amber fractal
#

No I want it on mobile

#

it works on mobile

#

just not edge

#

I've tested firefox, chrome, edge and safari

#

edge is the only one giving me problems

#

I fixed it

earnest phoenix
#

i still don't understand why you won't use a css library

amber fractal
#

Mainly because I dont know what that means, and I fixed it

earnest phoenix
#

how to use the internet ft. cryโ„ข

amber fractal
#

And rewrite everything?

#

ft. Steven, execpt it doesn't because I wont.

opal copper
#

Who have any help for me ? I've test 5 commands for args and, it doesn't work, who can help me ( API: Discord.js )

unreal junco
#
    const filter = m => m.content.startsWith(guessNum)
      message.channel.awaitMessages(filter, { max: 1, time: 600000000, errors: ['time'] })
          .then(collected => {
              message.channel.send(`${emoji('HyperTada')}**| Hooray! ${message.author} has guessed the number** ` + "`" + guessNum + "`")
              console.log(collected)
          })
          .catch(collected => {
              console.log(`After a minute, only ${collected.size} out of 4 voted.`)
              console.log(collected)
              message.channel.send("Sorry you took to long please say -create to try again!")
          });```
#

how do i make this last 1 month?

#

cuase its only lasting 6 mins

#

and if i make the number bigger

#

it last 1 second

#

if smaller

#

last 1 second

#

help?

amber fractal
#

Thats higher than the max for a 32 bit signed integer

#

The max time is 2,147,483,647

#

not just time

#

the max 32 bit signed integer

earnest phoenix
#

you dont have to rewrite everything lol, using a css lib is literally just applying class names to elements, you can set up a functional website made with bootstrap in under 10 minutes

ruby dust
#

I know that committing changes to sqlite database after every sqlite command is not a good idea, what are the better alternatives that I can use? At first I was thinking of an infinite loop that commits like every couple of seconds, is that a good practice?

sinful lotus
#

cache and sync perhaps?

subtle whale
#

Anyone here who does nodejs dev have any experience with pm2 forking process randomly? I normally host things containerized, but since I'm still working on my bot pretty actively I just have it set up as a pm2 service currently.

#

...but it seems to fork the process occasionally for no reason. Both copies are stable, nothing in logs ... it just decides I need 2 bots every now and then

#

it doesn't happen if I'm just running the bot directly in a terminal, so I assume its pm2 related

slim heart
#

im trying to make everything proxypass to a local address but then one part go to a different file only under that location

        listen 443 ssl;
        server_name WEBSITE;
        
        ssl_certificate  server.crt;
        ssl_certificate_key server.key;
        
        location /cp {
            try_files $uri C:/website/hueboi/index.html;
        }
        
        location / {
            proxy_pass "https://192.168.0.123:443";
        }
    }```
i tried this logic but it doesnt seem to work
topaz fjord
#

that's not how it works

unreal junco
#
         message.channel.send(`${emoji('HyperTada')}**| Hooray! ${message.author} has guessed the number** ` + "`" + guessNum + "`")```
#

message.author is tagging the user who made the command

#

how to i change it to the person who says the winning number?

bright spear
#

Wdym the winning number

#

That's not much context

#

You'll need to send the whole command

#

And explain what it does

earnest phoenix
#

How do I save contents of a .json file in hosting?

#

Cause I have js fs.writeFile("./exp.json", JSON.stringify(exp), (err) => { if (err) console.log("Writing to exp.json failed: " + err) })
But when you restart/deploy the bot all data inside of the json resets because it just replaces the file w/ {
}
again

sick cloud
#

dont use json

earnest phoenix
#

Then what do I use

#

@sick cloud

sterile hedge
#

xml

#

xd

earnest phoenix
#

@sterile hedge Do you know how to work w/xml?

sterile hedge
#

what is the json for?

earnest phoenix
#

Level value and xp value

#

assigned with user id

sterile hedge
#

why does it get replaced when you restart the bot?

sick cloud
#

use a database

#

writing to json is bad practice

#

if you need basics you can try sqlite or mysql

#

etc

unreal junco
#

this is the whole command

earnest phoenix
#

I don't know how to do anything else

#

and ok

#

I'll look stuff up

sick cloud
unreal junco
#
  let guessNum = false;
  let max = args;
  if(!args == "")
    {
          guessNum = Math.floor(Math.random() * args) +  1;
          if(isNaN(guessNum))
          {
            message.channel.send(`${message.author}, ${args} is not a valid number`).then(msg => msg.delete(2000));
          }
          else
          {
            message.channel.send(`${emoji('guess')} **| Generating a new random number!**\nGuess the number between 1 and ${max}`)
            console.log(guessNum)

          }
        }

        const filter = m => m.content.startsWith(guessNum)
        message.channel.awaitMessages(filter, { max: 1, time: 2147483647, errors: ['time'] })
            .then(collected => {
                message.channel.send(`${emoji('HyperTada')}**| Hooray! ${message.author} has guessed the number** ` + "`" + guessNum + "`")
                console.log(collected)
            })
            .catch(collected => {
                console.log(`After a minute, only ${collected.size} out of 4 voted.`)
                console.log(collected)
                message.channel.send("Sorry you took to long please say -create to try again!")

            });

        function emoji(name) {
            return bot.emojis.find(emoji => emoji.name === name)
        }```
sterile hedge
#

how+do+seach+on+google

unreal junco
#
         message.channel.send(`${emoji('HyperTada')}**| Hooray! ${message.author} has guessed the number** ` + "`" + guessNum + "`")```
message.author is tagging the user who made the command
how to i change it to the person who says the winning number?
sick cloud
#

console.log(`After a minute, only ${collected.size} out of 4 voted.`)
try not copy pasting the code from a tutorial

unreal junco
#

huh

#

i didnt watch any tutorial though

sick cloud
#

did i say video

#

no

unreal junco
#

?

sick cloud
#

i said dont copy your code from examples or tutorials, and maybe learn

#

the function returns a "collected" parameter

unreal junco
#

one of the mods in the server was helping me and teaching me how to catch errors and learn new ways

sick cloud
#

which is the users that reacted /etc

sterile hedge
#

Get the message author of the last message sent in the channel ?? idk

sick cloud
#

it literally provides the user

unreal junco
#

idk how to do that xD yet

sick cloud
#

collected.first().author

unreal junco
#

๐Ÿ‘

#

ima go to reaserch on how to do other things as i need to "learn"

amber fractal
#

I mean my bot is online

#

its all working, but what is this Thonk

bright spear
#

a shard died

earnest phoenix
#

jksdfsbhdjfdk

coral trellis
amber fractal
#

It died before it launched? ๐Ÿค”

bright spear
#

It died before the ready event

earnest phoenix
#

How do I code stuff

bright spear
#

Learn a programming language

earnest phoenix
#

I did but what site

bright spear
#

??

#

Wdym

#

You can code it in a code editor on your computer and host it on a server

inner yoke
#

a!botinfo

unreal junco
#

help

#

how can i make the bot delete all non numbers in a command

cause when i tried it did it once
it only did it when the command was triggered

#

please ping me

harsh nova
#

We donโ€™t even know what programming language you are using

#

But Iโ€™d assume JavaScript from your earlier messages

unreal junco
#

js

split hazel
#

so i have express to handle http requests

server.get("/", (request, response) => {

How would i log the request the initial server sent?

#

Nevermind, I just made the express handle post requests and then parse them

near lotus
#

"Unexpected token ๏ฟฝ in JSON at position 3" why do I see this message guys? I tried to put the command 'node bot.js'

earnest phoenix
#

go to your json file

split hazel
#

go to line 3

earnest phoenix
#

line 3 and fix it

split hazel
#

or if you have no idea paste line 3 here

near lotus
#

{
โ€œtokenโ€: "mytokenโ€
}

#

the whole file is this

split hazel
#

package.json?

near lotus
#

auth.json

split hazel
#

ah

near lotus
#
    at JSON.parse (<anonymous>)
    at Object.Module._extensions..json (internal/modules/cjs/loader.js:708:27)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (C:\Users\conan\OneDrive\Desktop\DiscordBOT\bot.js:3:12)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)```
earnest phoenix
#

did you put a space at the end of your auth.json?

#

If yes delete it

#

if no check again

near lotus
#

no

#

I checked many times

split hazel
#

thats strange it should not be happening

near lotus
#

so what should I do now?

split hazel
#

one sec

near lotus
#

okay!

split hazel
#

when trying your json, i did get a json error but on line 2

near lotus
#

weirdo

#

what's wrong with my file lmao

late hill
#

JS Eris
Using client.getMessageReaction will the order always be the same?

#

What is the order based on?

split hazel
#

@near lotus put

"token": "your token"
}```
exactly that except replace your token with well your token.
near lotus
#

okay

#

let me try

split hazel
#

and when referring to token :
(how you defined requiring your json file).token

near lotus
#

how?

split hazel
#
auth.token```
#

auth.token will give the token in json file

near lotus
#
file, or operable program. Check the spelling of the name, or if a path was
included, verify that the path is correct and try again.
At line:1 char:1
+ const auth = require("./auth.json")
+ ~~~~~
    + CategoryInfo          : ObjectNotFound: (const:String) [], CommandNotFoundExce
   ption
    + FullyQualifiedErrorId : CommandNotFoundException

auth.token : The term 'auth.token' is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the name, or if a
path was included, verify that the path is correct and try again.
At line:2 char:1
+ auth.token
+ ~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (auth.token:String) [], CommandNotFoun
   dException
    + FullyQualifiedErrorId : CommandNotFoundException```
#

sorry i don't know anything about this

split hazel
#

what are you even trying to do

#

i've never seen such error

#

it isn't even a node error

near lotus
#

I try to active my bot on my Discord

#

I mean run the bot

quartz kindle
#

why does everyone use that tutorial

split hazel
#

@near lotus thats a very very very old and outdated tutorial

near lotus
#

idk

quartz kindle
near lotus
#

so what should I do?

split hazel
#

and discord io is dead

#

use discord js. i recommend it for starting

dusky steeple
#

and maybe learn javascript?

near lotus
#

yeah, I think I should

fathom storm
#

Any documentation for the discord js?

hushed zodiac
#

How can I discourage my bot @jade garnet

split hazel
dusky steeple
#
quartz kindle
#

^

near lotus
#

thank you so much @split hazel

#

thanks guys for the information

dusky steeple
#

you guys know any good lavalink docs? I keep getting connection refused error an trying to figure out how to fix it

near lotus
#
(function (exports, require, module, __filename, __dirname) { const client = new Discord.Client()
                                                                             ^

ReferenceError: Discord is not defined
    at Object.<anonymous> (C:\Users\conan\OneDrive\Desktop\DiscordBOT\my_bot.js:1:78)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)```
#

what is the problem now?

dusky steeple
#

you need to define Discord

near lotus
#

oh

#

but how?

mossy vine
#

you just

#

define Discord

split hazel
#

define the discord js module

#

before making bots, it's recommended to have at least basic javascript knowledge

near lotus
#

okay! Thank you!

unreal junco
#

how can i add a role once someone guessed the number?

#

im using discord.js

mossy vine
#

read the docs

unreal junco
#

yeah

#

ik how to addrole

#

but this add role is different

#

if someone guesses the number it gives them a role

#

wait i think i got it

#

cannot read property 'addRole'

mossy vine
#

addRole is not a property

#

what

lament meteor
#

i presume u need to learn js

knotty steeple
#

addRole is a function

#

thats how you add the role

unreal junco
#

once someone guesses a number how can the bot auto pin message?

mossy vine
#

read the fucking docs yo

#

also dont pin message just because someone guessed the fucking number

stray cedar
sick cloud
#

put commands each in their own file

stray cedar
#

The commands themselves have their own file

sick cloud
#

discordjs.guide
read the command handler guide

stray cedar
#

Thanks

dull bobcat
#

ugh

wide ruin
#

node/discord.js

#

i type node server.js and websocket is not a constructor

#

what does that mean?

knotty steeple
#

it means its not a constructor

#

common sense

wide ruin
#

how do i fix?

marble needle
#

we need a "how to ask technical questions 101" pin ๐Ÿ˜ฉ

wide ruin
#

do i need to npm install websocket?

knotty steeple
#

How to ask a technical question 101:

What is your problem?
Can you give us any details on your problem?
Can you provide the language or library/framework you are using?

If you have any images relating to the problem post them. Be sure to post the error or actual problem instead of just "it isnt working"

#

@marble needle does that work

wide ruin
#

ok:

marble needle
#

no you need to specifiy what the difference between a lib and a language is. i stopped counting how many threw "javascript" at me when i asked for their lib

wide ruin
#

discord.js

knotty steeple
#

their problem

marble needle
wide ruin
#

well it was working fine before and now its not

#

so im confused

#
(node:8160) UnhandledPromiseRejectionWarning: TypeError: WebSocket is not a constructor
    at WebSocketConnection.connect (C:\Users\\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:254:26)
    at new WebSocketConnection (C:\Users\\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:89:10)
    at WebSocketManager.connect (C:\Users\\node_modules\discord.js\src\client\websocket\WebSocketManager.js:75:25)
    at client.rest.methods.getGateway.then.res (C:\Users\\node_modules\discord.js\src\client\ClientManager.js:45:22)
    at process._tickCallback (internal/process/next_tick.js:68:7)
#

well what would this even need?

quartz kindle
#

you did something wrong in your code

#

like using new in the wrong place

proper ember
#

^

#

Sounds like WebSocket wants to be returned as an object rather than formed as one

ruby dust
earnest phoenix
#

Would anyone want to get paid to make a web scrapper for me? o-o
its a bit complicated

quartz kindle
#

depends, how much you're offering? what kind of things do you need to scrap?

slender thistle
#

@ruby dust Groups?

ruby dust
#

there's commands.command and there's commands.group

#

I have an idea how it works but idk how to execute it

slender thistle
#
@commands.group(invoke_without_command=True)
async def your_command_name(self, ctx):
    do_your_functions()

@your_command_name.command()
async def sub_command_name(self, ctx):
    do_your_subcommand()
ruby dust
#

huh

#

how can I use both of these as functions?

slender thistle
#

await self.your_command_name()?

ruby dust
#

yes, how can that be useful to me

slender thistle
#

wdym use both of of those as functions? thonk_think

#

in Discord chat?

ruby dust
#

for example yes

slender thistle
#

[p]your_command_name sub_command_name

ruby dust
#

well that I know, but what's the reason behind both of these being functions? can I use the group function as a global check to be used by server managers, for example?

slender thistle
proper ember
#

Tfw you know next to nothing about Python. Smh

slender thistle
#

You don't need to judge someone or yourself for not knowing something

proper ember
#

I know, I was judging myself in a sense. Never picked up Python

ruby dust
#

there's always room to learn more

proper ember
#

I hope to learn it though!

slender thistle
#

It's not too hard, good luck though

proper ember
#

^^ Thanks!

ruby dust
#

just to let you know, python is best for scripting than anything else

proper ember
#

Yeah, so I've heard!

#

It sounds quite fascinating with a wide range of uses.

#

If anything, adding more skills to ones list is never a bad thing

ruby dust
#

it's well known for being one of the easiest languages and for being used by large companies, like google

proper ember
#

Yeee

topaz fjord
#

What about go

#

go is pretty fast

#

I'm thinking of using go for a neural network

proper ember
#

That sounds neat!

dusky steeple
#
output += `\`${c.help.name}\`, `;``` is how I have it now.
amber fractal
#

Slice the end

#

Or put them into an array and join the array by commas

hushed berry
#

yeah, joining is the clean solution

earnest phoenix
#

Economy System :c

#

Mad

late hill
#

Join them/check if last entry/check if first entry

mossy vine
#

@earnest phoenix store all members in a variable to prevent api abuse, and loop through the statuses

#

I aint gonna fucking spoonfeed you

quartz kindle
#

best way to do that would be to enable getting all users, if your library has that option. but keep in mind that doing so will increase your bot's resource usage and load time

uneven scarab
#

So am 13 and i am currently making a simple bot

#

all my friends want to use it in their servers

#

so how do i publish it?

steel heath
#

oh god

#

||u cant until you be 14|| lie

uneven scarab
#

wym

steel heath
#

you are making a bot but you don't have the application yet?

uneven scarab
#

what application lol

#

i use python to code

steel heath
uneven scarab
#

oh yeah i have that

steel heath
#

okay

#

then

#

you can just: