#development

1 messages · Page 1891 of 1

split hazel
#

yeah I was confused by the number range loss when apparently modern systems were supposed to use twos complement

rustic nova
#

youtried.jpg

solemn latch
rustic nova
#

-M @calm night

gilded plankBOT
#

🤐 Muted VBoi#0459 (@calm night)

#

🤐 Muted VBoi#0459 (@calm night)

scarlet cliff
#

double muted

outer perch
#

holy

solemn latch
#

the code i gave is only for files in the public folder, and only works with html.

earnest phoenix
#

is using user.discriminator instead of user.tag a good practice?

#

and const guild instead of const server

outer perch
#

should index.ts be inside or outside src? Thonk

outer perch
#

ikr

#

but what's the convention

earnest phoenix
#

if it's the main for an npm package put it outside

#

your lib's code should be in src and the index file outside src should export everything

wheat mesa
earnest phoenix
#

also @wheat mesa can you tell me what's the property for user about me in detritus

wheat mesa
#

Not sure, I don’t think the API even has access to that does it?

earnest phoenix
#

"privacy protection"

#

for data that is already public

wheat mesa
#

About me can contain pretty private information

#

So it wouldn’t surprise me

earnest phoenix
#

yes but even people who aren't in your friend list can see it

wheat mesa
#

The problem isn’t from it being public, it’s from it automatically being collected without the user’s knowledge

#

The user is expecting those who know them and those in servers with them to see it, not a bot that automatically collects data from their profile that they don’t anticipate

earnest phoenix
#

how fun would it be to log all capybara about mes mmulu

wheat mesa
#

That would be quite fun though

earnest phoenix
#

intense advertising

wheat mesa
#

Too bad people abuse data though topggLikeThis

earnest phoenix
#
// yes i know this is djs
guild.members.cache.forEach(m => everIncreasingCollectionOfAboutMes.push(m.user.bio));
wheat mesa
#

That’s cursed

#

Using api that doesn’t exist, using forEach, using an array to collect about me’s instead of a KV pair, and it’s djs

earnest phoenix
#

bruh moment

earnest phoenix
wheat mesa
#

Never, you use js when you’re using detritus

#

That’s truly cursed

scarlet cliff
earnest phoenix
cinder patio
#

Use the typescript compiler to compile it to js, then eval the js

earnest phoenix
#

says the guy who recorded 190 mb ram usage from tsc

cinder patio
#

you got a point

scarlet cliff
#

use swc

#

extremely based compiler

earnest phoenix
#

the point is i dont like typescript

scarlet cliff
#

why tho

earnest phoenix
#

i dont like static types

rare granite
#

umm so im using vps for first time i have everything done instead of pm2 , its like i have latest nodejs and npm ver in root or main src but its not updated pm2
anyone knows how do i upd it in pm2
lmao its 16. smthng in the main file and 5. smthng in pm2

earnest phoenix
#

bad then types are important,else your code will be a green banana

sharp saddle
#

why my mongodb is giving an buffering error

#

?

#

i put 0.0.0.0.0/0

#

I always did that

sharp saddle
#

and it's no longer working

earnest phoenix
#

in 0.0.0.0/0

#

you've put 6

stray seal
#

Can someone DM me who knows HTML Code?

#

Please

scarlet cliff
#

no

#

ask here

stone nova
#

עידוו

#

מי קורא לי בשמי

earnest phoenix
earnest phoenix
scarlet cliff
earnest phoenix
zenith terrace
earnest phoenix
scarlet cliff
#

spoonfeed me daddy uwu

spark flint
#

i-

earnest phoenix
#
import { useState as us, useEffect as ue } from "react";
const fn = Function;
const A = Array;
A.prototype.f = A.prototype.fill;
function Brainfuck() {
  const [s, ss] = us(!0);
  ue(fn("ss(!s)"), A(1).f(s));
  return <a>A</a>;
}
#

@scarlet cliff here you go

quartz kindle
#

not enough fuckery

#

needs a pass of jsfuck

earnest phoenix
scarlet cliff
earnest phoenix
scarlet cliff
#

yeah

gritty widget
#

Hi

#

Can anyone tell mw how to upgrade ram on heroku?

rose warren
#

Pay, I believe.

gritty widget
scarlet cliff
#

why do you wanna upgrade ram in the first place

gritty widget
scarlet cliff
#

then your code is bad

boreal iron
#

Enable the intent in your Discord developer page

#

And in your code

scarlet cliff
#

hold on my message didnt send

#

1 sex

#

sec

#

**

#

god damnit

#

here you go

boreal iron
#

The process.memoryUsage.rss() method returns an integer representing the Resident Set Size (RSS) in bytes.

earnest phoenix
#

process.memoryUsage().rss/1024/1024

boreal iron
#

1,048,576 bytes is 1 MB (practically)

#

that should answer your question

earnest phoenix
#

help

#
if(xp > req){ message.channel.send('Insufficient cards to upgrade') 
} else if(xp < req){
#

doesn't work

#

it's the same having more than required or less

#

and i changed < & > too but same

#

when i change it it only says Insufficient cards

#

and now it only says the next embed

pale vessel
#

Check how much xp and req is

#

Debug :|

earnest phoenix
#

xp depends

scarlet cliff
#

if you want more than required or equal to the requirement do xp >= req (xp is more than or equal to req) or xp <= req (xp is less than or equal to req)

earnest phoenix
#

i checked it with a command

lyric mountain
cinder birch
#

Can a bot have 2 Help command for same prefix?

#

I mean

lyric mountain
#

A bot can have anything u can code

earnest phoenix
#

xp is more than 10

cinder birch
#

I thought they would consider it as spam but it's ok

scarlet cliff
#

like

#

-help

cinder birch
#

-bots

gilded plankBOT
#
Bots

@magic pecan
@grand spade
@lucid oriole
@finite quest

#
Bots

@magic pecan
@grand spade
@lucid oriole
@finite quest

scarlet cliff
#

yeah

earnest phoenix
#

-bots

gilded plankBOT
earnest phoenix
#

??

boreal iron
cinder birch
#

Ok

earnest phoenix
#

what with me?

#

If you're dealing with a single boolean check u don't need else-if

Then?

lyric mountain
#

Makes sense?

earnest phoenix
#

kinda

lyric mountain
#

No, it doesn't

#

If the first check is false the second is automatically true

earnest phoenix
#

oh then

lyric mountain
#
if (true) {
	//do this
} else {
	//do this
} 
earnest phoenix
#

k

scarlet cliff
lyric mountain
#

...do you even example?

scarlet cliff
#

do you even grammar?

boreal iron
#

English broken

lyric mountain
#

Are you trolling or being hard woooshed?

earnest phoenix
scarlet cliff
#

but its if (true)

lyric mountain
#

It's an example goddamn

boreal iron
#

if() exit;

earnest phoenix
pale vessel
#

but that'll error...

scarlet cliff
earnest phoenix
#

Actually itsnt matter

#

cause it is still string

#

Not number

rapid raven
#

@rare mist pls view my amazing bot

boreal iron
#

Stop randomly ping the staff dude, read the guidelines and how long it takes

scarlet cliff
#

h4ck3r 😎

earnest phoenix
#

doesn't work

#
if(xp <= req){
   message.channel.send('Insufficient cards to upgrade') 
} else {

i did this too:

if(xp <= req)return message.channel.send('Insufficient cards to upgrade') 

//code
#

doesn't work

lyric mountain
#

Then your issue lies somewhere else

boreal iron
#

Log both vars and see what's the issue

lyric mountain
#

Log both lets*

#

🗿

boreal iron
#

Are you trolling or being hard woooshed?

lyric mountain
#

And I am, in fact, trolling now

earnest phoenix
#

yeah maybe it's problem of xp

#

0 xp
10 req
1 lvl

lyric mountain
#

Btw, the condition u want is if (xp < req)

#

Bcuz if it is the same or higher than required it should pass

boreal iron
#

How does that feel, hmm!!!11!

quartz kindle
#

lmao

lyric mountain
boreal iron
#

Oh no Tim's watching us, careful

earnest phoenix
#

oh yeah

#

sht

#

Before i used args[0] so i defined it like that

#

and now i use args.join

#

i didn't change that

boreal iron
#

That's the reason I said

#

Log both vars and see what's the issue

earnest phoenix
#

yeah thx

#

i was about to send the definitions

#

and noticed

#

works

feral aspen
#

Did I do something wrong? roleUpdate event.

<embed>.addField("**Mentionable**", oldRole.mentionable, true);
``````js
RangeError [EMBED_FIELD_VALUE]: MessageEmbed field values must be non-empty strings.
#

According to the docs, I did everything correct.

quartz kindle
#

oldRole.mentionable is not a string

feral aspen
#

DAMN, I have to .toString() it now?

quartz kindle
#

if you want it to display "true" yes

feral aspen
#

It returned the same error. oldRole.mentionable.toString()

quartz kindle
#

then the error is somewhere else

#

show full code

#

and full error

feral aspen
#

Oh, my bad, the entire role update embed is returning an error since most are booleans, my bad.

#

V13 is a pain.. 🤷‍♂️

slow ibex
#

Okay.. im currently lost.. but.. i need to make an axios.get request.. but the Data that i send with it must be in the body... how the f. can i do that?
The API constantly says that it gets nothing

boreal iron
#

Make sure if it’s body: { data } or like we had a few days ago data: { data }

slow ibex
boreal iron
#

Dunno their requirements if the requests needs a content type, the data needs to be JSON etc.

#

Check the requirements for the endpoint

slow ibex
#

My Endpoint needs their request data as raw json in the body.

proven lantern
#

there is no request body for get requests

slow ibex
#

ikr?

proven lantern
#

is there an api doc for the endpoint?

slow ibex
#

uuh..

#

Hehe

earnest phoenix
#

help

#
ERROR:

(node:838) UnhandledPromiseRejectionWarning: TypeError: Must specify value to add. Need Help? Check Out: discord.gg/
    at Object.subtract (/home/runner/Clash-Chest/node_modules/quick.db/src/index.js:107:19)
Where is error:
db.subtract(`coin_${message.author.id}`, amount)
Amount definition:
let amount;
if(lvl === 1 && rarity === "Common")amount = 20
if(lvl === 1 && rarity === "Rare")amount = 140
if(lvl === 1 && rarity === "Epic")amount = 260
if(lvl === 1 && rarity === "Legendary")amount = 450
if(lvl === 2 && rarity === "Common")amount = 40
if(lvl === 2 && rarity === "Rare")amount = 280
if(lvl === 2 && rarity === "Epic")amount = 520
if(lvl === 2 && rarity === "Legendary")amount = 900;
if(lvl === 3 && rarity === "Common")amount = 60
if(lvl === 3 && rarity === "Rare")amount = 320
if(lvl === 3 && rarity === "Epic")amount = 780
if(lvl === 3 && rarity === "Legendary")amount = 1350
#

oh sorry

#

link

#

the link was in the console

boreal iron
#

Omg

slow ibex
#

I'm the author lel.. i rewrote it t... so..
Thats the Endpoint... pls. dont judge me... im still learning lol xD

router.get('/ytdb', jsonParser, (req, res) => {
    var song = req.query.song;
    console.log(`GET-YTDB: song - ${req.query.song}`);
    if (con) {
        var sql = `SELECT * FROM ytdb WHERE title LIKE '%${song}%'`;
        con.query(sql, function (err, result) {
            if (err) throw err;
            console.log(`GET-YTDB: result - ${result}`);
            if (Object.keys(result).length > 0) {
                res.status(200).send(JSON.stringify(result));
            } else {
                console.log(`GET-YTDB: req.body - ${req.body}`);
                res.status(404).send("No data found!");
            }
        });
    }
});
earnest phoenix
#

help me pls

pale vessel
#

then it's not data, it's params

proven lantern
pale vessel
#
axios.get(url, { params: { song } });```
slow ibex
#

but i had to use the urlencodedParser

last tapir
#
let embed = new MessageEmbed()
.setColor(blackColor)
.setTitle("Bot Ping")
.addField("**Message**", `${Math.floor(msg.createdAt - interaction.createdAt)}ms`, true)
.setFooter(`Responded across ${bot.guilds.cache.size} servers.`)

msg.edit({ embeds: [embed] })
return await interaction.followUp();

how can i edit and and follow up at the same time?

pale vessel
#

you were using req.query, you don't even need a parser for it

slow ibex
#

But my script says so.. idk.. it works so... i wont touch it again 😂

boreal iron
proven lantern
last tapir
#

What?

slow ibex
#

BTW...
Quick Question.. hehe
SQL related so..
I have a Table.. you know?
This is one of the entries
https://i.imgur.com/lzSRbAh.png

I have an SQL Query that searches for dreamcatcher whistle
If i use SELECT * FROM ytdb WHERE title LIKE '%dreamcatcher whistle&' i get no match... so.. how should i rewrite this query?

proven lantern
#

what does the & do in %dreamcatcher whistle&?

slow ibex
#

Woops. that was a typo from me

#

I was pasting the Query into DC and accidentally inserted a &

proven lantern
#

WHERE LOWER(title) LIKE

boreal iron
#

Like doesn’t care about case sensitivity

slow ibex
#

i mean.. i could prob. combine both fields.. but would be extremely dirty..

proven lantern
#

use elasticsearch

#

dump sql

slow ibex
#

Ngl.. im not rewriting everything again.

proven lantern
#

just add elasticsearch to the stack

#

search in the elasticsearch db and have that return the id for the sql db

feral aspen
#
const events = [
    "messageDelete",
    "messageDeleteBulk",
    "messageUpdate",
];

if (!events.includes(event.toLowerCase())) {
    const invalid = new MessageEmbed()
    .setColor(red)
    .setDescription("❌ The event ID you entered is invalid.")
    return await interaction.followUp({ embeds: [invalid] });
};
#

I have event as the user's input, I'd like to ask how can I make it so if someone inputted messagedelete and not messageDelete?

#

Basically trying to lowercase all the strings in events then checking.

cinder patio
#

events.some(ev => ev.toLowerCase() === event.toLowerCase())

#

but also you could just

const events = [
    "messagedelete",
    "messagedeletebulk",
    "messageupdate",
];
feral aspen
proven lantern
#
    "messageDelete":true,
    "messageDeleteBulk":true,
    "messageUpdate":true,
};
if(events[event.toLowercase()]) {}
#

that's faster

cinder patio
feral aspen
#
let lowercased = [];
events.map((x) => lowercased.push(x.toLowerCase()));

console.log(lowercased);

if (!lowercased.includes(event.toLowerCase())) {
    const invalid = new MessageEmbed()
    .setColor(red)
    .setDescription("❌ The event ID you entered is invalid.")
    return await interaction.followUp({ embeds: [invalid] });
};
#

Had to do this.

proven lantern
#

more efficient

cinder patio
#

depends

#

If you need the keys later on then, no, not really

proven lantern
#

the code that i wrote is faster

cinder patio
#

That's just a micro-optimization which could bite you in the ass later on

pale vessel
#

Also, why lowercase?

proven lantern
#

i was just copying the code example and improving it

pale vessel
#

None of them will pass

#

O ic

cinder patio
#

I'd just use some if the events aren't 100+

proven lantern
#

i plan ahead

#

it's still a useful optimization. even if it's only a list of 10. that 10x optimization

#

O(1) vs O(n)

cinder patio
#

Yeah, 10x when 1x is literally a nanosecond, and n = 3

proven lantern
#

think about scaling

cinder patio
#

If you wanna use the keys later you'd have to use Object.keys() which kills the trade

proven lantern
#

it's just to validate input

cinder patio
#

Because the person who asked the question said so

proven lantern
#

you shouldn't do that

cinder patio
#

They'll need them for another thing maybe...

#

not to validate input

last tapir
#

the guy probably solved his issue 😂 by merging both your answers into one ig

cinder patio
#

pointless arguing is the mantra of this channel

feral aspen
#

I've made a loop by setting a new defined array into all the current array's values lowercased, then making a check. 👍

woeful pike
feral aspen
#

👍 👍 👍

woeful pike
#

depending on what the constant is. But at that point you're just splitting hairs

#

not to mention object lookups aren't technically constant time either SanaSip

modest maple
#

oh yeah

#

generally you can get away with a couple hundred or even a couple thousand items in a list and do it faster in linear time than with a hash lookup

woeful pike
#

hey linear search can be constant time too if your luck stat is high enough

wheat mesa
#

Luck stat KEKW

split hazel
#

what if my search is non linear

proven lantern
modest maple
#

Most / all languages have that behavour

#

Just because something is O(1) does not magically make it faster in all cases

#

Hashing, although it has a constant cost, is still a starting cost, you are always going to take that time to compute that hash to then do the lookup

#

Which often is slower than some linear lookup in a small list for example

#

In JS this is lesser of a thing because every is an object and although your array might be small if i remember correct node internally handles it as an object / dict anyway

lyric mountain
#

ye, arrays are actually maps with index as keys

#
  • in js
woeful pike
#

we say constant time is "better in all cases" because the real problems you end up solving generally involve creating an algorithm that can accommodate large inputs, not trivial numbers

wheat mesa
#

I need to learn more about time complexity

woeful pike
#

learning about time complexity in CS is easy, you just need to take an algorithms and data structures class, get a university degree then unlearn all the incorrect information your prof taught you and learn it again on your own

proven lantern
#

is this because it runs so many tests?

woeful pike
#

ok you can't do benchmarks like this

#

you don't know what code the interpreter is actually executing

wheat mesa
woeful pike
#

and a 1.7% performance difference is well within a margin of error

wheat mesa
#

js likes to give you the result of some stuff instantly as opposed to actually running it sometimes, right?

modest maple
#

Well yes

woeful pike
#

no, it's because V8 is smarter than trivial benchmarks

modest maple
#

I imagine the JIT has sussed out to a constant lookup

woeful pike
#

it doesn't run source code directly, there are a ton of optimizations being done

modest maple
#

I mean

woeful pike
#

both before the code is executed and also during execution

modest maple
#

One can argue that you should make an informed decision based on the language

woeful pike
#

also these cases are by definition trivial, you don't care whether your code takes 2 or 3 microseconds to run, you're specifically testing for a case where you have a super tiny input size

modest maple
#

After all assuming everything will be faster O(n) for a small n in every lanuage without taking into account these optimisations are just as bad as assuming O(1) will always be faster

proven lantern
#

if n is .5 then O(n) will be faster

#

lol

woeful pike
#

constant time doesn't mean 1 btw O(1000) is still constant time

proven lantern
#

O(1) is the best constant time

modest maple
#

Well that would be simplified to O(1)

proven lantern
#

#1

#

it would be 1000 operations no matter the size of n

woeful pike
#

yeah cuz we don't care about how long a thing takes, we care about the growth of that time in relation to the input

#

so O(1) and O(1000) are the same as far as you're concerned

proven lantern
#

as n reaches infinity

#

the difference goes to 0

woeful pike
#

idk I failed calculus 3 times, probably something like that

lyric mountain
rare mist
rare mist
#

Ty

rapid raven
#

no prob

solemn latch
spark flint
#

what is the best way for me to code/find a template/design a magical website

#

i feel like with html most templates are really OTT and more than necessary

solemn latch
#

Design it yourself ^_^

spark flint
#

I'm struggling to lmao

woeful pike
#

if you're looking for a magical website do you not need it to be over the top lol

spark flint
#

I hate sites that have way too many details on it

slender wagon
#

Xetera the sus

split hazel
#

a lot of the computer science specifications contain bad practises and very old methods of doing things

#

like in A levels the cpu layout

#

they teach you the old cpu architecture which contains only one register called an accumulator while modern cpus have a few general purpose registers instead of 1

#

easy to learn but will probably fuck you over in the future

solemn latch
#

Is that what they actually teach?

split hazel
#

yes thats part of my specification

solemn latch
#

Even Ben eater teaches more than that

split hazel
#

i would show you the 1000 page revision book ocr but its in class

#

they teach you little man computing instead of actual assembly

#

funnily enough i find little man computing more confusing than assembly

spark flint
#

like bro kill me now

#

I have the mock mock exam on Tuesday

split hazel
#

this thing

#

lol do you mean pseudo code

spark flint
#

an entire language which is python, JS and Java combined

solemn latch
spark flint
#

Python: len(string)
OCR reference: string.length()

split hazel
#

its basically worse and btec version of assembly

spark flint
#

yeh

split hazel
spark flint
#

pseudo code is much easier

#

this is actual code but like its just combined shit

split hazel
#

never did that only pseudo code

#

and python in the gcse exam

spark flint
#

they changed it in the past 3 years

split hazel
#

i did it last year

spark flint
#

oh

#

not sure why i'm being forced for this now

split hazel
#

you're doing gcses right

spark flint
#

yes

#

i mean i'm fine doing it

#

but its the fact that lots of the stuff doesn't exist in python which most people learn for GCSE

split hazel
#

that doesnt sound nice

spark flint
#

nope

#

and there is no actual practical work for the exam

#

i have to prove at least 20 hours of coding though

split hazel
#

what is this btec pseudocode

spark flint
split hazel
#

what else do you need to know

sage prairie
#

oi

#

do you have tips for epic website

spark flint
#

not really

sage prairie
#

:(

split hazel
#

:)

#

a level computer science is pretty good so far we've been doing representation of negative numbers in binary

#

twos complement and sign magnitude

sage prairie
#

what

split hazel
#

amogus

sage prairie
#

me when sus

split hazel
#

apparently there is also some sigma involved

#

i havent looked too much into that

lyric mountain
#

wait until ligma gets involved

sage prairie
#

ok

potent canyon
#

so discord.py is gone, any recommendations for alternatives/forks to use?

potent canyon
#

yea so i did some searching and it seems like there are a lot

#

pycord, nextcord, enhanced-dpy, hikari

#

which one would be the best?

spark flint
#

but im gonna migrate to next cord

potent canyon
#

is there a specific reason for nextcord over the others?

spark flint
#

not really

potent canyon
#

well i cant really see any big differences

#

pycord has the most stars on github

#

but it doesnt have the bot ui kit

lyric mountain
#

bot ui kit?

wheat mesa
#

I want to make a nice looking site for my bot as a passion project, but at the same time I have a lack of time and lack of motivation to learn react

#

😩

spark flint
#

same lol

#

my site is a shit mobirise one

wheat mesa
#

I tried to make a site with raw html and css to try to get the basics down

#

Sucked ass

#

I need to learn more about html tbh

#

I kinda suck with div layouts

wheat mesa
#

I should really learn react

#

Just not sure where to start

lyric mountain
#

since it's faster to get a prototype running you might not lose motivation as fast

wheat mesa
#

Yeah

warm crypt
#

how do make columns of text with titles

#

in html

#

nvm found it thumbs_up

tulip marsh
#

anyone to help with slash cmds in cogs

rare granite
#

why im getting this error while using pm2

^

SyntaxError: Invalid or unexpected token
    at Object.compileFunction (node:vm:352:18)
    at wrapSafe (node:internal/modules/cjs/loader:1031:15)
    at Module._compile (node:internal/modules/cjs/loader:1065:27)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Object.<anonymous> (/usr/local/lib/node_modules/pm2/lib/ProcessContainerFork.js:33:23)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
quartz kindle
#

or trying to run the wrong file

earnest phoenix
wheat mesa
#

If I import multiple weights of font from google fonts, how do I differentiate between the two in CSS?

#

For example, I import Poppins weight 500 and weight 200 like so: html <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@200;500&display=swap" rel="stylesheet"> but I'm not sure how to differentiate between 200 weight and 500 weight in CSS, as I use ```css
font-family: 'Poppins', sans-serif;

pale vessel
wheat mesa
#

Doesn't seem to do anything for me

#

Nevermind, forgot to select the h1 element

wheat mesa
#

starting to get a hang of html and div alignment etc

#

actually not too bad to work with

midnight swallow
#

You trying to build a static web?

wheat mesa
#

yeah

#

Not working with react quite yet

#

Just trying to get a better grasp of HTML

#

and CSS

midnight swallow
#

lol

errant flax
#

should i deprecate aka rmv text cmds for my bot or add slash cmds and text cmds while msg intent isnt a thing yet

errant flax
#

?

gusty lintel
#

hi rookies

errant flax
#

wym by "its recommended"

#

ill still add slash cmds ofc for both options

cobalt junco
errant flax
#

its public bot soooo

#

and it hasnt been verified yet still waiting for it to go in 75+ servers

cobalt junco
cobalt junco
errant flax
scarlet cliff
#

put that exact text into ur bot

#

i dare you

earnest phoenix
#

what even is this

#

happens on replit only

earnest phoenix
#

i did npm i node@latest

#

its using v12, weird

scarlet cliff
#

ur ecma version is old

scarlet cliff
cobalt junco
earnest phoenix
#

i know but replit

cobalt junco
earnest phoenix
scarlet cliff
#

lmao

earnest phoenix
#

u can update it with npm

scarlet cliff
#

npm is a npm package

earnest phoenix
earnest phoenix
# stray seal Reasons...

don't worry no one will call you dumb for not knowing programming
you should (never) check my first messages in this channel

eternal osprey
#

hey what's going on?TypeError: Cannot read properties of undefined (reading 'uses')

#
 let gInvites = await member.guild.fetchInvites()
      let g= [...gInvites]
      console.log(g)
      for (const key in g){
        z1 += g[key][1].uses
  
      }
      const createdAt = new Date(member.user.createdAt).getTime()
      const difference = Date.now() - createdAt

        const invite = gInvites.find((inv) => invites.get(inv.code).uses < inv.uses);```
eternal osprey
#

i know but why?

#

Should it be 0

cobalt junco
dawn flax
#

-bots

cobalt junco
scarlet cliff
#

could be the second one

cobalt junco
earnest phoenix
#

it used to be Cannot read property uses of undefined

scarlet cliff
#

different versions of the runtime im guessing

earnest phoenix
#

why did they change the error message

#

you can't read more than one property at a time can you

#

@rancid kite lmao imagine ghost pinging instead of apologizing for wrong reply

earnest phoenix
#

ok

quartz kindle
#

not that it changed much

quartz kindle
#

yes

#

like explaining

#

"you cant read shit from undefined"

#

more emphasis on the thing being undefined

#

than the prop youre trying to read

#

since most noobs didnt understand the "of undefined" part and think the prop itself is undefined

earnest phoenix
#

which it is

quartz kindle
#

lmao

#

i didnt say it as a bad thing

#

just easier to type than "inexperienced/beginners"

earnest phoenix
quartz kindle
#

lmao

errant flax
#

tim has no bot dev role anymore

split hazel
#

lies he does

earnest phoenix
#

uvuvwevwevwe onyetenyevwe ugwemubwem ossas

quartz kindle
#

brezil

errant flax
#
<!DOCTYPE html>
<html>
 <head>
  <script href="https://cdn.socket.io/socket.io-3.0.1.min.js"></script>
 </head>
 <body>
 <p>a</p>
  <script>
   const socket = io("https://joe.mama")
   socket.on("connection",()=>{
     console.log("hai")
   })
  </script>
 </body>
</html>

error: io is not defined

#

im using socket.io

quartz kindle
#

src

#

not href

errant flax
#

oh lol

#

DevTools failed to load source map: Could not load [the cdn url]: HTTP error: status 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

#

fixed

errant flax
#
<!DOCTYPE html>
<html>
 <head>
  <script src="https://cdn.socket.io/4.2.0/socket.io.min.js"></script>
 </head>
 <body>
  <div id="texts"></div>
  <button type="button" id="btn">Click</button>
  <script>
   const socket = io("https://joe.mama")
   socket.on("connect",()=>{
     const btn = document.getElementById("btn")
     btn.addE
   })
  </script>
 </body>
</html>
#

i want to add a p element into the div with the id of texts how can i do that?

boreal iron
#

Using your keyboard to write it into it? KEKW

#

<div><p>text</p></div>

boreal iron
#

Fetching your div element by its ID and add your p element to its innerHTML

brisk lance
errant flax
#

what does appendChild do thonk

brisk lance
errant flax
#

how do i rmv an element in js?

pale vessel
#

removeChild()

#

or element.remove()

slender thistle
#

@quartz kindle tfw my while loop was supposed to iterate over weeks in September

#

but instead it went as far as fucking January of 2022 because I forgot to add a check for the date's month

blissful coral
#

Bruh moment

spark flint
#

@earnest phoenix

earnest phoenix
#

-b 780939405313310740

gilded plankBOT
#

dblMod Banned ITZ PORRA#5979 (@maiden surge)

#

dblMod Banned ITZ PORRA#5979 (@maiden surge)

earnest phoenix
#

Spooky

scarlet cliff
#

who is hosting luca

misty sigil
#

good question

woeful pike
#

luca runs load balanced on 2 different free replit accounts

static trench
#

even though discord.py has been archived can i still develop with it?

static trench
#

good idea

blissful coral
#

Because its trying to get a document from mongo

earnest phoenix
#

why req is undefined?

#
let req;
if(rarity === "Common"){
if(lvl === 1)req = 1
if(lvl === 2)req = 2
if(lvl === 3)req = 4
if(lvl === 4)req = 10
if(lvl === 5)req = 20
if(lvl === 6)req = 50
if(lvl === 7)req = 100
if(lvl === 8)req = 200
if(lvl === 9)req = 400
if(lvl === 10)req = 800
if(lvl === 11)req = 1000
if(lvl === 12)req = 2000
if(lvl === 13)req = "Maxed"
} else if(rarity === "Rare"){
if(lvl === 3)req = 1
if(lvl === 4)req = 2
if(lvl === 5)req = 4
if(lvl === 6)req = 10
if(lvl === 7)req = 20
if(lvl === 8)req = 50
if(lvl === 9)req = 100
if(lvl === 10)req = 200
if(lvl === 11)req = 400
if(lvl === 12)req = 800
if(lvl === 13)req = "Maxed"
} else if(rarity === "Epic"){

if(lvl === 6)req = 1
if(lvl === 7)req = 2
if(lvl === 8)req = 4
if(lvl === 9)req = 10
if(lvl === 10)req = 20
if(lvl === 11)req = 50
if(lvl === 12)req = 100
if(lvl === 13)req = "Maxed"
} else if(rarity === "Legendary"){


if(lvl === 9)req = 1
if(lvl === 10)req = 2
if(lvl === 11)req = 4
if(lvl === 12)req = 10
if(lvl === 13)req = "Maxed"
}
#

rarity is defined and works

#

req is also defined (?)

spark flint
#

does anyone know how to add domain options to blesta

#

its killing me inside

earnest phoenix
#

I am waiting for 10 hours but my application commands still doesnt appear

blissful coral
cinder patio
#

I don't think that matters, console log rarity to see what it really is, lvl too

earnest phoenix
#

k

earnest phoenix
#

1000 lines of code

#

every file

open aurora
#

ew

earnest phoenix
#

before it was more but i made a test bot to make it less code

earnest phoenix
#

lvl = 3

#

rarity = Legendary

cinder patio
earnest phoenix
#

ok

solemn field
#

-ONLINE

#

any help?

#

i get?

boreal iron
#

Multipling it for example by 1,5 to add 50% of the current value to it or more complex adding a value to it based on the current value.

boreal iron
earnest phoenix
#

btw

#

Rare
number

#

lvl is number

#

idk what is the error

boreal iron
#

What's the actual error?

earnest phoenix
#

req is undefined

wicked pivot
#
.addField('CREATE', '<t:' + member.user.createdAt + ':R>')```how can I do ?
mint pewter
#

use member.user.createdTimestamp

boreal iron
#

Log the var rarity and see

wicked pivot
boreal iron
mint pewter
#

Math.floor(member.user.createdTimestamp/1000)

earnest phoenix
#

Rarity is rare

boreal iron
#

Starting with a capital letter?

earnest phoenix
#

yes

wicked pivot
#

2017 not 2021 Daltons_ref

boreal iron
#

Well then your timestamp is wrong.

wicked pivot
#

ow not

#

no no

boreal iron
wicked pivot
#

I know thank you it's me who am stupid

earnest phoenix
#

how to solve my error

#

i can pass all the code if necessary

boreal iron
#

Log all the var you declare and change and send a screenshot of your console output, please

earnest phoenix
#

nah i can't screenshot

#

replit

#

i'll edit it

boreal iron
#

Press PRINT and you got a screenshot.

earnest phoenix
earnest phoenix
boreal iron
#

Rare doesn't contain a lvl 1

earnest phoenix
#

oh

wicked pivot
#
function getJoinMember(ID, guild){
                    let arr = guild.members.cache.array();
                    arr.sort((a, b) => a.joinedAt - b.joinedAt);
                
                    for (let i = 0; i < arr.length; i++) {
                        if (arr[i].id == ID){
                            if(i == 0){
                                return (arr[i-2].user.tag + ", " + arr[i-1].user.tag + ",**" + arr[i].user.tag + "**")
                            }
                        }
                    }
                }```
let arr = guild.members.cache.array();
earnest phoenix
#

solved

#

i'll check if works

boreal iron
#

The other categories don't contain level 1, too

earnest phoenix
#

works thx

boreal iron
#

Just the first one does

earnest phoenix
#

yeah i saw it

#

thxx

high crown
#

Hey....when I'm trying avatar command, I have set the image size to 256, and it is showing the image blur, a bit blur

#

While I tried same with koya bot, it was showing a clear image

#

Why am I getting it blur on my bot?

wheat mesa
#

Show your code for it please

wicked pivot
#

collection.get with number ?

boreal iron
#

collection.get( K E Y )

high crown
boreal iron
#

That's what he's doing.

wicked pivot
#

is there a way to do it from a number?

#

example :
collection.find(3)
return
collection 3

high crown
# wheat mesa Show your code for it please
run(message, { user }) {
    const embed = new MessageEmbed()
      .setTitle(user.tag)
      .setImage(user.displayAvatarURL({ dynamic: true, size: 256}))
      .setColor(0x00ae86);
    message.embed(embed);
    return;
  }

#

nothing much a simple code

blissful coral
#

what are you destructuring?

#

what object gets passed to run()

high crown
#

Whom are u talking to?

blissful coral
#

you...

high crown
#

Ok

#

Wait lemme send the entire code

#

I'm not having any issues with the code

#

But certainly with the output

#

It is giving blur image

blissful coral
#

thats a discord issue then

#

or sizing

old cliff
#

Is there a way to get guild member count without the intent and cache?

#

Djs btw

blissful coral
#

No

high crown
#

Nope

blissful coral
high crown
#

Without cache u can't

blissful coral
#

You can without cache

#

It's without intents that you can't

high crown
old cliff
#

Oof

blissful coral
#

yes lmao

wheat mesa
old cliff
#

Its a music bot so wont get the intents

blissful coral
#

smh

high crown
blissful coral
#

?

#

GUILD_MEMBER intent

wheat mesa
#

Cache is just a way to not query the API every time you want to get a member object

high crown
blissful coral
#

lul

old cliff
#

I have no privileged intents

simple stump
#

Is this error an issue with my code or Discord API?

blissful coral
#

You don't really need them for music bot so

wheat mesa
#

You can still do it without cache, and it's probably recommended you do it without cache, since not all members get cached 100% of the time

blissful coral
old cliff
#

Just wanted to see the member count of each guild for statistics

blissful coral
#

Either inputted something wrong or forgot to input something

high crown
#

This is what Koya Bot is showing, clear

#

This is what my bot is showing

#

Blur

high crown
#

Can anyone help

blissful coral
#

Like I said

#

Most likely connection issue

#

Not really anything that can be fixed like that lul

old cliff
#

Can I get the preexisting invite code of each guild and use the guild member count from there?

blissful coral
#

Uhhhh

#

I don't know if it is shown to bots honestly

blissful coral
#

No

old cliff
high crown
#

Then?

blissful coral
#

There's not a reasonable way to get it without the guild member intent

#

sadly

old cliff
#

Yeah

#

I guess ill just display the cached stats then...

blissful coral
#

yeah smh

cinder patio
#

That's such a useless statistic

earnest phoenix
high crown
#

Wait lemme share it with u

#

U can cache it

pale vessel
#

You can, but it's an approximate

high crown
#

And will get the count

pale vessel
#
  • you don't need an invite
old cliff
blissful coral
#

@high crown Please stop

high crown
old cliff
blissful coral
#

What endpoint is that flaze?

pale vessel
#

/guilds/:id?with_counts=true

blissful coral
#

ah

earnest phoenix
blissful coral
#

check djs docs

old cliff
old cliff
#

Oof... didnt know

cinder patio
#

Can't you do Guild.memberCount like reis said?

old cliff
#

Wait... does it work without intents?

pale vessel
#

Do those even update? You only get the memberCount property on GUILD_CREATE. while you can fetch the approximate presence and member count at any time

cinder patio
#

discord.js probably increments / decrements them on a guild join / leave

#

though not sure

boreal iron
#

Yes they update. You will get the current amount with the ready event, too

pale vessel
#

Ready event

#

uhh

#

That wasn't the point

old cliff
pale vessel
#

They do

cinder patio
#

you could increment / decrement it yourself tho

pale vessel
#

You need to fetch it since Discord doesn't provide the counts by default

pale vessel
cinder patio
#

but you just said they explicitly mentioned that they don't do that

old cliff
#

Ok ill use the approxMemberCount

wheat mesa
#

Shit, no wonder my member count never changes.

pale vessel
wheat mesa
#

lmfao

#

Didn't know that memberCount doesn't get updated often

pale vessel
#

There's no way they don't provide member_count if you don't have the guild members intent

cinder patio
#

oh no I'm talking about the guild's memberCount on a GUILD_JOIN

pale vessel
#

Discord.js might do that internally

#

Hold on, what's GUILD_JOIN

cinder patio
#

when a member joins a guild, not your bot

old cliff
#

That isnt available without the members intent

pale vessel
#

Yeah no I doubt Discord gives the new member count, but Discord.js can increment the initial count provided by Discord initially

#

I think they do that

old cliff
#

So to conclude I should use the approximateMemberCount, right?

pale vessel
#

Why can't u use memberCount again?

old cliff
#

No intent

pale vessel
#

How

old cliff
#

No members intent

pale vessel
#

I thought Discord gives that regardless since it's part of GUILD_CREATE

#

Well in order to get approximateMemberCount you have to FETCH the guild every time you want to check

#

Could be trouble

old cliff
#

Nvm... memberCount is available

#

Ill compare the result in a sec and see....

#

Ok thanks... ill use the Guild#memberCount 😛

pale vessel
#

They handle it

old cliff
#

Oof... I dont have the members intent so it never updates smh...

#

Because the gateway event isnt triggered without the intent

wheat mesa
#

Hmmm... Anyone know how to fix this alignment issue when using a box model? The CSS and HTML are as follows: ```css
.features-container {
background-color: inherit;
width: 80%;
margin: auto;
margin-top: 10px;
border-radius: 30px;
padding: 10px;
text-align: justify;
}

.feature-item {
text-align: center;
background-color: #2f2e2e;
color: white;
padding: 15px;
border-radius: 15px;
max-width: 15%;
min-width: 140px;
display: inline-block;
margin-top: 10px;
}
html
<div class="features-container">
<div class="feature-item">
<h2>Test</h2>
<p>I wonder how I fix this stupid alignment issue when the boxes have different amounts of lines</p>
</div>
<div class="feature-item">
<h2>Test</h2>
<p>Testing of the crappy website I've made so far.</p>
</div>
</div>

old cliff
#

Why not use flexbox?

wheat mesa
#

Gonna be honest, no idea how to use flexbox

#

Nor do I have an idea of what it really does

old cliff
#
.features-container {
    display: flex;
    justify-content: space-around
}
#

I have a whole channel for these things

wheat mesa
#

Just put that in, works pretty well. I'll look into what flexbox actually does before moving on though

old cliff
#

@drowsy crag

wheat mesa
#

Oh damn this flexbox thing is actually a really nice thing to use

old cliff
#

Yeah... css 3 has interesting stuff

old cliff
#

Whenever my css works... I store the code in the channel lol

sage citrus
#
(node:562) UnhandledPromiseRejectionWarning: DiscordAPIError: 404: Not Found
    at RequestHandler.execute (/home/runner/weq/node_modules/discord.js/src/rest/RequestHandler.js:154:13)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async RequestHandler.push (/home/runner/weq/node_modules/discord.js/src/rest/RequestHandler.js:39:14)
(node:562) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:562) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

``` how i can fix it?
proven lantern
spark flint
#

how do i prevent html from caching images

#

but the html site using the image tag shows the same image everytime

proven lantern
sage citrus
proven lantern
#

<img src={`https://imagehost.com/img.jpg?${Math.random()}`}/>

spark flint
#

not working

#

its going to https://www.capybara.bar/%7B%60https://api.stupidapi.com/capybara?${Math.random()}}/
instead of https://api.stupidapi.com/capybara

proven lantern
proven lantern
# spark flint not working

that's jsx javascript. you'll basically need to do the same thing with whatever js library you're using

sage citrus
proven lantern
proven lantern
tardy hornet
#

is there a specific way that i can put the bots pfp as the thumbnail in an embed?

spark flint
proven lantern
spark flint
#

its flask

#

well quart

#

i can add a header

proven lantern
#

Cache-Control: no-cache

spark flint
#
@app.after_request
def add_header(r):
    """
    Add headers to both force latest IE rendering engine or Chrome Frame,
    and also to cache the rendered page for 10 minutes.
    """
    r.headers["Cache-Control"] = "no-cache, no-store, must-revalidate"
    r.headers["Pragma"] = "no-cache"
    r.headers["Expires"] = "0"
    r.headers['Cache-Control'] = 'public, max-age=0'
    return r```
proven lantern
#

you are overwriting it

#
    r.headers['Cache-Control'] = 'public, max-age=0'
#

i like the smiley faces

rocky dagger
#

any good tutorial on how to read/write data to mongoDB?
preferably with djs?

tardy hornet
#

what is the way to show the bots creation date? i forgot

#

bot.user.createdAt()?

spark flint
#

might be easier as its still not working

proven lantern
pale vessel
#

Doesn't Discord still cache the image?

spark flint
woeful pike
#

cache control tends to only work for assets

spark flint
woeful pike
#

your site caches it? or your browser

#

cache-control works both ways

spark flint
#

my site relies on showing a random image from a set 5 images

woeful pike
#

are you serving different binary data from the same endpoint?

spark flint
woeful pike
#

as in GET /image returns image/png?

spark flint
#

https://api.stupidapi.com/capybara returns a random capybara at a bar image

spark flint
woeful pike
#

hmm that's not very cache friendly

#

you have to add cache-control headers on the server side on the response to make sure the browser doesn't store the response

spark flint
#

thats why im thinking using html/js to return a random image url instead

woeful pike
#

the easiest way to do this would be to return a json response with the url that points to where that random image is hosted

spark flint
#

alr i can do that

woeful pike
#

then you have no caching issues and browsers can freely optimize things for you

#

otherwise you always have to re-fetch every new image and that actually works against you

#

unless your dataset is so big that you probably won't ever have repeats

#

which I'm guessing isn't the case for you

spark flint
#

its 5 images

#

so no

#

and repeats don't matter

woeful pike
#

yeah for sure you don't want to add a no-store header

proven lantern
#

you could generate the images like captchas do

woeful pike
#

yeah have fun generating animal images like captcha

proven lantern
#

that seems like the right direction to take this project

spark flint
#

im totally useless when it comes to html and js

woeful pike
#

get the url and create an img tag

wheat mesa
#

Anyone know how to fix this? I want the images to be in the same position regardless of the lines of the text. I've tried to align the img element to the bottom of the div, but I couldn't figure out how to get it to work properly

#

(These are just filler images for now)

exotic tendon
#

how can I set in my index that top.gg site can see in how many server(s) my bot is

wheat mesa
#

Good point

lyric mountain
#

however, there's a little issue with that too

#

you'll be limited on how long text can be

#

you could like, break the card in 2 parts

#

one is fixed on 75% size or so

#

which will hold the image

#

the other will hold the text

#

something like this

#

the red section shouldn't be resized no matter what

wheat mesa
#

I could try to vertically center the text in between the image and the h1 element

#

Not sure how that would look, but I'll try that rq

#

If that doesn't look right then I'll try your suggestion

lyric mountain
#

the issue in the current design is that the text is sharing the same space as the image

#

so changing text also affects the image

wheat mesa
#

Yeah

proven lantern
#

are you using flexbox?

wheat mesa
#

I'm using a flexbox for the cards, but the cards themselves are not a flexbox

#
        <div class="features-container">
            <div class="feature-item">
                <h2>Moderation</h2>
                <p>Moderate your server with ease.</p>
                <img src="Resources/fillerImage.jpg">
            </div>
            <div class="feature-item">
                <h2>Reminders</h2>
                <p>Never lose track of time with WaffleBot reminders.</p>
                <img src="Resources/fillerImage.jpg">
            </div>
            <div class="feature-item">
                <h2>User Information</h2>
                <p>Get information about users.</p>
                <img src="Resources/fillerImage.jpg">
            </div>
            <div class="feature-item">
                <h2>Fun</h2>
                <p>Mess around with fun commands with your friends.</p>
                <img src="Resources/fillerImage.jpg">
            </div>
        </div>
``````css
.features-container {
    gap: 10px 20px;
    display: flex;
    flex-wrap: wrap;
    background-color: inherit;
    width: 50%;
    margin: auto;
    margin-top: 10px;
    border-radius: 30px;
    padding: 10px;
    justify-content: center;
}

.feature-item {
    text-align: center;
    background-color: #2f2e2e;
    color: white;
    padding: 15px;
    border-radius: 15px;
    max-width: 25%;
    min-width: 215px;
    margin-top: 10px;
}

.feature-item img {
    vertical-align: bottom;
    width: 200px;
    height: 200px;
}

.feature-item p {
    font-weight: 300;
}
#

Sorry for the text wall

proven lantern
#
    flex:1;
}```
#

perhaps

wheat mesa
#

Doesn't seem to do anything, probably because .feature-item isn't a flexbox

proven lantern
#

oh yeah

#
flex-flow: column;
wheat mesa
#

Produces an even weirder result

#

closer though

modest maple
#

There is not real 'best'

#

its all down to personal preference

#

Some people use VSCode

wheat mesa
#

intellij IDEs are really nice

modest maple
#

I use JB products so we roll with PyCharm, Rider and Webstorm

wheat mesa
#

You can

proven lantern
#

The objective answer to that question is intellij

wheat mesa
#

It's just not a good choice for developing an app with C# on

#

For C# I'd recommend visual studio community

#

For everything else I'd recommend Intellij

#

Rider just kinda sucks ngl

modest maple
#

wdym?

wheat mesa
#

No hot reload for xaml

modest maple
#

You recommend Intellij for C# but say rider sucks KannaWhat

wheat mesa
#

🤮

wheat mesa
proven lantern
#

i recommend avoiding c#

modest maple
proven lantern
#

it doesn't even have wrapper classes for primitives

spark flint
#

i can't get the json thing to work

#

so far, it gets the img url from the json, but how do i then get it to show the image from the URL?

proven lantern
#

idk, jetbrains likes to take your money

modest maple
#

Community Edition is well.. For the community so yes, free

proven lantern
#

but you can do that when you have the best IDE

lyric mountain
#

@wheat mesa try flex: 3 on image and flex: 1 on text

#

then align image to bottom

wheat mesa
#

Worked!

spark flint
#

its here too @drowsy crag

split hazel
#

where is beautiful timothy when i need him

spark flint
#

or html

split hazel
#

id say im good at js

#

i sweat it for the past 2-3 years

spark flint
#
<script>
url = "https://api.stupidapi.com/capybara";

$.ajax({
  method: "GET",
  cache: false,
  url: url,
  success: function(data) {
    document.getElementById('capyimg').innerHTML = data.img;
    var data.img = document.getElementById("capyimg").src;
  },
  error: function(error) {
    //What do you want to do with the error?
  },
});


</script>
split hazel
#

not anymore though

#

oh boy ajax

spark flint
#

i did console.log(data.img) and it returned an image url

split hazel
#

whats the problem

#

sounds like its doing what its supposed to

spark flint
#
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
</head>

<img id="capyimg" src="capys/pc.png">


<script>
url = "https://api.stupidapi.com/capybara";

$.ajax({
  method: "GET",
  cache: false,
  url: url,
  success: function(data) {
    document.getElementById('capyimg').innerHTML = data.img;
    $("capyimg").attr('src', data.img);
    
  },
  error: function(error) {
    //What do you want to do with the error?
  },
});


</script>
#

its meant to replace capys/pc.png with the capybara image

split hazel
#

let me test something

spark flint
#

ok

#

wait it works

split hazel
#

lmao

earnest phoenix
#

is there a way to detect if my image wont load in html? <img src> stuff, and if not, print "this" instead of <alt>

spark flint
#

i did $("#capyimg").prop("src", response.img);

split hazel
#

nice

#

jquery docs are all over the place

#

thought there was something wrong with that line but wanted to test it first

spark flint
#

weird request

#

how can i make a raining effect

#

but its images raining

fresh bluff
#

Can someone tell me whats wrong with this code?

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

require('dotenv').config();

const Prefix = process.env.Prefix

client.on('ready', () => {
console.log("Logged in as the bot!")
} )

client.on('message', message =>{
if(!message.content.startsWith(Prefix)||
message.author.bot) return;

if(message.content === ${prefix}ping){
message.reply("pong!")
}
});

client.login(process.env.Token)`

#

Its not working

royal portal
fresh bluff
#

/home/runner/ORPtest/node_modules/discord.js/src/rest/RESTManager.js:32
const token = this.client.token ?? this.client.accessToken;
^

SyntaxError: Unexpected token '?'

I get this

royal portal
#

update node

spark flint
#

wow burbur coming in clutch

fresh bluff
#

How?

#

Im using Replit

royal portal
#

run npm install node@latest in shell
create start script in package.json with node index.js
create .replit file with run = "npm start"

fresh bluff
#

ok

#

Thank you

#

Its updating

royal portal
fresh bluff
#

but now im confused

#

on this part

create start script in package.json with node index.js
create .replit file with run = "npm start"

#

what do i do?

royal portal
#

create a new file named .replit with run = "npm start"

fresh bluff
#

ok

#

Now what?

#

It still does not work

fresh bluff
royal portal
#

you have to create a start script in package.json

royal portal
#
"start": "node index.js"
fresh bluff
#

at the top?

royal portal
#

after the test script

fresh bluff
#

{
"name": "ORPtest",
"version": "1.0.0",
"description": "",
"main": "index.js",
"dependencies": {
"discord.js": "^13.1.0",
"dotenv": "^10.0.0",
"fs": "^0.0.1-security",
"node": "^16.10.0"
},
"devDependencies": {},
"scripts": {
"test": "echo "Error: no test specified" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}

fresh bluff