#development

1 messages · Page 846 of 1

earnest phoenix
#

hey guys

quartz kindle
#

a part of the token is actually just a timestamp

#

only the timestamp part changes

#

the actual token doesnt

earnest phoenix
#

anyone know if its possible to use permissionsOverwrites on a channel based on a users permissions
i.e a user with KICK_MEMBERS can see the channel however without, they cannot.
[djs]

quartz kindle
#

the token will still work regardless of the changes of its timestamp component

keen fern
#

ow

quartz kindle
#

@earnest phoenix the only way is to use roles

earnest phoenix
#

yeah thought so

quartz kindle
#

give the user a role with kick_members and put the role in the channel's permission overwrites

earnest phoenix
#

thing is I want it to be sorta globally working, cus some servers mods will be named "mods, moderators" etc.

quartz kindle
#

you can search for all roles with kick member permission and add them all to the channel

earnest phoenix
#

ah is that a thing, right.

#

would you mind pointing me in the direction for that

quartz kindle
#

you can loop over roles in a guild and check if role permissions contain kick members

#

for example (v12) js let roles = guild.roles.cache.filter(role => role.permissions.has("KICK_MEMBER"))

earnest phoenix
#
    if (resolve[1] != null) {
        getPlayers(758071, 4585176).then(function(resolve) {
            if (resolve[1] != null) {
                getPlayers(758071, 4585176).then(function(resolve) {
                    if (resolve[1] != null) {
                        //YOU GET THE IDEA
                    } else {
                        //DO ACTION
                    }
                })
            } else {
                //DO ACTION
            }
        })
    } else {
        //DO ACTION
    }
})```

How can I automate this so it isn't hardcoded?
#

sorry if I'm asking too many questions, and you don't have to give the code for this but, how exactly would I add "roles" to the permisisonsOverwrites.

quartz kindle
#

what is the difference between each nested function?

earnest phoenix
#

well, at some point the function will return resolve[1] which isnt gonna be null

#

and i want it to keep running until it does that

copper cradle
#

a while loop

earnest phoenix
#

uhhhhhhhhhhh

copper cradle
#

inside the first function

earnest phoenix
#

with async

#

how

copper cradle
#

ah crap

quartz kindle
#

@earnest phoenix why is the result of the function gonna change over time?

earnest phoenix
#

alright perfect, thanks for the help!

quartz kindle
#

what exactly is the function doing?

earnest phoenix
#

@quartz kindle oh crap i forgot something in that example code

#
    var currentArray = []
    return new Promise(resolve => {
        var url = `removedbecuznotneeded`;
        if (cursor) {
            var url = `removedbecuznotneeded`;
        }
        fetch(url)
            .then(res => res.json())
            .then(jsonData => {
                jsonData.data.forEach(element => {
                    var pushTo = element.username + "(" + element.userId + ")"
                    currentArray.push(pushTo);
                    
                });
                var resolveMe = [currentArray, jsonData.nextPageCursor]
                resolve(resolveMe)
            });
    })
}```
#

so it should use the new resolve[1] (nextPageCursor)

#

in each of those nested

quartz kindle
#

ah so each iteration can only resolve a part of the data with a cursor

#

and you need to scan more parts

earnest phoenix
#

yep

#

yep

#

exactly kind sir

quartz kindle
#

you can use either a recursive function or a while loop

earnest phoenix
#

i just dont know how to use a while loop with async

quartz kindle
#

a while loop should work with async as long as the loop itself is inside an async function

#
async (whatever) => {
  while(something) {
    let a = await result()
  }
}```
tired nimbus
#

How can I access the bot-img class on the dbl bot pages

copper cradle
#

inspect it and see which class it has lol

earnest phoenix
#

@quartz kindle what goes in (whatever)

#

could I do async function getAllPlayers(group, roleId) => {

quartz kindle
#

yes

#

and inside that function you can use a while loop with await

earnest phoenix
#

ok also what are ur rates

#

for classes

#

kind sir

quartz kindle
#

now the problem is, you need to be very careful

#

because while loops can easily lead to infinite loops

earnest phoenix
#

ok

#
    var cursorNull = false
    while(cursorNull == false) {
      let curResolve = await getPlayers(group, roleId)
      if(curResolve[1] == null) {
        cursorNull = true
      }

    }

  }```
#

so like that

#

then i can use the data

#

from curResolve

copper cradle
#

use ===

#

why are you using =>

earnest phoenix
#

k

#

'{' or ';' expected. wait what

copper cradle
#

I mean you don't need => if you're using the function keyword

quartz kindle
#

you can also use while(!cursorNull)

earnest phoenix
#

ok

#
        SEND_MESSAGES: true,
        VIEW_CHANNEL: true
    })

Tim just wondering if I had done something incorrect here if you could point me in the right direction that would be great!

dreamy breach
#
    var cursorNull = false
    while(cursorNull == false) {
      let curResolve = await getPlayers(group, roleId)
      if(curResolve[1] == null) {
        cursorNull = true
      }

    }

  })``` Isn't like that?
#

@earnest phoenix

earnest phoenix
#

nah UH

#

that leads to more errors

#
    var cursorNull = false
    while(!cursorNull) {
      let curResolve = await getPlayers(group, roleId)
      if(curResolve[1] === null) {
        cursorNull = true
      }

    }

  }```
#

that works ^

dreamy breach
#

Oh yeah it's a function, alright ^

#
        SEND_MESSAGES: true,
        VIEW_CHANNEL: true
    });``` @earnest phoenix
earnest phoenix
#

ah sorry, I took .updateOverwrites from the documentation, my bad.

dreamy breach
#

Np, ^^

quartz kindle
#

updateOverwrite does the same thing mostly

#

overwritePermissions is better if you're adding multiple users/roles

earnest phoenix
#

This is my code here, https://sourceb.in/7f7d38ebb5
it is allowing all users to be able to see into the channel, is this a problem due to the permissionOverwrites of when I create a channel?

quartz kindle
#

this is very wrong @earnest phoenix

#

you probably want handleVideo() not handleVideo = ()

#

@earnest phoenix you can add the permission overwrites on the channel options, no need to add them after the channel is created

#

also

earnest phoenix
#

How can I get a bot to respond to a trigger word?

quartz kindle
#

your "allowedUser" is a collection of roles

#

you need to add a separate permissions block for each item

earnest phoenix
#

like I'm planning on using the word replaced

#

and him responding to it

copper cradle
#

alessandro, go and learn how to call a function

earnest phoenix
#

like he's supposed to respond to replaced

#

the word

#

Do I use it like the ping pong version?

dreamy breach
#

@quartz kindle The code of alessandro isn't very similar to Cxllm who said that he made it by himself? x)

earnest phoenix
#
    return new Promise(resolve => {
    var currentArray = []
    var cursorNull = false
    var nextCursor = null
    while(!cursorNull) {
      let curResolve = await getPlayers(group, roleId, nextCursor)
      length = length + curResolve[0].length
      currentArray = currentArray.concat(curResolve[0])
      if(curResolve[1] === null) {
        cursorNull = true
        
      }

    }
resolve(currentArray)
            });
  }

why do i get await is only valid in async function

#

this is how i call it

#
    console.log(resolve.length)
    })```
crimson vapor
#

because its not an async function

#

you need to make it async

earnest phoenix
#

wtf

#

i did

#

async function

crimson vapor
#

the resolve function

#

make it async

#

I meant promise

dusty onyx
#

is £ a common prefix? curious

crimson vapor
#

return new Promicse(async resolve => {})

#

no, its not

dusty onyx
#

fun

tired nimbus
#

hey I need help

#

see the border line

#

I cant seem to find how to remove that

dusty onyx
#

what program u using? to animate

quartz kindle
#

look for box-shadow, should be in one of the img's parent elements

tired nimbus
#

css

finite bough
#

CSS I think

dusty onyx
#

ah ok no idea how that works sorry

tired nimbus
#

oh I was looking at the wrong class

agile orchid
#
#bot-details-page .bot-img {
    box-shadow: none !important;
}```
tired nimbus
#

yep

earnest phoenix
#

How long does it take for a bot to get ready? Like I'm on terminal

#

And my bot hasn't gotton ready at all

#

Its taking 5 of the forevers

crimson vapor
#

what processor do you have?

earnest phoenix
#

Macoxs

#

macos

crimson vapor
#

ok do you know how to find the CPU you have?

earnest phoenix
#

no

crimson vapor
#

top left, press the apple logo and press about this mac

#

then you can take a screenshot

earnest phoenix
crimson vapor
#

it should only take a few seconds maybe 20 at max

earnest phoenix
#

it worked fine eariler

crimson vapor
#

you didnt delete any code?

earnest phoenix
#

No let me send you something

#

Its all in the code

crimson vapor
#

add this to the bottom of your code :

client.login(token)```
pale vessel
#

how did it even work fine before

#

must've accidentally removed it

crimson vapor
#

yeah Lol

earnest phoenix
#

Ok it works

#

I'm dumb sometimes

#

const playlistPattern = /^.*(youtu.be\/list=)([^#\&\?]*).*/gi;
i know this is wrong some plz help ASpapohm

pale vessel
#

regex 101

crimson vapor
#

I have never used regex's

earnest phoenix
#

How do I add new commands?

#

I mean like a trigger word

#

i was planning on my bot responding to the word replaced

#

?

crimson vapor
#

wrong chat srry

earnest phoenix
#

oh

#

Anyways like I said I needed help with a bot trigger word

#

btw that's not allowed in this server fyi

#

if the bot is this server responded to words it will be mute

#

No in my own server

#

I'm trying to get him to respond to replaced

#

so for example u say replaced it will respond an msg yes @earnest phoenix

#

then do this

if (message.content === 'replaced') {

    message.channel.send(`hello world`);
  
  }}```
pale vessel
#

it's trigger word

#

so he can use includes

zenith terrace
#

or .startsWith

#

Whichever

#

¯\_(ツ)_/¯

finite bough
#

hmm

earnest phoenix
#

For some stranger reason he's not responding

#

are u new to this

#

yes

#

I'm used to coding ddlc mods

finite bough
#

@earnest phoenix why make an async function tho

earnest phoenix
#

u don't need to i did that if he wanted to add more

finite bough
#

well ye

#

like awaits and stuff

earnest phoenix
#

So what do I do?

#

I literally am new to this

#

let me see your code plz

#

Ok

#

here ya go

#

one sec

#

k

mystic violet
#

vap ncs 24/7

earnest phoenix
#

strange your code is acting wrong

mystic violet
#

oops

#

wrong chat

#

sry

earnest phoenix
#

how?

quartz kindle
#

no need to send your js file

#

you can paste your code here using code blocks

#

``` code here ```

crimson vapor
#

```js
code here
```

#

js tag better

tired nimbus
#

yes we all need colors

crimson vapor
#

colors make it 69% easier to read

tame shuttle
#

Are iframes allowed in bot posts?

earnest phoenix
#
const Discord = require('discord.js');
const client = new Discord.Client();
const { prefix, token } = require("./config.json");

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

client.on('message', console.log);

client.on('message', message => {
  if (!message.content.startsWith(prefix))
    return;

  const args = message.content.substring(prefix.length)
    .trim()
    .split(/\s+/);

  const command = args.shift().toLowerCase();
  if (message.content === 'replaced') {

    message.channel.send(`What? Did you say the forbidden 'r' word?`);
  
  }
  switch(command) {

    case "ping":
      message.channel.send('Pong!');
      break;

    default:
      break;

  }
});

client.login(token)```
crimson vapor
#

Epic

modest maple
#

@tame shuttle yes

earnest phoenix
#

What did I do wrong?

#

plus why ar u doing it like this

crimson vapor
#

can I have colors?

earnest phoenix
#

I dunno

#

u did the js one i did the block one

#

What do I have to redo it?

pale vessel
#

what am I looking at

#

why are you guys sending codes with no context

earnest phoenix
#
const Discord = require('discord.js');
const client = new Discord.Client();
const { prefix, token } = require("./config.json");

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

client.on('message', console.log);

client.on('message', message => {
  if (!message.content.startsWith(prefix))
    return;

  const args = message.content.substring(prefix.length)
    .trim()
    .split(/\s+/);

  const command = args.shift().toLowerCase();
  if (message.content === 'replaced') {

    message.channel.send(`What? Did you say the forbidden 'r' word?`);
  
  }
  switch(command) {

    case "ping":
      message.channel.send('Pong!');
      break;

    default:
      break;

  }
});

client.login(token)```
#

u dont have to but way your doing it so uneasy

pale vessel
#

again

earnest phoenix
#

My code is wrong

#

yes

#
const Discord = require('discord.js');
const client = new Discord.Client();
const { prefix, token } = require("./config.json");


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

  
client.on('message', console.log);


client.on('message', message => {
  if (message.content === 'replaced') {

    message.channel.send('why did u say the r word');
  
  }
  if (!message.content.startsWith(prefix))
    return;

  const args = message.content.substring(prefix.length)
    .trim()
    .split(/\s+/);

  const command = args.shift().toLowerCase();

  switch(command) {

    case "ping":
      message.channel.send('Pong!');
      break;

    default:
      break;

  }
});

client.login(token)```
#

can you

#

stop

#

just do taht

#

spamming the code blocks

#

that

#

its not

pale vessel
#

what now

earnest phoenix
#

@earnest phoenix just in the future dont do it like that k

tired nimbus
#

Whats wrong

#

you have a blob with no information

earnest phoenix
#

anyways is this the right format for playlist
const playlistPattern = /^.*(youtu.be\/list=)([^#\&\?]*).*/gi;

#
#

it will help u alot

#

did someone say breaded fish?

heavy anchor
#

cry bro chill this is what this channel is for

agile orchid
#

well but it's not for spamming

heavy anchor
#

no not spamming

neat gazelle
#

does anyone know how to host a bot on repl.it?

earnest phoenix
#

dude, just buy a raspberry pi

#

itd be 10x better than any free one

#

😄

slender thistle
quartz kindle
#

you can use repl.it, but you can only run discord.js v11 in there

earnest phoenix
#

It turned it was going into the console

#

and not the server itself

#

How do I do that?

agile orchid
#

do what?

earnest phoenix
#

get the bot to say its command in the server

agile orchid
#

send me your code

#

i wanna see what u did wrong

#

only from the command tho

earnest phoenix
#

ok I deleted the console part

#

because it was going straight to the console instead of the server

#
const Discord = require('discord.js');
const client = new Discord.Client();
const { prefix, token } = require("./config.json");


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

client.on('message', message => {
  if (message.content === 'replaced') {

    message.channel.send('why did you say the r word?');
  
  }
  if (!message.content.startsWith(prefix))
    return;

  const args = message.content.substring(prefix.length)
    .trim()
    .split(/\s+/);

  const command = args.shift().toLowerCase();

  switch(command) {

    case "ping":
      message.channel.send('Pong!');
      break;

    default:
      break;
agile orchid
#

there's nothing wrong

earnest phoenix
#

Then why isn't it responding?

agile orchid
#

because you have to type your prefix infront of ping

#

obviously

prime cliff
#

You used a space between the prefix and command

elder garnet
#

i keep getting a events.js error help?

prime cliff
#

pb!ping not pb! ping

earnest phoenix
#

I did but its not working

agile orchid
#

does the console say any error?

prime cliff
#

You should add Console.Write() in your code to check what is being given then and you might find out

#

i keep getting a events.js error help?
@elder garnet you need to give us info about the issue

agile orchid
#

you ever just ask for help without letting others know what's wrong

elder garnet
#

h m

#

it doesnt say which line

#

but it says its in events line 182

#

events.js

prime cliff
#

Show us the error message

agile orchid
#

then look up the line

elder garnet
#

ok

#

sec

#

throw err;

#

er*

prime cliff
#

WaitWhat you having a brain error too

elder garnet
#

i am reinstalling npms too lol

#

im ona school tablet i cant copy and paste stuff lol

prime cliff
#

Wait why are you coding on a tablet

elder garnet
#

im not coding on a tablet

#

lol

#

im coding on my pc

#

i use my tablet to use discord

earnest phoenix
#

ar u an caveman

elder garnet
#

lolno

prime cliff
#

Wait what was that github you just deleted thonK

elder garnet
quartz kindle
#

that has nothing to do with discord whatsoever lmao

prime cliff
#

Have you tried some of the solutions in there then?

elder garnet
#

h m

#

nop

#

lol

#

gonna try them now

prime cliff
elder garnet
#

l o l

past trail
#

Well I am new to making discord bots and I am trying to make a basic game of war for my bot using discord.py and I am having error and I don't know how to fix it as it happens when I try to either take a card away from one player and give to another. I am using two separate list (one for the player's cards and one for the computer's card) and I'll copy and paste the code in here. The error is that the integer is not subscriptable.

quartz kindle
#

unhandled error event meants the event emitter emited an error, which was not handled by your program

#

the event emitter in this case is your discord client

#

in order to catch an error event, simply add an event for it

#
client.on("error", console.log)```
elder garnet
#

okay

quartz kindle
#

this will log the error instead of throwing an error and crashing your program

past trail
#

Well I am new to making discord bots and I am trying to make a basic game of war for my bot using discord.py and I am having error and I don't know how to fix it as it happens when I try to either take a card away from one player and give to another. I am using two separate list (one for the player's cards and one for the computer's card) and I'll copy and paste the code in here. The error is that the integer is not subscriptable.

#
async def playwar(ctx):
    cards = [2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,6,6,6,6,7,7,7,7,8,8,8,8,9,9,9,9,10,10,10,10,11,11,11,11,12,12,12,12,13,13,13,13,14,14,14,14,15,15]
    random.shuffle(cards)
    playerhand = random.choices(cards, k=27)
    cpuhand = random.choices(cards, k=27)
    playercardnumber = 27
    cpucardnumber = 27
    nowinner = True
    while nowinner:
        await ctx.send('Let the game begin')
        time.sleep(2)
        if playerhand[0] > cpuhand[0]:
            await ctx.send(playerhand[0])
            await ctx.send(cpuhand[0])
            await ctx.send('player has won this round')
            playerhand.append(cpuhand[0[:-1]])
            cpuhand.remove([0])
            playercardnumber += 1
            cpuhand -= 1
            print(playerhand)
            time.sleep(2) ```
quartz kindle
#

im not familiar with python, but does random.choices return one item from cards? if so, then playerhand[0] is trying to get item 0 from what is already a final item

copper cradle
#

yes

#

yes

#

random choice returns the item

past trail
#

The error is the line with playerhand.append(cpuhand[0[:-1]])

copper cradle
#

and what does the error say

quartz kindle
#

if playerhand is an item from cards, then it is a number

past trail
#

TypeError: 'int' object is not subscriptable

quartz kindle
#

you cannot append something to a number

copper cradle
#

ah yes

#

I know that error

#

cpuhand is a number

#

you can't index from a number lmao

#

is like doing

#

3[0]

earnest phoenix
#

Tim is this playlist format right i know it wrong but i dont know the format
const pattern = /^.*(youtu.be\/|list=)([^#\&\?]*).*/gi;

quartz kindle
#

idk

earnest phoenix
#

XD

quartz kindle
#

idk how youtube playlists look like

#

i dont use them

earnest phoenix
#

np

quartz kindle
#

use some regex tester online and test it against some real links

earnest phoenix
#

ohhh didn't know this existed thx

quartz kindle
#

there are dozens of those lul

earnest phoenix
#

How long does it take usually for a MongoDB database to update?

past trail
#

So is there anyway that I could fix that error without changing the cards list from integers to strings? If I change the integers in that list to strings then I obviously cannot compare a string to a string

sick cloud
#

got a js question, i'm using window.location.href = '...'; on a button using onclick, how do i set the target to open in a blank tab

earnest phoenix
#

you don't

heavy anchor
#

is there any reason I can't do this

bot.on('message', msg => {
   console.log(`${msg.author.username}: "${msg.content}" ${msg.guild.name} ${msg.guild.id}`);
}); ```
valid frigate
#

i mean couldn't you just append target attribute to the button

#

or wait is that for links only

sick cloud
#

well i'm asking here

earnest phoenix
#

you're changing the current window's location

#

you need to create a new one

#

use window.open

sick cloud
#

got it

#

ty

zenith terrace
#

Interesting

earnest phoenix
#

btw is it easy to make it where your bot can have multiple languages

#

pretty much

split hazel
#

if you code it right

earnest phoenix
#

so i need the lang file ex eng an command to run the thing and an save file like json or sqlite

zenith terrace
#

Ye it could be hard

#

But what Speedy said

#

If you code it right

split hazel
#

For example good handler that takes care of the preferences & messages for you

earnest phoenix
#

ASpapohm i shall try

zenith terrace
#

Hmm

earnest phoenix
#

first you need to store the guild language in a database, then store your responses in some .json file with the locale name, e.g en_US.json would be

{"greet": "Hello!"}

while fr_FR.json (french) would be

{"greet": "Bonjour!"}

then on boot load those json files into some service in memory, then replace everywhere you send a message with those responses, e.g "Hello!" would be replaced with responseService.get(guild locale, "greet") etc

#

just to note that you won't have much use out of a multilangual bot since chances are whoever uses/will use your bot already understands how to use it in english

#

i saw something like this somewhere responseService.get(command : grate)

#

and in the json file like {command
{ grate : 'great',
}
}

elder garnet
#

Tim, idid your client.on("error") thing but i still get the error

#

error:EADDREINUSE address already in use

#

the events.js is is not defined in my code

#

so its a nodejs problem i guess?

quartz kindle
#

EADDREINUSE means you're trying to use a port that is already being used

#

you cannot use the same port multiple times

earnest phoenix
#

How do I kill a process on a port so I can use it for other things?

quartz kindle
#

depends on the operating system

earnest phoenix
#

Im using CentOS Linux

quartz kindle
#

but 99% of the times its your own process thats trying to use the same port more than once

earnest phoenix
#

btw await in JS makes it so that the code must wait for a promise before proceeding right?

quartz kindle
#

yes but only inside the async block, code outside that block will continue to run normally

solar lark
#

when using a regex, how would it match "owo" at a random position?

#

for example "test34Owoq92"

pale vessel
#

/owo/i

#

if you make the string to lowercase you wouldn't need the i flag

solar lark
#

aight, ty

heavy anchor
#

Is there anyway to send the logs from my bot to a specific channel in my discord server?

neat gazelle
#

repl.it isn't for hosting 👀
@slender thistle they advertise hosting bruh

hollow granite
#

Yes, i think you would have to first find your guild

var myGuild = client.guilds.cache.find(g => g.id == YOUR_GUILD_ID)``` 
then find the channel in your guild
```js
var logChannel = myGuild.channels.cache.find(c = c.id == YOUR_CHANNEL_ID)```
you can send messages and stuff to this channel now
```js
logChannel.send("whatever you want")```
earnest phoenix
#

or client.channels.get(channelid)?

#

if ur in v11

clear wraith
#

Have any of you Devs used Glitch.com to develop your bot, and willing to help me with some things?

zenith terrace
#

@clear wraith what kind of things

clear wraith
#

Errors on Glitch

#

I have some errors, but i can't seem to fix them.

earnest phoenix
#

ok i am going to use this chat alot bc i want to upgrade for 11 to 12 but i lazy hence i will ask u botaful people

clear wraith
#

Plus I'm kinda new to the whole thing

earnest phoenix
#

so what has bot.guilds.forEach() replaced with

hollow granite
#

but maybe bot.guilds.cache.forEach()

earnest phoenix
#

i am lol but i cant find it

#

too many changes

summer torrent
#

guilds.cache

earnest phoenix
#

kk

summer torrent
tawdry tangle
#

Do anyone have experience with a bot call Alice I’m having trouble with it

hollow granite
#

their support server can probably help you more than here

tawdry tangle
#

That what been doing some reason I can’t find it but look harder thx anyway

summer torrent
tawdry tangle
zenith terrace
#

@clear wraith what errors?

clear wraith
#

On when I type my command c!help It sends Glitch.com errors

#

And my help menu doesn't show up

earnest phoenix
zenith terrace
#

what error pops up?

clear wraith
#

Ill take a pic

zenith terrace
#

sure

clear wraith
#

The first line says... (node:173) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'tag' of undefined

Then it has Jump To Sections.

zenith terrace
#

What does it jump to?

#

Whats the code?

#

Also are you on windows?

clear wraith
#

No

quartz kindle
#

thats glitch

zenith terrace
#

I know Tim

#

<_<

#

I mean OS

quartz kindle
#

why does os matter?

zenith terrace
#

Cause snipping tool on windows

quartz kindle
#

ah lul

zenith terrace
#

Make it easier

quartz kindle
#

could also copy and paste the actual text

zenith terrace
#

True

clear wraith
#

The First one jumps to... My help.js file... The error line (line 10) says..... .setDescription(If you are having any trouble, please join our server and contact the bot creators ${owner.tag} and ${owner2.tag}.)

zenith terrace
#

What have you got owner defined as?

#

and owner2

clear wraith
#

Like...

#

The owner ID?

zenith terrace
#

No

topaz fjord
#

guid owners aren't cached

clear wraith
#

Sorry, I'm new at this

topaz fjord
#

*guild

zenith terrace
#

owner.tag what is owner defined as?

#

Look where you defined owner

quartz kindle
#

cannot read X of undefined means you're trying to access a property of something that doesnt exist. for example if owner2 does not exist, then owner2.tag will throw that error, because "it cannot read tag from something that doesnt exist"

clear wraith
zenith terrace
#

No

earnest phoenix
#

OMG

zenith terrace
#

Show whole code

#

@quartz kindle Dont go into big words, the guy is new lol

earnest phoenix
quartz kindle
#

to fix this error, you need to look at how you define owner and owner2, ie: look at where you create them. you have to make sure that they properly exist and are valid

zenith terrace
#

@earnest phoenix error?

clear wraith
earnest phoenix
#

Cannot read property 'catch' of undefined

#

its bc 11 to 12

#

i cant see any thing in the discord js doc

zenith terrace
#

@clear wraith maybe owner.user.tag?

quartz kindle
#

no, the problem is that the user is not cached

zenith terrace
#

That catch error is annoying

earnest phoenix
#

wow u didnt put the , after ever field

quartz kindle
#

@earnest phoenix show error

summer torrent
earnest phoenix
#

xcmeep discord 12 is annoying

dusky garden
#

whats the code?

earnest phoenix
#

look above

quartz kindle
#

@clear wraith instead of client.users.get("ID"), do await client.fetchUser("ID")

#

@earnest phoenix show message.js line 34

clear wraith
quartz kindle
pale vessel
#

sigh

summer torrent
#

learn how to take ss please

dusky garden
#

it is pretty annoying

earnest phoenix
clear wraith
#

Dude... Im taking pics from my phone

clear wraith
#

NOT screenshots

dusky garden
#

just do windows + PrtSc

summer torrent
#

taking screen pics from phone is bad idea

zenith terrace
#

or use the snipping tool

quartz kindle
#

@earnest phoenix .catch() only exists in async functions. your function is not async

dusky garden
#

@earnest phoenix do try and catch instead

earnest phoenix
#

hmmm is it discord 12 change bc it used to work in 11

quartz kindle
#

or make it an async function

#

this is not related to discord

clear wraith
#

Am I allowed to invite people to my glitch.com project?

zenith terrace
#

U can yes

#

But if people want to

quartz kindle
#

i literally told you exactly what you need to do. what didnt you understand??

clear wraith
#

Can i invite one of you?

dusky garden
#

@earnest phoenix discord does not change async functions and .catch in anyway. this is normal javascript no packages will change that

zenith terrace
#

@clear wraith instead of client.users.get("ID"), do await client.fetchUser("ID")
@quartz kindle

clear wraith
#

NOTHING @quartz kindle, I UNDERSTOOD NOTHING

quartz kindle
#

I SHOWED YOU

#

WHAT TO CHANGE

#

Lol

earnest phoenix
#

lol

clear wraith
#

😐

earnest phoenix
#

kk apple

dusky garden
#

u can do try and catch instead

zenith terrace
#

change it from

let owner = client.users.get('ID')```
to
```js
let owner = await client.fetchUser("ID")```
regal saddle
#

whut happend here?

zenith terrace
#

do the same for owner2

earnest phoenix
#

lol

clear wraith
#

Ok

zenith terrace
#

@regal saddle Tim being mad

#

👀

regal saddle
#

Tim is mad?
Tim?

quartz kindle
#

fear me

regal saddle
#

how is that possible

dusky garden
#

lol

zenith terrace
#

Once Tim gets mad, the world is doomed

quartz kindle
#

anyways im tired asf you guys got this

#

see ya

zenith terrace
#

Bye

regal saddle
#

Good Bye tim

#

what happend...reading time

zenith terrace
#

Luv u tim no homo GWjiangLoveHeart

earnest phoenix
#

if (message.author.id === config.owner) is this right

dusky garden
#

no its fine

zenith terrace
#

should be that

dusky garden
#

discord 12 reallt stumped me as well

earnest phoenix
#

Rage discord 12 will give me high blood pressure

plain gazelle
#

jda had a really good transfer guide

clear wraith
#

I know, I probably Make you guys mad...

Listen, I am a beginner at this stuff.
So just bare with me if I don't understand something. I will Eventually understand what you are talking about.

dusky garden
#

i mean how do i get a channel

zenith terrace
#

message.channel.cache.get

plain gazelle
#

bruh this is why you dont cop code on the interwebz and use youtube tutorials for everything lol

dusky garden
#

it used to be msg.guild.channels.get("id") but now its idk

#

message.channel.cache.get
thx

zenith terrace
#

@dusky garden if you are making a private bot for a server then you dont need guild

dusky garden
#

also how do i find a channel via name?

earnest phoenix
#

what if i changed this if (message.author.id === config.owner) to bot.users.cache.get('266636923387248640');

dusky garden
#

hmmmm

zenith terrace
#

try it

dusky garden
#

lets see

hollow granite
#

idk if it's better but there is also bot.users.fetch('266636923387248640');

zenith terrace
#

¯_(ツ)_/¯

#

i dont really think it matters

hollow granite
#

yeah, it probably doesnt

earnest phoenix
#

ASwaitWUT it worked

zenith terrace
#

which one

earnest phoenix
zenith terrace
#

oof

earnest phoenix
#

noo

#

i mean the other one

#

idk why

zenith terrace
#

maybe it changed a bit

earnest phoenix
#
        cmdFile(bot, msg, args, ).catch(err => {}``` what to do with this
#

make it async

#

??

zenith terrace
#

I cant get on my project since im streamiing

#

Reee

earnest phoenix
#

its not an big deal it still works but the error will fill my console with crap

neat gazelle
#

does anyone know how to use node.js to use multiple cores instead of just one core?

zenith terrace
#

Ah Tony is here now

#

He can help

#

Hopefully

earnest phoenix
#

tony help

sick cloud
#

i have an arr like this:

[
{ id: 0 },
{ id: 1 },
...
]

how would i find if the array has the object i need (ie. 1)

#

also whats up

dusky garden
#

just do

if(cmdFile) {
try{
cmdFile(bot, msg, args, )
} catch(err){
//err code
}
zenith terrace
#

@sick cloud text is right above you

earnest phoenix
hollow granite
#

I would try to use a loop and go through each one to see if it has an id that equals to 1

earnest phoenix
#

kk apple thx

dusky garden
#

umm hi

#

i need help

#

i need to find the bot count of a server using the bot

pale vessel
#

filter

#

the

#

members

dusky garden
#

k

digital ibex
#

hi

summer torrent
#

show full error

digital ibex
summer torrent
#

MODULE_NOT_FOUND

#

which module?

elder garnet
#

h0w t0 make a 8ball cmd?

digital ibex
#

uh

#

thats the full error

earnest phoenix
#

msg.mentions.users.first() what is this replaced with 11 to 12

#

too lazy to chek the doc

summer torrent
earnest phoenix
#

is it data

dusky garden
#

nothing

#

nothing was changed with that statemeny

earnest phoenix
#
mentions.has() has been added, replacing message.isMentioned() and message.isMemberMentioned(). It has two paramets: the first is data representing a User, GuildMember, Role, or GuildChannel and an optional options object.```
dusky garden
#

msg.mentions.users.first() this still works

earnest phoenix
#

it not working though

#

strange

dusky garden
#

hmm show me code

zenith terrace
#

error?

earnest phoenix
#

Supplied options is not an object. i think

zenith terrace
#

code

earnest phoenix
#

i am using the doc but some things i cant find

dusky garden
#

whats wrong with it

#

what is it showing when u run the cmd

zenith terrace
#

U didnt add the message.channel.send?

dusky garden
#

ooh

earnest phoenix
#

its below

zenith terrace
#

Oh

dusky garden
#

what is it showing when u run cmd

digital ibex
#

whats not working

dusky garden
#

do u get an err or what

digital ibex
#

and error

#

yah

earnest phoenix
#

(node:16208) UnhandledPromiseRejectionWarning: TypeError [INVALID_TYPE]: Supplied options is not an object.

digital ibex
#

full error?

dusky garden
#

screenshot it

digital ibex
#

what part of the code does it take u to

earnest phoenix
#

wait let me do an support test

dusky garden
#

which file what line?

earnest phoenix
#

ok nvm

dusky garden
#

?

digital ibex
#

whatever that is

#

👍

#

sure

dusky garden
#

how do i find the bot count of a server?

digital ibex
#

wdym?

earnest phoenix
summer torrent
#

filter()

digital ibex
#

guilds memebrcount?

#

oh

#
message.channel.guild.memberCount.filter((e) => e.bot).length
#

:p

summer torrent
#

@earnest phoenix show your code

earnest phoenix
#

look above

digital ibex
#

thats not code

summer torrent
#

@digital ibex this is wrong

digital ibex
#

its for eris @summer torrent

#

ok

summer torrent
#

memberCount is a number Thonk

digital ibex
#

wot

#

iirc its a string

summer torrent
#

how do you can filter "memberCount"

digital ibex
#

lemme show u rq

summer torrent
digital ibex
#

OH

#

my bad

#

@dusky garden use ```js
message.channel.guild.members.filter((e) => e.bot).length

summer torrent
#

*size

dusky garden
#

oh

digital ibex
#

for eris

#

im not trying to totally spoonfeed

#

which i am but

#

shrug

summer torrent
#

length is for Array

dusky garden
#

godness

digital ibex
#

without .length it returns an array then

dusky garden
#

does it?

summer torrent
#

which lib are you talking about

digital ibex
#

eris

dusky garden
#

discord.js

digital ibex
#

yah

summer torrent
digital ibex
#

its pretty similar for d.js

#

cba to log it

#
message.guild.members.filter((e) => e.bot).size
#

thats for d.js

summer torrent
#

yes

dusky garden
#

got an err

earnest phoenix
#

k i fixed for some reason the error was the report thing it works now facepalm2

dusky garden
#
D:\Bot Counter\index.js:16
    let botCount = msg.channel.guild.members.filter((e) => e.bot).length
                                             ^

TypeError: msg.channel.guild.members.filter is not a function
    at Client.<anonymous> (D:\Bot Counter\index.js:16:46)
    at Client.emit (events.js:210:5)
    at MessageCreateAction.handle (D:\Bot Counter\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (D:\Bot Counter\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (D:\Bot Counter\node_modules\discord.js\src\client\websocket\WebSocketManager.js:386:31)
    at WebSocketShard.onPacket (D:\Bot Counter\node_modules\discord.js\src\client\websocket\WebSocketShard.js:435:22)
    at WebSocketShard.onMessage (D:\Bot Counter\node_modules\discord.js\src\client\websocket\WebSocketShard.js:293:10)
    at WebSocket.onMessage (D:\Bot Counter\node_modules\ws\lib\event-target.js:120:16)
    at WebSocket.emit (events.js:210:5)
    at Receiver.receiverOnMessage (D:\Bot Counter\node_modules\ws\lib\websocket.js:801:20)
digital ibex
#

error?

summer torrent
#

what is your djs version

digital ibex
#

wot

#

message.channel

dusky garden
#

newest

digital ibex
#

for eris

#

not d.js

#

u done message.channel

summer torrent
#

newest what

#

12.1.1?

digital ibex
#

v12

dusky garden
#

yes

zenith terrace
#

would the

message.guild.members.filter((e) => e.bot).size```
work in a botinfo logging the amount of bots in a server
summer torrent
#

that is members.cache.filter

dusky garden
#

i downloaded yesterday

digital ibex
#

oh

#

thats the issue

summer torrent
digital ibex
#

dumb useless cache

elder garnet
#

how to make a 8ball cmd? still have no idea

#

lol

zenith terrace
#

Nice

digital ibex
#

make respponses an array

#

u got 0 den :p

#

0 cached*

#

@elder garnet make the responses an array and do the math stuff math florr

#

and send it

summer torrent
#

make respponses an array
then send responses randomly

digital ibex
#

he gets what i mean

elder garnet
#

the problem for me

#

is

digital ibex
#

or?

elder garnet
#

i havent

#

tries

digital ibex
#

ok

elder garnet
#

tried

dusky garden
#

idk

elder garnet
#

something like

dusky garden
#

i dont get it

elder garnet
#

goose 8ball hello im goose

dusky garden
#

how do i filter the bots?

elder garnet
#

a text

digital ibex
#
let responses  = [
'option 1',
'and',
'so',
'on'
]
dusky garden
#

in v12

summer torrent
#

@dusky garden filter(m => m.user.bot)

elder garnet
#

ik the responses thing

dusky garden
#

i still dont get it

digital ibex
#

what dont u get den?

elder garnet
#

just the cmd

digital ibex
#

huh

#

wot

dusky garden
#

let botCount = msg.channel.guild.members.filter((e) => e.bot).length

elder garnet
#

ok

#

so

summer torrent
#

user.bot

dusky garden
#

what does that become in v12

elder garnet
#

you know

#

like

#

when you so

#

8ball hello ayfs

digital ibex
#

@dusky garden its not msg.channel.guild.memebrs...

elder garnet
#

it only detects for 8ball

#

and if its not 8ball

zenith terrace
#
message.guild.members.filter((e) => e.user.bot).size```
elder garnet
#

then it returns

dusky garden
#

oh

elder garnet
summer torrent
#

cache.filter

digital ibex
#

channel is a a guild property for eris

#

not d.js

summer torrent
#

djs too

zenith terrace
digital ibex
#

K

dusky garden
#

where the hell did you get 7270 bots?

summer torrent
dusky garden
#

oh wait

#

now i get it

digital ibex
#

@dusky garden ```js
message.guild.members.cache.filter((e) => e.user.bot).size

dusky garden
#

ok

summer torrent
digital ibex
#

i have't looked at d.js docs for a while

#

K

#

yeah well

earnest phoenix
#

u should

#

let me try in 11

summer torrent
#

cache.filter in v12

digital ibex
#

why do i get this error when index.js is a file?

dusky garden
#

works thx!

earnest phoenix
#

yah 12 it doesn't work

digital ibex
#

.user.bot

zenith terrace
#

user.bot

#

<_<

#

u were told

#

Reee

summer torrent
#

@digital ibex show full error

#

not console

digital ibex
#

the error is in the console doe

summer torrent
#

pm2 logs --lines=100

zenith terrace
#
bot.users.size```
(v11) anyway to get it so it can find every user in every guild
earnest phoenix
digital ibex
#

how do i get the full error then?

summer torrent
#

pm2 logs --lines=100
@summer torrent

digital ibex
#

just !user.bot

earnest phoenix
#

xcmeep i have crap tone of code to convert to 12

#

{"listOfSaves":[["3/30/2020",{"...":"..."}]]}

How do you get the date in listOfSaves? What would be the location?

digital ibex
#

oh

#

OH

#

ty

earnest phoenix
#

if (!msg.member.hasPermission('BAN_MEMBERS') discord 12 if(permissions.missing(['BAN_MEMBERS']))

#

? am i suposed to do it like that

digital ibex
#

depends on what u want after

#

oh

#

first 1

earnest phoenix
#

ok then has perm

digital ibex
#

wait

#

is missing even a thing

#

wtf

summer torrent
#

that is permissions.has() in v12

#

just rtfm

earnest phoenix
digital ibex
#

then both will work

#

but

#

that is permissions.has() in v12
@summer torrent

summer torrent
#

hasPermission renamed to permissions.has()

earnest phoenix
#

ok so it will beif (!msg.member.permissions.has('BAN_MEMBERS')

#

soo many changes

#

lol

digital ibex
#

K

earnest phoenix
#

but i like this one

digital ibex
#

K

earnest phoenix
#

How can I check if an array element exists?

summer torrent
#

example

if (array.indexOf(element) === -1) {} // doesn't exists```
tired nimbus
#

I have this:
await sql.prepare(`DELETE FROM quests WHERE id = ${message.author.id}`)

#

but it never deletes that users data

#

nvm

#

also

#

is it supposed to make 3 sql files

#

is it possible to make it one

#

does the amount of files affect performance as it has to reach different locations?

past trail
#

Does anyone know on python how to move the first element in a list and make it the last element of that same list? I've been searching on how to find it but haven't found what I am exactly looking for

earnest phoenix
#

@past trail a, b = list[0], list[1]

#

then after that

#

list[b], list[a] = list[a], list[b]

#

i got a question

#
    
        
    if (!fs.existsSync(`./users/${playerId}.json`)) {
        fs.createReadStream('./users/template.json').pipe(fs.createWriteStream(`./users/${playerId}.json`));

how can I make it wait for the copy to complete before running the rest of the function

tired nimbus
#

can someone please explain this

#

I really dont understand

#

does that increase speeds?

clear wraith
#

Ok, I can take actual screenshots now if someone can help me with my bots errors..??

earnest phoenix
#

what is the error

#

@clear wraith

clear wraith
#

Well, If i could figure out how to get my bot back online, I could show you

earnest phoenix
#

ok then

clear wraith
earnest phoenix
#

no

clear wraith
#

Oh ok

earnest phoenix
#

but i recommend you shell out the $3 for a host

sick cloud
#

does anybody use jquery here

#

if so did they remove .post()

amber fractal
#

Seems to still exist as of the latest jquery docs however they do say Deprecation Notice The jqXHR.success(), jqXHR.error(), and jqXHR.complete() callback methods are removed as of jQuery 3.0. You can use jqXHR.done(), jqXHR.fail(), and jqXHR.always() instead.

sick cloud
#

got it

#

also const submitButton = document.getElementById('submitButton'); submitButton.append('disabled', 'true');
by any chance is that possible

#

(to disable a button)

amber fractal
#

I think you can with .prop()

#

Doesnt append do content stuff?

sick cloud
#

no idea lol

amber fractal
#

Only the prop part

#

Idk what dialog does lol

copper cradle
#

I've never used JQuery, what is it used for?

#

and what is that $ function used for

#

and why do people always define $this

#

makes no sense to me

sick cloud
#

prop disabled true got it

eternal ermine
#

Oh, command not here.

stark terrace
#

@copper cradle $ is simply a variable. I believe it refers to the document root (someone correct me if I'm wrong)? If you're familiar with lodash, you may have seen _ used to access methods from the lodash package in regards to NPM and Node

jQuery in a nutshell is simply a library that makes coding in Js a lot better and even more robust

earnest phoenix
#
    
        
    if (!fs.existsSync(`./users/${playerId}.json`)) {
        fs.createReadStream('./users/template.json').pipe(fs.createWriteStream(`./users/${playerId}.json`));

how can I make it wait for the copy to complete before running the rest of the function

copper cradle
#

ah, thanks for the explanation @stark terrace

stark terrace
#

No problem

clear wraith
#

My bot is back up and running! Thanks to the ones who helped me!

past trail
#

On discord.py is there any way to have a command terminate or stop another command while the command I want to terminate is still running? or do I use an event?

delicate zephyr
#

You could seperate the commands into threads and then terminate the threads

tardy estuary
#

@sick cloud if you didn't figure out, $.post is still available in latest jQuery. Just a shorthand version for post. There's also $.get

sick cloud
#

yep

earnest phoenix
#

Error: Cannot find module 'C:\Users\namehere\Desktop\name 2020-2021'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15)
at Function.Module._load (internal/modules/cjs/loader.js:864:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
at internal/main/run_main_module.js:18:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}

#

it cant find the module for node, anyone know why?

prime cliff
#

You're not even loading a module you are using a file path WaitWhat

earnest phoenix
#

oh

#

what am i supposed to do then

#

😆

#

how can I remove all of a users role and then when they react to the message it sends add them back?

#

@prime cliff whats the soloution

prime cliff
#

What are you trying to import?

earnest phoenix
#

wdym

prime cliff
#

What are you trying to do with your code

earnest phoenix
#

open up a bot

#

make it active

prime cliff
#

That's not how it works you need to actually code a bot

#

@earnest phoenix check your lib docs for guildmember and use the functions to get all roles, store that data with the user id and then foreach remove all roles

runic willow
#

why is tupperbox offline ;-; wait is this even the right server- o-O”.

prime cliff
#

Nope

runic willow
#

f-

prime cliff
#

Click the Support Server button on the bot page

#

If it has one

cursive dagger
#

Use the join support button on the site

runic willow
#

okAy tHanks

earnest phoenix
#

Builderb this is what I came up with targUser.roles.remove(targUser.roles)

prime cliff
#

What are you trying to use with that?

#

Also the code for that is wrong

#

Console.log is a function not a variable and i'm pretty sure the syntax for that is wrong

earnest phoenix
#

To be fair, I kinda cheat when making bots.

#

ah, that was from my old line of code oop

prime cliff
#

Cheat how? because stealing other peoples code and/or cloned bots is bad you should actually learn something new

earnest phoenix
#

I use a website called BotGhost.

prime cliff
#

Ah

earnest phoenix
#

is that a bot builder

#

It allows you to add cpmmands, without actually coding.

#

commands*

prime cliff
#

Technically not cheating but DBL does not allow those bots because it's basically a template and very limited

earnest phoenix
#

True.

#

I dont think it's cheating, it's just another way of doing it. It's up to the person if they want to learn or not

#

I mean, I used to be great at coding. Then I learnt other stuff and forgot how to do it.

#

anyway Builderb what I'm trying to accomplish is that when the command is executed it will remove the users current roles and add another role.

prime cliff
#

What lib are you using?

earnest phoenix
#

djs

#

Is it possible to learn coding just by looking in a coding-based chat?

#

you might learn how to make errors

cursive dagger
#

Well you can but its really hard

earnest phoenix
#

lol

prime cliff
earnest phoenix
#

Yeah, and it wouldn't help to have ASD.

#

That is gonna stop me from learning this big-time.

#

Lol.

#

Afk I'm gonna go watch some YouTube coding courses.

prime cliff
earnest phoenix
#

Maybe then I can have a good bot 😄

#

Oh, thanks!

#

@prime cliff it comes with the same error message

prime cliff
#

What are you trying to run?

earnest phoenix
#

a discord bot

#

turn it online

prime cliff
#

But what lib and code

earnest phoenix
#

Error: Cannot find module 'C:\Users\name\Desktop\name2020-2021'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15)
at Function.Module._load (internal/modules/cjs/loader.js:864:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
at internal/main/run_main_module.js:18:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}

prime cliff
#

That's the error what is the code you are trying to run?

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

const token = '';

bot.on('ready', () =>{
    console.log('This bot is online')
})

bot.login(token)```
#

How do you actually get into the bot code?

prime cliff
#

powfu try npm install discord.js

earnest phoenix
#

Wait, is that how you edit code?

prime cliff
#

That installs the Discord lib

earnest phoenix
#

Ok...

#

Portal

#

😕

#

Hm?

prime cliff
#

PortalFan you are using windows right?

earnest phoenix
#

Yes.

#

do you mean edit code as literally, how do you type it into a file or?

#

Windows 10

prime cliff
#

Go to that guide i linked above and click windows

earnest phoenix
#

Literally.

#

Oh,

#

I was reading Getting Started, lol.

#

Is it node.js we install?

prime cliff
#

Yup

earnest phoenix
#

Great, thanks.

#

I'll download it now.

#

@prime cliff sorry for the @ but do you have any good js tutorials you suggest?

prime cliff
#

10-15 messages up

earnest phoenix
#

I had a look at that, looks more focused on just creating your first djs bot?

#

Which page?

prime cliff
#

Windows

earnest phoenix
#

Click that and read.

#

Not the nprmal Getting Started,

#

if you were.

#

Now, I play the waiting game as it installs to my computer,

#

how to get app id?

elder vine
#

App ID?

earnest phoenix
#

application id

cursive dagger
#

Click the copy button next to the client id text on the dev portal

earnest phoenix
#

Huh?

high bough
#

Can someone tell me what i missed?

if (command === "balance") {
    const balembed = new Discord.MessageEmbed()
      .setAuthor(`${message.author.tag}`, `${message.author.avatarURL()}`)
      .setColor([173, 216, 230])
      .addField("**Balance**", "**" + `${output.balance}` + "**")
      .setFooter(
        `${footer}`,
        `${avatarURL}`
      );
    if (message.author.id !== config.ownerID) {
      var output = await eco.FetchBalance(message.author.id);
      message.channel.send(balembed);
    } else if (message.author.id === config.ownerID) {
      var user = message.members.mentions.first();
      if (!user) {
        var output = await eco.FetchBalance(message.author.id);
        message.channel.send(balembed);
      } else {
        var output = await eco.FetchBalance(user.id);
        const baleembed = new Discord.MessageEmbed()
          .setAuthor(`${user.tag}`, `${user.avatarURL()}`)
          .setColor([173, 216, 230])
          .addField("**Balance**", "**" + `${output.balance}` + "**")
          .setFooter(
            `${footer}`,
            `${avatarURL}`
          );
        message.channel.send(baleembed);
      }
    }
  }
```?
earnest phoenix
#

Tbh I know nothing, lol.

high bough
#

XD

zenith terrace
#

error?

prime cliff
#

@high bough read the message.channel.send

earnest phoenix
#

Although I am doing a course online.

high bough
#

Click the copy button next to the client id text on the dev portal
@cursive dagger Isn't that basically your bot's id?

#

@high bough read the message.channel.send
@prime cliff What do you mean?

cursive dagger
#

On older apps there is a difference

prime cliff
#

baleembed

#

const balembed

high bough
#

balembed is for non owner id

#

the owner id part uses baleembed

zenith terrace
#

its fine build

#

they both there

earnest phoenix
#

oK i AM SUPER CONFUSED. wHAT IS THIS? oOF MY KEYBOARD HAS INVERTED MY CAPS.

high bough
#

It's called coding a bot

earnest phoenix
#

Is this working?

#

There we go.

#

I finally got my caps back.

prime cliff
#

The code is a bit weird though why is he trying to use 2 embeds when he could just use 1

earnest phoenix
#

Ik it's coding, I am just confused by var and beleembed and balembed and balance.

high bough
#

the top code is for non owner user which allows using )balance only, while the bottom one allows owner to use )balance @granite pagoda but also returns the user being me if it's blank.

The code is a bit weird though why is he trying to use 2 embeds when he could just use 1
@prime cliff

earnest phoenix
#

(I am great at computers, but coding is not my strong point).

#

Ah.

#

I see now.

high bough
#

Ik it's coding, I am just confused by var and beleembed and balembed and balance.
@earnest phoenix Baleembed and balembed is just a random name for defining my embed, it can be anything.
Balance is the command>

#

And var is ... var?

earnest phoenix
#

What does var mean exactly? I've never heard of it.

high bough
#

it means variable in javascript

earnest phoenix
#

Oh!

#

how do i get application id i have client id and client secret

#

So it is shorter for another word?

zenith terrace
earnest phoenix
#

I get it now.

high bough
#

if i say ```js
var hi = "hi!"

> What does var mean exactly? I've never heard of it.
@earnest phoenix
earnest phoenix
#

Ok.

#

Node.js has finally installed! WOOHOO!

high bough
#

how do i get application id i have client id and client secret
@earnest phoenix Application ID is the Client ID

earnest phoenix
#

ok

prime cliff
#

Yea but like it could just be

var output;
var user;
if (message.author.id !== config.ownerID)
{
    user = message.author;
    output = await eco.FetchBalance(message.author.id);
}
else
{
    user = message.members.mentions.first();
    // Check if user is not null or has mentions too
    output = await eco.FetchBalance(user.id);
}

and then do the embed
const baleembed = new Discord.MessageEmbed()
          .setAuthor(`${user.tag}`, `${user.avatarURL()}`)
          .setColor([173, 216, 230])
          .addField("**Balance**", "**" + `${output.balance}` + "**")
          .setFooter(
            `${footer}`,
            `${user.avatarURL}`
          );
        message.channel.send(baleembed);```
high bough
#

Yeah, okay I'm not that smart i coding

earnest phoenix
#

Is the ID not the Secret Token?