#development

1 messages · Page 1374 of 1

earnest phoenix
#

however, the reason is typically longer than 1 word

#

so how can i do something like

#

const reason = SplitMessage[2 and above]

#

wait i forgot about iterating

#
String reason = ""

for(var i=2, SplitMessage.Length-2, i++) {
  v = SplitMessage[i]
  reason ..= v
}```
#

this should work right?

#

wait .. is lua

#

how do you concatenate

#

bruh u can do +

#

wtf

lucid prawn
#
C:\Users\dogli\Documents\Discordbot\index.js:63
                          .setTitle(message.mentions.members.first().toString + 'called , ' + message.author.toString())
                                                                    ^

TypeError: Cannot read property 'toString' of undefined
    at Client.<anonymous> (C:\Users\dogli\Documents\Discordbot\index.js:63:69)
    at Client.emit (events.js:327:22)
    at MessageCreateAction.handle (C:\Users\dogli\Documents\Discordbot\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (C:\Users\dogli\Documents\Discordbot\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (C:\Users\dogli\Documents\Discordbot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
    at WebSocketShard.onPacket (C:\Users\dogli\Documents\Discordbot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (C:\Users\dogli\Documents\Discordbot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
    at WebSocket.onMessage (C:\Users\dogli\Documents\Discordbot\node_modules\ws\lib\event-target.js:125:16)  
    at WebSocket.emit (events.js:315:20)
    at Receiver.receiverOnMessage (C:\Users\dogli\Documents\Discordbot\node_modules\ws\lib\websocket.js:797:20)
#

my error

earnest phoenix
#

p sure toString is a method

#

toString()

#

that's not what the error is saying

lucid prawn
#

my code

            if(message.content.startsWith(prefix + "call" )){
                message.channel.send('Ur love');
                }
                if(message.content.startsWith(prefix + "call" )){
                    var embed = new Discord.MessageEmbed()
                          .setTitle(message.mentions.members.first().toString + 'fcalled , ' + message.author.toString())
                          .setTimestamp()
                          .setImage('')
                      message.channel.send(embed);
                }
earnest phoenix
#

did you enable intents

lucid prawn
#

...

sweet sand
earnest phoenix
#
const reason = "";
        for(var i=2; SplitMessage.Length-2; i++) {
            v = SplitMessage[i];
            reason += v;
          }```
#

@earnest phoenix do u know why this isnt changing the value of reason?

#

what is that for loop

#

ok so

#

i know

#

My uh kick command

#

you want to skip the first two args

#

yes

#

but what's the reason for subtracting

#

also

#

in js, indexes are 0 based

#

they start at 0

#

i know

#

0 = command

#

1 = user

#

2+ = reason

#

ah

#

remove that subtraction

#

/kick user is very annoying

#

it doesn't make sense

#

if i didnt subtract 2

#

it would say

#

stop

#

spamming

#

your

#

code

#

you have been kicked for: user is very annoying null null

#

holy fucking shit i told you what the error is can you not read

#

@earnest phoenix what 🤔

#

if arr[0] is command and arr[1] is user

#

if i didnt subtract 2

#

it would say

#

"reason null null"

#

you're starting at a different index though

#

because its like wtf are the other 2 elements

#

this is how i made it on my lua version

#
local m = msg:split(" ")
local cmd, plr = table.remove(m, 1), table.remove(m, 1)
local reason = table.concat(m, " ")```
#

is something like this possible in js

pale vessel
#

split
shift
shift
join

#

basically

lucid prawn
#

@pale vessel can u help me

pale vessel
#

cry can help you

earnest phoenix
#

i asked you whether you had enabled intents and you still have not answered me so stop bothering other people lol

lucid prawn
#

i said no

earnest phoenix
#

so enable them

#

you can't get members without privileged server members intent

lucid prawn
#

how

earnest phoenix
#

go to your bot's page on discord developers

#

you'll see switches for it

lucid prawn
#

done

earnest phoenix
#

@pale vessel I know why its doing this, but i dont know how to fix it

#

When I tried your method it said like

#

/kick user very annoying

#

the dm would be

#

very,annoying

lucid prawn
#

i can help u @earnest phoenix

earnest phoenix
#

how can i remove da , and space it out

pseudo hare
#

m.join(' ')

earnest phoenix
#

oh

lucid prawn
#

here ```js

              if (message.content.startsWith('!kick')) {
                let messageArray = message.content.split(" ");
                let command = messageArray[0];
                let args = messageArray.slice(1);
                let xdemb = new Discord.MessageEmbed()
                    .setColor("#00ff00")
                    .setTitle("Kick Command")
                    .addField("Description:", `Kick a member`, true)
                    .addField("Usage:", `Kick [user] [reason]`, true)
                    .addField("Example:", `Kick @rain spam`)
        }
pale vessel
#

trim it also to remove spaces

#

xd embed

lucid prawn
#

ik

pale vessel
#

dank

earnest phoenix
#

is there like an unpack method for tables

lucid prawn
#

and this ```js
if(cmd === 'kick'){
if(!msg.member.hasPermission('KICK_MEMBERS')) return msg.channel.send("You don't have permission to kick members :stuck_tongue_closed_eyes:.");
let toKick = msg.mentions.members.first();
let reason = args.slice(1).join(" ");
if(!args[0]) return msg.channel.send('Please mention someone to kick cutie :stuck_tongue_closed_eyes:');
if(!toKick) return msg.channel.send(${args[0]} is not a member :stuck_tongue_closed_eyes:.);
if(!reason) return msg.channel.send('Specify a reason :stuck_tongue_closed_eyes:.');

  if(!toKick.kickable){
      return msg.channel.send(':x: I cannot kick someone that is mod/admin cutie are u dumb :stuck_tongue_closed_eyes:. :x:');
  }

  if(toKick.kickable){
      let x = new Discord.MessageEmbed()
      .setTitle('Kick')
      .addField('Member Kicked', toKick)
      .addField('Kicked by', msg.author)
      .addField('Reason', reason)
      .addField('Date', msg.createdAt)

      msg.channel.send(x);
      toKick.kick();
  }

}

#

@earnest phoenix still have error

earnest phoenix
#

wait

#

my script can be simplified that much shorter? @lucid prawn

pseudo hare
#

message.mentions.members.first() is possibly undefined in your code which could cause the error @lucid prawn

lucid prawn
#

how do i fix that

pseudo hare
#
                if(message.content.startsWith(prefix + "call" )){
                  message.channel.send('Ur love');
                }
                if(message.content.startsWith(prefix + "call" )){
                    if (!message.mentions.members.first()) return;
                    var embed = new Discord.MessageEmbed()
                          .setTitle(message.mentions.members.first().toString() + 'fcalled , ' + message.author.toString())
                          .setTimestamp()
                          .setImage('')
                      message.channel.send(embed);
                }
lucid prawn
#

@pseudo hare my embed is not working now

pseudo hare
#

Any error message?

lucid prawn
#

no

earnest phoenix
#

if(msg.member.hasPermission('KICK_MEMBERS')) {

#

Uncaught TypeError: Cannot read property 'hasPermission' of null

#

do what now

pseudo hare
#

member is undefined

earnest phoenix
#
bot.on('message', msg => {
    if(msg.member.hasPermission('KICK_MEMBERS')) {```
pseudo hare
#

i think it sould be msg.author

earnest phoenix
#

uh

#

oh

pseudo hare
#

@lucid prawn What is the command you run to check if it works?

earnest phoenix
#

msg.author.member.hasPermission(...)?

#

@pseudo hare

lucid prawn
#

ummm

#

can i dm

#

it

earnest phoenix
#
bot.on('message', msg => {
    if(msg.author.member.hasPermission('KICK_MEMBERS')) {```
pseudo hare
#

is this discordjs?

earnest phoenix
#

Uncaught TypeError: Cannot read property 'hasPermission' of undefined

lucid prawn
#

yes

earnest phoenix
#

and if i say js bot.on('message', msg => { if(msg.author.hasPermission('KICK_MEMBERS')) {

#

it says its not a function

lucid prawn
#

give ur bot kick_members permission

earnest phoenix
#

it has administrator

#

do i still need to give it kick members

pale vessel
#

it's msg.member

lucid prawn
#

yes

pale vessel
#

author is a User

earnest phoenix
#

Uncaught TypeError: Cannot read property 'hasPermission' of null

pseudo hare
#

oops havent used discordjs in quite a while lol

earnest phoenix
#

@pale vessel

pale vessel
#

is it a DM?

lucid prawn
#

no

earnest phoenix
#

i fixed it

#

new problem

#

wait

#

no

#

aaa ill just make a mods array

#

this is annoying

olive barn
#

how do i get a host 24/7

#

for free

solemn latch
#

repl is technically 24/7 free.

olive barn
#

ok. does it work with discord.js?

pseudo hare
#

aws has a free tier

olive barn
#

repl is technically 24/7 free.
@solemn latch technically?

#

does it go offline sometimes or?

solemn latch
#

not that i am aware of

olive barn
#

ok

#

thanks, i will look into it

solemn latch
#

its just not an ideal playform due to the low ram and cpu power

earnest phoenix
#
var mods = {
    "346100939297390613":true, //valurim
    "608068786058428416":true, //Apple Master
    "462020257071104010":true, //Pasta
    "628020046941257738":true, //TwoDoritos

}
  
bot.on('ready', () => {
    console.log(`${bot.user.tag} logged in successfully`);
});

bot.on('message', msg => {
    if(mods[msg.member.id] === true) {```
lucid prawn
#

heyyy again woo

earnest phoenix
#

Uncaught TypeError: Cannot read property 'id' of null

#

??

#

why does it get past that if statement

#

when the if statement is clearing erroring

#

🤔

#

wait

#

do errors not yield the script in js?

pseudo hare
vital bramble
#

Is it true that Melania Trump is actually a man and their children are adopted russian orphans

earnest phoenix
#

tf

#

why is it grey

#

o

#

no

stark abyss
#
client.on('guildMemberAdd', async member => {
  console.log("hi")
  const channel = member.guild.channels.cache.find(ch => ch.name === 'general');
  channel.send("Welcome")
})
earnest phoenix
#

its a method

stark abyss
#

what am I doing wrong

#

is someone willing to help me a little?

earnest phoenix
#

any errors?

stark abyss
#

so i am gonna do it and try

#

it worked

raven urchin
lucid prawn
#

my error ```js
.setTitle(!message.mentions.members.first().toString() + 'called' + message.author.toString())
^

TypeError: Cannot read property 'toString' of undefined
at Client.<anonymous> (C:\Users\dogli\Documents\Discordbot\index.js:64:72)
at Client.emit (events.js:327:22)
at MessageCreateAction.handle (C:\Users\dogli\Documents\Discordbot\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (C:\Users\dogli\Documents\Discordbot\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (C:\Users\dogli\Documents\Discordbot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
at WebSocketShard.onPacket (C:\Users\dogli\Documents\Discordbot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
at WebSocketShard.onMessage (C:\Users\dogli\Documents\Discordbot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
at WebSocket.onMessage (C:\Users\dogli\Documents\Discordbot\node_modules\ws\lib\event-target.js:125:16)
at WebSocket.emit (events.js:315:20)
at Receiver.receiverOnMessage (C:\Users\dogli\Documents\Discordbot\node_modules\ws\lib\websocket.js:797:20)

my code 
```js
                if(message.content.startsWith(prefix + "call" )){
                    message.channel.send('Ur Making love');
                  }
                  if(message.content.startsWith(prefix + "call" )){
                      var embed = new Discord.MessageEmbed()
                            .setTitle(!message.mentions.members.first().toString() + 'called' + message.author.toString())
                            .setTimestamp()
                            .setImage('')
                        message.channel.send(embed);
                  }
blissful coral
#

@lucid prawn do message.members.members.first().user.username

#

instead of toString()

tired nimbus
#

if im just storing data in a file as static, should I use a json file or should I just put it in a js file

lucid prawn
#

ok

robust blade
#

@lucid prawn for your code change var to const

lucid prawn
#

@blissful coral the embed is not working

quaint cairn
#

how to create bot in js?

robust blade
#

are u a beginner?

lucid prawn
#

@robust blade i have many other var embed = new Discord.MessageEmbed()

#

no

robust blade
#

@robust blade i have many other var embed = new Discord.MessageEmbed()
@lucid prawn oh

#

i meant "mentionable name"

lucid prawn
#

it work but the embed will not send

quaint cairn
#

how to create bot in js?
@quaint cairn

blissful coral
#

@lucid prawn You cannot mention users in the title

#

@lucid prawn No

#

Do not give people code

quaint cairn
#

This code help you get started with your discord bot go to this website
https://pastebin.com/sPXPkh6K or https://pastebin.com/DxAMwfFd
update
///pls vote if this helps
///Btw i made this code
@quaint cairn
@lucid prawn ok

blissful coral
quaint cairn
#

Ok

blissful coral
#

They do not learn from copy pasting @lucid prawn

#

Don't just spoon feed code

lucid prawn
#

ok

robust blade
#

how to create bot in js?
@quaint cairn this

quaint cairn
#

Const Discord = require('discord.js')
Const Client = New Discord.Client

Client.on(' ')

blissful coral
#

No

#

Const is not capitalized

quaint cairn
#

And so?

blissful coral
#

New is not capitalized

quaint cairn
blissful coral
#
const Discord = require(`discord.js`)
const client = new Discord.Client()

client.on(`ready`, () => {
console.log(`Bot online`)
})
client.login(`Token`)```
#

Starter code

quaint cairn
#

Ok

solemn latch
#

capitalization matters

#

everythings case sensitive

quaint cairn
#

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

client.on(ready, () => {
console.log(Bot online)
})
client.login(Token)
`

lucid prawn
#

my embed is still not sending

blissful coral
#

Show code

quaint cairn
#

I'm Brazilian but I use the translator here

lucid prawn
#
                if(message.content.startsWith(prefix + "call" )){
                    message.channel.send('Ur Making love');
                  }
                  if(message.content.startsWith(prefix + "call" )){
                      if (!message.mentions.members.first()) return;
                      var embed = new Discord.MessageEmbed()
                            .settitle(heyyy)
                            .setDescription(message.members.members.first().user.username + 'called' + message.author.toString())
                            .setTimestamp()
                            .setImage('')
                        message.channel.send(embed);
                  }
blissful coral
#

Because you are not putting heyyy in a string.

earnest phoenix
#
bot.on('guildMemberAdd',member => {
    member.send(`Welcome to ${msg.guild.name}! The rules are as follows: \nRule1:\nRule2:\netc...`)
})```
#

is this the correct even name?

blissful coral
#

msg is not a value of client#guildMemberAdd event

#

member.guild.name is how you would get the guild name

lucid prawn
#

@earnest phoenix go here it will help https://discord.js.org/#/docs/main/stable/general/welcome

earnest phoenix
#

oops i didnt mean msg lmao

#

i meant member

#

typo

#

but anyways

#

he didnt get the dm when he rejoined and i didnt get an erorr

raven urchin
blissful coral
#

make sure ur whitelisted

lucid prawn
#

Because you are not putting heyyy in a string.
@blissful coral
wym

earnest phoenix
#

make sure ur whitelisted
@blissful coral

blissful coral
#

Please learn basic js.

earnest phoenix
#

wdym?

blissful coral
#

Not you valurim

#

Talking to @raven urchin

#

@lucid prawn you need to do 'heyyy' instead of heyyy

raven urchin
#

I have it whitelisted

blissful coral
#

It has to be a string because heyyy is not a variable

#

@raven urchin attempt removing and readding it

raven urchin
#

Will do, brb

blissful coral
#

Mongo doesn't do that normally so I am not experienced with that issue

raven urchin
#

Ah ok

#

I'ma go try

lucid prawn
#

@blissful coral

my embed is still not sending
do u want to see what it doing

blissful coral
#

Show your error.

#

I literally told you what to fix

lucid prawn
#

no error

earnest phoenix
#
bot.on('guildMemberAdd',member => {
    console.log("Member Joined");
    member.send(`Welcome to ${member.guild.name}! The rules are as follows: \nRule1:\nRule2:\netc...`)
})``` @blissful coral yeah the msg thing was a typo lol, ive been working with chat commands all day. Anyways, no errors when they join and the console doesnt log anything
blissful coral
#
bot.on(`guildMemberAdd`, (member) => {
member.send(`Hi`)
})
#

Make sure you have the GUILD_MEMBER intent @earnest phoenix

earnest phoenix
#

im confused on what u changed

blissful coral
#

Basically nothing

#

Just make sure you have the guild member intent

earnest phoenix
#

uh

#

so will that fix it

blissful coral
#

Turn this on

#

To receive that event

earnest phoenix
#

o i c

lucid prawn
#

do u want me to show u what the bot does

blissful coral
#

How many times am I gonna have to tell you that you have to make the title a string instead of a var because the var is not a thing

raven urchin
#

Still gives an error when I type in a command

blissful coral
#

weird

raven urchin
#

Could it be because I have the same database running on my other bot?

blissful coral
#

contact mdb support I suggest

#

maybe

lucid prawn
#

like this ? js .settitle('heyyy')

honest perch
#

setTitle

raven urchin
#

.setTitle('heyyy')

#

Cuz I'm using a hosting IP but not sure why it's not working

blissful coral
#

Yes @lucid prawn

#

Like I said

languid inlet
#

I don't know why my bot is not working

#

I keep getting an error

lucid prawn
#

still wont work waitWhat

solemn latch
#

ghostping op

blissful coral
#

@languid inlet can't really help you without the error and a code snippet

#

@solemn latch shhhh

#

rocky sorry for ping whoever you are

languid inlet
#

trying to

blissful coral
#

@lucid prawn Show your full code snippet of the embed and where you do <message>.channel.send(<embed>)

languid inlet
#

also I don't care about pings

blissful coral
#

I pinged a random person

#

So that is why I sent that.

lucid prawn
#
                  if(message.content.startsWith(prefix + "call" )){
                      if (!message.mentions.members.first()) return;
                      var embed = new Discord.MessageEmbed()
                      .setDescription(message.members.members.first().user.username + 'called' + message.author.toString())
            
                      .setTitle('Heyyy')
 
                      .setTimestamp()
                      .setImage('')
                        message.channel.send(embed);
                  }
languid inlet
blissful coral
#

Put it in a bin

lucid prawn
blissful coral
#

Try removing your return and see if it works

languid inlet
blissful coral
#

What is your error that you are getting

languid inlet
#

I don't know

blissful coral
#

Then I can't help you

#

I need a error to work off of

#

So that I can find the problem

earnest phoenix
#

how can I find a channel via id if the client has multiple shards, and send a message in it if it exists?

blissful coral
#

Like this:

proven ice
#

TypeError: Request with GET/HEAD method cannot have body what does this mean? data is a dictionary with some parameters as key/value pairs

const res = await fetch("https://nekobot.xyz/api/imagegen", { body: data })
      .then((r) => r.json());```
earnest phoenix
#

just like it says

proven ice
#

but i need to pass parameters for the api

earnest phoenix
#

then idk tbh

blissful coral
#
<client>.shard.broadcastEval(`this.guilds.cache.get('${<guild>.id}')`).then(g => {
//Code here
})

// OR

//Inside of a async function
const getguild = await <client>.shard.broadcastEval(`this.guilds.cache.get('${<guild>.id}')`)
//returns the guild object```
#

@earnest phoenix

earnest phoenix
#

thanks

#

i have one more question

blissful coral
#

Sup

earnest phoenix
#

how can i reload a command on every shard

blissful coral
#

Ummm

#

Good question

#

LMAO

#

I honestly don't know

earnest phoenix
#

I’m using pm2 but the bot still goes offline when I turn off my pc

#

How can I make it stay online 24/7

#

Without never turning off my pc

#

vps

blissful coral
#

You buy a vps

earnest phoenix
#

What that

#

Is there any free ones I don’t want to pay

blissful coral
#

ℹ️ This is a list of hosting providers, not a backing/support for them. You will need to make your own decision. All $dollar prices are in USD.

earnest phoenix
#

Is there any free ones I don’t want to pay
@earnest phoenix

blissful coral
#

Not really no

earnest phoenix
#

free trials

#

Idc about quality

#

Is there anything

#

free trials

#

that’s stupid

solemn latch
#

they are servers

earnest phoenix
#

is router hosting possible

blissful coral
#

Not really

solemn latch
#

routers often have under 50mb of ram

blissful coral
#

Kinda have to pay

#

Routers almost always have under 50mb of ram and it is already all being used by the network

lucid prawn
solemn latch
#

if you got a sick ass router with a custom os on it, yes KEKW

blissful coral
#

??

#

You can't do mentions in a title.

earnest phoenix
#

^

blissful coral
#

Only fields and descriptions

earnest phoenix
#

How do u link a bot to a vps

#

use desciption

blissful coral
#

@earnest phoenix I suggest you look itup

earnest phoenix
#

A thanks

solemn latch
#

you upload your bots code to the vps, then run it

blissful coral
#

Need Filezilla, PuTTy a process manager and some other stuff

earnest phoenix
#

run it in a screen lel

#

Bruh I’ll just keep my pc then

#

it's quite simple

#

^^

#

you just upload the code

lucid prawn
earnest phoenix
#

install te modules etc

blissful coral
#

Read what I said.

earnest phoenix
#

just like you would do on your pc

blissful coral
#

You cannot mention in a title

earnest phoenix
#

and then start it via pm2

blissful coral
#

It will show the <@!id>

lucid prawn
#

ok

earnest phoenix
#

💩

#

guys i found a free vps

#

ibm

#

theres a paid verson

#

but theres also a free version

#

its probably bad but idc as long as it stays up

#

bruh a free vps sounds sketchy CH_starkfacepalm

solemn latch
#

it always is

earnest phoenix
#

its not free

#

if it's not free you have to pay for it

#

👍

#

looks legit ngl

#

it really deosnt

#

theres a lite version though

#

LOL wolfy genius !

#

thanks james !

blissful coral
#

LOL

#

This shit is so sketch

#

Homie this isn't meant for bot hosting

earnest phoenix
#

12 months free trial

lucid prawn
#

so like this @blissful coral ```js
if(message.content.startsWith(prefix + "call" )){
message.channel.send('Ur Making love');
}
if(message.content.startsWith(prefix + "call" )){
if (!message.mentions.members.first()) return;
var embed = new Discord.MessageEmbed()
.setDescription(${message.mentions.members.first().toString()} called ${message.author.toString()})

                  .setTimestamp()
                  .setImage('https://ii.yuki.la/7/29/012c95f665ec8cc105e45d31e1eb347eb74bdfb603f0ab37a86392fff9d78297.gif')
                    message.channel.send(embed);
              }
earnest phoenix
#

you can just send the whole object

#

@blissful coral

#

it will convert it into a mention

#

its literally an international coporation

#

@lucid prawn

#

real sketch huh

#

yes @earnest phoenix

#

🤦‍♂️

lucid prawn
#

wolfy the emebed is not sending

blissful coral
earnest phoenix
#

why are you using 2 the same if statements??

#

your best with working with switch cases lel

#
if (false !== true){

  console.log("hello world")

  if (false !== true){

    console.log("hello world!")

  }

}
#

like wot

#

which one is for bot hosting

#

amazon free tier

#

thats not an option

#

why would it be free????

#

which one is for bot hosting

#

think about it

#

i dont care

#

just

#

which one is for bot hosting

#

valurim if you know about vps then you should know the answer to that question

#

i dont know about vps

#

and i never said i did

lucid prawn
earnest phoenix
#

@earnest phoenix do u know the answr

#

Valurim lool my guess google basics in vps hosting and it will no doubt answer you question. Yes but this is for you to figure out or you wont understand my answer at all

#

i dont know how i google that

#

Bruh

#

hey google which one of these is for bot hosting

#

lol read them and figure out which one sounds like bot hosting, im not going to spoon feed you the answer when its already on your screen

#

its not spoon feeding its helping

#

spoon feeding would be asking for guidance the entire time

#

you clearly dont know

#

or you're just an asshole

#

Lol

#

ill take that as the first one

#

stop swearing!111!!!

#

Bruh i run my own network and know how to manipulate it to run my own projects lmao

#

then which one is it

#

"noT tEliNG YoU"

#

will be ur next words

#

Which one of those packages litterally tells you /defines bot hosting CH_starkfacepalm

#

foundry

#

how was i supposed to know that

#

the word foundry literally sounds nothing like bot hosting

#

i was just guessing idk

#

maybe its speech to text

#

that was probably sarcsatic but u were right anyways

#

fine the answer is services -_- happy ?

#

oh

#

what

#

oh wtf

#

when u click services it opens like a million things

#

and discord bot isnt one of them

solemn latch
#

they wouldnt list discord bot

#

a vps is just a server

earnest phoenix
#

yes i know

#

i meant like

solemn latch
#

you can do anything with one

earnest phoenix
#

Bot hosting or anything along those lines

#

Bruh its not going to spell out "DISCORD BOT" you need to figure out which services will be suitable to run a discord bot CH_starkfacepalm

#

Bot hosting or anything along those lines
@earnest phoenix

solemn latch
#

i mean, discord bots run anywhere nodejs runs on. and thats a lot of things

earnest phoenix
#

so what about this one

glacial ridge
#

How use reactions on messages with Discord.js

solemn latch
#

it would probably run there, but may not be what you expect

earnest phoenix
#

wait i found on literally called Node.js

#

valurium your best with getting a blank vps and installing all of your bots dependencies instead of a premade vps , as some components within that vps may not include the libraries you need or they may be outdated. You can update all dependencies but its a pain xD

solemn latch
#

^

earnest phoenix
#

uhh

solemn latch
glacial ridge
#

How use reactions on messages with Discord.js?

earnest phoenix
#

whats a blank vps

solemn latch
#

its a vps with an os installed on it

#

like ubuntu

earnest phoenix
#

yup

#

are they free

solemn latch
#

nothings free long term

earnest phoenix
#

and you manually install all the dependencies and libraries you need to run your bot

solemn latch
#

youll pay one way or another

earnest phoenix
#

then no

solemn latch
#

well, all of ibms stuff is paid in the long run

earnest phoenix
#

bruh im 14 and my parents dont even know i have discord

solemn latch
#

so dont use ibm if you demand free

earnest phoenix
#

i cant just be like

#

yo gimme vps

#

valurim you'll eventually need to pay for your own vps if you want your bot to last .. common sense xD

solemn latch
#

most parents are pretty cool spending $3 a month for kids who are excited to learn

earnest phoenix
#

^^

#

mine arent

solemn latch
#

then mow the neighbors lawn for $10 and get 3 months of vps pogey

earnest phoenix
#

trying to run a bot on a budget of almost nothing will not last, simple as that

#

¯_(ツ)_/¯

#

bruh ill just keep my pc on

#

does it hurt a desktop to keep it on 24/7

#

yes lmao

#

how

#

you can't keep your pc's running 24/7 it will run your system processes in overdrive if they dont have a daily restart

#

restarting takes like 1 minute

#

i can deal with that

#

just like how you can't function without sleep

#

ok, valurium do what you want lol

pure lion
#

Sometimes ytdl won't play a song, it throws a "can't get video stream" error

#

Anyone have a fix?

solemn latch
#

retry to get it? 🤷‍♂️

earnest phoenix
#

maybe your being rate limited ?

pure lion
#

No and no

solemn latch
#

youtube is pretty clear about ratelimits most of the time

earnest phoenix
#

lol i was just guessing xD

pure lion
#

It's being thrown from ytdl and usually this doesn't happen

#

Before 4.0.1 it worked fine

weak parrot
#

Not really. For most PCs it doesn't really make a difference if you restart or not. Only part that generally matters with are storage devices like hard drives. If they aren't build for it they can get performance deterioration but even with most hard drives it would take quite a long time (over a month of continues runtime) for it to become actually noticeable. Actual long term deterioration usually will only happen if you run it in ways it wasn't designed to (high humidity or a place with a lot of vibrations).

solemn latch
#

my main concern about 24/7 pc running is the psu 🤷‍♂️

#

especially on prebuilt machines

earnest phoenix
#

i made my computer

solemn latch
#

did you get a good psu?

earnest phoenix
#

uhh

#

whats that

solemn latch
weak parrot
#

I have used prebuilt machines for decades and haven't had an issue but I do agree that prebuild psu's can be a point of failure.

earnest phoenix
#

bruh idk pc terms

solemn latch
#

power supply

earnest phoenix
#

how do i check

#

i made it almost a year ago i dont remember anything

weak parrot
#

If you made it you should have a part list somewhere? If not you could take off your cases side panel and just check it (model and manufacturer) on the power supply itself

earnest phoenix
#

i figured it out

#

650 watt coursier

weak parrot
#

Corsair?

earnest phoenix
#

yes

solemn latch
#

cant belive you kept a prebuilt for a decade and didnt replace the psu.
I get scared with a psu for 5 years even if its good

weak parrot
#

Should be fine then generally. Though I did have a fan fail on my Corsair CX 750M after a couple of years but I didn't do anything special stitch_shrug

earnest phoenix
#

it has a 5 year warranty

solemn latch
#

fan failure in a psu is a blessing in disguise. dead psus are scary

weak parrot
#

True

earnest phoenix
#

if ur using pm2 does discord have to be open or can it be off, but ur pc still on

solemn latch
#

my house got struck by lightning years ago, every electronic in the house died except my pc's.

#

bots have their own client

#

you dont need discord open

weak parrot
#

And I mean my original "gaming pc" was a prebuild HP Compaq from like 2008 that I ran for like 3-4 years still has the original PSU all these years later (today) and still runs fine. But anyway this is a bit off-topic.

earnest phoenix
#

Will server size effect my bot ultimately effecting my pc?

solemn latch
#

if your bot needs a lot of resources, yes it will slow down your pc

#

anything your bot uses, you wont be able to

lyric mountain
#

99% the slowdown is member presences

earnest phoenix
#

It’s just 3 events

#

kick ban and member join message

#

Bruh how much is that rly gonna slow down my pc tho

solemn latch
#

🤷‍♂️ its impossible to say

earnest phoenix
#

You’re telling me a 100 line bot gonna slow down my pc more than my 50 60gb games

weak parrot
#

No

#

They're not

solemn latch
#

if they are both running together, any resources your bot uses your game wont have.

weak parrot
#

They're just saying that if your bot grows it could start impacting performance. Obviously it will different on the hardware to what amount but if it keeps growing it will keep eating up more system recourses.

earnest phoenix
#

Yeah I just checked

#

Currently my bot is 3 KB

#

doubt that’s going to effect anything

solemn latch
#

3kb can crash a pc

weak parrot
solemn latch
#

heck 100B can crash a pc

earnest phoenix
#

my bot ain’t running a while loop constantly

solemn latch
#

yeah, just saying size means nothing

earnest phoenix
#

I meant in terms of eating of resources

#

I know how to crash a pc in 11 bytes

#

start %0
%0

lyric mountain
#

Actually, code size doesn't tell whether it's going to impact performance or not

solemn latch
#

^

lyric mountain
#

Like, bigger code doesn't mean heavier code

solemn latch
#

with intents alone you can drastically change the performance of a bot.

lyric mountain
#

Look at yandere simulator for example lul

earnest phoenix
#

what is an intent

#

i keep hearing that

#

do u mean like

#

the english word "intent"

#

or is that a js thing

solemn latch
#

its the events you receive from discord

earnest phoenix
#

oh

#

i have one of those

solemn latch
#

mainly

lyric mountain
#

Intent is something your bot "wishes" to use

#

You tell discord what you're gonna use and they send you the payload

earnest phoenix
#
bot.on(`guildMemberAdd`, (member) => {
    console.log("Member Joined");
    member.send(`Welcome to ${member.guild.name}! The rules are as follows: \nRule1:\nRule2:\netc...`)
})```
solemn latch
#

the less you have the less you get.
when they came out, i cut my bots network usage down almost 90%

earnest phoenix
#

u mean like that

lyric mountain
#

No

#

That's an event

earnest phoenix
#

yeah but u have to enable somethin from discord

#

to make it work

lyric mountain
#

Like, let's say I go to a fast food

solemn latch
#

you can have an intent without having an event

#

you can have an event without having an intent.

lyric mountain
#

"i want to eat a cheese burger and drink a pepsi"

#

So I'll get exactly those two things

#

Those are my intents

earnest phoenix
#

yeah i know what the english word means

lyric mountain
#

I'll not get a potato bag because I've not declared my intent for that

#

Same with discord

#

You'll not get voice status if you don't ask for it during initialization

earnest phoenix
#

wdym script not found

#

its there for me

lyric mountain
#

That init command is a bit weird

earnest phoenix
#

ok but why does it say it doesnt exist

lyric mountain
#

Like, if you just do start index.js won't it work?

#

What it's not finding is the name=index.js probably

#

Like, it's searching for some script called index.js inside index.js ig

earnest phoenix
#

uh

lyric mountain
#

Try without name param

earnest phoenix
#

do what

#

whats the parameter

lyric mountain
#

Start index.js

earnest phoenix
#

o

#

misread it

#

mb

lyric mountain
#

Without name param

earnest phoenix
#

same error

#

OH

#

its a js file named index.js

#

bruh

lyric mountain
#

That ain't the issue probably

earnest phoenix
#

that fixed it

#

it was the issue

lyric mountain
#

The name?

earnest phoenix
#

yeah because

#

i did start index.js

#

but the file name is index.js

#

and the type is JS

#

do you have your package json and your bots dependencies ?

lyric mountain
#

So index.js.js?

earnest phoenix
#

so it should be index.js.js

lyric mountain
#

Lul

earnest phoenix
#

yeah

lyric mountain
#

Hidden extensions

earnest phoenix
#

hey

thick gull
#

you have hide known file extensions

#

on

earnest phoenix
#

anyone knows

#

me?

#

why appears this

#

Otisbotfinal\commands\mute.js:22
await (user.roles.add(role.id).catch(err => message.channel.send(Algo salio mal: ${err})))
^

ReferenceError: await is not defined

lyric mountain
#

Because that's not how you use await shiro

earnest phoenix
#

._.

thick gull
#

your using it like a function

#

remove the ()

#

and make sure its in an async function

earnest phoenix
#

where?

#

where i remove that

thick gull
#
await (user.roles.add(role.id).catch(err => message.channel.send(`Algo salio mal: ${err}`)))
// await is not used like this
await user.roles.add(role.id) ... // finish the statement
#

i dont know if you can use await on roles.add but probably

earnest phoenix
#

oh

thick gull
#

its saying its not defined cause

earnest phoenix
#

so i delete the

thick gull
#
function (param1, param2)
function(param1, param2)
#

so you would remove the ()

#

extra

lyric mountain
#

Wouldn't it be better to handle everything inside .then tho?

thick gull
#

yea

#

wait

#

i mean

#

it depends

#

¯_(ツ)_/¯

lyric mountain
#

Like, sync doesn't pair well with js

#

Except if you truly need to sequence stuff

earnest phoenix
#

await user.roles.add(role.id).catch(err => message.channel.send(Algo salio mal: ${err}))
^^^^^

SyntaxError: await is only valid in async function

blissful coral
#
lyric mountain
#

That last one is kinda cute embed

blissful coral
#

Removes embed

earnest phoenix
#

oh and I also have another question

#

i created an user info command but

blissful coral
#

Why...

#

Do you have...

earnest phoenix
#

it says that i am offline

#

and i am online

blissful coral
#

A if(message.content) inside of a command file

earnest phoenix
#

idk

lyric mountain
#

Also, if if if if

blissful coral
lyric mountain
#

Use a switch case

earnest phoenix
#

oh thanks

lyric mountain
#

Wait, no

#

That's just a coding tip

#

Not the actual fix

blissful coral
#

Yeah...

#

user#presence#status required a privilged intent

#

Whatever it is called

lyric mountain
#

Yeah, GUILD_PRESENCES

#

You cannot retrieve online status without that intent

earnest phoenix
#

so

#

i will try to

#

delete the if message.content

lyric mountain
#

No

#

It's just the hard-coded prefix

#

Some people will get a bit uneasy without being able to change it

#

Although I guess otis! is quite unique

earnest phoenix
#

yeah

#

so

#

How i can do an "switch case" for the presence?

lyric mountain
#
switch (somevar) {
	case "a": 
		//do this
	break;
	case "b":
		//else do this
	break;
	case "c":
		//or this
	break;
	default: //if all else fails, do this
} 
#

Case being your ifs

#

And somevar being user.presence.status

earnest phoenix
#

so in my case will be this

#
switch (ESTADO) {
    case "dnd": 
        //do this
    break;
    case "idle":
        //else do this
    break;
    case "offline":
        //or this
    break;
    case "online":
    break;
    default: //if all else fails, do this
} ```
lyric mountain
#

Almost

#

Instead of ESTADO it'd be user.presence.status

#

And below each case you'd do ESTADO = something

#

Think of switch-case as chained ifs

#

Like "with this var, check which case is true, then do something"

earnest phoenix
#

oh

#

something like this?

lyric mountain
#

Yep

#

Btw, where did you define ESTADO?

#

Before opening the command function?

earnest phoenix
#

for this

#

like

#

💠 Status: Online

lyric mountain
#

No, i mean, did you declare the variable ESTADO before assigning a value to it?

#

Like let ESTADO?

earnest phoenix
#

there n_vibin

lyric mountain
#

Ah

earnest phoenix
#

so

#

like this?

lyric mountain
#

Just remove the default branch, I just added it there as example

#

It'll error if you do nothing inside it

earnest phoenix
#

Oh ok 👍

lyric mountain
#

Nonetheless, you still need presences intent to be enabled

earnest phoenix
#

But how

lyric mountain
#

Else all you'll get is offline status

#

It's in the discord developer dashboard

#

Note that you'll need to verify your bot if you plan to have more than 100 servers

#

When you apply for verification, remember to state that you'll need to use presences intent

earnest phoenix
#

So

#

I will search in that "discord dev dashboard"

lyric mountain
#

Just do discord dev

#

It'll show as first result

earnest phoenix
#

Ok 👍

#
@client.command()
async def members(ctx):
    member_count = len(ctx.guild.members)
    true_member_count = len([m for m in ctx.guild.members if not m.bot])
    bot_count = member_count-true_member_count
    await ctx.send(f"**Total Members:** {member_count}")
    await ctx.send(f"**Users:** {true_member_count}")
    await ctx.send(f"**Bots:** {bot_count}")

In a large server, 150+ people, it says Total Members: 1, Users: 0, Bots:1. Why?

lyric mountain
#

No cache probably

solemn latch
#

your using cached members

earnest phoenix
#

cached?

lyric mountain
#

Yep, most libs will cache members as they trigger events

earnest phoenix
#

wdym cached?

lyric mountain
#

Except if you have guild_members intent, in which case some libs will cache everything on start

solemn latch
#

things stored in memory

earnest phoenix
#

i have the intent

#

ok lemme walk you through what i did for intents

#

i enabled it on Developer Portal

#

and then

#

i added it in my code

lyric mountain
#

How are you getting member count?

#

Like, code

earnest phoenix
#

intents = discord.Intents.all()
intents.members = True  # this is redundant, all intents are already enabled
lyric mountain
#

Ah nvm

earnest phoenix
#

ok

lyric mountain
#

Sorry, don't know how discordpy works, maybe someone else here could help u

earnest phoenix
#

k

#

thx!

lyric mountain
#

Nonetheless cache is your issue, you need to retrieve real member count

earnest phoenix
#

how would i do that

lyric mountain
#

Idk how in python, every lib handles it differently

#

Do you know how Woo?

solemn latch
#

nah, python is a mystery.

earnest phoenix
#

o ok

#

Hey @lyric mountain

#

I did this

#

Its ok?

lyric mountain
#

Its ok?
@earnest phoenix that's actually a quite clever way to do it

#

Haven't thought of using objects for that

#

Yes, that is the intent you need

#

You have an extra bracket there tho

earnest phoenix
#

Yeah but is from an other bracket

lyric mountain
#

Ah ok

earnest phoenix
#

ok i got it thx

#

thank you haku

#

now i have to fix the mute command

lyric mountain
#

Yw shiro

terse stirrup
#

module.exports = {
name: 'kick',
execute(message, args){

if(message.member.permissions.has("KICK_MEMBERS")) {
    message.channel.send('you can kick people');
}  

}
}

#

can someone tell me whats wrong with this?

earnest phoenix
#

But

#

What the command does?

#

Kick people or only check if you have permissons

terse stirrup
#

its just supposed to return the message you can kick people if they have perms

earnest phoenix
#

oh

terse stirrup
#

im eventually going to make it kick people but for now i want to get it to wrok

earnest phoenix
#

Wait

#

let me check

terse stirrup
#

thanks

earnest phoenix
#

i have a functional kick command i will check

terse stirrup
#

thanks

#

if (command === 'kick'){
client.commands.get('kick').execute(message, args).catch(console.error);
}

#

thats what actually initiates the action too

earnest phoenix
#

hey

#

whats your prefix

#

?

terse stirrup
earnest phoenix
#

so

#

-kickpermissons?

#

something like that

terse stirrup
#

no its just going to be -kick

analog onyx
earnest phoenix
#

you need to

terse stirrup
#

because i just want to see if the perm check works

lyric mountain
#

What's the error tony?

terse stirrup
#

nothing is returne

#

returned*

earnest phoenix
#

@analog onyx async (client, message, args, msg) => {

#

like this

#

async (client, message, args, msg) => {
if(message.content === ("test")){
message.channel.send('test');

#

something like that but with your command

lyric mountain
#

Put a Console.log inside that command to see whether it's even going inside the perm check

#

Maybe it's not entering it

terse stirrup
#

see i thought of that but nothing is sent to cosole

analog onyx
#

It makes a role

lyric mountain
#

Then it's not going inside it

#

Put logs everywhere to see how far it's getting

earnest phoenix
#

if(!message.guild.me.hasPermission('KICK_MEMBERS')) return message.channel.send('you cant kick people')
if(message.guild.me.hasPermission('KICK_MEMBERS')) return message.channel.send('you can kick people')

#

something like this @terse stirrup

lyric mountain
#

Err, no

earnest phoenix
#

😭

lyric mountain
#

Lul

#

Issue is the code isn't reaching inside that if

#

Also, else would be better in your example

terse stirrup
#

can i call someone to ss for a sec?

lyric mountain
#

I can't rn sorry

terse stirrup
#

its fine

analog onyx
#

Let me retry

earnest phoenix
#

so tony

#

i can

#

so call me if you want but

#

i cant say nothing bc im not that good on english

terse stirrup
#

its fine ill call in 1 sec lemme test this quick

dire brook
#

how i can show in a let a value of a mysql table

opal plank
#

a what now?

thick gull
#

what

umbral zealot
#

translation: "how do I define a variable from a value inside of a mysql table"

thick gull
#

@opal plank y it no work >:ccccccc

if (true) {
     true = false
} else if (false) {
     false = true
}
#

/joke

opal plank
#

@thick gull you clearly forgot a ; you dummie

thick gull
#

:((((

#

pls fix !!

opal plank
#

just add 2 ;

thick gull
#

no

#

3

opal plank
#

nah jut 2

thick gull
#
if (true) {
     true = false;
} else if (false) {
     false = true; // 3 ;
}

@thick gull

sudden geyser
#

sadly I think that's valid JS

thick gull
#

it’s not

opal plank
#

whos gonna be the brave soul who's gonna hardlock their discord console with that?

thick gull
#

the if () is fine

#

but you can’t change false and true

#

trust me I tried

#

:(

lucid prawn
#

message.author.username

Cannot read property 'username' of undefined

how do i fix this

rustic nova
#

Can't do much with that information

umbral zealot
#

sounds like your message isn't actually a discord.js message object.

lucid prawn
#
            if(message.content.startsWith(prefix + "hug" )){
                message.channel.send('**OMG YOUR HUGGING**');
                }
                if(message.content.startsWith(prefix + "hug" )){
                  var embed = new Discord.MessageEmbed()
                        .setDescription(message.mentions.users.first().username + ' huged ' + message.author.username)
   
                        .setTimestamp()
                        .setImage('https://gifimage.net/wp-content/uploads/2017/06/anime-hug-gif-11.gif')
                    message.channel.send(embed);
              }
Cannot read property 'username' of undefined
#

@rustic nova is that ok

opal plank
#

fairly certain you loking at the wrong place

#

this is likely returning undefined

#

cuz there isnt a mention

lucid prawn
#

ok how do i fix it

earnest phoenix
#

why you not put first message.author.username and after message.mentions.users.first().username

lucid prawn
#

ok i will fix that

earnest phoenix
#

how do i make my bot online 24 hours?

#

oe

#

I can put my bot 24/7 on my pc

#

But

#

I have to mantein the pc On all the night

#

yea

#

Yeah

#

how i fix that

sudden geyser
#

[Python] I'm having trouble with dependency conflicts (aka one thing relies on X version, but another thing relies on Y version). From the looks of it, pip doesn't download the other version some other library would use, which causes conflict.

To illustrate, I'm using discord.py. It relies on the aiohttp library, which can use any version between 3.6.0 and 3.7.0. The latest version of aiohttp is 3.7.2, which I'd like to use in my source code. How would I resolve this?

#

@earnest phoenix you can't use async in that context

#

What are you trying to do exactly.

opal plank
#

@earnest phoenix thats.... not how you run async code....

thick gull
#

@opal plank how do I stay motivated

opal plank
#

by watching me code

#

it'll trigger you immensely

thick gull
#

ok

vague imp
#

Lol

thick gull
#

twitch link

#

?

vague imp
#

I stay motivated to code by taking new challenges

opal plank
#

erm, im not streaming on twitch

thick gull
#

where are you streaming it

#

:)

opal plank
#

nowhere yet

#

you wanna see cursed code?

thick gull
#

yes

opal plank
#

cuz it looks like you wanna see cursed code

#

imma share it on myy private server

#

too many eyes here

#

👀

thick gull
#

ok

vague imp
#

Lol

halcyon kite
#

Hi so im making a clear command for my bot but for some reason it gets rid of the messages, but the message saying it has deleted the message is not deleting afterwards, what should I do?

#

heres the code: `else if (command == 'clear'){
if (!message.member.hasPermission("MANAGE_MESSAGES") || !message.member.hasPermission("ADMINISTRATOR")) return message.channel.send("You cant do that Random Memer... Sorry!")
if (isNaN(args[0])) return message.channel.send("Please put a number that works!")
if (args[0] > 100) return message.channel.send("I dont have enough power to do over 100, but it has to be less than 100, sad")
if (args[0] < 1) return message.channel.send("HA less than 1 is not worthy of me power!!!")

message.channel.bulkDelete(args[0])
.then(messages => message.channel.send(`Deleted ${messages.size} messages like u asked`))
.catch(() => message.channel.send("Sorry but I cant do it for some reason :("))

}`

#

oof i put it in wrong on discord

sudden geyser
#

Because you never actually delete it.

#

First you purge the messages, then you say the messages have been deleted, and that's it.

halcyon kite
#

ok so i should put something to delete afterwards

#

hmm

sudden geyser
#

If you want to delete that message, resolve the promise then delete it. js message.channel.send(`...`).then((msg) => msg.delete(...))

halcyon kite
#

ok thanks!

#

So for the ```.then((msg) => msg.delete(...)) its causing this error

#

oh wait

#

I think i solved it

#

Solved it

slender thistle
#

@sudden geyser you can try manually building after cloning the repo and editing the dependencies

sudden geyser
#

ehh, that's not very elegant. I'd need to jump through a few hoops having a different version of the lib. Though, I did just find Pipenv and it looks like just what I was looking for.

slender thistle
#

Right, I keep forgetting about it 😂

hazy sparrow
sudden geyser
#

.join()?

hazy sparrow
#

ah yes

sudden geyser
#

Right, I keep forgetting about it 😂
it's alright. though I feel all my struggles with pip vanishing

slender thistle
#

Noiceee

hazy sparrow
#

is refreshing my bot's custom status every 15 seconds API abuse?

sudden geyser
#

I think the current limit is 5 per 1 minute (60 / 5 = 12), but there's no defined limit as it's dynamic. You should set it to something reasonable, like 1 per minute.

hazy sparrow
#

ah okay, thanks!

earnest phoenix
#

is it okay to change status for every 2 mins?

#

or that's rate limit

fiery tide
#

I think rate limit is about every 4 seconds, so 2 minutes should be fine.

earnest phoenix
#

thanks!

hazy sparrow
#
     ^ cannot read property "id" of undefined.
#

Discord.js btw

umbral zealot
#

I'd wager taggerMember.user is undefined

#

how is that defined?

hazy sparrow
#

and taggedMember is message.mentions.members.first()

umbral zealot
#

looks like that member isn't cached, that would do it

#

you can do something like ```js
if(taggedMember.partial) taggedMember = await message.guild.members.fetch(taggedMember.id);

#

If I recall how partials work correctly

hazy sparrow
#

eh okay i'll try that, thanks!

#

ok im dumb, taggedMember was message.mentions.users.first() so taggedMember.id worked.

#

thanks anyways

rocky hearth
#

Is anyone well known of typescript here?

sudden geyser
#

could you explain the issue you're having with ts?

solemn latch
#

ERWIN

rocky hearth
#

So... I have extended the Client, how do I get typings of my extended client accessible within <Guild | Member | etc>.client.myProp

#

bcoz <Guild>.client still referencing the original Client, and gives error for .myProp

#

Hey @sudden geyser

knotty basin
earnest phoenix
#

just for reference im hosting my bot on my pc

#

will having a warnings table cause preformance issues

#

what i mean by that

#

if i did like, "/warn bob"

#

it adds him to a dictionary with his amount of warnings

#

"Bob'sUserId": 1

#

also, if i make changes to the bot it will like reset the table

#

so how can i keep the table's values?

rocky hearth
#

use a db

earnest phoenix
#

db?

rocky hearth
#

database

earnest phoenix
#

yeah but

#

will having one effect my pc's preformance?

#

i host bots from my pc

rocky hearth
#

naah, not much. Its just a normal process

#

There's a bunch of technologies out there

earnest phoenix
#

are databases included with discord.js

#

or do i gotta use like sql or somethin

rocky hearth
#

djs doesn't provide any databases, it just an api

earnest phoenix
#

is there any documentation on it

rocky hearth
#

yes see the guide. There's a topic on it

earnest phoenix
#

what

#

can u send me the link

rocky hearth
earnest phoenix
#

bruh

#

is executed edit possible in any way?

#

so like if i did Array.insert() during runtime

#

it would actually be part of that array, while editing

#

if that makes sense

rocky hearth
#

which language u using?

earnest phoenix
#

js

rocky hearth
#

so u want to insert values into an array, at runtime? (When bot is online?)

earnest phoenix
#

but then it save those inserted values outside of runtime

#

maybe like insert them into a json file or something

rocky hearth
#

ooh, u want to save the values, so when u restart the bot. The values should already be there. Am I right?

earnest phoenix
#

yeah

rocky hearth
#

That's what databases are for

earnest phoenix
#

ah

rocky hearth
#

read the guide

earnest phoenix
#

alright

#

thanks

rocky hearth
earnest phoenix
#

im not new to discord.js entirely

#

just this batabase thing

ember lodge
#

    const servers = [""]
    const embed = new Discord.RichEmbed()
      .setAuthor("Server Status")
    fetch('https://api.nitrado.net/services', {
      method: 'GET',
      headers: {
        'Authorization': `Bearer ${nitrapiToken}`
      }
    })
      .then(res => res.json())
      .then(json => {
        json.data.services.forEach(async (el) => {

           
          let stat
          if (el.status === "active") stat = "✅"
          if (el.status === "suspended") stat = "❌"

          const obj1 = serverList
          let obj = obj1[el.details.address]

          servers.push(`[${stat}] ${obj.name}`)

       
        });
      })
        console.log(servers)
        let pve = servers.filter((s) => s.includes("PvE"))
        let pvp = servers.filter((s) => s.includes("PvP"))
        let duos = servers.filter((s) => s.includes("Duos"))
        let tribes = servers.filter((s) => s.includes("Small"))
        let events = servers.filter((s) => s.includes("Events"))

        embed.setAuthor("Server Status", client.user.avatarURL)
        embed.setColor("PURPLE")
        embed.addField("PvE servers:", pve.join("\n\n"))
        embed.addField("PvP servers", pvp.join("\n\n"))
        embed.addField("Duos servers", duos.join("\n\n"))
        embed.addField("Small Tribes servers", tribes.join("\n\n"))
        embed.addField("Events", events.join("\n\n"))
        message.channel.send(embed)

Someone knows why the bot is giving me the error that the addFields could not be empty, apparently the bot can't make the .push to the array

trim saddle
#

@earnest phoenix well uh, don't use json, you have a few choices

#

the most common database choices are almost any sql here, mongo or redis

earnest phoenix
#

which would u suggest for someone just starting discord.js

#

and i only have background in lua and c#

#

aka the easiest