#development

1 messages · Page 1179 of 1

spare gale
#

woah

#

wait

pale vessel
#

undo that async (err, row)

spare gale
#

bot.channels.fetch?

opal halo
#

yes

pale vessel
#

you're supposed to just add async on the other function

small prairie
#

thats the weirdest thing ever

pale vessel
#

not add async (err, row) before channel

#

just add async

#

don't add other stuff

spare gale
#

use bot.channels.cache.get()

pale vessel
#

no

#

well sure

small prairie
#

db.get(query, [user],async (err, row) => {

pale vessel
#

but fetch works too

small prairie
#

i think here

opal halo
#

no

pale vessel
#

what?

opal halo
#

thats my data base @small prairie

#

well

#

part of it

pale vessel
#

that's the function

#

make it async

#

that's what it wants

small prairie
#

^

spare gale
#

and

#

add return

pale vessel
#

what

spare gale
#

your anon function dont return result

#

:/

pale vessel
#

he's not even supposed to do that

opal halo
#

But thats not part of the message function

#

a

pale vessel
#

okay, here, just do it.

spare gale
#

let channel = async (err, row) => {await ...}

pale vessel
#

nono

spare gale
#

;/

pale vessel
#

don't give him weird ideas

small prairie
#

@spare gale That part is completely wrong

opal halo
#

lol

pale vessel
#

it's fetching the channel inside the database callback, which is a function that isn't async

#

you can use await only on async functions, so add await before the callback function

#

don't change other things

small prairie
#

OR You can nest .thens but wont recommend

opal halo
#

would it be easier to use cache?

pale vessel
#

yes it is

#

you used fetch so i went along with it

hazy sparrow
opal halo
#

Ok can we do cache thing, this is complicated

pale vessel
#

channels.cache.get("ID")

opal halo
#

users?

#

oh ok

pale vessel
#

@hazy sparrow await the message

small prairie
#

@hazy sparrow when you make the bot send the embed
do

.then(m=>{
//the reaction part replace message.react to m.react
})```
lament meteor
#

5 year old gamer Thonk

small prairie
#

Or await

hazy sparrow
#

got it, ty

#

await is easier tho

opal halo
#

When I hover over get it says "any"

pale vessel
#

that's just what it accepts

opal halo
#

oh ok

hazy sparrow
#

can i use embed.react() instead of message.react()?

lament meteor
#

depends on the variable name

opal halo
#

@pale vessel Thanks

hazy sparrow
#

const embed = new MessageEmbed() @lament meteor

pale vessel
#

bruh

lament meteor
#

im pretty sure u gotta await the embed to send then react to it

pale vessel
#

await the send method, yeah

hazy sparrow
#

hmm ok, ty again

delicate shore
#
client.once('ready', () => {
client.user.setActivity(`to awesome vibes`, { type: `LISTENING` });
})```
#

cannot read property user of undefined

spare gale
#

let client = new Discord.Client(); ?

#

:/

delicate shore
#

yeaeh

#

i am alread using it

#

bruh

spare gale
#

client = undefined? :/

#

can u give all code?

delicate shore
#

ok this chat is weird i will go

#

can u give all code?
@spare gale no ;-;

#

ok

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

const prefix = '-';
 
const fs = require('fs');
 
client.commands = new Discord.Collection();

// YOU DON'T NEED TO KNOW

client.once('ready', () => {
  client.user.setPresence({ status: 'online', activity: { name: 'to chill vibes 🎧', type: 'LISTENING'} });

})

//YOU DON'T NEED TO KNOW

client.login(token)```
earnest phoenix
#

the hell is happening here

delicate shore
#

it giveds no error

#

but

hazy sparrow
#

guys my command only works in 1 channel and if i use it in the rest of the channels it gives a unhandled promise warning

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


module.exports = {
    name: 'jarvis',
    description: "jarvis",
    
    execute(message){
        const newEmbed = new MessageEmbed()
        
        
        .setTitle("Game Roles Pick")
        .setDescription("React to the corresponding emoji to get the desired role you want.\n\n\n<@&742413618951225395> - 😊\n <@&742416504380981390> - 🙂\n <@&742416674472329297> - 😉\n <@&742416735738527906> - 😍\n <@&742416788347813920> - 😎")
        
        .setColor(0x00B26E)
     
       message.channel.send(newEmbed)
       .then(m=>{
        m.react('😊')
        m.react('🙂')
        m.react('😉')
        m.react('😍')
        m.react('😎')
        })

    }
 }
spare gale
#
 const Discord = require('discord.js');
 const client = new Discord.Client();
  const keepAlive = require('./server');
 
 const prefix = '-';
  
 const fs = require('fs');
  
 client.commands = new Discord.Collection();
 
 // YOU DON'T NEED TO KNOW
 
 client.once('ready', () => {
   client.user.setPresence({ status: 'online', activity: { name: 'to chill vibes 🎧', type: 'LISTENING'} });
 
 })
 
 //YOU DON'T NEED TO KNOW
 
 client.login(token)```

@delicate shore you restarting script on './server'?

delicate shore
#
client.once('ready', () => {
client.user.setPresence({ activity: { name: 'with everyone XD' }, status: 'idle' })
});```
#

this is not working

ionic shard
#

I am using an API which only returns promises and its the property of promises that u cant access it out of scope

But i need to access it out of the promise what to do?

delicate shore
#

@spare gale it's just so that pinging services can ping it

spare gale
#

what version of node u use?

small drum
#

I'm sure I been waiting more than 3 weeks and I haven't heard anything about my bot

slender thistle
#

and read the pins there

crystal bison
#

just curious... one of my ram died and i wanna test bot on computer... how much ram will it use#?

#

im on python

restive furnace
#

around 30mb to 1gb, depends how large is ur bot

crystal bison
#

not that big just anti ad

restive furnace
#

well probably around 30 to 60mb

crystal bison
#

oh ok few 😐 my ram was on 16gb now its on 8gb 😐 tried restarting pc 😐 and then 1 large and 2 short beeps 😐

#

then errors

#

xD

restive furnace
#

remove the broken ram

#

and i have 8gb ram on my pc, works fine

#

with around 100 chrome tabs open

crystal bison
#

but mine 7 year old pc 😐

#

DDR3

restive furnace
#

same here, DDR3

crystal bison
#

oh ok

#

wait what happens if i leave broken on one... ? i mean im just being laz\y xD

#

lazy

cinder patio
#

RAM usage also depends on how big your bot is, especially if caches a lot of discord data

crystal bison
#

i see

restive furnace
#

he said it isnt big

#

wait what happens if i leave broken on one... ? i mean im just being laz\y xD
ut might not work, but u can see

crystal bison
#

im getting new pc soon so if it goes it goes XD i got backup laptop anyways

crystal socket
#

is there a way to turn a discord slowflake into a user id without your bot being in the same server? how does https://discord.id do it?

golden condor
#

Rest search

crystal socket
#

more info?

golden condor
#

Eris has a feature with iy

#

client.getRESTUser

#

But you have to enable rest mode on it

crystal socket
#

sigh guess il just do it logged in

golden condor
#

You can also check the API docs

#

See if there is anything about it there

#

Because there should be if Eris has it

restive furnace
#

and u can get use creation date without any fetching too

earnest phoenix
#

what's a class
is it basically smth which stores a lot of functions and stuff and can be used to create new stuff or perhaps copies of it's own

golden condor
#

Isn't the id just like the date encoded somehow?

honest perch
#

@crystal socket there's an api endpoint

restive furnace
#

yes

golden condor
honest perch
#

You can even change nicknames with the api

#

Its pretty large

earnest phoenix
#

why always link me french ones

golden condor
#

You can change the Lang at the top

analog rampart
golden condor
#

why always link me french ones
@earnest phoenix because they are the ones that come up for mr

delicate shore
#

imagine logging into your bot

restive furnace
#

most of the things what bots do, they do with rest api

golden condor
#

¯\_(ツ)_/¯

leaden shard
#

Is it possible to make your bot change the channel name every minute?

restive furnace
#

api spam

misty sigil
#

that’s on the line of api abuse

delicate shore
#

Is it possible to make your bot change the channel name every minute?
@leaden shard rate limit

misty sigil
#

really

golden condor
#

Yeah I think they added a rate limit to that

leaden shard
#

It is forbidden to ?

restive furnace
#

its 2 times pe 20 mins

delicate shore
#

kind of

golden condor
#

Maybe every 10 minutes then?

honest perch
#

@golden condor then switch to english

golden condor
#

No

restive furnace
#

yep, 10 mins is bare minimum

honest perch
#

Yes

golden condor
#

He can change the language in the top corner

misty sigil
#

I’d go for 30 mins personally

leaden shard
#

Thanks for your reply

golden condor
#

Or maybe 15

leaden shard
#

Where can I find how to do that?

earnest phoenix
#

learn

golden condor
#

You can use a timeout?

#

Or an interval more like

restive furnace
#

i assume u are using discord.js, https://discord.js.org and setInterval function.

leaden shard
#

i use java script

earnest phoenix
#

bruh

golden condor
#

So you can use interval

misty sigil
#

setInterval(() => {do shit here},time in ms)

earnest phoenix
#

that's the syntax

#

setInterval(callbackFunction, time in milliseconds);

leaden shard
#

Is it hard to do that?

misty sigil
#

no

golden condor
#

Not really

misty sigil
#

pseudo code incoming

earnest phoenix
#

super easy

#

the callback function is what gets executed

leaden shard
#

Maybe for you xd

misty sigil
#
earnest phoenix
#

spoonfeed

restive furnace
#

it is easy - if u know basic of JS

earnest phoenix
#

Algebra teachers: what's a function I've only heard of constants and variables

golden condor
#

Not really a place for this.

earnest phoenix
#

Channel for chatting about (bot) development

misty sigil
#

I provided the docs

#

should be easy as cake for them now

earnest phoenix
#

yep

carmine summit
#

if (priceBuyChange >= 1.40 || priceSellChange <= 0.40){
if (priceBuyChange >= 1.40) var crashReport = `Buy change: ${priceBuyChange}`
if (priceSellChange <= 0.40) var crashReport = `Sell change: ${priceSellChange}`
console.log(t)
}
console.log(i)

}, 3000);```
is there any way to shorten this?
rocky hearth
#

Can I use [Link Text](Link URL), anywhere else other than embeds??
Like in block messages?

misty sigil
#

no

carmine summit
#

who no?

#

@rocky hearth or @me?

winter basalt
#

curios

weak rain
#

curios

carmine summit
#

oke oke

#

how bout mine

rocky hearth
#

What u want to do?? Cwickks

carmine summit
#

shorten it

#

cuz half of me feel like there is a shorter version

#

half of me think it doesnt

rocky hearth
#

I think u no require to do this
priceBuyChange >= 1.40 || priceSellChange <= 0.40, in first place

#

wait

carmine summit
#

eh

#

thats what i thought in the first place

#

lol

cinder patio
#

the first if statement is unnecessary

carmine summit
#

how can i log i?

#

if it is false

rocky hearth
#
setTimeout( function() {
  if (priceBuyChange >= 1.40 || priceSellChange <= 0.40) {
    var crashReport = priceBuyChange < 1.40 ? `Sell change: ${priceSellChange}` : `Buy change: ${priceBuyChange}`;
    console.log(t)
  } else {
    console.log(i) // What is `i` here??
  }
}, 3000);
#

OR```js
setTimeout( function() {
if (priceBuyChange < 1.40 && priceSellChange > 0.40) {
console.log(i); // What is i here??
} else {
var crashReport = priceBuyChange < 1.40 ? Sell change: ${priceSellChange} : Buy change: ${priceBuyChange};
console.log(t); // What is t here??
}
}, 3000);

#

Did I messed anything?

carmine summit
#

its messier than mine 😄

rocky hearth
#

No I'm asking if it, giving wrong output?

carmine summit
#

i cant see why not

earnest phoenix
#

based on your current code of

setTimeout(function(){

if (priceBuyChange >= 1.40 || priceSellChange <= 0.40){
if (priceBuyChange >= 1.40) var crashReport = `Buy change: ${priceBuyChange}`
if (priceSellChange <= 0.40) var crashReport = `Sell change: ${priceSellChange}`
console.log(t)
}
console.log(i)

}, 3000);```
you could shorten it like so
```js
setTimeout(() => {
  if(priceBuyChange < 1.40 && priceSellChange <= 0.40) return console.log(i)
  (priceBuyChange >= 1.40) ? let crashReport = `Buy change: ${priceBuyChange}` : return
  (priceSellChange > 0.40) ? let crashReport = `Sell change: ${priceSellChange}` : return
  console.log(t)
}, 3000)```
#

dont use var unless you want to state globally

#

else use let

carmine summit
#

i need to log i

#

if its false

rocky hearth
#

@earnest phoenix return can't be used in conditional operators....

earnest phoenix
#

there

#

er

#

maybe?

carmine summit
#

xD

earnest phoenix
#

let me go to my chrome terminal

carmine summit
#

ill just stick to my code

#

lol

rocky hearth
#

yeah, they cant be used like that

#

Cwickks, mine is more simpler.

earnest phoenix
#

ternary operaters cant have return

#

yep

#
setTimeout(() => {
  if(priceBuyChange < 1.40 && priceSellChange <= 0.40) return console.log(i)
  if(priceBuyChange >= 1.40) let crashReport = `Buy change: ${priceBuyChange}`
  if(priceSellChange > 0.40) let crashReport = `Sell change: ${priceSellChange}`
  console.log(t)
}, 3000)
``` i guess it might be cleaner to instead check if false for the first line and return if it is instead of nesting
#

but really thats the only way i could see it cleaner

carmine summit
#

im new to coding and i cannot understand some of it

#

its better to stick to mine

#
setTimeout(() => {
  if(priceBuyChange < 1.40 && priceSellChange <= 0.40) return console.log(i)
  if(priceBuyChange >= 1.40) let crashReport = `Buy change: ${priceBuyChange}`
  if(priceSellChange > 0.40) let crashReport = `Sell change: ${priceSellChange}`
  console.log(t)
}, 3000)
``` i guess it might be cleaner to instead check if false for the first line and return if it is instead of nesting

@earnest phoenix this could do it

rocky hearth
#

Waft, you would have 2-4 condition checks, but mine is 2-3.

#

LOL

earnest phoenix
#

its how readable the code is not necessarily how many condition checks there are

#

on that note though you could shorten mine further

#
setTimeout(() => {
  if(priceBuyChange < 1.40 && priceSellChange <= 0.40) return console.log(i)
  let crashReport =  priceBuyChange < 1.40 ? `Sell change: ${priceSellChange}` : `Buy change: ${priceBuyChange}`
  console.log(t)
}, 3000)
carmine summit
#

how can i remove the whole numbers and be left out only with the decimals?

earnest phoenix
#

%1

#

let decimal = your_number % 1

#

you could always turn it into a string and array and slice the first character

#

too

#

and convert it back to a number because %1 sometimes will give a reallllly long floating decimal

vivid wadi
#

Guys

fluid field
#

Тут есть русские!?

vivid wadi
#

is something about making a video for Vimeo Tutorial Video ID for support cuz i wanna know what editors,recorders u guys suggest

fluid field
#

Sos

#

@vivid wadi тут есть русские

#

@earnest phoenix тут есть русские?

vivid wadi
#

@fluid field я имею в виду я русский

#

Я родился в России

slender thistle
#

-noru

gilded plankBOT
#

Вы можете говорить по-русски в #memes-and-media.
Если Вам нужна помощь с top.gg, Вы можете обратиться за помощью в #support.

earnest phoenix
#

trivago do you have one of those for every lang

slender thistle
#

Only for the frequently seen ones

vivid wadi
#

alr brb

thick gull
#

never seen shiv be called a trivago... mind telling me how common this is in #general

vivid wadi
#

@fluid field они сказали, что нам нужно говорить по русски на этом канале #memes-and-media

fluid field
#

@vivid wadi я понял

vivid wadi
#

Ладно

eternal osprey
#

hey could someone help me

#

my bot isn't going online

#

eventhiough i have the right config bot key in there

#

and the bot also says it is online in vsc

#

without errors

wary flame
#

By what do you judge it isnt online

eternal osprey
#

well i am in my dc server

#

but it doesn't appear to be online

carmine summit
#

let decimal = your_number % 1
@earnest phoenix im confused

wary flame
#

It could be just discord that it isnt yet updated (the status)

#

Try a simple command and see if it responds

carmine summit
#

What does % 1 do

eternal osprey
#

the commands aren't working either

faint prism
#

Remainder of 1?

#

Modulus

wary flame
#

Can you show me your code (without token)

eternal osprey
#

of course

#

the index.js?

wary flame
#

Yes

eternal osprey
#

basically this bot contains like 4 different folders or more

#

1 for the events, for data, commands etc.

#

but everything should be working fine?

#

for some reason

#

the old bot token i had entered

#

in the config file

#

now runs 24/7

#

eventhough i have no clue why

carmine summit
#

Kewl it works

wary flame
#

Can you send your message event

earnest phoenix
#

Kewl it wors

eternal osprey
#

okay

carmine summit
#

Whats the opposite of .substring()?

eternal osprey
earnest phoenix
#

superscript

carmine summit
#

Nono

eternal osprey
carmine summit
#

Noo

#

I mean substring

wary flame
#

You dont have any errors?

#

Are you using the correct token

eternal osprey
#

i am

#

it is really strange

wary flame
#

Because that is the bot you are running the code for?

eternal osprey
#

no

#

i want it on another bot

#

and i am sure the config file is updated with another key

wary flame
#

Then you need to use that bots token

#

Hmm

#

Odd

eternal osprey
#

maybe the json file is corrupted?

wary flame
#

Did you restart your bot after updating the token?

eternal osprey
#

definitely

#

even regenerated the token etc.

#

tbh i have never ever seen spomething like this

wary flame
#

maybe the json file is corrupted?
That would most likely result in an invalid token though

misty sigil
#

its a .env

wary flame
#

Yes?

eternal osprey
#

ooooowh

wary flame
#

Wait

eternal osprey
#

it should be a env file instead of json

wary flame
#

Did you update the wrong file?

misty sigil
wary flame
eternal osprey
#

you i am going to check that out

#

wahahahahha

earnest phoenix
#
collector.on('collect', async m => {
        if (!m) return;
        if (m.toString().toLowerCase() == "disable") {
            guild.wellcome.enableJoin = false;
            guild.wellcome.left = " ";
        } else {
            guild.wellcome.joined = m.toString();
        }
        await message.channel.send("Please supply a Member left message, Type `disable` to disable it");
        if (m.toString().toLowerCase() == "disable") {
            guild.wellcome.enableLeft = false;
            guild.wellcome.left = " ";
        } else {
            guild.wellcome.left = m.toString();
        }
        await guild.save();
        collector.stop();
        message.channel.send("Nice, you are done with the **SETUP**");
    });

This is not working

eternal osprey
#

yoo can i hug you guys

#

for helping me

#

i have been at this for 2 fucking day

#

days*

#

(no homo tho)

weak rain
#

which is better pagination embed or simple embed

eternal osprey
#

simple

#

well actually depends

pale vessel
#

@earnest phoenix what's not working?

earnest phoenix
#

look the image

#

they are same

#

i want to prompt a join message and left message

#

but join and left are same

pale vessel
#

it collects two times?

earnest phoenix
#

yes

eternal osprey
#

you spelled welcome wrong btw

pale vessel
#

how do you detect if it's for join or leave?

#

do you have a counter?

#

or you have two separate collectors?

#

if so, why not just use awaitMessages?

earnest phoenix
#

awaitMessages ?

eternal osprey
#

can't you just compare 2 guild member lists

earnest phoenix
#

@pale vessel can u give me docs about it

pale vessel
earnest phoenix
#

@pale vessel

const filter = m => m.author.id === message.author.id;
    channel.awaitMessages(filter, { max: 2, time: 60000})

So it will be max 2 (2 messages) ?

pale vessel
#

yes

#

it'll return two messages (if they set it up correctly)

#

use messages.size and make sure it's 2

earnest phoenix
#

ok

pale vessel
#

but you can't detect on collect

#

you have to tell the member to send two messages for join and leave

earnest phoenix
#

:0

#

can i use

        if (m.author.bot) return;

pale vessel
#

yes

earnest phoenix
#

and then send a message with bot

pale vessel
#

actually, you should use collectors

earnest phoenix
#

._.

pale vessel
#

so that you can send a message after each step

earnest phoenix
#

._.

#

@pale vessel but if i use collector

#

it still not working

pale vessel
#

you have to use something like a counter and increment it on every step

#

so that you'd know whether it's for join or leave

earnest phoenix
#

wdym ?

#
if(collected.size == 2) return guild.save();
#

??

#

so it will save in database ?

#

bruh

flint yew
#

Anyone can help. How to add spotify to my music bot. Play playlist spotify by my music bot

restive furnace
#

with spotify api

flint yew
#

@restive furnace bro

#

I need code

#

Not the api xD

restive furnace
#

with the api u can, bro

warm marsh
#

The API doesn't allow you to stream the music as only gives info for each song.

flint yew
#

Add the api only will not work

restive furnace
#

U need to use the API

flint yew
#

Ik

restive furnace
#

we dont spoonfeed, if u want to be spoonfed, post a question at stackoverflow

misty sigil
#

I need code
@flint yew spoonfeed

flint yew
#

Ahh

twilit rapids
#

A simple solution is to get the Track author and name and search for it on YouTube or SoundCloud (Or other providers)

#

That's what I do at least

flint yew
#

I did sound cloud but after I was searching for the sound cloud api

#

It's closed

#

And no more sound cloud api

twilit rapids
#

Then you can use YouTube

warm marsh
#

Lavalink still supports Soundcloud

flint yew
#

I use YouTube

#

But I want to use

#

Spotify also

restive furnace
#

Lavalink still supports Soundcloud
yeah cause it scrapes

warm marsh
#

Fair.

twilit rapids
#

Doubt they have a LavaLink server setup though ¯_(ツ)_/¯

flint yew
#

:/

twilit rapids
misty sigil
#

how do you do edit commands

#

e.g. you edit your message and the bot edits it's message

twilit rapids
#

Listen for the messageEdit event I guess

#

Check if that message was used in a command

misty sigil
#

i had assumed that

pale vessel
#

some use frameworks like Klasa, some use a custom send function that tracks bot's messages (this is what i did) but i removed mine since it would mess up stuff that use reactions

#

just not worth it in my opinion

flint yew
#

@twilit rapids how he have api

#

If sound cloud closed

#

All api

#

I am in need for api for soundcloud

pale vessel
#

soundcloud api is closed for now iirc

flint yew
#

When will open

#

Xd

golden condor
#

lavalink scrapes soundcloud

ionic shard
misty sigil
#

aEH

#

what the hell

honest perch
#

Tf

ionic shard
#

its because the API im using returns promises

#

then i have to nest them

#

now i made a huge mess

dense vessel
#

i need help with my tempmute command

#

the permissions, timer and all that works fine

#

but when i run it the console says that the bot doesnt have sufficient permissions

#

i've dragged it above all roles and i gave it every single permission

#

i've also checked that my alt doesnt have any administrator permissions

cerulean venture
#

Uhm I might be dum right now but how would I create a channel that is nsfw (discordjs) ?

fossil harness
#

yo im trying to get a bot or make a bot that will basically delete my message and say the exact same thing so it looks like i'm talking from a bot, this is just bc i cbf to make an automated bot lol

restive furnace
#

@ionic shard thats def not how to use promises

ionic shard
#

yes mate can u link me something useful

#

im kinda new learning things along the way

#

@restive furnace

restive furnace
#

just google mdn promises

fickle dune
hollow saddle
#

Well you scribbled out what is actually important to solve your issue

golden condor
#

^

fickle dune
#

its the files of my pc

#

wait

hollow saddle
#

You’ve defined a file in your code that doesn’t exist

earnest phoenix
#

You trying to require a file/folder in your code that doesn't exist in that directory

river sedge
#
if(filter.includes("name ") || filter.includes("n ")){
      console.log(name)
    }
    else if(filter.includes("shiny") || filter.includes("s ")){
      console.log("shiny")
    }```

is it possible to execute both if and else if, if filter includes name as well as shiny?
earnest phoenix
#

Just include all in one if statement?

#

Instead of seperating them to 2 if statements

river sedge
#

it will be complicated

#

I am working on multiple filters

#

like .filter --name raj --dateofbirth 2June --class 7

#

I am basically filtering from a huge bunch of databases

earnest phoenix
#

If you want both of the if statements to execute, then remove the else

river sedge
#

and applying multiple filters

#

i did still doesn't works

#

sadly

earnest phoenix
#
if(filter.includes("name ") && filter.includes("shiny") && filter.includes("n ")) {
  if(filter.includes("s ")) console.log("shiny")
  console.log(name)
}```
#

shoop da woop

river sedge
#

uh I said already it will become so much complicated

#

what if name is not included in filter and only shiny is included

#

it won't execute it

earnest phoenix
#

do you want that?

river sedge
#

.filter --name raj --dateofbirth 2June --class 7

#

multiple filter

earnest phoenix
#
if(filter.includes("s ")) console.log("shiny")
if(filter.includes("name ") && filter.includes("shiny") && filter.includes("n ")) {
  console.log(name)
}```
#

shoop da woop

river sedge
#

I am saying this will make it complicated because I have 20+ filters

#

like --name

#

--class

#

etc

#

imagine writing each filter and then if statement inside each filter

earnest phoenix
river sedge
#

uh?

earnest phoenix
#

Both would execute if you didn't include that else

#

As you said it didn't work

river sedge
#

this is what I am doing

#

and it's only printing shiny

#

not the name

#

ok fixed it

#

ty

earnest phoenix
#
let
a
=
1


; console



.log
(a)      ;```
#

javascript is cool

golden condor
#

That hurts me

thin turret
#

Scripted Java

dense vessel
#

why

earnest phoenix
#
console.log(Boolean(1 + true - false * true ** Number([] * 33)- false * true - false)?'parry this':'casuals')```
grand finch
#

anyone know of a node based poll bot that's open source, struggling to find one on github for a day or so now

earnest phoenix
#

You seriously need to find an open source one? Poll bots are extremely easy to make

grand finch
#

@earnest phoenix well I mean, I never worked with the discord api before but cheers for that

sudden geyser
#

It's not hard to make one.

#

Learn a language, use a library for the Discord API, boom.

grand finch
#

I have written a few million lines of node.js that's why I asked about a node based one

#

c is fine too, if its written for debian

earnest phoenix
#

ive written a combined total of 3 lines of code

#

Amateur i've written 1.5 lines

sudden geyser
#

Yeah, so use a library like Discord.js or Eris.

misty sigil
#

Same

earnest phoenix
#

whatsup car show man

grand finch
#

@sudden geyser yea I get it zzz just wanted something that was done already

#

seems everyone wants to integrate their polls into other more excessively featured bots

restive furnace
#

c is fine too, if its written for debian
@grand finch what? linux have GCC, meaning it works on all distros duh

earnest phoenix
#

whats a compiler

restive furnace
#

amd C is cross platform

grand finch
#

right

earnest phoenix
#

Wanting an open source bot like a poll bot is just a little bit yikes

sudden geyser
#

You could probably find some if you kept searching (Google is your best friend) but there's more value in writing your own than just downloading and running an already-made on.

#

and is C really that cross platform

earnest phoenix
#

yes

grand finch
#

c doesnt define any architecture

#

so technically it is platform independent

#

but try writing networking code that works on everything

restive furnace
#

well its pretty easy (excluding windows)

earnest phoenix
#

cIsJusTCoMpIlEdAsSeMblyY

restive furnace
#

since u have to use win32 api for that

earnest phoenix
#

cCaNbeCoMpIlED

#

ToManYArch

grand finch
#

right and you have to use networking syscalls on debian so... what's your point exactly?

restive furnace
#

🤷

misty sigil
#

anyone know how to filter the reddit api to only posts with images?

earnest phoenix
#

just be a big brain and use java

#

or better yet

restive furnace
#

but u can use a library whats already made for that purpose

earnest phoenix
#

node

restive furnace
#

just be a big brain and use java
@earnest phoenix no unsigned ints

earnest phoenix
#

@misty sigil Just check if the link property exists or it has a link

restive furnace
#

node
@earnest phoenix not compiled

sudden geyser
#

kotlin gang

grand finch
#

I think the rules quite clearly said no down-talking languages

earnest phoenix
#

then use typescript

grand finch
#

but I am so tempted

earnest phoenix
#

if you want compiled js

#

:^)

#
<Posts>.filter(p => p.link);``` @misty sigil
#

i cant really think of a reason to use a compiled lang

grand finch
#

resource constraints on a vps

#

where I presume most people host their bots

restive furnace
#

compiled lang = hardware level things, but if u dont find reason to use it, keep using node

earnest phoenix
#

i mean for bots

#

dum dum

#

it obviously has its uses

restive furnace
#

intepreted lang = websocket things and websites etc.

earnest phoenix
#

but for discord bots

#

its not very practical to use such low level langs

#

for most bots that is

#

but i doubt anyone has a bot that interacts with hardware

#

or needs to operate on such a low level

#

way more practical to use a higher level lang

restive furnace
#

well if u mainly use "that" language, but i get the point 🤷

earnest phoenix
#

too bad you cant set chat color

#
[Yea imagine that]
#
Would be pretty cool
restive furnace
#

i believe sporks was made in c++, but cant confirm

#

with aegis.cpp

earnest phoenix
#
+ If we oculd
#

sporks?

restive furnace
#

@wintry hatch

grand finch
#

like a spoon and a fork

slender thistle
#

i believe sporks was made in c++, but cant confirm
yeah

restive furnace
#

The name came from that

grand finch
#

what does it even do

earnest phoenix
#

oh brains bot

restive furnace
#

it is a chat bot

earnest phoenix
#

so when you post a link it gives a preview....is there anyway tap into that functionality for non links?

restive furnace
#

what?

earnest phoenix
#

like that kind of output

misty sigil
#

Like an embed?

earnest phoenix
#

yes

misty sigil
opal plank
#

omg yes!

earnest phoenix
#

no way

misty sigil
#

It’s just meta tags

earnest phoenix
#

are you using djs @earnest phoenix

restive furnace
earnest phoenix
#

yes

#

read that

zenith terrace
earnest phoenix
#

tyvm

zenith terrace
misty sigil
zenith terrace
#

Oh this is dev chat

#

+_+

restive furnace
#

nice

earnest phoenix
#

that is so awesome

misty sigil
#

meh not really

earnest phoenix
#

well since i thought you couldnt do it its awesome

#

if you want something cool to look forward too look into the bot ui changes coming up here

#

in like october i think it is

#

nice ill def read about it

opal plank
#

i think i finally managed to move everything

#

imagine being forced to learn ubuntu shit to host your bot

grand finch
#

when something 'requires' a module that is installed from npmjs, it gets its knowledge of that module from whatever module.exports is in its respective index.js right?

slender thistle
#

Imagine not using Ubuntu in the first place

opal plank
#

well at least everything is ported now

#

rate the rig shiv

slender thistle
#

0/10

zenith terrace
#

Istg I heard some kid in vc moan

slender thistle
#

wew

#

looks hot

opal plank
#

i havent fully loaded it with a full on stress test

#

but im having trouble event denting it

zenith terrace
#

moves to shitpost since this is development

earnest phoenix
#

any word on if there is work being done for bot to authorize a third party login? I have some bot ideas but some require auth

slender thistle
#

Discord OAuth?

restive furnace
#

i havent fully loaded it with a full on stress test
@opal plank what is that host, or is that ur pc 🤔

opal plank
#

thats 100% not my pc

#

and as stupid as it may sound, idk what the host is

restive furnace
#

what

opal plank
#

yes

restive furnace
#

do u even know where u got that

opal plank
#

friend let me use her rig, thats afaik

restive furnace
#

ah ok

earnest phoenix
#

yes oAuth...so i can log into third party site securely and start scraping or using api

slender thistle
#

Your friend is very fucking generous

opal plank
#

cuz my setup was not keeping up with the retarded amount of traffic i was getting

#

she said herself, good luck denting it

#

so i took it as a challenge

#

under 200k users it hit 6% cpu usage

slender thistle
opal plank
#

on ONE CORE

earnest phoenix
#

I have this beg command but it says Cannot read property 'members' of undefined?

opal plank
#

i doubt i'll be able to hit 20% even on a single of those cores

earnest phoenix
#

...Should i show code

thin turret
#

Yos

opal plank
#

if its not long, yes

#

if it is, host it on hastebin

earnest phoenix
#
  let user = message.mentions.members.first() || message.author;
        user = member.user;

        let timeout = 180000;
        let amount = 5;

        let beg = await db.fetch(`beg_${message.guild.id}_${user.id}`);

        if (beg !== null && timeout - (Date.now() - beg) > 0) {
            let time = ms(timeout - (Date.now() - beg));

            let timeEmbed = new Discord.MessageEmbed()
                .setColor("#FFFFFF")
                .setDescription(` You've already begged recently\n\nBeg again in ${time.minutes}m ${time.seconds}s `);
            message.channel.send(timeEmbed)
        } else {
            let moneyEmbed = new Discord.MessageEmbed()
                .setColor("#FFFFFF")
                .setDescription(`You've begged and received ${amount} coins`);
            message.channel.send(moneyEmbed)
            db.add(`money_${message.guild.id}_${user.id}`, amount)
            db.set(`beg_${message.guild.id}_${user.id}`, Date.now())


        }
opal plank
#

first line error'ing?

earnest phoenix
#

Line 10

opal plank
#

also you returning different stuff

#

member =/= than user

misty sigil
#

ok I see the issue

earnest phoenix
#

?

misty sigil
#

you’re re-assigning member to user

#

Also message.author returns user

#

it’s message.member

opal plank
#

yup

earnest phoenix
#

Oh

#

Wait i think i have the same error even i remove that

#
module.exports = function inviter(member) {
    member.guild.fetchInvites().then(guildInvites => {
        const ei = invites[member.guild.id];
        invites[member.guild.id] = guildInvites;
        const invite = guildInvites.find(i => ei.get(i.code).uses < i.uses);
        const inviter = client.users.get(invite.inviter.id);
        return invite;
    });
}

why this returb undefiene

opal plank
#

isnt it cache?

misty sigil
#

let member = member
if(!member)return
let user = member.user

earnest phoenix
#

whre ?

opal plank
#

users.get() isnt a thing

earnest phoenix
#

:0

misty sigil
#

client.users.cache.get() is what you’re looking for

opal plank
#

user.cache.get() is

earnest phoenix
#

i tried

#

but doesn't work

#

wait

opal plank
#

show error

#

you could use optional chaining aswell

grand finch
#

why do so many people join the voice channel with mics muted and then leave

opal plank
#

mentions doesnt always exist

grand finch
#

bot testing?

earnest phoenix
#

This? let user = user.cache.get() || message.author;?

opal plank
#
let user = message.mentions?.members?.first() || message.member;```
#

and dont touch user after that

earnest phoenix
#

oh

opal plank
#

cuz the line right after changes it

earnest phoenix
#

still undefiene :((

opal plank
#

tip

#

use step debugging

earnest phoenix
#

how

#

Is there a bot that automatically sends links from our social networks

opal plank
#

step debugging is a saving grace

#

being able to look at the code as it runs

sudden geyser
#

@opal plank you only need the optional chaining at members?.

opal plank
#

and pause execution

#

doesnt mentions also not exist whenever there isnt a mention?

sudden geyser
#

noop

#

it exists

opal plank
#

then, yeah, indeed, only members

misty sigil
#

just has nothing

steady anchor
#
let ban = message.guild.fetchBans();

if (!ban.find(user => user.id === member.id)) {
  //my code
}
#

how do I get a banned member? (discord.js)

opal plank
#

filter?

#

idk what fetchBan returns

#

if tis an array or map

steady anchor
#

a list of the bannend members

opal plank
#

yeah no shit

#

what format does it output?

pale vessel
#

a collection

opal plank
#

a map it is

pale vessel
#

he didn't await the promise

#

plus, it's user.user.id

earnest phoenix
#

lose the !

opal plank
#

i think d.js adds a find method to collections, no?

pale vessel
#

he didn't await

opal plank
#

otherwise just do values() and filter

earnest phoenix
#

if its true they are banned

pale vessel
#

okay, just await the fetchBans() and change user.id to user.user.id

#

probably shouldn't name it user to avoid confusion

#

maybe entry => entry.user == member.id

steady anchor
pale vessel
#

can you show the code?

#

or did you just change it to filter without adding anything?

earnest phoenix
#

I have this error when i do beg command--> Cannot access 'user' before initialization

steady anchor
opal plank
#

use d.js's methods, or use map()s normal methods

earnest phoenix
#

Im not sure if im doing it right
let user = user.cache.get() || message.author;

opal plank
#

if its a map you can do values() and filter

pale vessel
#

his method works too

sudden geyser
#

Where did you define user in the past Hermi?

#

I think it's complaining that you're doing let user = user.<...>

earnest phoenix
#

I did this at first let user = message.mentions.members.first() || message.author;

#

but i had an error

#

then i changed it

sudden geyser
#

Well what are you trying to do in the first place? At first you're trying to get the first mention, then default to the user if not found. The second attempt is you trying to get someone from the cache with no argument

earnest phoenix
#

ohh sorry

pale vessel
#
let user = message.mentions?.members?.first() || message.member;```

@opal plank the ?. are unnecessary though?

opal plank
#

only in mentions

#

member is necessary

#

cant function on undefined

pale vessel
#

members will return an empty collection

steady anchor
opal plank
#

that'll error still no?

pale vessel
#

nope

#

first() will just be undefined

opal plank
#

u sure?

pale vessel
#

members*

opal plank
#

oh my bad

pale vessel
opal plank
#

hmmm i though it would error

sudden geyser
#

run it in a dm

steady anchor
opal plank
#

i disabled my dms

#

cant test it

sudden geyser
#

bad

opal plank
#

i absolutely despise dm bots

pale vessel
#

i disabled dms on my bot

earnest phoenix
#

Im having the same error

pale vessel
#

but it should still be defined but empty

earnest phoenix
#

It's still undefined

#

?

steady anchor
misty sigil
#

it’s not a snowflake

steady anchor
#

the error must be before the console.log()

misty sigil
#

a snowflake is the numbers on their own

earnest phoenix
#

Hmm how do i fix my error

stable eagle
#
    at Function.normalizeFields (/home/runner/wmjs/node_modules/discord.js/src/structures/MessageEmbed.js:443:8)
    at MessageEmbed.setup (/home/runner/wmjs/node_modules/discord.js/src/structures/MessageEmbed.js:77:91)
    at new MessageEmbed (/home/runner/wmjs/node_modules/discord.js/src/structures/MessageEmbed.js:18:10)
    at embedLikes.map.e (/home/runner/wmjs/node_modules/discord.js/src/structures/APIMessage.js:164:40)
    at Array.map (<anonymous>)
    at APIMessage.resolveData (/home/runner/wmjs/node_modules/discord.js/src/structures/APIMessage.js:164:31)
    at TextChannel.send (/home/runner/wmjs/node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js:166:62)
    at Object.execute (/home/runner/wmjs/commands/bal.js:23:17)
    at Client.bot.on.message (/home/runner/wmjs/index.js:29:29)
    at Client.emit (events.js:198:13)
(node:327) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:327) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.``` I tried executing an embed, and for some reason I get this??
earnest phoenix
#

upgrade nodejs to v12.x

vivid ravine
#

can someone help me please. When i type +help it doesnt show the embed but it doesnt give any error

stable eagle
#

how?

vivid ravine
#
let { MessageEmbed } = require("discord.js")


module.exports = {

    name: "help",
    category: "info",
    description: "Shows all commands",
    usage: "+help",

    run: async (bot, message, args) => {

    let embed = new MessageEmbed()
    .setTitle(`Help`)
    .setDescription(`The Prefix is \`+\``)
    .addField(`Info [5]` , `\`help\` \`ping\` \`uptime\` \`serverinfo\` \`userinfo\``)
    .addField(`Moderation [6]` , `\`ban\` \`kick\` \`setnickname\` \`purge\` \`mute\` \`poll\``)
    .addField(`Fun [3]` , `\`dog\` \`cat\` \`meme\``)
    .addField(`Economy [3]` , `\`balance\` \`addcoins\` \`removecoins\``)
    .addField(`Utility [2]` , `\`prefix\` \`invite\``)
    .setFooter(`Requested By: ${message.author.tag}`)

    message.channel.send(embed);

    }
}
#

thats the code

opal plank
#

why u async it?

steady anchor
#

it’s not a snowflake
@misty sigil I'm new in js, how can I fix this?

misty sigil
#

by removing the <@>

#

snowflake is just the numbers

opal plank
#

its running syncronously

vivid ravine
#

so remove it

#

still not working

steady anchor
#

by removing the <@>
@misty sigil from which var?

misty sigil
#

args[0]

vivid ravine
#

can someone help me out?

pale vessel
#

don't use filter, use .find

#

filter returns a an empty array collection which is truthy *confused with eris

steady anchor
#

i don't send any <@ >

restive furnace
#

u cant join non arrays

steady anchor
#

ok

rocky hearth
#

How do I import images in nodejs?

steady anchor
#

the nex terror ist unbanned.replace is not a function

pale vessel
#

what is unbanned_snow for?

earnest phoenix
#

Umm

steady anchor
earnest phoenix
#

unbanned is an object not an array

#

Why are you joining it

pale vessel
#

well, a map still an object

#

@steady anchor resolve(args[0].join().replace())

steady anchor
pale vessel
#

put join().replace() inside resolve()

steady anchor
#

@steady anchor resolve(args[0].replace())
@pale vessel ah ok

earnest phoenix
#

@pale vessel args[0] is a string

stable eagle
#

UnhandledPromiseRejectionWarning: TypeError: fields.flat is not a function Bruh, I updated to latest version of discord.js and node.js ??

pale vessel
#

wdym

stable eagle
#

well,

steady anchor
earnest phoenix
#

Update node you aren't in the v12 version of it

pale vessel
#

oh yeah

stable eagle
#

I am

pale vessel
#

args.join() not args[0].join() @steady anchor

#

wait no he kept on changing it

#

@steady anchor resolve(args[0].replace())

earnest phoenix
#

The hell is he trying to do

pale vessel
#

resolve a snowflake to a user

steady anchor
#

i have it

pale vessel
#

yes

earnest phoenix
#

why change a mention to an id snowflake when you already get it with message.mentions.members.first()

pale vessel
#

idk

#

his method won't work with members with nicknames too

steady anchor
earnest phoenix
#

With usernames? Wot

pale vessel
#

nickname

earnest phoenix
#

Is he trying to get a member with nickname or username I'm confused

pale vessel
#

no that's clearly a user

#

users.resolve()

#

i'm retarded no i'm not, they will mention a member anyway but wait the member is banned so they can't have a nickname

steady anchor
#

i've copied it from github xd

misty sigil
#

try getting the ID from message.mentions

earnest phoenix
#

@steady anchor Just do this

let unbanned = message.mentions.members.first() || message.guild.members.cache.get(args[0]);```
pale vessel
#

and change user.user.id === member.id to user.user.id === member.user.id no

steady anchor
earnest phoenix
#

Flaz member has an id property

pale vessel
#

o

steady anchor
earnest phoenix
#

@steady anchor Well try this

let unbanned = message.mentions.members.first() || message.guild.members.cache.get(args[0]) || client.users.cache.get(args[0]);```
stable eagle
#
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.resolve (internal/modules/cjs/helpers.js:33:19)
    at ChildProcess.<anonymous> (/home/runner/wmjs/node_modules/node-bin-setup/index.js:18:27)
    at ChildProcess.emit (events.js:198:13)
    at maybeClose (internal/child_process.js:982:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)``` So uh, tried updating to latest node version and this happens??
steady anchor
#

@steady anchor Well try this

let unbanned = message.mentions.members.first() || message.guild.members.cache.get(args[0]) || client.users.cache.get(args[0]);```

@earnest phoenix then it's not a snowflake

earnest phoenix
#

If it's not snowflake then there's something wrong with your args definition

#

How did you define args may i see

steady anchor
#
var args = cont.split(' ').slice(1)```
#
var cont = message.content```
#

@earnest phoenix

#
λ node -v
v13.12.0```
earnest phoenix
#

Oh well, if you didn't realize, you're trying to get a mention or use an id of somebody existing in the guild which is not banned, but banned users aren't in the guild so why not just get args[0] over all

steady anchor
#

is this a wrong version of node.js?

earnest phoenix
#
let unbanned = args[0];```
#

is this a wrong version of node.js?
@steady anchor No

restive furnace
#

newer than 12.0.0 will work on v12 of discord.js

tight plinth
#

@steady anchor try restarting your machine

earnest phoenix
#

<How does that help>

steady anchor
#

how can i find the user?

tight plinth
#

b r u h

steady anchor
ionic dawn
#

SpaceX dragon capsule interfaces built in HTML/CSS/JS (Vanilla) eyeshake

earnest phoenix
#

user is undefined

steady anchor
#

my input

tight plinth
#

user.user does not exist

#

use user

earnest phoenix
#

Also why are you awaiting find?

#

find is not a promise

steady anchor
#

the id is the right one

pale vessel
#

bruh

earnest phoenix
#

This is wrong

if (!ban.find(user => user.user.id === member.user.id)) {```
pale vessel
#

user.user does not exist
@tight plinth it's banObject.user

#

he just named it user

#

so user.user

steady anchor
#

what must i rename to banObject.user?

earnest phoenix
#
if (!ban.get(member.id)) {```
pale vessel
#

nope

#

ignore me

steady anchor
#

ok xd

#

IT WORKS

#

:D

#

Thanks xd

earnest phoenix
#

Np

leaden rover
sudden geyser
#

Are you sure the cog is being loaded in your main file

leaden rover
#

Yes

vale garden
#

hi

#

i am bored

#

and i dont know what commands to make

#

lol

#

what commands can i even make

#

now

earnest phoenix
#

Depends on how much of a knowledge you have on the current programming language you're using

misty sigil
#

Try making a meme command using the reddit api

leaden rover
#

My cog is loaded in my main file, but none of its commands are in the help command itself...

sudden geyser
#

My cog is loaded in my main file, but none of its commands are in the help command itself...
@leaden rover are you able to use the commands?

leaden rover
#

yes

#

I can use the commands, but they're not in the help command

sudden geyser
#

Are you using the default help command or made your own

leaden rover
#

I am using the default?

#

Its the same, but embed

zenith citrus
#

Hello, guys. who use hosting Heroku what database are you using? PostgreSql, MongoDB or something else? i write a bot on sqlite3, but then i found out that Heroku doesnt support it and doesnt overwrite files at all(

misty sigil
#

I use mongo

leaden rover
#

I don't use heroku nor a db

opaque eagle
#

@zenith citrus heroku has free postgres iirc

safe kelp
#

What's the error

#

?

#

Plz help

opaque eagle
#

If you're using sqlite3 already, most of your code should still work with postgres

#

@safe kelp You don't have a start script

safe kelp
#

Means

leaden rover
#

I am using a help command package

opaque eagle
#

In your package.json, under scripts, you need a start script

leaden rover
#

But either way, it never shows up

#

As in if its embed or not

safe kelp
#

Well I don't know js so plz tell how to

sudden geyser
#

Well if you can use the command but it's not appearing in the help command I'd recommend comparing another cog that's being shown in the help manual and see if there's some difference. It looks fine from my perspective (I have average knowledge in Python). Maybe it's a check that's returning false which won't make it show up?

safe kelp
#

Anyone that can help

#

In js

opaque eagle
#

Didn't I already answer lol

#

that's not even a js problem

#

just how npm works

safe kelp
#

I said I don't know how to

#

And what to add

opaque eagle
#

What do you want heroku to run in order to start the bot

safe kelp
#

Wait

opaque eagle
#

what command do u run on ur current computer when u start the bot

opaque eagle
#

what command do u run on ur current computer when u start the bot

#

in the terminal

safe kelp
#

@opaque eagle see I will run the bot codes the index.js

opaque eagle
#

?

#

What exact phrase do you type out in the terminal to start the bot

safe kelp
#

My main file

opaque eagle
#

I don't see how that's a hard question

#

What do you type out

safe kelp
#

npm start index.js

#

Or node .

opaque eagle
#

Which one

safe kelp
#

node .

#

I need to add "start": "node index.js"

opaque eagle
#

Yeah

#

Like I said at the very beginning

safe kelp
#

Okay but now see

opaque eagle
#

Lmao

#

you need a comma at the end of the previous line

safe kelp
#

Okay

#

The first error again

opaque eagle
#

show me the new error

opaque eagle
#

Did you push your code properly?

safe kelp
#

Two

opaque eagle
#

You likely want to disable web and keep worker running

safe kelp
#

Wait let me do it

hazy sparrow
#
if (args === '<insert text here>'{}

Will this work?

opaque eagle
#

What language is that supposed to be

hazy sparrow
#

d.js

opaque eagle
#

JavaScript*

#

how did you define args

#

Also you need to close the ) on the if statement

hazy sparrow
#
const args = message.content.slice(prefix.length).trim().split(/ +/);
safe kelp
opaque eagle
#

Make sure you're using the right bot token

safe kelp
#

Yeah

#

Wait let me regenerate token

#

And reput

opaque eagle
#

@hazy sparrow so there, args is an array.
If the user runs !hello foo bar lmao
args will be ["hello", "foo", "bar" ]

hazy sparrow
#

i know that

#

wait what

opaque eagle
#

Then use that to handle args properly

safe kelp
#

I put my token in a file config.json

And in my main file I use client.login(process.env.token)

opaque eagle
#

You see what's wrong there

safe kelp
#

.env?

opaque eagle
#

You have the token in config.json, not in the token env, but you want d.js to use env

hazy sparrow
#

isnt it supposed to be ["foo", "bar", "lmao"]

opaque eagle
#

is that what you get back?

safe kelp
#

So should I rename config.json to env?

opaque eagle
#
message.content.slice(prefix.length)
// hello foo bar lmao
// gets rid of the prefix

.trim()
// hello foo bar lmao
// removes any whitespace at the start and end

.split(/ +/);
// ["hello", "foo", "bar", "lmao" ]
// splits the string at each space```
safe kelp
#

Or use (process.config.token)??

opaque eagle
#

@safe kelp i'd go learn some basics of node.js

safe kelp
#

Bro I use Python

#

I just got this to host

opaque eagle
#

No you don't... that's clearly a package.json file

#

so that's js

#

not python

safe kelp
#

I said I work with Python

opaque eagle
#

You can host python on heroku lmao

safe kelp
#

The codes gave by someone to host

opaque eagle
#

not just node.js

safe kelp
#

Ik

#

I have hosted my very own bot made with Python