#development

1 messages · Page 161 of 1

spark flint
#

Yeah it’s a weird way of handling it lol

lyric mountain
#

maybe it's some failsafe against ddos

#

since changing the ip effectively cancels the attack

earnest phoenix
#

Possibly

crystal wigeon
#

btw

#

whats the catch with contab? why are they so cheap

#

10.29$/mo for 4cpu 8gb ram is still huge, cloud vps

#

compared to vultrs 40$ for same configuration

sage bobcat
crystal wigeon
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

solemn latch
#

Iirc they don't have as much redundancy

crystal wigeon
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

crystal wigeon
#

hmm i see, is it a good idea to host postgres on these cloud vps they provide?

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

crystal wigeon
#

thanks, mhm hopefully i wont have issues with them, always skeptical when someone offers 4x less cost kekcry

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

solemn latch
#

Yeah, they have gotten better over time.
I still perfer other providers, but I dont really have anything against contabo

crystal wigeon
#

instead of always copying everything and building on docker, create the build file locally and jsut copy the build dir and run the command

#

im surprised why nobody does that, it saves a lot of image size no?

marsh lark
#

even with nodejs, there are still some things that are platform-specific

#

which is exactly what docker is trying to fix

crystal wigeon
#

no i get that, what im asking is the project related viles

#

why copy package json and stuff and then run npm i and npm build instead why not just build locally

#

and only copy the build files

#

and install nodejs & os on docker as usual, and just run npm start?

#

considering you already have the build folder the appln should work as expected no

#

nvm

#

i answered my own question.

marsh lark
#

I would say only build locally if you want to for typescript/babel/other js parsers. For npm dependencies, no.

#

Plus source maps if you're using something like ts (if you just include the source code as well)

soft laurel
#

This is with Java for clarification. Not super familiar with nodejs project builds. But I imagine it's similar enough.

The multi stage approach results in a smaller image size which is a very good outcome.

crystal wigeon
#

ty

earnest phoenix
#

Can anyone wanna devlop for me
I can give 3m Owo if want

#

Dm

#

Plz help

rustic nova
#

Lol

earnest phoenix
#

To help

rustic nova
#

You won't go far with "I can give 3m owo"

#

Nobody wants bot currency as payment

earnest phoenix
#

So money

#

$?

rustic nova
#

Yes, people would want money for that

earnest phoenix
#

💸 me poor

rustic nova
#

-needdev

gilded plankBOT
#

You seem to be asking for something you don't have experience for or something that hasn't been done yet, but really need for your bot/server.
You can hire developers from Fiverr or Freelancer to code the things you need for your bot/server.

rustic nova
#

Well

earnest phoenix
#

Helper

#

Needed

deft wolf
#

There are tutorials on the internet

#

Just use them

earnest phoenix
#

about getting free dev??

#

Lmao

deft wolf
#

No, there is no such thing as a "free developer"

earnest phoenix
deft wolf
#

Developer is a job that deserves to be paid

#

If you want free developer, then become a developer yourself

earnest phoenix
#

lmao

#

Bro is spitting fax.

#

Like how much day it will take to learn + apply it making Multipurpose all in one bot dc bot @deft wolf

deft wolf
#

It probably depends on how fast you learn and whether you have the ability to use, for example, a normal IDE and not writing in notepad++

#

Of course, paid courses are better because they teach more, but they are paid

earnest phoenix
#

sadly searched " Discord All In One bot Coding Tutorial
Getting no tutorial, getting download open sources

deft wolf
#

There are also text guides. Like the ones on discordjs.guide for example

#

You don't always need a video tutorial

earnest phoenix
#

Let's check Google

warm scroll
#

hlo

iron lion
gloomy current
#

sup

crystal wigeon
# soft laurel You can do achieve that with multi stage docker builds. My project builds in th...

so uh im trying to write a multi stage docker file, but the image size after it builds is 300MB, wondering if i can reduce the size further, i tried chatgpt it turned out to be absolute useless. the code it gave me increased the size to 700MB like bre.


# Adjust NODE_VERSION as desired
ARG NODE_VERSION=17.6.0
FROM node:${NODE_VERSION}-alpine as base

# Node.js app lives here
WORKDIR /app

# Set production environment
ENV NODE_ENV=production


# Throw-away build stage to reduce size of final image
FROM base as build

# To install node canvas
RUN apk add --no-cache \
        git \
        build-base \
        g++ \
        cairo-dev \
        jpeg-dev \
        pango-dev \
        freetype-dev \
        giflib-dev \
        make \
        python3

# Install node modules
COPY --link package-lock.json package.json ./
RUN npm ci --include=dev

# # Copy application code
COPY . .

# Build application
RUN npm run build

# Remove development dependencies
RUN npm prune --omit=dev


# Final stage for app image
FROM base

# node canvas requires these in runtime
RUN apk add --no-cache \
    cairo \
    jpeg \
    pango \
    giflib

# Copy built application
COPY --from=build /app /app

# Setup sqlite3 on a separate volume
RUN mkdir -p /data
VOLUME /data
ENV DATABASE_URL="file:///data/sqlite.db"

ENV NODE_PATH=lib/
# Start the server by default, this can be overwritten at runtime
EXPOSE 3000
CMD [ "npm", "run", "start" ]
#

also is there a way i can access redis that is running on my host from docker? like i want the appln running on docker to connect to hostmachine redis, i keep getting connection refused but the status is active

rustic nova
#

There's a parameter for that

#

Can't be bothered to look for it rn

#

Also, only install what's absolutely necessary then

#

Because for example I can't see git being used there so

#

also you'll never get lower with nodes modules

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

civic scroll
lyric mountain
#

thing is, you mustn't search for tutorial to making bots, you need to search how to code

#

besides, "all in one" is just throwing anything you can think about in a regular bot

civic scroll
lyric mountain
#

imagine blindly copying code from videos

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
civic scroll
#

what

#

i don't follow youtube tutorials

civic scroll
earnest phoenix
civic scroll
#

wait what

lyric mountain
crystal wigeon
#

okay so, does anyone know how i can create gifs ? in node

#

or do i have to use something like rust

soft laurel
#

Lookup docker-compose and add redis as one of the services. The internal networking of docker will allow you to access that instance of redis. Much better than accessing the host redis instance.

crystal wigeon
#

gifs like these which can be sent in embeds

lyric mountain
#

nothing requires one specific language

#

also third card is possibly nsfw

crystal wigeon
#

is it possible via canvas?

#

ik ik imma unsend it

#

but just for reference thats the only card i got

#

currently im using canvas to like place the cards in some order

#

but trying to figure out how i can add some animations

#

like that card

lyric mountain
#

yes it is, but there are 2 things to consider

crystal wigeon
#

mhm

#

how can i create one

#

i just found gifencoder

lyric mountain
#

first, you must create the frames individually and then assemble into a gif, this is annoying to do without a very abstracted library cuz gif uses a bunch of metadatas

#

second, you have a hardcap on how detailed a gif can be:

  • either 100% transparent pixels or 100% opaque, no in-betweens
  • maximum of 254 + 1 colors (+1 being transparency)
  • gif is BIG, so either use very small images or very short animations (remember 8 MB limit)
crystal wigeon
#

im okaywith the cap as long as its not too blurry and laggy

#

i can play around with it tho yeah

#

just wondering if nodejs is optimal or should i just use some other language for this

lyric mountain
civic scroll
#

so if you want no gif

#

take a frame within that gif

crystal wigeon
lyric mountain
civic scroll
crystal wigeon
#

yeh but gotta see how fast the gif will load on the canvas with other cards

#

but that comes later

lyric mountain
#

js is monothreaded, so u cant really split the generation into sub-tasks

crystal wigeon
#

first i wanna figure out how to add cool animations like that

earnest phoenix
#

I edited it
Removed nsfw feature
Fix emoji errors
Fix api bugs
Removed old music (tht don't work)
Added new music bot tht work better

civic scroll
lyric mountain
civic scroll
lyric mountain
#

especially the last 2 points

crystal wigeon
civic scroll
#

i'd recommend that you don't put gif

crystal wigeon
#

my limit goal is possibly less than 100kb

civic scroll
#

since well, animated frame but the subject is not animated feels odd

crystal wigeon
#

that should be fine

civic scroll
#

plus with restricted frame data, you can only pack so much information per frame

crystal wigeon
#

even the animated frames still give some cool effect

#

thats fine,

civic scroll
#

have you considered using a website mmGolden

lyric mountain
crystal wigeon
#

what packages do you recommend

lyric mountain
#

if the bot had 500+ commands, u needed to add 251+ commands to be considered not a clone

crystal wigeon
lyric mountain
#

gif is awfully inefficient, you cant really get that small

civic scroll
#

do you know
how bad an image of that quality looks with < 100kB?????

#

just ONE image alone is already bigger than 100kB

crystal wigeon
#

I've done it with my bot

civic scroll
crystal wigeon
#

not really

civic scroll
#

and the resolution isn't high either

lyric mountain
#

"optimization" and "quality" dont exist in the same phrase when ur talking about gif

civic scroll
#

if you want you can try WebP or APNG

#

but gif? nah

crystal wigeon
#

yeah i gotchu, but i just want to know how to get the same effect as that gif i shared

#

apng

#

m

#

could try that

#

so like i can load the apng onto the canvas and send it as gif in embeds right?

civic scroll
#

😭

lyric mountain
#

discord doesn't support any animation type but gif

lyric mountain
#

they're image formats, u cant order a pizza and eat it like pasta

crystal wigeon
#

ok

#

imma just try with gif

civic scroll
#

i'd recommend image only

crystal wigeon
#

any libs you recommend? for adding gifs into canvas

civic scroll
#

and then reserve GFX for websites instead

civic scroll
crystal wigeon
civic scroll
#
for a number of frame counts:
    load canvas
    render 
    export to a frame list

compile all the frames into gif
#

i would assume this can be kind of a costly operation if not done right

civic scroll
#

Tamanho

crystal wigeon
civic scroll
#

yes i love em disco

lyric mountain
#

and that's only for a few changing pixels (the rainfall thing)

crystal wigeon
#

true

lyric mountain
#

and if you zoom in the image, you'll notice it's heavily dithered

#

this works fine for small sizes like the one you sent

lyric mountain
#

but as you get bigger, the more dithering u get

crystal wigeon
#

im sticking with smaller ones yeah

lyric mountain
#

well then, all you need is to generate the frames individually and then assemble into a gif file

crystal wigeon
civic scroll
crystal wigeon
lyric mountain
#

no no, ur missing the point

civic scroll
#

you mean lossy compression

crystal wigeon
#

i got your point for gifs

lyric mountain
#

it's not small because optimization, it's small because it's jpeg

#

aka the smallest image type to date

crystal wigeon
#

nnop, Im creating a smaller version

#

yeah that too

lyric mountain
#

gif isn't jpeg

crystal wigeon
#

jpeg + have versions

#

kekcry i was just responding to her saying it wasnt possible for image to look high quality and be less than 100kb

lyric mountain
#

jpeg is an exception smh

#

we were talking abt gif

crystal wigeon
#

alr

lyric mountain
#

and honestly, maybe it's just my eyes after 1k+ cards, but that image is pretty low qual

crystal wigeon
#

i understood that part yep

crystal wigeon
lyric mountain
#

fair point

crystal wigeon
#

its all about the illusion of high quality smile_kek

#

bronya

crystal wigeon
#

i just found something

#

wtf is this

#

animated webp????

pale vessel
#

webp can be animated

radiant kraken
#

pngs can be animated too

crystal wigeon
#

okay this a pain i have to create each frame

lyric mountain
#

well yes, that's how animation works

#

regarding animated formats, there are many much better than gif, but for some reason the internet adopted gif as the de-facto format

#

while it's actually one of the worst both in quality and size

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

grim aspen
radiant kraken
grim aspen
#

I refuse to believe that

radiant kraken
grim aspen
#

Ffs it actually is

pale vessel
#

like how gif is supposed to be pronounced as jif, no one really does it

lyric mountain
#

me when .jif file tho

warm surge
#

Bruh

green kestrel
#

...you know you didn't release a new version of your GitHub project in a while when the changelog takes 5 nitro messages to send on Discord kekeke

green kestrel
#

if they wanted it to be pronounced jif should have called it jif instead of trying to force an acronym

lyric mountain
#

JPEG Interchange File Format

green kestrel
#

jfif

sharp geyser
lyric mountain
#

format can be omitted

quartz kindle
#

jraphics interchange format

green kestrel
#

giraffics interchange format?

#

who wants to exchange giraffes, mines too old

lusty quarry
#

Guys with which package i can make reward vote code im using js

wheat mesa
#

Make it yourself 😭

#

Js users try not to use a package for doing literally anything challenge (impossible)

lyric mountain
#

while there is top.gg sdk, it's literally just making a common webserver with express or smth

sharp geyser
#

whenever someone votes give them a reward

#

ez as that

lyric mountain
#

top.gg votes are nothing more than requests sent to the specified url

pale vessel
#

make sure to respond with OK or it'll keep on sending the request a few times

earnest mural
#

Nuh uh

pale vessel
crystal wigeon
#

TT

#

how tf do i make these animations aaaaaaa

#

figma? canva?

frosty gale
spark flint
#

lol

radiant kraken
#

LMAOO

crystal wigeon
#

wtf is this discordjs library

#

i fkin didnt change anything now suddenly its broke

#

it says "Maximum call stack size exceeded"

deft wolf
#

It's not discordjs error

#

This is a error coming from the programming language itself

#

It seems that inside one function you call another function, and so on indefinitely

wheat mesa
deft wolf
lament rock
#

iirc, you can't get call stack size limit errors with async functions but I might be wrong

#

(do not do it anyways)

crystal wigeon
#

Ye I fixed it, it was a dumb bug on my end but the stack trace showed discord js lib kekcry

#

Anyway, does anyone who know elixir or rust wanna collab together and make a bot? A simple bot similar to yui

lyric mountain
#

you have some weird taste for making a bot in elixir

deft wolf
#

Kinda

#

Since you already use discordjs, you can't make a bot with it?

lyric mountain
#

inb4, the most important thing between language performance and resource consumption is how familiar u are with the damn language

#

c++ being fast and efficient is worth nothing if you cant write fast and efficient code

quartz kindle
#

fast js >>>> slow c++

lament rock
#

I use c++ to write faster js

frosty gale
#

me when the stack overflows

frosty gale
sharp geyser
lyric mountain
#

at first sight, on a minified notification, that looked like an aubergine with a butt

radiant kraken
dry imp
#

elixir logo lookin kinda hawt

neon spruce
#

So that in py the bot gives me an event with the exact time it was with the time that the same discord delivers, would this code be?
entry.created_at.strftime("%Y-%m-%d %H:%M:%S")
what happens is that when delivering the information with the time that Discord delivers by default, when the message is delivered, it delivers it with another time and adds 4 more hours.
Here is an example, the information when the bot delivered it and the time that "said event" happened

#

and the time that appears in the discord audit log of when the event occurred

quartz kindle
#

your bot runs in a server on a different timezone

neon spruce
lament rock
#

Reject local time zones. Embrace the number of ms elapsed since the midnight at the beginning of January 1, 1970, UTC.

earnest phoenix
#

Hii

sonic lotus
#

please help with this error

deft wolf
#

The first is that you are using illegal intents and the second is some bug with the mongo db

deft wolf
#

Illegal in the sense that your bot cannot access them

sonic lotus
deft wolf
#

If your bot is verified, you need to verify it separately for each intent. If not, you're probably trying to use an intent that you don't have enabled in discord.dev

deft wolf
#

And with mongo db, you most likely exceeded the amount of collections that are allowed in the free version

sonic lotus
deft wolf
sonic lotus
#

ohk

#

thank u

earnest phoenix
sonic lotus
#

and have made more than 500+? bots

#

maybe

#

i dont remeber

#

with same mongodb

earnest phoenix
#

You're using the same MongoDB Atlas instance for all of your bots? Weeping

earnest phoenix
#

That's really bad, you're not only clogging up the storage of the database but also bringing its performance down to its knees from all the bots reading and writing to it

#

I've never seen someone do that before

#

Also maybe consider using PostgreSQL or similar

deft wolf
#

It seems to me that they are not all working at once, he only creates each collection with the creation of a new bot

sonic lotus
deft wolf
#

I doubt he's capable of hosting 100+ bots since he's using the free version of mongo db kappalul

earnest phoenix
slender wagon
#

I am pretty sure the error is telling you exactly what's wrong

sonic lotus
#

TypeError: channel.isTextBased is not a function
at InteractionCreateAction.handle (/home/runner/lavamusic-replit/node_modules/discord.js/src/client/actions/InteractionCreate.js:50:33)
at Object.module.exports [as INTERACTION_CREATE] (/home/runner/lavamusic-replit/node_modules/discord.js/src/client/websocket/handlers/INTERACTION_CREATE.js:4:36)
at WebSocketManager.handlePacket (/home/runner/lavamusic-replit/node_modules/discord.js/src/client/websocket/WebSocketManager.js:352:31)
at WebSocketShard.onPacket (/home/runner/lavamusic-replit/node_modules/discord.js/src/client/websocket/WebSocketShard.js:489:22)
at WebSocketShard.onMessage (/home/runner/lavamusic-replit/node_modules/discord.js/src/client/websocket/WebSocketShard.js:328:10)
at callListener (/home/runner/lavamusic-replit/node_modules/ws/lib/event-target.js:290:14)
at WebSocket.onMessage (/home/runner/lavamusic-replit/node_modules/ws/lib/event-target.js:209:9)
at WebSocket.emit (node:events:527:28)
at Receiver.receiverOnMessage (/home/runner/lavamusic-replit/node_modules/ws/lib/websocket.js:1178:20)
at Receiver.emit (node:events:527:28)

deft wolf
#

What version of discord.js are you using?

sonic lotus
#

but now i m getting a error

#

An error has occurred : TypeError [CLIENT_INVALID_OPTION]: The Amount of shards option must be a number.

#

before updating i wasent getting this error

spark flint
#

Why are you using v12

#

That’s several years out of date

sonic lotus
spark flint
#

What errors

sonic lotus
#

colorconvert*

spark flint
#

Are you trying to set an embed colour as something like BLUE or RED

spark flint
#

That’s the issue

#

You have to give it a definite hex colour in v14

earnest phoenix
radiant kraken
rustic nova
#

also mfw lavamusic-replit is a clone

little niche
#

how do i know if a bot is approved on top.gg?
(I will do it through the bot)

#

Can i control it with @top-gg/sdk module?

sonic lotus
earnest phoenix
earnest phoenix
#

Your editor should provide a search/replace functionality, if not, use other tools

earnest phoenix
#

💀

radiant kraken
#

how can you not tell already

sonic lotus
# earnest phoenix 💀

TypeError [ColorConvert]: Unable to convert color to a number.
at resolveColor (/home/runner/lavamusic-replit/node_modules/discord.js/src/util/Util.js:289:63)
at EmbedBuilder.setColor (/home/runner/lavamusic-replit/node_modules/discord.js/src/structures/EmbedBuilder.js:23:36)
at Object.run (/home/runner/lavamusic-replit/src/events/Client/interactionCreate.js:56:40)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
code: 'ColorConvert'
}

#

💀 same

earnest phoenix
#

Your first mistake is using Replit here, have fun searching for and replacing all of that manually

sonic lotus
#

it have an option

#

replace all

#

but same error after changing .setColor('RED') to .setColor(0xff0000)

warm surge
sonic lotus
#

14.13.0

warm surge
sonic lotus
warm surge
#

Just like that

sonic lotus
#

.setColor('#FF0000')

warm surge
#

no

sonic lotus
#

so?

warm surge
#

im saying if you want do it like RED they changed it to Red

sonic lotus
#

do i have to change it to red?

#

again

warm surge
#

Look

#

It was .setColor('RED') now it is .setColor('Red')

sonic lotus
#

k

#

u mean change all the values to .setcolor('Red')

sonic lotus
#

😐

warm surge
earnest phoenix
sonic lotus
#

then what to do?

spark flint
earnest phoenix
spark flint
sonic lotus
spark flint
#

include the # ofc

warm surge
sonic lotus
earnest phoenix
earnest phoenix
# sonic lotus what can i do now?

You need to do .setColor(0xff0000), make sure all of them uses that (can also use a different hex of course), and make sure your changes are saved

warm surge
#

@earnest phoenix still works and its on v14.13.0

sonic lotus
sonic lotus
earnest phoenix
earnest phoenix
# sonic lotus nope

Then you're not saving your changes, or haven't replaced all of them, can you show the error you're getting right now?

sonic lotus
#

[AntiCrash] | [UnhandledRejection_Logs] | [start] : ===============
TypeError [ColorConvert]: Unable to convert color to a number.
at resolveColor (/home/runner/lavamusic-replit/node_modules/discord.js/src/util/Util.js:289:63)
at EmbedBuilder.setColor (/home/runner/lavamusic-replit/node_modules/discord.js/src/structures/EmbedBuilder.js:23:36)
at Object.execute (/home/runner/lavamusic-replit/src/commands/Information/help.js:18:6)
at Object.run (/home/runner/lavamusic-replit/src/events/Client/messageCreate.js:122:21)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
code: 'ColorConvert'

earnest phoenix
# warm surge Hm?

Strings are not allowed in the setColor() method in any possible way there, not sure how it works for you

warm surge
earnest phoenix
warm surge
#

Screenshot the code

sonic lotus
earnest phoenix
# sonic lotus

.setColor(client.embedA)
What have you set client.embedA to?

warm surge
#

It should be in your index file

earnest phoenix
#

It's your bot, right? You set it

sonic lotus
#

i dont remeber

warm surge
earnest phoenix
sonic lotus
#

thanks @earnest phoenix and @warm surge

earnest phoenix
#

hi

warm surge
craggy garden
#

Is it normal for me to send a test webhook on the top gg dashboard and receive 3 or more notifications?

marsh lark
#

no

spark flint
earnest phoenix
#

hi guys, does anyone know how I can get a Spotify artists streams ❓

#

and track streams and album streams

#

and monthly listeners

#

i don't see in api but i see other services have them so i wonder how they get it

slim void
#

I may be wrong thi

earnest phoenix
#

it doesn’t have plyxoubts or nothing

#

or monthly listeners

craggy pine
#

Getting an actual Spotify audio stream is not happening unfortunately. Their API is private and I heard hella expensive as well.

#

Why most music bots do stuff like sound cloud or anything else really. I have a music bot that's only for my server for YouTube music since I don't plan on releasing it to the public anyways.

earnest phoenix
#

i want

#

playcount of tracks

craggy pine
#

I see

earnest phoenix
#

but spotify api don't provide

#

but i see services with them

#

so how they getting them

craggy pine
#

Are the services you see like discord bots or proper websites?

earnest phoenix
solemn latch
#

could be scraped data

craggy pine
#

I think its scraped information

sharp geyser
#

Most definitely, spotify doesn't really have an api that gives that kind of information

earnest phoenix
#

is scraping spotify allowed

craggy pine
#

They probably dont like it, but nothing states it's really "Allowed" or not unless its in their TOS.

earnest phoenix
#

hm

sharp geyser
#

Who reads company tos anyway

earnest phoenix
#

would it be unethical to scrape them

craggy pine
#

Facts.

#

I think scraping in general is a 50/50 in peoples eyes.

earnest phoenix
#

right now i'm scraping this website but it sucks

#

i wanna get the information myself

spark flint
#

fun fact

#

which meanssss the data they use on the site is in the code :3

#

application/ld+json section

#

i would just parse the description part imo

lament rock
spark flint
#

ah ok, noted

lament rock
earnest phoenix
#

how can i access network with puppeteer?

lyric mountain
#

Wdym access network?

earnest phoenix
lyric mountain
#

Open a page you mean then

earnest phoenix
#

i can get playcount for track from the request they make to this api

#

so hhow can i access it

lyric mountain
#

There's no api, you need to scrap

#

Which is why I believe ur using puppeteer

earnest phoenix
#

there is

lyric mountain
#

I meant there's no api for that specifically

#

Did you read puppeteer quick start tutorial?

earnest phoenix
#

look at this

lyric mountain
#

Doesn't mean there's a public api

earnest phoenix
#

yeah i know

#

thats why i want to load the page then steal that data

#

how can i

lyric mountain
#

That's not how it works

earnest phoenix
#

what

#

why not

lyric mountain
#

Scrapping only gives you access to the data ON the page, not requests made to/from it

#

So like, if there's a number somewhere in the page, you can get it, but not the request that filled that number

earnest phoenix
#

but i can access the data with my browser?

#

so why can't i withh puppeteer

lyric mountain
#

It's...complicated to explain, but when u enable network trace in chrome you're intercepting all requests made and received, but that data doesn't exist anywhere on the page

#

It only exists on chrome itself

#

Because you were intercepting the requests

#

Doing that with pptr is quite a bit complex, if possible

earnest phoenix
#

🙁

lyric mountain
#

Pptr is for scrapping pages, not intercepting requests

earnest phoenix
#

so i can't get playcounts of songs? they're no displayed on page on spotify website

lyric mountain
#

Is the play count written anywhere on the page?

earnest phoenix
#

not on the spotify website for some reason

#

but they are on the desktop app

#

but can you scrape the desktop app?

lyric mountain
#

Not through legal means

#

Are u sure it's not listed on the site? Iirc spotify uses react

#

So both their site and app are the same code

wheat mesa
#

Spotify has a public API to some extent iirc

#

Through Oauth

lyric mountain
#

Try reading the source html to see if there's a playcount element invisible

lyric mountain
earnest phoenix
wheat mesa
#

Wdym numbers?

earnest phoenix
#

followers

#

monthly listeners

#

playcounts

spark flint
#

i wouldn't use puppeteer

pale vessel
#

you could easily use the web api

spark flint
#

just use something like axios and then cheerio to parse it

earnest phoenix
#

left is desktop app

spark flint
earnest phoenix
#

website only gives playcounts for artists top 10 songs

#

not for any else

earnest phoenix
wheat mesa
earnest phoenix
#

what is a hash

pale vessel
earnest phoenix
#

sha256Hash?

pale vessel
#

yeah

earnest phoenix
#

ok

#

bro

#

does anyone know how i can fix this

pale vessel
#

ngl you're giving me battleless vibes

earnest phoenix
#

my computer keeps copy and pasting blank images

pale vessel
#

happens to me too

#

and when you send, it fails

earnest phoenix
#

i can't copy and paste text

pale vessel
#

you gotta paste again

earnest phoenix
#

i need to reset my computer to fix

pale vessel
#

until it shows the preview properly

earnest phoenix
pale vessel
earnest phoenix
#

how do i fix then

pale vessel
#

cope with it

earnest phoenix
#

The field at path '/albumUnion' was declared as a non null type, but the code involved in retrieving data has wrongly returned a null value. The graphql specification requires that the parent field be set to null, or if that is non nullable that it bubble up null to its parent and so on. The non-nullable type is 'AlbumResponse' within parent type 'Query'

rustic nova
#

-b 1069001636061663324 mute evasion from battleless

gilded plankBOT
#

upvote dondathedon#0 was successfully banned.

rustic nova
#

good job

deft wolf
wheat mesa
#

LMAOOOOO

#

surprised I didn’t notice sooner

rustic nova
#

update

#

im stupid

pale vessel
#

he's unmuted

rustic nova
#

yeah I realized afterwards

earnest phoenix
#

brother was so quick to ban me without even checking

#

thats crazy

pale vessel
#

poor blud

earnest phoenix
#

idk what that means

mild raptor
#

Can I access my discord account token from top.gg site

#

As im logged in there

#

(Experiment)

earnest phoenix
#

🤨

earnest phoenix
lyric mountain
rustic nova
#

peacefull is battleless

earnest phoenix
#

💀

#

lmfao

spark flint
#

the username made it kinda obvious too ☠️

frail smelt
rustic nova
#

State your full issue, and wait for someone who can help

#

people cant help with only parts of the issue you're having

frail smelt
rustic nova
#

that doesnt help

#
  • what issue are you facing
  • what have you done already
  • what did you try to fix it already
  • how does your code look like

Literally describe the issue you're having

#

what you're telling does not help at all

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

spark flint
#

yes

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

i am peacefull

#

don't think i know who a battleless is

#

😁

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

Hii

earnest phoenix
#

But i don't have development role

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

Ok

#

What is going on hee

#

Here*

#

you don't need bot developer role to chat here

#

it's for everyone 🌸

#

Ok

earnest phoenix
#

Ok

#

@earnest phoenix if owr bot get verified we get any dm

earnest phoenix
#

top

#

Ok i am waiting

#

For 2 day

#

good luck

#

it can take a little bit sometimes

#

I now

#

question guys is it possible for these to be like

#

moderation ban
moderation edit message

?

deft wolf
#

Why not just /ban?

earnest phoenix
#

better organization

earnest phoenix
#

this is my json

#
[
  {
    "name": "help",
    "description": "Get help with the bot."
  },
  {
    "name": "moderation",
    "description": "Manages the moderation commands.",
    "type": 2,
    "options": [
      {
        "name": "ban",
        "description": "Ban a user.",
        "type": 1
      },
      {
        "name": "message",
        "description": "Manages the message commands.",
        "type": 2,
        "options": [
          {
            "name": "edit",
            "description": "Edit the message for warnings, kicks and bans.",
            "type": 1
          },
          {
            "name": "remove",
            "description": "Remove the message for warnings, kicks and bans.",
            "type": 1
          }
        ]
      }
    ]
  },
  {
    "name": "server",
    "description": "Manages the server commands.",
    "type": 2,
    "options": [
      {
        "name": "info",
        "description": "Gets the servers information.",
        "type": 1
      }
    ]
  }
]
spark flint
#

subcommand groups

earnest phoenix
#

then explain

#

above not working

spark flint
earnest phoenix
#

sir

#

you say it's possible yet it's not working

earnest phoenix
deft wolf
#

Yea, context menus cannot have options

#

You need to make slash commands

earnest phoenix
#

it is slash command

deft wolf
#

Then how error says "context menu"?

earnest phoenix
#

idk

#

discord is slow

tulip ledge
#

bro I went back to read this guy's messages and peacefull is batleless it can't be otherwise 💀

deft wolf
#

He admitted he is

#

But he deleted the message

#

He even got a ban but the mute on the main account is over

earnest phoenix
#

battleless is the past

#

i am not battleless

#

i am peacefull

earnest phoenix
#

says who

#

i am peacefull

deft wolf
#

If you piss people off, you won't be peacefull

wheat mesa
#

so why is he still here 😭 ban evasion

deft wolf
#

It was an unfair ban

#

Aurel thought his mute was still on but it ended today

wheat mesa
#

Oh I thought it was permanent

earnest phoenix
#

not sure why you mean

#

i wasn’t banned from here

#

well i was falsely

#

because a mod decided to ban me without checking anything

deft wolf
#

Mod permissions abusing

earnest phoenix
#

lol you can tell that’s how much he hated me

#

no check if my mute was over

#

just ban

#

😭

earnest phoenix
#

i tried it and the first one wasn’t registered

quartz kindle
#

afaik a command can either be a command or a list of subcommands, it cant be both

#

so if you set it to have subcommands, you cant run it by itself

earnest phoenix
#

sad

frosty gale
#

what is bro even doing

#

is he soldering or what

#

or welding

earnest phoenix
#

why is his hair purple and body yellow

#

he built different

sharp geyser
#

You dont need goggles for soldering

rustic nova
spark flint
#

have a development meme i did not steal

carmine summit
#

What is number? How can I put my hexadecimal color using EmbedData?

wheat mesa
#

Number is quite literally a number

earnest phoenix
#

parseInt('hex code color', 16)

wheat mesa
#

That is the type

carmine summit
#

Does files have to be uploaded to discord cdn before they can be shown as this? or a link will do fine?

marsh lark
#

They need to be uploaded

carmine summit
#

So max 8mb right?...

marsh lark
#

25mb

radiant kraken
marsh lark
#

If the server is boosted then it's more

rustic nova
#

25mb max for bots

#

iirc boost status doesn't affect that on bots

marsh lark
#

It does I think

rustic nova
#

Nevermind yeah, according to docs:

A file upload size limit applies to all files in a request (rather than each individual file). While the limit depends on the Boost Tier of a guild, it is 25 MiB by default.

#

So ye 25MiB, unless boost is higher

earnest phoenix
#

can you get a servers info from an invite url?

deft wolf
#

I don't think so

muted zinc
#

my bot are been declined because : The prefix you've listed on your bot page seems to not match your bot's actual prefix.
However, in my discord server, it's this prefix / that I mentioned

deft wolf
#

You need to contact the person who checked your bot

muted zinc
#

ok thx

#

contact in private or here ?

deft wolf
#

In a private message

muted zinc
#

thx

earnest phoenix
#

I never worked with the module "Express" I do not know what to add in 'app.listen(80)' that number I have to change or I leave it so for the use of webhook?

rustic nova
#

That's the port

lyric mountain
#

set it any number u want, as long as it's above 1024

#

or 80/443

rustic nova
#

actually

#

are you still able to set 80/443 when not being privileged?

#

no right?

lyric mountain
#

u can

#

but u cant use 80 if u have ssl enabled, nor the other way around

#

I mean, u can, but the other side will refuse to connect

green kestrel
cinder patio
#

Noticed that too

green kestrel
#

it appears to be githubs fault

#

network related

earnest phoenix
#

or should i just make the api request myself

tulip ledge
muted zinc
#

global slahs commands

tulip ledge
#

then talk to the person who reviewed your bot

muted zinc
#

I’m doing it now

thorn spruce
#

Hi I'm building a web site with Svelte and express and I wonder if it's better to put my session with express and do an API call with Svelte in the SSR (+server.svelte) to get the session data or to directly import my session from my backend to my SSR (svelte)

earnest phoenix
#

how can a get the urls and stuff from this data

#

icon, banner and splash

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

um

#

what is this

sharp geyser
#

I mean just index the guild object

#

for those values

#

not hard

tulip ledge
sage bobcat
#

One message removed from a suspended account.

wheat mesa
#

this is why typed languages are nice for modeling firm data

#

makes it easy to serialize and deserialize

earnest phoenix
#

for the invite

#

i assume that string has something to do with it?

#

how can i convert it to the url

wheat mesa
#

You can't just generate an invite with a guild object alone

#

That would be a massive privacy issue

earnest phoenix
#

then what’s that code for?

wheat mesa
#

The "icon" code?

earnest phoenix
#

yeah

#

look in screenshot

#

guild.icon

wheat mesa
#

That's the hash for the server icon

earnest phoenix
#

so how can i get the server icon from that?

wheat mesa
#

from their CDN

earnest phoenix
#

OHH

#

thx

#

sir

#

i appreciate that info

spark flint
earnest phoenix
#

thx

wheat mesa
#

You can't generate an invite without your bot being in the actual server and having proper permissions though

spark flint
#

if you do not put a file type it will default to the applicable one

#

so if its animated, it will render the gif

earnest phoenix
#

i just wanted to get icon url from invite

#

btw guys in discord.js how can i get full command used

#

from interaction

marsh lark
#

What do you mean by full command

earnest phoenix
#

like

marsh lark
#

Like the options?

earnest phoenix
#

ok so

#

i do

#

ok

#

so

#

i do interaction.commandName

#

for example

#

but if i have a command like "moderation ban"

#

it will only return "moderation"

#

but i want all

#

"moderation ban"

marsh lark
#

interaction.options.getSubcommand()

#

that will get the ban part

earnest phoenix
#

ok

#

would interaction.options.getSubcommandGroup() work?

marsh lark
#

That will get the subcommand group /a b c it will get b

#

but if you only have /a b it will get b (for subcommand)

earnest phoenix
#

but i want all

#

bruh wym no

#

i'm not allowed to get it all?

marsh lark
#

Uh interaction.commandName + interaction.options.getSubcommand(true)

#

I mean that's the best you'll get

#

Not sure why you need all

earnest phoenix
#

because how else will i know what command was ran

#

???

earnest phoenix
#

nvm thanks for help guys

wheat mesa
#

subcommands are considered options on normal commands

#

it sucks but it's how it is

#

you have to map it out the way that works for you

#

I do this for example

#

very basic functionality but is very simple to implement

earnest phoenix
#

i am trying 💔

warm surge
#

Coding is hard in general

#

Bru

earnest phoenix
#

this bot is too simple for all this shit

#

imma just quit

warm surge
#

take classes

#

It will help

earnest phoenix
#

why

craggy pine
#

Because you will never succeed in what you want to do if you just quit early. 🙂

wheat mesa
#

The programming isn't necessarily the hard part (once you've experienced a bit of it), it's designing creative solutions to your problems

earnest phoenix
#

i'm not quitting

wheat mesa
craggy pine
#

Basically what Waffle said. I'm defenitly not anything special when it comes to being a developer, I only know the basics of javascript and node. But the more I play with it the more I learn and stuff. I started doing this stuff from Discord bots, but I do branch out of it from time to time aswell. Now my bot is pretty large in terms of code. Is it good code? Probably not lol

warm surge
earnest phoenix
craggy pine
#

Wish coding was a requirement when I went into HS lol

earnest phoenix
#

but i'm not quitting being a coder🤓

wheat mesa
#

I have my fair share of dogshit code in my compiler that I need to clean up ngl, reminds me

earnest phoenix
#

i am taking computer engineering this year in school

#

😋

wheat mesa
#

"oopsies"

earnest phoenix
#

oopsies!!!!

#

guys

warm surge
craggy pine
wheat mesa
#

rust

earnest phoenix
#

in sql is there anyway to do like

#

don't edit if undefined

#

?

craggy pine
#

Ah rust

wheat mesa
#

dear god I would never make a compiler in ts

craggy pine
#

I should have figured since you said compiler

wheat mesa
#

that's a sin

#

and I'm not even religious

earnest phoenix
craggy pine
#

That should be something you check in the code for JS not sql

earnest phoenix
#

🙁

craggy pine
#

like

if(thing === undefined) return
#

Speaking of undefined

sharp geyser
# wheat mesa

The cleanness of this code makes me want to learn rust

wheat mesa
#

this is absolutely not very clean

earnest phoenix
#

i don't wanna do that

sharp geyser
#

it looks clean to me so

wheat mesa
#

could be 10 million times better ngl

earnest phoenix
#

can you do it in sql?

sharp geyser
#

yes waffle

craggy pine
#

I would imagine so

sharp geyser
#

but even bad rust looks clean

wheat mesa
#

don't worry I can make you take that statement back

sharp geyser
#

Looks fine to me

wheat mesa
#

that if statement

#

is fucking ugly

sharp geyser
earnest phoenix
#

would thhis work

'UPDATE fractions SET owners = ? NOT "undefined", message = ? NOT "undefined", WHERE invite = ? NOT "undefined"'

wheat mesa
#

however I have some clean code too

earnest phoenix
craggy pine
#

Just reading the first line I'm just like... function build mutable? vector? expression? Result

earnest phoenix
#

🤲

craggy pine
#

It's just so much simplier to just check for those being undefined b4 doing a database update in all honesty. Probably faster but what do I know

earnest phoenix
#

ok but if i do that

#

i’ll need to do multiple operations

#

🙁

wheat mesa
craggy pine
#

😛

#
//UPDATE fractions SET owners = ? NOT "undefined", message = ? NOT "undefined", WHERE invite = ? NOT "undefined
if(!owners || !message || !invite) return
earnest phoenix
#

what’s this

craggy pine
#

basically checking if they exsist and if any is undefined dont do anything

earnest phoenix
#

is this sql

craggy pine
#

javascript...?

wheat mesa
earnest phoenix
#

bru

#

i wanna do it with sql

#

not javascript

craggy pine
#

🤷‍♀️ im a league game now so idk my man

earnest phoenix
#

ok

#

if anyone else knows spam ping me

#

and i will investigate

earnest phoenix
#

silence

sharp geyser
earnest phoenix
#

How do I configure top.gg bot to only send messages to a specific channel?

sharp geyser
#

bozo

earnest phoenix
#

being unnecessarily hostile 🙁

earnest phoenix
#

I don't think I can be much more clear.

#

what messages?

#

I installed the bot on my server. It sent a message to one of my channels. I want it to send messages to a different channel.

quartz kindle
#

what bot?

earnest phoenix
#

iirc the top.gg bot doesn’t have any features that would send messages

#

unless that’s changed in the 2 months i’ve been gone

#

It's literally called the "top.gg" bot. When you ad your server to top.gg

#

Well, it sent a message.

#

can you send a screenshot?

#

Of what?

#

the message?

quartz kindle
#

ah, that would be more of a #support issue i think?

earnest phoenix
#

I deleted it.

#

Okay.

quartz kindle
#

since its about top.gg's internal systems

earnest phoenix
#

I'll wait for a response there.

earnest phoenix
quartz kindle
#

what do you want it to do if the values are undefined?

earnest phoenix
#

if the value is undefined i don't want it to update

quartz kindle
#

well

#

first of all undefined does not exist in sql, so depending on the library you're using, it will either convert it to null, or not work

#

so assuming it converts it to null

sharp geyser
quartz kindle
#

afaik sql does not treat null values as non-passed values

#

so if you set something to null, it will be set to null

#

there is no fallback

#

now

#

you CAN do comparisons in sql

earnest phoenix
quartz kindle
#

but its complicated and not worth it most of the time

#

or

earnest phoenix
#

i want to not update the value if it's undefined

#

with sql

quartz kindle
#

you can use something like insertion triggers

#

which are functions that you define, and are executed on every insert

sharp geyser
#

undefined doesn't exist in sql

quartz kindle
#

so the final answer is: its possible yes, but dont bother, just do it with js

earnest phoenix
#

ok

#

btw

quartz kindle
#

i hve something like that in one of my projects

earnest phoenix
#

can you set all options to not required

#

in slash commands

quartz kindle
#

i simply build an sql string with only the columns that have actual values to update

quartz kindle
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

yeah that was me

#

i decided to retract my message because i no longer wish converse here

slim void
#

Could u code a bot in c#?

wheat mesa
#

yes

#

any language that has access to the internet/http

slim void
#

So....html?

wheat mesa
#

html is not a programming language

slim void
#

I know but it has access to the internet and http lol

lyric mountain
#

Nop

#

Html has access to nothing, it's a purely structural language, no executing logic whatsoever

#

However u could technically code a bot in sql, more specifically plpgsql

slim void
#

Intresting

rustic nova
#

@lyric mountain were you the one who had a mailcow setup too?

surreal sage
vivid fulcrum
#

i don't know about you, but i don't usually spend my days standing in front of banks and smile at them