#development

1 messages · Page 1675 of 1

quartz kindle
#

the same way you are listing the number of users and channels

tulip ledge
#

TypeError: canbnot read property locked of undefined

crimson vapor
#

wait you have 80mb heap used????

long crow
#

Oh, you mean on the stats command

#

lol

zenith terrace
#
if(tim.locked) {
tim.stayLocked()
} else {
tim.lockIn(development)
}```
crimson vapor
#

im barely 11

long crow
#

I mean, yeah detritus is cool and such, but if I cant understand it, no use for me

quartz kindle
#
client.users.cache.size
client.channels.cache.size
client.guilds.cache.size
client.guilds.cache.reduce((a,b) => a + b.members.cache.size)
client.guilds.cache.reduce((a,b) => a + b.roles.cache.size)
client.guilds.cache.reduce((a,b) => a + b.presences.cache.size)
client.channels.cache.reduce((a,b) => a + b.messages.cache.size)
``` @long crow
crimson vapor
quartz kindle
#

there's also voice states cache you can add to that

long crow
#

voice no, since this is not music bot

crimson vapor
#

you will still have it tho

quartz kindle
#

but if you have the VOICE_STATES intent then you have cached voice states

crimson vapor
#

ye

quartz kindle
#

also cached messages

tulip ledge
#

so idk what happened

crimson vapor
#

why does djs cache so much

tulip ledge
#

but

crimson vapor
#

makes no sense to me

tulip ledge
#

for some reason they're merged now

quartz kindle
#

client.channels.cache.reduce((a,b) => a + b.messages.cache.size)

tulip ledge
#

even tho I didn't do shit

long crow
#

["GUILDS","GUILD_MESSAGES","DIRECT_MESSAGES","GUILD_INTEGRATIONS","GUILD_WEBHOOKS","GUILD_INVITES","GUILD_MESSAGE_REACTIONS","GUILD_PRESENCES","GUILD_MEMBERS"],

#

all the intents I have

quartz kindle
#

add those caches i listed to your stats command and see what causes the memory usage increase

long crow
#

will do in an hour

#

still multitasking discord/game

#

lol

stable nimbus
#

Is there a way to load certain folders in a certain order on startup?

quartz kindle
#

yes

long crow
#

and lol, I got better answer here than djs discord itself

#

This is not related to djs kekw

quartz kindle
#

you could say im an expert on discord.js caching lmao

crimson vapor
#

Tim is djs caching

old cliff
#

Did team forget removing the embeds in #logs ?

zenith terrace
#

or lazy

earnest phoenix
#

hmm

marble juniper
#

lets say I have 2 coordinates

{ x: 10, z: 0 }
{ x: 0, z: 10 }

how could I create an array that would be a ray that has a step of 0.1?

#

I need to do some math in my code rn

#

lol

earnest phoenix
#

can someone tell me how much a custom gamberling bot would be in cash

zenith terrace
#

depends on the person you ask

dusky sundial
quartz kindle
#

a ray of step 0.1

toxic jolt
#

im getting this error pls help

marble juniper
#

basically

toxic jolt
#

my bot dont login

marble juniper
#

I have z: 10 and z: 0

#

would be
z: 0.1, 0.2, 0.3

#

and so on

#

thats what I meant

quartz kindle
#

so from 0 to 10 in 0.1 increments?

marble juniper
#

yeah

toxic jolt
cinder patio
#

A for loop but increment by 0.1

marble juniper
#

but in the real case scenario I have

cinder patio
#

instead of 1

marble juniper
#

3 variables

toxic jolt
#

Which DNS is the best for Discord Bot pls help

marble juniper
#

x and y and z

#

the z one was the example

#

lol

earnest phoenix
#

so what is a basike one like would it cost more then 50 or 100 $

marble juniper
#

I need to do it with x and y and z

#

idk how to

quartz kindle
#
let start = 0;
let end = 10;
let step = 0.1;
let array = [];
while(start < end) {
  array.push(start);
  start += step;
}
#

lul

cinder patio
#

why not a for loop

marble juniper
#

I said its with x and y and z

dusky sundial
marble juniper
#

lol

#

its not just a single value

#

its 3

earnest phoenix
#

oh

marble juniper
#

its a vec3 in a 3d space

cinder patio
#

give an example with 3 variables

quartz kindle
#

increment all 3 variables on each step

marble juniper
#

thats just an example

#

lol

#

in the actual code its ofc random

cinder patio
#

so you want to go from pos1 to pos2 gradually?

marble juniper
#

yeah

#

like a straight line you could say

#

but as an array

#

of positions

#

lol

crimson vapor
#

loop through every one

earnest phoenix
#

ok so if i was asking some one in here since your bot develiperss how much would it cost for one u to make one? thats kinda what i wont to know

crimson vapor
#

add 1 to z remove one from x

light sequoia
#

Kwai617635478 entrai kkkk

marble juniper
#

yeah but x and y and z is random when I use it in the actual code

#

y needs to be considered too

quartz kindle
crimson vapor
#

ex.

{ x: 10, z: 0 }
{ x: 9, z: 1 }
{ x: 8, z: 2 }
{ x: 7, z: 3 }
{ x: 6, z: 4 }
{ x: 0, z: 10 }```
quartz kindle
#

the steps will be different for each coordinate

#

so a step of 0.1 on which coordinate?

crimson vapor
#

that would be fucky wucky with a y value tho

marble juniper
#

idk

quartz kindle
#

like

marble juniper
#

since

#

the x and y and z can also be negative

#

lol

crimson vapor
#

you can make a formula

quartz kindle
#

if you start from 0,0,0 and you go to 3,6,5 then the step from 0 to 6 will be one thing, the step from 0 to 3 will be half of that

crimson vapor
#

like y = mx + b

quartz kindle
#

so you need to chose which coordinate you want the steps to be in

crimson vapor
#

is this for the minecraft bot thing

marble juniper
#

yes

#

not just for minecraft bot

#

its for the fomular of calculating explosion damage for minecraft entities

#

for mineflayer an open source repository that lets you make minecraft bots in js

#

thats why im asking in the first place

#

lol

marble juniper
#

if the coordinates can be negative and are random

quartz kindle
#

you can do steps based on distance

#

so you need to triangulate the destination to measure the true distance, instead of axial distance

tulip ledge
#

So I have this array [6, 6, 6, 6, 6] this array could also be [6, 5, 4, 3, 2] right now I need to get the index of it I'm using .indexOf()+1 to ge t it but when I have the first array it alwayssais: Level 1 but it needs to say Level 1, Level 2, Level 3 ... how would I do this?

champion["q"].map(cd => `Level ${champion["q"].indexOf(cd)+1} **${cd}s**`).join("\n")

This is what I'm doing

marble juniper
#

im working with these kinds of positions

#

it has some functions already

quartz kindle
#

the true distance between the two points in 3d is the same formula as the diagonal distance of a cube

crimson vapor
#

yep

#

it should be super easy actually

#

you can make the formula using the y - y1 = m(x - x1)

#

but 3d version

#

idk that one

#

all you need is 1 end point and the slope

#

im not too sure how that would work in 3d space

marble juniper
#

yeah

tulip ledge
crimson vapor
#

iterate over the length of the array

tulip ledge
#

so for loop instead of mapping right

crimson vapor
#
const arr = [0, 1, 2, 3]
let str = '';
for (let i in arr) {
  i++
  str += `Level ${i}`
}```
cinder patio
#

euh

crimson vapor
#

its not the best

#

but it works

quartz kindle
# marble juniper oh ic

i think i did it right but try this ```js
x = 6;
y = 68;
z = 4;
d2 = Math.sqrt(x2 + y2);
d3 = Math.sqrt(z2 + d22); // true 3d distance

marble juniper
#

what does sqrt doe

#

lol

quartz kindle
#

square root

crimson vapor
#

root

marble juniper
#

what is even **

crimson vapor
#

^

#

power

quartz kindle
#

power

marble juniper
#

oh

#

ic

#

im not good at math at all

#

lol

quartz kindle
#

square root of x²+y² is the 2d distance of the hypotenusa

crimson vapor
#

can't you do the third root of x ** 2 + y ** 2 + z ** 2

quartz kindle
#

maybe let me try

#

hmm results were different

crimson vapor
#

ye

#

1552?

#

no you're right

#

wait

#

no im readin this wrong

marble juniper
#

now that I think about it I should have looked at stackoverflow first

crimson vapor
#

shit no I typed z 2 times

marble juniper
#

oh wait tim is my second stackoverflow

#

lol

marble juniper
#

thanks for the help btw you 2

cinder patio
#

Isn't that the pythagorean theorem

marble juniper
quartz kindle
#

wait it does work

crimson vapor
quartz kindle
#
x = 55;
y = 68;
z = 44;
Math.sqrt(x**2 + y**2 + z**2)
marble juniper
quartz kindle
#

the first time i did this i got wrong results, but now it worked

#

lul

marble juniper
#

lol

crimson vapor
#

no

quartz kindle
#

no

crimson vapor
#

you would do it on all points

marble juniper
#

I need an array of positions

quartz kindle
#

not necessarily

crimson vapor
#

search generating all points inbetween 2 vectors

quartz kindle
#

use that formula to get the true distance

#

then use the steps on this true distance

#

and recalculate x/y/z based on it

crimson vapor
#

ye

#

hmm

drowsy sparrow
#

.help

#

-help

#

/help

#

fuck

quartz kindle
drowsy sparrow
#

thank you 😄

tired panther
crimson vapor
#

it should be 68.381284

crimson vapor
#

distance formula is the same thing as pythagreon theorm

tired panther
#

a^2 + b^2 = c^2
c = root(a^2 + b^2 )

#

thats pythagorean

#

there is a big difference

crimson vapor
#

D = sqrt(x^2 + y^2)
c = sqrt(a^2 + b^2)

#

there is not

#

I can change the letters

marble juniper
#

My brain hurts from this

crimson vapor
#

draw it on paper @marble juniper

#

makes it easier when dealing with shapes and numbers

cinder patio
#

It's the same thing, but instead of c you're searching the distance

quartz kindle
# marble juniper My brain hurts from this
x = 55;
y = 68;
z = 44;
d3 = Math.sqrt(x**2 + y**2 + z**2)
array = [];
for(let i = 0; i < d3; i += 0.1) {
    array.push({
        x: i * x / d3,
        y: i * y / d3,
        z: i * z / d3
    })
}
marble juniper
#

thanks

#

0.1 is the step thing right

quartz kindle
#

yes

#

keep in mind that x,y,z here is distance, not position

crimson vapor
#

there is prolly a library for this tho

#

LOL

quartz kindle
#

you need to do original x - target x, etc

crimson vapor
#

find distance and generate an array of points

quartz kindle
#

to get the distance x, etc

marble juniper
#

okie

quartz kindle
#

then do the opposite to get positions again

#

original x + incremented distance x, etc

#

since you get an array of distances

crimson vapor
#

since you have points you can also just make the formula

#

this is actually pretty cool

quartz kindle
#

i hardly understand math formulas

marble juniper
#

same

quartz kindle
#

i need to translate them to code so i can understand xd

crimson vapor
#

the proof is just beyond me but I think I get most of it

marble juniper
#

lol

crimson vapor
#

Link if you take about 30 mins to read about vectors im sure the answer is going to be a bit simpler than that

quartz kindle
#

x,y,z are the distance between both positions

#

so you need to x = positionX1 - positionX2, y = positionY1 - positionY2, etc

crimson vapor
quartz kindle
#

5/7

crimson vapor
#

in 2d space its essentially that

sacred juniper
#

Hi

quartz kindle
#

can also use math.abs to keep distance positive

#

because you know

#

we have to keep distance from positive people

#

(covid joke)

sacred juniper
#

How can i learn my bot is confirm

marble juniper
cinder patio
crimson vapor
#

if you are given 2 points there will always be a square and therefore a 90 degree angle

quartz kindle
sacred juniper
#

Yea

long crow
#

@quartz kindle I don't even know what those big numbers came from

sacred juniper
#

Is it true server

#

Because it was say you Luca will say you

crimson vapor
quartz kindle
#

xd

umbral zealot
long crow
#
const { version } = require("discord.js");
const moment = require("moment");
require("moment-duration-format");

module.exports = {
  name:'stats',
  aliases:['info','status'],
  description: 'Show the statistic of bot',
  guildOnly:true,
  async run(message) {
    const duration = moment.duration(message.client.uptime).format(" D [days], H [hrs], m [mins], s [secs]");
    message.channel.send(`= STATISTICS =
  • Mem Usage  :: ${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)} MB
  • Uptime     :: ${duration}
  • Users      :: ${message.client.users.cache.size.toLocaleString()}
  • Servers    :: ${message.client.guilds.cache.size.toLocaleString()}
  • Channels   :: ${message.client.channels.cache.size.toLocaleString()}
  • Discord.js :: v${version}
  • Node       :: ${process.version}
  • User       :: ${message.client.users.cache.size}
  • Channels   :: ${message.client.channels.cache.size}
  • Guilds     :: ${message.client.guilds.cache.size}
  • Members    :: ${message.client.guilds.cache.reduce((a,b) => a + b.members.cache.size.toLocaleString())}
  • Roles      :: ${message.client.guilds.cache.reduce((a,b) => a + b.roles.cache.size)}
  • Presence   :: ${message.client.guilds.cache.reduce((a,b) => a + b.presences.cache.size)}
  • Platform   :: ${process.platform} ${process.arch}`, {code: "asciidoc"});
  }
};```
blazing rune
#

How can I make my node.js bot 24/7

quartz kindle
#

b.members.cache.size.toLocaleString()

#

you cant do that there

#

do it after the reduce

sacred juniper
quartz kindle
#

.reduce(...).toLocaleString()

marble juniper
#

im bad at making jokes sorry

sacred juniper
#

And if my bot verify will i get a rosette

#

a rosette*

umbral zealot
#

what the hell is a "rosette"

sacred juniper
#

You have

#

Blue

umbral zealot
#

the badge?

#

no\

blazing rune
#

How can I make my node.js bot 24/7

umbral zealot
#

You can't get the badge

sacred juniper
#

Umm how did you get

umbral zealot
#

I got it almost a year ago at this point

#

it hasn't been given for over 6 months

sacred juniper
#

Umm ok

umbral zealot
sacred juniper
long crow
#

still same, but no more ,

quartz kindle
#

can you show the code again?

umbral zealot
#

There are free hosting services. You can check in the pins for more deatails.

long crow
#
const { version } = require("discord.js");
const moment = require("moment");
require("moment-duration-format");

module.exports = {
  name:'stats',
  aliases:['info','status'],
  description: 'Show the statistic of bot',
  guildOnly:true,
  async run(message) {
    const duration = moment.duration(message.client.uptime).format(" D [days], H [hrs], m [mins], s [secs]");
    message.channel.send(`= STATISTICS =
  • Mem Usage  :: ${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)} MB
  • Uptime     :: ${duration}
  • Users      :: ${message.client.users.cache.size.toLocaleString()}
  • Servers    :: ${message.client.guilds.cache.size.toLocaleString()}
  • Channels   :: ${message.client.channels.cache.size.toLocaleString()}
  • Discord.js :: v${version}
  • Node       :: ${process.version}
  • User       :: ${message.client.users.cache.size}
  • Channels   :: ${message.client.channels.cache.size}
  • Guilds     :: ${message.client.guilds.cache.size}
  • Members    :: ${message.client.guilds.cache.reduce((a,b) => a + b.members.cache.size).toLocaleString()}
  • Roles      :: ${message.client.guilds.cache.reduce((a,b) => a + b.roles.cache.size)}
  • Presence   :: ${message.client.guilds.cache.reduce((a,b) => a + b.presences.cache.size)}
  • Platform   :: ${process.platform} ${process.arch}`, {code: "asciidoc"});
  }
};```
#

@quartz kindle

umbral zealot
cinder patio
quartz kindle
#

do .reduce((a,b) => a + b.members.cache.size, 0) then

quartz kindle
#

which is weird because the reduce docs say accumulator is the result of the first iteration of no initial value is given

#

but maybe its incorrectly implemented by Collection

cinder patio
#

I think Guild#valueOf returns the guild's ID

quartz kindle
#

ah

#

If no initialValue is provided, then accumulator will be equal to the first value in the array, and currentValue will be equal to the second.

#

so accumulator is the value of b / array[0], not the result of the first iteration

boreal iron
#

Did you.... err did you read the JS docs, Tim?
Oh no... no no all our hope is gone now.

sacred juniper
#

How can i get Bot developer role

quartz kindle
#

i read a lot of docs

quartz kindle
sacred juniper
#

Oh ok

long crow
#

@quartz kindle What those numbers supposed to do though

sacred juniper
#

Thanks for answer

boreal iron
#

We thought you’re the chosen one and the docs would read you.

quartz kindle
#

the numbers are there so you can see more cache information now, so then your ram usage increases, you will see which cache caused it

boreal iron
#

sounds like a chuck norris joke lmao

marble juniper
#

pain

quartz kindle
#

bread

marble juniper
#

I mean it works but

crimson vapor
quartz kindle
#

but?

marble juniper
#

indeed

#

but it outputs these long thicc things

#

lol

#

these numbers

quartz kindle
#

client.channels.cache.reduce((a,b) => a + b.messages.cache.size, 0)

crimson vapor
#

message caches make no sense tbh unless you need message edits

long crow
#

i ran into Cannot read property 'cache' of undefined

#

that why I skip it

quartz kindle
#

oh yeah

long crow
#

though I use the exact line as ${message.client.channels.cache.size.toLocaleString()}

quartz kindle
#

client.channels.cache.filter(c => c.messages).reduce((a,b) => a + b.messages.cache.size, 0)

#

because non-text channels have no messages

long crow
#

lemme try again

quartz kindle
#

edited to include dms

#

or simple check if the messages field exists

quartz kindle
cinder patio
#

Though there's no point in limiting it unless you want to display these numbers somewhere

quartz kindle
#

yes

long crow
#

the new status

quartz kindle
long crow
#

oops

quartz kindle
#

ok so now you have a more complete view of the discord.js cache

#

now restart your bot to clear the ram

#

then watch which caches increase ram the most

marble juniper
#

I think I will use ==

#

for the first time

quartz kindle
#

thats not very efficient but ok

marble juniper
#

idk how else to do it

#

lol

quartz kindle
#

math is always faster than string conversion

marble juniper
#

I just used .toFixed

quartz kindle
#

Math.round(number * 10) / 10

marble juniper
#

ok

marble juniper
#

lol

#

thanks for the help again

#

appreciate it

#

ur the best tim and co

quartz kindle
#

now the values in that array are distances

long crow
#

fresh reboot

quartz kindle
#

because they are calculated from the original distance betwee both points

#

if you want positions, for example to draw a line

#

you need to convert each of those items in the array back to positions

#

for example positionX1 = originalX + array[0].x

#

positionX2 = originalX + array[1].x

#

etc

quartz kindle
marble juniper
long crow
#

that quite fast changes

sterile lantern
#
var date = new Intl.DateTimeFormat('en-US', { dateStyle: 'medium', timeStyle: 'medium', timeZone: 'America/New_York' }).format(Date.now())
#

I want this to be URC

#

UTC*

#

rn it’s EST

quartz kindle
#

you can disable presences by removing the intent

#

and you can limit message caching using the client options

long crow
#

👍

onyx jay
quartz kindle
#

removing the presences intent will also prevent online members from being cached at login

#

which will also help with memory saving

onyx jay
#

I might be thinking wrong, but I believe that is the default string for UTC times (although it might just be a python thing). you could also try DATE.UTC()

long crow
thin echo
#

I am trying to make a command where my bot shows how many servers it is in, but everything I find doesn't work. this is discord.py

green kestrel
#

Hey there Tim 😄

onyx jay
thin echo
#

Thx

#

it worked

toxic jolt
#

Please help.

const hentai_channels = ["hentai-fans", "hentai-channel", "hentai-love", "hentai-lol"]

var hentai = message.guild.channels.find(channel => channel.type ==="text" && channel.name == hentai_channels.includes(hentai_channels))

message.reply('channel: ' + hentai)``` 
![yupi](https://cdn.discordapp.com/emojis/778673235889618995.webp?size=128 "yupi") __**I want to do;**__ *Find that say "`const hentai_channel = [`' and tag a channel for "`message.reply`"*
cinder patio
#

Use hentai_channels.includes("channel name" to check if the channel name is inside the hentai_channels array

toxic jolt
#

i like it

cinder patio
#

yes

toxic jolt
#

thanks

#
var hentai = message.guild.channels.find(channel => channel.type ==="text" && channel.name == hentai_channels.includes(hentai_channels))```
#

let see

dusky lagoon
#

ohw no not hentai

cinder patio
#

No

#

not like this

#

don't compare channel.name to hentai_channels.includes(hentai_channels), and don't give the includes function the array, give it channel.name

dusky lagoon
#
const Discord = require("discord.js")
module.exports = {
    name: "dice",
    run(message, client) {

        var dice1 = new Discord.MessageEmbed()
        .setImage("https://rolladie.net/images/dice/dice1.jpg")
        var dice2 = new Discord.MessageEmbed()
        .setImage("https://rolladie.net/images/dice/dice2.jpg")
        var dice3 = new Discord.MessageEmbed()
        .setImage("https://rolladie.net/images/dice/dice3.jpg")
        var dice4 = new Discord.MessageEmbed()
        .setImage("https://rolladie.net/images/dice/dice4.jpg")
        var dice5 = new Discord.MessageEmbed()
        .setImage("https://rolladie.net/images/dice/dice5.jpg")
        var dice6 = new Discord.MessageEmbed()
        .setImage("https://rolladie.net/images/dice/dice6.jpg")
        var pages = [
            dice1,
            dice2,
            dice3,
            dice4,
            dice5,
            dice6
        ];

        var author = message.author;

        
    const random = pages[Math.round(Math.random() * (pages.length - 1))]
        message.channel.send(pages[0]).then( async message => {
            await message.react('🔄');
            var collector = message.createReactionCollector(
                
                // only collect left and right arrow reactions from the message author
                (reaction, user) => ['🔄'].includes(reaction.emoji.name) && user.id === author.id,
            )

            collector.on('collect', reaction => {
                reaction.users.remove(author.id)
                if (reaction.emoji.name === '🔄') {
                    message.edit(random);
                }
                
            })
        })
        
    }
};``` made this embed paged dice command only probles that it can edit it self only ones if you press the reaction it just stays on the changed pages how do i fix this
toxic jolt
#

dont worked

dusky lagoon
#

in what language is this bot tf

toxic jolt
#

dont worked

toxic jolt
dusky lagoon
#

nooo i mean is it turkish orrr

cinder patio
#

You are still comparing channel.name to hentai_channels.includes...

sterile lantern
#

why are you using v11

#

use v12

dusky lagoon
#

smooth

cinder patio
#

just hentai_channels.includes...

sterile lantern
#

v11 is deprecated

toxic jolt
#
const hentai_channels = ["hentai-fans", "hentai-channel", "hentai-love", "hentai-lol"]

var hentai = message.guild.channels.find(channel => channel.type ==="text" && hentai_channels.includes(hentai_channels))

message.reply('channel: ' + hentai)```
#

i so stupid

cinder patio
#

Remove channel.name ==

toxic jolt
#

okay

#

i deleted

#

Is that all

cinder patio
#

yes

#

no

#

You are still passing hentai_channels to the include function instead of the channel.name property

#

learn to code

#

don't copy things blindly

toxic jolt
#

YEEEEEES

#

thanks man

toxic jolt
cinder patio
#

sure

old cliff
#

will djs 13 have inline replies ?

#

also how can I do those now?

sterile lantern
#

tbh good question

#

djs will probably include it

#

but@you can do it mhm

brittle bane
#

Hm

dusky lagoon
#
const Discord = require("discord.js")
module.exports = {
    name: "dice",
    run(message, client) {

        var dice1 = new Discord.MessageEmbed()
        .setImage("https://rolladie.net/images/dice/dice1.jpg")
        var dice2 = new Discord.MessageEmbed()
        .setImage("https://rolladie.net/images/dice/dice2.jpg")
        var dice3 = new Discord.MessageEmbed()
        .setImage("https://rolladie.net/images/dice/dice3.jpg")
        var dice4 = new Discord.MessageEmbed()
        .setImage("https://rolladie.net/images/dice/dice4.jpg")
        var dice5 = new Discord.MessageEmbed()
        .setImage("https://rolladie.net/images/dice/dice5.jpg")
        var dice6 = new Discord.MessageEmbed()
        .setImage("https://rolladie.net/images/dice/dice6.jpg")
        var pages = [
            dice1,
            dice2,
            dice3,
            dice4,
            dice5,
            dice6
        ];

        var author = message.author;

        
    const random = pages[Math.round(Math.random() * (pages.length - 1))]
        message.channel.send(pages[0]).then( async message => {
            await message.react('🔄');
            var collector = message.createReactionCollector(
                
                // only collect left and right arrow reactions from the message author
                (reaction, user) => ['🔄'].includes(reaction.emoji.name) && user.id === author.id,
            )

            collector.on('collect', reaction => {
                reaction.users.remove(author.id)
                if (reaction.emoji.name === '🔄') {
                    message.edit(random);
                }
                
            })
        })
        
    }
};``` made this embed paged dice command only probles that it can edit it self only ones if you press the reaction it just stays on the changed pages how do i fix this
cinder patio
#

random is the same even after the user reacts

#

you need to generate a new random number when a user react, not before

dusky lagoon
#

ooohw but what can i do instead of message.edit

#

nothing??

cinder patio
#

no... just define the random variable inside the collect event

#

so the random embed is different everytime someone reacts to the message

dusky lagoon
#

ooohw

earnest phoenix
#

Oop

proven ice
#

hey guys im wondering if anyone here has used datadog...i just got it today and i wanna set up some metrics for my bot but im a bit clueless rn

#

so far i found theres a library for javascript

earnest phoenix
#

No sorry dude

proven ice
#

and got a general idea of how to increment counters

#

k

earnest phoenix
#

help
replit is reinstalling wrong versions of all dependencies which causes zero to reinstall them
and the next time i press run replit installs them again

how do you prevent replit from giving you a stroke

cinder patio
#

buy a vps mmulu

earnest phoenix
#

im using repl as an actual ide

cinder patio
#

vps' are not only for bots

quiet topaz
#

how can i escape strings for mysql queries in Java?

vivid fulcrum
#

your library you use for interacting with the database should already have some sort of sanitization method

#

which library are you using

quiet topaz
#

one from some Person from github.
it has prepared Statements but i dont know if this is what i want

vivid fulcrum
#

it is

frigid mountain
#
const Discord = require('discord.js')

module.exports = {
    name: 'dm',
    run: async (message, args) => {
const user = client.users.cache.get('774903577068044298');
user.send('hello');
    }
}

Can someone help me with this code its suppose to dm the user with my message but it does not work

vivid fulcrum
#

debug it

earnest phoenix
frigid mountain
earnest phoenix
#

await messageReply

frigid mountain
vivid fulcrum
#

oh my jesus

#

that is a dumpster fire

#

you're meant to use a single message event

#

handle everything from there

old cliff
vivid fulcrum
#

that code is just glued copypasted snippets 😔

frigid mountain
vivid fulcrum
#

yes really

old cliff
vivid fulcrum
#

i can mention 2 people right now who are instantly able to recognize over 50% of that code because they wrote it

old cliff
#

sice its static

earnest phoenix
frigid mountain
vivid fulcrum
#

close enough

earnest phoenix
#

or maybe oliy and veld

vivid fulcrum
#

eevie and flaze

earnest phoenix
#

they wrote the complete gibberish luca code

vivid fulcrum
#

i forgot how to spell eevee

umbral zealot
earnest phoenix
vivid fulcrum
#

yeah

umbral zealot
#

I mean, it's Evie, Evelyne, Evie.Codes, whatever.

tulip ledge
#

is there a way to get data from a website when they're not an api?

vivid fulcrum
#

scrape it

earnest phoenix
#

ah duck im slow

vivid fulcrum
tulip ledge
#

how?

vivid fulcrum
#

make a GET request and parse the html

#

although

earnest phoenix
#

or this

vivid fulcrum
#

puppeteer is a bit much if there's no js

earnest phoenix
#

if you have ram to burn

tulip ledge
#

I just need to get this data

earnest phoenix
#

there might be another way

#

reverse engineer the website code and see how they're fetching the data

vivid fulcrum
#

if the data you need is loaded without js -> GET request and parse the html
if the data you need is loaded with js -> use puppeteer

#

also this

#

they have an internal API most likely

#

if not, the site is SSR'd

earnest phoenix
#

but how do you parse the html

#

use an xml parser?

vivid fulcrum
#

i don't think xml parsers would really work

glass hazel
#

bro i need help hosting my bot

vivid fulcrum
#

there are probably existing libraries to help you parsing html

glass hazel
#

what do u guys use to host ur bot?

quartz saddle
#

there is a ton of info about hosting there

glass hazel
#

oh wow

vivid fulcrum
#

i know that in c# i used HtmlAgilityPack to scrape genius lyrics

glass hazel
#

which channel?

quartz saddle
#

this channel

glass hazel
#

okay

#

thank you kind sir

earnest phoenix
quartz saddle
#

of course

earnest phoenix
#

cry can i ask you smth

vivid fulcrum
#

i wonder if you could run a very barebones discord gateway implementation on an arduino

#

sure

tulip ledge
#

so

#

do I just use node fetch?

vivid fulcrum
#

depends

earnest phoenix
#

why are you still whitename

vivid fulcrum
earnest phoenix
sacred aurora
tulip ledge
sacred aurora
#

if not then u can just use node fetch

earnest phoenix
tulip ledge
earnest phoenix
vivid fulcrum
#

content can be dynamic even with a site that doesn't use js

sacred aurora
#

thats just for the get request

vivid fulcrum
#

dynamic content != js website

sacred aurora
#

right

vivid fulcrum
#

since there's SSRing

sacred aurora
#

whats that?

#

CORS?

vivid fulcrum
#

server sided rendering

sacred aurora
#

oh

vivid fulcrum
#

server renders the website and then sends it to the client

sacred aurora
#

if ssr its safe then

#

node fetch would work

vivid fulcrum
#

yup

#

though it's best to confirm by disabling js in your browser

#

reloading the site

#

and seeing if you still see the data

sacred aurora
#

just see page source

vivid fulcrum
#

if you don't see the data, you're going to need puppeteer

upper island
#

I'm having an issue getting the avatar of my bot updated. I changed it a few weeks ago and tried changing it again but its still showing as empty. Any ideas? https://top.gg/bot/798271376020340746

tulip ledge
#

euhm

#

res.body returns a buffer

vivid fulcrum
upper island
#

ack trying

#

how long does it usually take to update?

sacred aurora
#

isn't there like a function in node-fetch

#

im not using it tho

vivid fulcrum
#

it's cache dependant

#

topgg doesn't check with discord for your bot details everytime someone visits the bot page

#

it instead caches the data

#

so when you change it in discord

#

it becomes stale (useless) data

#

so you need to somehow trigger a refresh

#

editing your bot description would usually work

sacred aurora
upper island
#

ok; hopefully works just tried the description

tulip ledge
#

TypeError: res.text is not a function

sacred aurora
#

bruh

#

how did u write that

tulip ledge
#
    const res = await p("https://www.counterstats.net/league-of-legends/yasuo");
    console.log(res.text())
vivid fulcrum
#

they're not using node fetch

sacred aurora
#

wtf

#

then what

#

u say u're using node fetch

tulip ledge
#

code913 told me to use phin

sacred aurora
#

hmm

#

check the doc

tulip ledge
#

they say res.body

#

but it returns a buffer

cinder patio
#

res.body.toString()

tulip ledge
#

alright

#

alright that worked

#

now I need to parse it right?

sacred aurora
#

nice

sacred aurora
tulip ledge
#

any tips on how I should do that?

sacred aurora
#

you can use cheerio

vivid fulcrum
#

htmlparser2 i guess

sacred aurora
#

or maybe that

sacred aurora
#

i kinda want to try that

vivid fulcrum
#

no idea

#

i've seen my friends use it

#

i don't know if htmlparser2 supports querying via xpath

#

which is arguably the easiest way to scrape for an element

sterile lantern
#
let inc = new punishments({
  Number: 0
});
inc.save();```
#

i saved the increment as 0

#

now when i run a command,

quartz kindle
#

if you want fast, use string.indexOf()

#

xD

sterile lantern
#

and it saves the data, i want it to increment by 1

#

hmm wait actually i would need to remove that

#

since it'd keep setting the number to 0

vivid fulcrum
sacred aurora
#

but i used that in the old days tho :v

quartz kindle
#

if you just want to extract a single piece of information from html, then its quite simple

#

just find a single unique pattern before and after the target piece

tulip ledge
#

htmlparser2 has weird documentation how do I parse an HTML object?

sacred aurora
#

dunno either

#

lets just use cheerio

#

u can use selector to get the element that you want to scrape

tulip ledge
#

I think I'm doing it wrong

#
    const res = await p("https://www.counterstats.net/league-of-legends/yasuo");
    let body = res.body.toString();

    let data = cheerio.load(body);
    console.log(data.html())
#

It returns the exact same as body

sacred aurora
#

well yeah

sterile lantern
#

so in my punishments collection, i have something called inc and its set to Number: 0

sacred aurora
#

u search for the element

sterile lantern
#

how would i fetch that number (using mongoose)

earnest phoenix
#

Because you're loading the html string and returning the html

sacred aurora
#

so like data("selector")

earnest phoenix
tulip ledge
#

data.html("percentage")?

sterile lantern
#

nvm im pretty sure i need to do a diff collection

sacred aurora
#

check on the website

#

see on the developer tab

tulip ledge
#

I need the div with class percentage

sacred aurora
#

or inspect element

#

oh

tulip ledge
#

but there's like 20

sacred aurora
#

then its "div.percentage"

#

oof

#

can i see the page?

tulip ledge
sacred aurora
#

and the content?

tulip ledge
#

it's like

#

2000 lines

#

if not more

sacred aurora
tulip ledge
#

yes

#
<a href="/league-of-legends/yasuo/vs-gragas/middle/all" class="radial-progress radial-progress--med green" data-progress="61" data-final="61">
<div class="circle">
<div class="mask full">
<div class="fill"></div>
</div>
<div class="mask half">
<div class="fill"></div>
<div class="fill fix"></div>
</div>
</div>
<div class="inset">
<img src="https://www.mobafire.com/images/champion/square/gragas.png" alt="Counter Stats for Gragas">
</div>
<span class="percentage">60.84%</span>
</a>
sacred aurora
#

so the title and then the hero list with its percentage?

tulip ledge
#

this basically

#

yes

cinder patio
#

Right click on the html element and click on "Copy > Copy XPath"

tulip ledge
#

I need that what I sent but like 20 times

sacred aurora
#

does cheerio support xpath?

cinder patio
#

if it doesn't then go with selectors

sacred aurora
#

hm

earnest phoenix
#

You can just <Selector>('span[class="percentage"]')

sacred aurora
#

or just "span.percentage"

cinder patio
#

or you can just use the dev tools to copy the selector

tulip ledge
#

I need these 2

#

for like the 20 items in that list

cinder patio
#

Right click on the html element and click on "Copy > Copy XPath"

tulip ledge
#

//*[@id="body"]/div/div[3]/div[1]/a[1]

#

what do I do with that?

cinder patio
#

give it to Cheerio

tulip ledge
#

data.html("//*[@id="body"]/div/div[3]/div[1]/a[1]")?

opal plank
cinder patio
#

not like that

#

I haven't used cheerio so go look in the documentation

sacred aurora
#

didn't see any xpath example on the cheerio docs

#

so maybe its not supported

frigid mountain
#
const Discord = require('discord.js')

module.exports = {
    name: 'botinfo',
    run: async (message, args) => {
        const sayMessage = args.join(" ")
        const embed = new Discord.MessageEmbed()
    .setTitle("Bot information")
    .setDescription("The bot was made by Nathithegamer99#2594 designed on 01/March/2021")
    .addField("🤖Bot Name:`Dr.Denzy#0598`")
    .addField("🇦🇺Language:`English`")
    .addField("☁️Prefix:`+`")
    .setColor("#FF005B")
    .setFooter("Dr.Denzy Bot Information")
    
    
        message.channel.send(embed)
    }
}       

Why does it say undefined in my embed

quartz saddle
#

because you didnt fill out the "value" part of the fields

sacred aurora
#

ur just adding the field name not the value

#

yeah

tulip ledge
sacred aurora
#

wait a sec

#

just use selector

frigid mountain
quartz saddle
#
.addField("Prefix", "+")
#

just make a second property

#

that second property is the value part of the field

tulip ledge
#

console.log(data("//*[@id=\"body\"]/div/div[3]/div[1]/a[1]")) unmatched selector

nimble crater
#

if u want ur embeds to look like the format u sent, just use description with \n and surround bold text in ** text **

#

instead of addField

quartz saddle
#

or you could also use

.addFields(
   { name: "Prefix", value: "+", inline: false }
)
#

then you can add multiple at a time

sacred aurora
#

and cheerio can't do that

cinder patio
#

You should really learn to read documentation

sacred aurora
#

wait can cheerio do that

cinder patio
#

You can use selectors with cheerio

#

otherwise what would be the point

sterile lantern
#

how would i change Inc here

#

i did inc.find, and it printed that

#

but i want to change Inc to 1

#

via code

quartz saddle
#

right

cinder patio
sterile lantern
#

oh

#

do you have the docs

#

for mongoose

#

i cant seem to find it

#

queery would be Inc right

#

query*

tulip ledge
#
<a href="/league-of-legends/yasuo/vs-nocturne/middle/all" class="radial-progress radial-progress--big green" data-progress="0" data-final="61">
<div class="circle">
<div class="mask full">
<div class="fill"></div>
</div>
<div class="mask half">
<div class="fill"></div>
<div class="fill fix"></div>
</div>
</div>
<div class="inset">
<img src="https://www.mobafire.com/images/champion/square/nocturne.png" alt="Counter Stats for Nocturne">
</div>
<span class="percentage">61.00%</span>
</a>
cinder patio
#

If I find it in under 10 seconds you owe me five bucks

tulip ledge
#

Now I have this

sacred aurora
#

@tulip ledge is there 387 heroes?

tulip ledge
#

cheerio returned this to me

sterile lantern
#

hmm

tulip ledge
#

No 157 or something like that

sterile lantern
#

i shall check again

sacred aurora
cinder patio
#

You didn't find it??

nimble crater
pale vessel
#

search for mongodb docs not mongoose

sterile lantern
#

ah i was searching mongodb docs

#

mb

sterile lantern
pale vessel
#

i told you

#

it's all in mongodb docs

nimble crater
#

do u want to increment it

#

or change it

cinder patio
#

updateOne(query, {$inc: { Inc: 1} })

sterile lantern
#

increment everytime the command is run

#

essentially, a case ID system

#

if someone gets warned, case ID is 1

nimble crater
#

what googlefeud said

sterile lantern
#

ok

#

what would query be

#

just Inc?

cinder patio
#

your query

#

how to find the document

sterile lantern
#

right so it's just saved as Inc: 0

cinder patio
#

You probably want to find it via the user's id or something

peak bough
#

i have a question regarding discord media links. need help urgent

cinder patio
#

not Inc

nimble crater
#

if u query for Inc: 0, then after increment u wont be able to access that

#

so use id or something

sterile lantern
#

find via user ID?

#

well,

#

i made a new collection

#

for case IDs

#

and just have one thing there

#

which is Inc

#

now whenever the cmd is ran, it would increment Inc by 1, assign CaseID as that number, and save Inc

indigo apex
#

ho ye

#

is it te pison of ma lif

#

oh wife

#

oh yeah

#

oh yeah

pale vessel
#

Ok

cinder patio
#

uuh... so can you give us the structure of your document?

indigo apex
#

it is the prison o my wife

#

oh wife

#

oh yeah

#

oh yeah

tulip ledge
#

Alright so I managed to get the first 20 champions of the list their html thingy now I turned the whole list into an array that looks something like this:

["<a href="/league-of-legends/yasuo/vs-nocturne/middle/all" class="radial-progress radial-progress--big green" data-progress="0" data-final="61">
<div class="circle">
<div class="mask full">
<div class="fill"></div>
</div>
<div class="mask half">
<div class="fill"></div>
<div class="fill fix"></div>
</div>
</div>
<div class="inset">
<img src="https://www.mobafire.com/images/champion/square/nocturne.png" alt="Counter Stats for Nocturne">
</div>
<span class="percentage">61.00%</span>", ...]

Now is there a way to access the img src and the thing between <span class="percentage"> and </span>

indigo apex
#

ya yaya ay ay

#

bum

#

tzi

indigo apex
#

tada bum

cinder patio
#

And _id is the case ID?

sterile lantern
#

no

#

This is just to increment a value

#

Inc

#

is set to 0

cinder patio
#

...

nimble crater
cinder patio
#

you need to link that value to something

nimble crater
#

i think he is trying to use Inc as an ID for some other object

cinder patio
#

otherwise what's the point of it

nimble crater
#

if i understand correctly

sterile lantern
#

im trying to increment Inc everytime cmd is ran

#

and then assign that new Inc to a caseID

#

then save

#

theres probably a wayyyy easier way to do this

peak bough
#

hello, the discord media links.there is media.discordapp. and another is images-ext. are both links permanent as long as i dont delete the original file ?

sterile lantern
#

yes

peak bough
#

okie okie, i had to copy the original gif i uploaded which was as media.discord form and when i copied it, it became images-ext. i was afraid it will be temporary

sterile lantern
#

so my increment doc is saved as

#
[ { _id: 60621b98ba0c41023da6cdad, Inc: 0, __v: 0 } ]
#

and when someone gets warned, inc should increment by 1

#

and save

#

so there's no duplicate IDs

#

although idk how to fetch Inc

#

and increment it

#

well incrementing would just be ++

pale vessel
#

do you have a collection for only one document?

#

why

sterile lantern
#

well

#

i cant save it into the other

#

cuz id need a user id, punishtype, date, etc

#

sooo

#

how would i fetch the inc and increment it

tulip ledge
#

alright sorry I'm asking so much but I'm stuck again, I have this string which is either: Counter Stats for <ChampName> or <ChampName> countering how do I "extract" the <ChampName> from those strings?

icy skiff
#

Is there a way to check for user roles in another server without having server members intents?
Like, the command was invoked on server X, and I want to check if the user has an specific role on server Y, but the bot does not have intents, is it even possible?

pale vessel
#

yeah, fetch the member

#

you can get their role IDs

sterile lantern
#

how would i set the value of inc

#

.push wont work since its an array

tight scaffold
#

hey so im trying to embed a video onto my bot page but i have no idea how

icy skiff
pale vessel
#

you'd want to fetch the member from the guild

#

not as a user

#

get guild y first

icy skiff
#
server = client.get_guild("id")
#

i did it like that

#

it works

#

but i cant figure out how to get the user by the server

pale vessel
#

🤔

#

ah

#

you can use await server.fetch_member(id);

#

you can use get_member() but the member might not be cached

icy skiff
icy skiff
#

thanks

#

i was using fetch_user and it wasnt working

#

fetch_member works

#

kek

pale vessel
#

ah, I think fetch_user is for client

icy skiff
#

welp that makes sense

upper island
#

following back up on missing avatar https://top.gg/bot/798271376020340746; I updated the description on discord of my application but it still doesn't seem to be picking it up. I'm running a couple hundred dollars in ads with you starting tomorrow so any help in getting this resolved is greatly appreciated.

vivid fulcrum
#

just searched through message history

#

there should be a refresh data button i guess?

upper island
#

yeah I see that on the top.gg page. Just ran it will check again in a couple minutes

opaque acorn
#

?

upper island
#

I think that helped cry, thanks! Avatar is now visible on the link to bot page in my profile + the voting page but still not the main one. Hoping that just takes some time to propogate thru.

sterile lantern
opaque acorn
ripe shadow
#

It's a Markdown lol

sterile lantern
#

on both sides

opaque acorn
sterile lantern
#

Mhm.

earnest phoenix
#

Hello,

I want to install phpmyadmin on my debian 10 (vps) but I don't know which guide to use as there are a lot of guides online. Which one should I use! Thank you

dusky sundial
#

I'd say go for the one that you understand the best

sterile lantern
#

how do i fetch Inc from here (mongoose)

#

i tried <Model>.Inc

pale vessel
#

use updateOne() and $inc

#

like model.updateOne({}, { $inc: { Inc: 1 } });

sterile lantern
#

so that adds 1 to the value?

#

or just changes it to 1

pale vessel
#

the filter is {} since it doesn't matter and yeah, it increments the value

sterile lantern
#

alr

pale vessel
#

google what increment means

sterile lantern
#

does it automatically save

#

or do i have to do

pale vessel
#

yep

sterile lantern
#

alr

#

so if i assigned

#

Inc to CaseID

#

would it be 2 the next time it was ran

#

lemme test

#

uh

#

(node:152) UnhandledPromiseRejectionWarning: Error: cyclic dependency detected

#

whats the issue with it?

#
   let cid = inc.updateOne({}, { $inc: { Inc: 1 } })
        data.Punishments.push({
            PunishType: 'Warn',
            Date: date,
            Moderator: message.author.id,
            CaseID: cid,
            Reason: reason,
        });
        data.save();```
#

i think it has to do with how i connect

#
useUnifiedTopology : true,
  useNewUrlParser: true```
#

am i supposed to add anything else

pale vessel
#

await it first and see if the error still occurs

#

updateOne() returns a promise

#

and log cid after that and make sure cid is a number, not an object

sterile lantern
#
{
  n: 1,
  nModified: 1,
  opTime: {
    ts: Timestamp { _bsontype: 'Timestamp', low_: 14, high_: 1617046758 },
    t: 4
  },
  electionId: 7fffffff0000000000000004,
  ok: 1,
  '$clusterTime': {
    clusterTime: Timestamp { _bsontype: 'Timestamp', low_: 14, high_: 1617046758 },
    signature: { hash: [Binary], keyId: [Long] }
  },
  operationTime: Timestamp { _bsontype: 'Timestamp', low_: 14, high_: 1617046758 }
}
(node:251) UnhandledPromiseRejectionWarning: MongoError: The dollar ($) prefixed field '$clusterTime' in 'Punishments..CaseID.$clusterTime' is not valid for storage.```
#

y i k e s

pale vessel
#

okay use findOneAndUpdate instead and log it

#

since you need the updated doc

sterile lantern
#

ok

#

aha

#

works

#

but

#
(node:354) DeprecationWarning: Mongoose: `findOneAndUpdate()` and `findOneAndDelete()` without the `useFindAndModify` option set to false are deprecated. See: https://mongoosejs.com/docs/deprecations.html#findandmodify```
#

should i set

#

useFindAndModify to false

pale vessel
#

add { useFindAndModify: true } I guess

sterile lantern
#

it says without it set to false

pale vessel
#

are deprecated

#

OH

#

yeah

sterile lantern
#

it works

#

tysmm

pale vessel
#

ok good

sterile lantern
#

but

#

case ID is Object

#

set to object*

pale vessel
#

yeah

#

log it

sterile lantern
#
{ _id: 60621b98ba0c41023da6cdad, Inc: 2, __v: 0 }

#

cid.Inc

pale vessel
#

Inc

#

yuh

sterile lantern
#

Poggers works ty

feral aspen
#

Any way to check if a user is executing a command and that command is part of the commands that is in an array const commands = ['command1', 'command2'], then I would add an additional code?

#

Kind of got lost on how to do that.

sterile lantern
#

one quick question

#

how would i uh

#

fetch a log with the caseID

#

and delete it

#

or list it

upper island
#

confirmed fix. My avatar was not showing up in my bot page after I changed it. It was using the old profile picture link. Hitting 'refresh data' button caused it to propagate through after about an hour; summarizing so maybe someone can find this in search more easily 🙂

pale vessel
#

use the case ID as the filter

#

like const case = await model.findOne({ caseID: 69420 });

sterile lantern
#

o

#

alr

#

ty

#

how would i detect if the message is too long

#

and then split it into two messages

#
f(data) {
                message.channel.send(new Discord.MessageEmbed()
                    .setTitle(`${user.user.tag}'s Moderation History`)
                    .setDescription(
                        data.Punishments.map(
                            (v, i) => 
                            '**__Case ID:__** `' + `${v.CaseID}` + '` | **Moderator**: ' + `<@${(v.Moderator)}>` + '\n**Date**: `' + v.Date + " EST`" + '\n**Reason**: `' + v.Reason + '`\n**Type:** `' + v.PunishType + '`'
                        )
                    )
                    .setColor("BLUE")
                    .setFooter("Moderation Logs")
                )
    ```
snow urchin
#

Why does this give 401 error?

#

I did the Authorization header correctly, right?

#

Also, the user does have the guilds.join scope

sterile lantern
#

shouldnt auth be in ""

#

"Authorization"

snow urchin
#

no

sterile lantern
#

i dont do web dev but just noticed

#

hmm

#

i have no clue then

snow urchin
#

its not web dev 🤷‍♂️

sterile lantern
#

axios.put?

#

that's a thing?

#

hmm

#

never used axios for anything besides get

#

thats probs why

boreal iron
snow urchin
#

How so

boreal iron
#

Well shouldn’t be hard to figure out

snow urchin
#

..

#

its not invalid

boreal iron
#

It is

snow urchin
#

its not lmfao

sterile lantern
#
message.channel.send(abc, { split: true })```
#

would this even work

#

splits embed into two embeds because message is too long

#

i tried it but it just returns object

boreal iron
#

Look at your content header

#

As tip

snow urchin
#

smh

boreal iron
#

Yeah that’s what I’m doing too can’t understand why you don’t fucking able to compare 2 lines or read the axios docs

snow urchin
#

no need to curse at me

#

and

#

the auth is not invalid

#

I said this before, and saying it again

#

I know its not.

#

It's something else.

boreal iron
#

Nobody spoke about the auth token

#

Authorization header is invalid

snow urchin
#

auth = authorization

#

big head

boreal iron
#

Alright you still don’t understand
Well then not my issue anymore...

sterile lantern
#

i dont understand, why doesnt the bot send the mesage as a txt file

#

message*

#

if it's above 2048 characters

#

or whatever the limit is

#

instead it just errors

#

ah wait its an embedd

#

ugh nvm

#

but how would you split it thonk

boreal iron
shell crest
#

can someone help me with my code? It doesnt seem to work...

@client.event
async def on_message(message):
  if message.author == client.user:
    return

  if message.content.startswith('pls rob @shut dragon'):
    await message.channel.send("@shut dragon You're being robbed!")

  if message.content.startswith('pls rob @shell crest'):
    await message.channel.send("@shell crest You're being robbed!")

#

can someone help me

sterile lantern
#

whats the error??

snow urchin
#

still didnt work anyways 🤷‍♂️

shell crest
#

error*

sterile lantern
#

did you login to the bot..?

#

also,

#

it says message.content.startswith

#

try making it if message.content == or something lik ethat