#development

1 messages · Page 123 of 1

quick abyss
#

I tried it, but got back that the interaction was already acked

#

wait do you still need interaction.deferReply for your method?

peak drum
#

You replace that code that replies to the interaction with my example

#

Example:
If(command){
let msg = await interaction.reply("text")

msg.edit("text123")
}

deft wolf
#

You need to fetchReply() right?

lyric mountain
#

isidora is pretty close

#

but not an exact match

rigid maple
#

I spent a lot of time on "what the font" and similar sites but couldn't find it.

quick abyss
#

but that could happen as many times as it takes for the hand to be over.

#

hence the multiple edits

deft wolf
#

Yes, but in order to work on the message that the bot sends, you have to fetch it

rigid maple
peak drum
rigid maple
#

look at 7

quick abyss
#

I'll give that a shot and see how it works out. Thanks!

lyric mountain
#

like, just the 36 chars (A-Z and 0-9)

#

you just need one sample of each char

rigid maple
#

💀

#

what do i need besides pictures

lyric mountain
#

it'll likely be faster than trying to make the OCR work without the source font

lyric mountain
#

then use a font maker tool to assemble a font file

rigid maple
#

this really need a patience

lyric mountain
#

the "export as svg files" is the easiest part, as inkscape can automatically extract vectors from images

rigid maple
#

thanks for your help you really helped a lot

lyric mountain
#

yw

neon leaf
#

Is there any way to indicate how big a streamed file is to a browser so it can display a proper progress bar? like I know how to do it with uncompressed files but what if they are compressed? Is that even possible?

quartz kindle
wooden ocean
#
const fs = require('fs');
const Discord = require('discord.js');
const xp = require('/home/container/Src/data/xp.json'); 
module.exports = {
    name: "xp",
    run: async (client, message) => {
if (!xp[message.author.id]) {
    xp[message.author.id] = {
      xp: 0,
      level: 1
    };
  }

  // Calculate the amount of XP the user should get for this message
  const xpToAdd = Math.floor(Math.random() * 10) + 1; // Random amount between 1 and 10
  xp[message.author.id].xp += xpToAdd;

  // Check if the user should level up
  const currentLevel = xp[message.author.id].level;
  const xpNeeded = currentLevel * 100; // Amount of XP needed to level up
  if (xp[message.author.id].xp >= xpNeeded) {
    xp[message.author.id].level++;
    xp[message.author.id].xp = 0;
    message.channel.send(`Congratulations ${message.author.username}! You've leveled up to level ${xp[message.author.id].level}!`);
  }

  // Save the user's XP data back to our database
  fs.writeFile('/home/container/Src/data/xp.json', JSON.stringify(xp), (err) => {
    if (err) console.log(err);
  });
    }
};

not working or showing anything in console

rustic nova
#

add debug lines then

#

and see where it stops running

wooden ocean
#

i did

#
const fs = require('fs');
const Discord = require('discord.js');
const xp = require('/home/container/Src/data/xp.json');

module.exports = {
  name: "xp",
  run: async (client, message) => {
    console.log('XP command triggered'); // Debug statement

    if (!xp[message.author.id]) {
      xp[message.author.id] = {
        xp: 0,
        level: 1
      };
    }

    const xpToAdd = Math.floor(Math.random() * 10) + 1; // Random amount between 1 and 10
    xp[message.author.id].xp += xpToAdd;

    console.log(`${message.author.username} gained ${xpToAdd} XP`); // Debug statement

    const currentLevel = xp[message.author.id].level;
    const xpNeeded = currentLevel * 100; // Amount of XP needed to level up
    if (xp[message.author.id].xp >= xpNeeded) {
      xp[message.author.id].level++;
      xp[message.author.id].xp = 0;
      message.channel.send(`Congratulations ${message.author.username}! You've leveled up to level ${xp[message.author.id].level}!`);
    }

    console.log(`Current XP for ${message.author.username}: ${xp[message.author.id].xp}`); // Debug statement

    fs.writeFile('/home/container/Src/data/xp.json', JSON.stringify(xp), (err) => {
      if (err) {
        console.log(err);
      } else {
        console.log('XP data saved successfully'); // Debug statement
      }
    });
  }
};
#

my bad for not providing that

#

nvm i forgot to add

#
customEvent: true,
earnest phoenix
#

Like PostgreSQL, MongoDB, ScyllaDB, CassandraDB, etc etc

wooden ocean
#

thanks for the advice I will note that down

quartz kindle
#

sadge

wooden ocean
#

XP command triggered
/home/container
undefined
~

    console.log('XP command triggered'); // Debug statement
    console.log(message); // Debug statement
    console.log(message.author); // Debug statement
    console.log(message.author.id); // Debug statement

is that right or it's just me?

quartz kindle
#

message logs as /home/container? that doesnt look right

earnest phoenix
quartz kindle
#

well i dont handle millions of queries of course

#

but for small stuff sqlite best

earnest phoenix
#

We have lost a soldier... Oh no not Tim

wooden ocean
quartz kindle
wooden ocean
#

it's a event

#

thus runs event code

const { statSync } = require("node:fs");
const directorySearch = require("node-recursive-directory");
module.exports = async(client, rootPath) => {
    const clientEventsFiles = await directorySearch(`${rootPath}/Src/Events`);
    clientEventsFiles.forEach(eventFile => {
        if (statSync(eventFile).isDirectory()) return;
        const clientEvent = require(eventFile);
        if (clientEvent.ignore || !clientEvent.name || !clientEvent.run) return;

        client.events.set(clientEvent.name, clientEvent);
        if (clientEvent.customEvent) return clientEvent.run(client, rootPath);

        if (clientEvent.runOnce) client.once(clientEvent.name, (...args) => clientEvent.run(...args, client, rootPath));
        else client.on(clientEvent.name, (...args) => clientEvent.run(...args, client, rootPath));
    });
};
quartz kindle
#

this -> ...args, client, rootPath

#

is what goes here -> run: async (client, message)

#

and the way it works is based on the order

#

it need to be in the correct order

#

your orders are wrong

#

on the event you have args first, client second

#

on the run function you have client first, message second

boreal iron
quartz kindle
#

multiple threads accessing the same db

#

in production

#

:)

earnest phoenix
earnest phoenix
boreal iron
#

Eww why would I want to do that

earnest phoenix
#

You must if you can't take me seriously :)

#

Go ahead

boreal iron
#

"One blocked message"

#

I suffer enough pain I didn't deserve already

#

So no, not goin to happen

earnest phoenix
boreal iron
#

Oh no, no anime please

#

My eyes

wooden ocean
#
<ref *1> Client {
  _events: [Object: null prototype] {
    shardDisconnect: [Function (anonymous)],
    interactionCreate: [Function (anonymous)],
    messageCreate: [Function (anonymous)],
    ready: [Function: bound onceWrapper] { listener: [Function (anonymous)] }
  }...

is this right for message to outinput

boreal iron
#

Nerdtrex

earnest phoenix
boreal iron
#

lol, no it has always been good to me

quartz kindle
#

it says Client right at the top

wooden ocean
#

i cant read 😭

quartz kindle
#

smell it then

earnest phoenix
#

Don't worry most people can't do that here either :^)

quartz kindle
#

imagine a blind person that can read books by smelling them

#

:^)

wooden ocean
#

i just want it to work

boreal iron
quartz kindle
earnest phoenix
#

Ez 😎

boreal iron
#

lol

quartz kindle
#

you cant read but your imaginary friend can

#

so you open the book and start reading it

#

also, that sounds like something a wh40k ork would do

#

except they dont wanna read, just fight

rustic nova
#

Tim is high

earnest phoenix
quartz kindle
#

trolling on discord while participating in a java class online

boreal iron
boreal iron
#

Tim, Java? Wtf

#

We're loosing anybody to Java now?

earnest phoenix
#

Surely Clueless

boreal iron
#

Even worse than php

quartz kindle
#

im learnign that java is hell and impossible to understand anything, so overcomplicated and overly abstracted

#

thank god i dont actually need to learn it

#

im learning about the teaching process (im basically an assistant teacher), not the language itself

earnest phoenix
quartz kindle
#

indeed

#

students are learning about unit testing and integrated testing

#

using java + spring

earnest phoenix
quartz kindle
boreal iron
#

Tf is this lol

quartz kindle
#

this is so true

#

everything they do is split into entitiy, controller, service, domain and what not

wheat mesa
#

Ngl I would try to defend Java’s honor but I can’t even find a reasonable defense to these statements…

#

Is it slander if it’s true

quartz kindle
#

like these are beginner students, learning a language for the first time, they started like 6 months ago

#

and already having to deal with all that abstraction crap, like mvc, hexagonal, tdd, bdd, architecture designs, etc (they are pretty much not understanding most of it, but pretending they do)

#

also whats up with java lib names

#

cucumber, spring with their beans, lombok, and other weird names

wooden ocean
#

Rust is Inevitable

wheat mesa
#

Java is easy to understand because it’s minimal, but that’s what also makes it more difficult to work with in larger codebases

quartz kindle
#

well maybe they were explained in other classes before that i didnt see

#

but i have a feeling that a big part of it feels like magic for the students

wheat mesa
#

Decorators are definitely not a beginner topic

#

But the idea is that it’s just mostly syntactic sugar for interface implementation

quartz kindle
#

ye

wheat mesa
#

I’m sure the college process is a lot different than high school, but for our classes in high school they definitely built a very good foundation

#

Also we’re forced on to Java 8 so we don’t have fancy features like decorators lol

quartz kindle
#

the students are being tasked with building simple webservers, and they are doing everything with @autowired and @AllArgsConstructor and a lot of other stuff from Lombok

wheat mesa
#

Oh boy

#

Yeah I need to learn lombok myself

quartz kindle
#

also, using docker for everyting

wheat mesa
#

Ouch

sage bobcat
#

One message removed from a suspended account.

wheat mesa
flat copper
civic scroll
earnest phoenix
#

can anyone help me where i did mistake in thsi code coz its not working

const { Client, GatewayIntentBits } = require('discord.js');
const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.GuildVoiceStates,GatewayIntentBits.GuildMembers, GatewayIntentBits.MessageContent, GatewayIntentBits.GuildMessageReactions] });
const { token } = require("./config.js");

// const client = new Client({ intents: [Intents.FLAGS.GUILDS] });

const roleName = 'muterole1';

client.once('ready', () => {
  console.log('Bot is online!');
  addRoleToChannels();
});

async function addRoleToChannels() {
  const guildId = 'SERVER_ID';
  const guild = await client.guilds.fetch(guildId);

  const role = await guild.roles.create({
    name: roleName,
    color: '#630909',
    permissions: []
  });

  guild.channels.cache.forEach(async (channel) => {
    try {
      if (channel.isTextBased() || channel.isVoiceBased()) {
        await channel.permissionOverwrites.create(role, {
          SEND_MESSAGES: false,
          VIEW_CHANNEL: false,
          SPEAK: false,
          CONNECT: false,
        });
        console.log(`Role added to channel: ${channel.name}`);
      }
    } catch (error) {
      console.error(`Failed to add role to channel: ${channel.name}\n${error}`);
    }
  });
}

client.login(token);

rustic nova
#

add debug lines

dusk sequoia
#

@rustic nova i was just curious about how does top.gg store the images ?

#

images like bot logos and other stuffs?

rustic nova
#

by using discords cdn

#

all images used in your bot page are fetched from discord and hosted by discord

dusk sequoia
#

oo
i thought were storing it on any server

#

like i am actually searching for a way so i could just store images and then use them for a site any idea for the build?

rustic nova
#

is how top.gg does it, the image itself is hosted on discord

rustic nova
#

or cloudflare provides cdns too

#

content delivery networks, allowing you to store and cache images

dusk sequoia
#

so in this case i would use the images not by base64 string but by cdns right?

rustic nova
#

unsure how cdns actually handle the data itself, but images would probably be stored in base64 for easier delivery and database use

#

might suggest not re-inventing the wheel about cdns but rather use an existing ones

dusk sequoia
#

cause 1 image if approx = 5mb the base64 strings would go high and would cause delays

rustic nova
#

so you'd do with the files itself

dusk sequoia
spark flint
#

using Next.js image optimization

#

it means faster loading and caching server side

#

i use it myself and its great

#

also allows for fallback options, like they do

dusk sequoia
spark flint
#
import Image from 'next/image'

<Image
  src={bot.icon}
  width={128}
  height={128}
  fallback={/*idk something here */}
/>```
#

its like that

#

they also use Chakra's avatar component

#

which works well together

dusk sequoia
#

i actually wanna store image

like :
user would upload image >> get it stored in my db >>> get it used on server back

problem : dont wanna do in base64 storage
, cant use multer cause it would start the server again on every upload due to the chnages and the next app also wont recognise it

spark flint
#

dont store image in DB

#

use something like Cloudflare R2

#

cheap, virtually free unless you store a lot of stuff (like 50gb+)

#

iirc its 10gb free anyways

#

i have an image host (pretty much dead) storing 10k images and videos for just under 4gb

#

you can store in DB the location of the image

dusk sequoia
#

ahh do i need to pay them to use it or i do get some free trials?

spark flint
#

nope no payment needed

#

cheap as fuck

#

10gb free then $0.01 per gb after

dusk sequoia
#

could i dm u>

#

?

spark flint
#

sure

#

i'll reply in a bit since i'm heading out for food 🔥

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

dusk sequoia
#

@spark flintpls accept the req just irritated by the captcha lol

#

@spark flint

sage bobcat
#

One message removed from a suspended account.

surreal sage
#

Linux PIDs already getting into the millions aPES2_Scared

lyric mountain
#

guess I found the alternative to using github as a cdn

#

what do these class A/B ops mean?

north cairn
#

Can someone suggest a good site to host my bot at

#

Bot isn't staying on idk why

#

No errors..

spark flint
lyric mountain
lyric mountain
#

like edits?

spark flint
#

see there

lyric mountain
#

it's basically read/write ops then

#

welp, at least the limit is big enough, and I do caching anyway

north cairn
#

We can host bots

#

On websites

lyric mountain
#

no, but you can on virtual servers

north cairn
#

How does bots like dank,carl stays on forever

lyric mountain
#

by hosting on virtual servers

#

like hetzner, contabo, oracle, digital ocean, galaxygate, etc

north cairn
#

Are they fre

#

Free*

lyric mountain
#

make a guess

north cairn
#

No ig

lyric mountain
#

pinpoint

#

oracle has a free tier but it's...subpar

north cairn
#

Ok then what does websites like uptimerobot does

lyric mountain
#

and being oracle, they can cease the services at any moment

north cairn
#

Or betteruptime

lyric mountain
#

replit might still work, but the performance aint very good

spark flint
#

my API that handles over 1.5m requests a month was deemed inactive KEKW

lyric mountain
#

lmao

spark flint
#

luckily i have 3 api nodes, the load balancer auto migrated to the other 2 servers

north cairn
#

Why not give it a try

#

I can't afford any payments for now to host

lyric mountain
#

I mean, by "payments" we're talking about like $7 per month

#

but replit will suffice if your bot is small enough

peak drum
#

U may use mine if you use JavaScript

#

@north cairn ^

north cairn
#

What u mean by "mine"

#

@peak drum

peak drum
#

i have a vps you may use my panel to host your bot

#

dm me

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

peak drum
#

i dont i have a pterodactyl panel xd

peak drum
rustic nova
#

ah yes

#

lemme just compromise my bots integrity by giving someone else access to my bot

neon leaf
rustic nova
#

yes I do

sage bobcat
#

One message removed from a suspended account.

neon leaf
#

well you arent giving him alot more access than he would have with just knowing the ip

#

because ptero containers dont run as root so you cant escape

lyric mountain
#

there's the opposite case

#

the host being able to access the bot

neon leaf
#

ah thats what he meant

#

yeah thats a risk

surreal sage
#

bro what

#

i zipped something up with winrar

#

and its like

#

4-5x bigger than the original size

lyric mountain
#

what did u compress?

#

also, I'd recommend 7zip instead

surreal sage
#

nvm

#

i uhh

lyric mountain
#

unless u bought winrar for some reason

surreal sage
#

added a file

#

i cut a video

#

in parts of 10 mins

#

and i put the original video with the zip

#

😃

lyric mountain
#

video cant be compressed (it already is)

surreal sage
surreal sage
lyric mountain
#

ah ok

lyric mountain
#

it's faster, smaller, better and doesn't break the law

surreal sage
#

meh

#

😃

wheat mesa
lyric mountain
#

fuck discord, gimme the inline urls back

#

this line specifically

#

tbh the entire license is talking about purchasing it

boreal iron
#

man... just download and insert the fucking rar.key file and that's it

wheat mesa
#

djs try not to have 15 major breaking version changes in 2.3 nanoseconds challenge (difficulty impossible)

quartz kindle
#

they even made breaking changes to their website and docs lnao

rigid maple
#

I guess I shouldn't have made it white 💀

#

but i don't think it will be a problem

lyric mountain
#

tho I can't see a thing in that image lmao

rigid maple
#

Nevermind 😃 i just need to convert to ttf file

#

first I took it apart from photoshop and put it in illustratore as transparent png, I think this creating a problem

opaque acorn
#

any ftp extension for vsc?

quartz kindle
opaque acorn
still thunder
#

Help do bot

solemn latch
#

What do you need help with?

rose warren
gilded plankBOT
#

@still thunder

Your question is likely answered by one of pinned messages.
Please take time to read the pinned messages by clicking on this icon.

sharp geyser
still thunder
#

Help create bot pls

wheat mesa
#

not specific enough

still thunder
#

What

#

I use bot designer

wheat mesa
#

Almost nobody here is going to be able to help you with a bot designer program, they're pretty bad and restricting

still thunder
#

What bad ?

wheat mesa
#

Not to mention you have not asked a specific question, we can't do much with "Help create bot"

still thunder
#

Yes

#

Yes

#

Look cool

#

And for fun

#

I am mobile

#

I cant ?

gusty linden
#

Are Music bots allowed on top.gg

gusty linden
# still thunder I cant ?

Are you broke af? If yes then look at app store or Google play for a coding platform if not then download visual studio code for mobile

pale vessel
#

just make sure you don't set a video thumbnail as an image inside an embed

peak drum
pale vessel
#

it would get rejected for showing nsfw images in a non-nsfw channel

#

oddly enough, if you put the image as the embed thumbnail, it should be okay

#

but it's safer to just not include any image in the embed

peak drum
#

Alright good to know thnx xD

restive shell
#

Does anyone here have experience with discord-hybrid-sharding? It's an amazing tool but with TopGG it seems to report incorrect numbers (1k members when there's about 36k). Had to revert back to discordjs sharding manager for the mean time but hoping someone has some ideas

pale vessel
#

isn't that @tired panther's package?

tired panther
earnest phoenix
#

Why is in <code> ?

#

Code:

<body>
    <style>
        @keyframes textAnimation {
            0% {
                background-position: 0% 50%;
            }
            100% {
                background-position: 100% 50%;
            }
        }
        .h1-gradient {
            background: linear-gradient(
                to right,
                #738adb 20%,
                #ffffff 30%,
                #738adb 70%,
                #ffffff 80%
            );
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
            color: transparent;
            background-size: 500% auto;
            animation: textAnimation 5s ease-in-out infinite alternate;
        }
    </style>
    <center>
        <div class="part1">
            <h1><span>👋 Hello, </span><span class="h1-gradient">there!</span></h1>
            <span>Welcome to the GuildManager page. Find out more about how it works and how useful it is</span>
        </div>

        <div class="part2">
            <h2>🤖 What is GuildManager?</h2>
            <span>GuildManager is a system offering you to get your own Discord bot completely free of charge.</span>
            <span>It offers continuous hosting and has multiple commands that you can embed into your bot because yes, you and only you choose which commands you want your bot to have!</span>        
        </div>

        <div class="part3">
            <h2>❓ How does it work exactly?</h2>
            <span>It's simple. If you want to set up your bot with our system, just run the command <b>/setup new</b> and include your bot's identifier and token.</span>
            <span>We then install your bot and once that is done, you will have access to the monitoring and management commands for your bot.</span>
        </div>

        <div class="part4">
            <h2>💽 Are my data protected?</h2>
            <span>Yes, it is a requirement.</span>
            <span>All the data of your bot that you transmit to us or that the bot transmits itself are 100% secure in a database where only the sole developer has access.</span>
            <span>In addition, the data is end-to-end encrypted, which further secures your use and the behavior of your bot within Discord servers.</span>
        </div>

        <div class="part5">
            <h2>Can I access the files that my bot runs? Can I access the files that my bot runs?</h2>
            <span>No it's impossible.</span>
            <span>We can't afford to give you access rights to the files your bot is running.</span>
            <span>On the one hand since they are our property and on the other hand, this will represent a major risk for all the bots that we propel since all the data of all the instances that we host are common but not accessible.</span>
        </div>
    </center>
</body>```
#

I don't have <code> key here

civic scroll
#

@earnest phoenix do you host the website somewhere

earnest phoenix
civic scroll
#

yeah so the thing is you are using md

#

iirc center tag can only be used with text and imgs and not divs

#

or not

#

hang on

#

just remove the spaces

#
<body>
    <style>
        @keyframes textAnimation {
            0% {
                background-position: 0% 50%;
            }
            100% {
                background-position: 100% 50%;
            }
        }
        .h1-gradient {
            background: linear-gradient(
                to right,
                #738adb 20%,
                #ffffff 30%,
                #738adb 70%,
                #ffffff 80%
            );
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
            color: transparent;
            background-size: 500% auto;
            animation: textAnimation 5s ease-in-out infinite alternate;
        }
    </style>
    <center>
        <div class="part1">
            <h1><span>👋 Hello, </span><span class="h1-gradient">there!</span></h1>
            <span>Welcome to the GuildManager page. Find out more about how it works and how useful it is</span>
        </div>
        <div class="part2">
            <h2>🤖 What is GuildManager?</h2>
            <span>GuildManager is a system offering you to get your own Discord bot completely free of charge.</span>
            <span>It offers continuous hosting and has multiple commands that you can embed into your bot because yes, you and only you choose which commands you want your bot to have!</span>        
        </div>
        <div class="part3">
            <h2>❓ How does it work exactly?</h2>
            <span>It's simple. If you want to set up your bot with our system, just run the command <b>/setup new</b> and include your bot's identifier and token.</span>
            <span>We then install your bot and once that is done, you will have access to the monitoring and management commands for your bot.</span>
        </div>
        <div class="part4">
            <h2>💽 Are my data protected?</h2>
            <span>Yes, it is a requirement.</span>
            <span>All the data of your bot that you transmit to us or that the bot transmits itself are 100% secure in a database where only the sole developer has access.</span>
            <span>In addition, the data is end-to-end encrypted, which further secures your use and the behavior of your bot within Discord servers.</span>
        </div>
        <div class="part5">
            <h2>Can I access the files that my bot runs? Can I access the files that my bot runs?</h2>
            <span>No it's impossible.</span>
            <span>We can't afford to give you access rights to the files your bot is running.</span>
            <span>On the one hand since they are our property and on the other hand, this will represent a major risk for all the bots that we propel since all the data of all the instances that we host are common but not accessible.</span>
        </div>
    </center>
</body>
earnest phoenix
#

❤️

eternal osprey
#

suppose i copy a channel and delete the original channel

#

would this new channel have the same id as the oc one

deft wolf
#

No

eternal osprey
#

or would it have a different id

#

clone that was the correct word*

still thunder
#

O

primal sky
#

How add bot?

eternal osprey
#

i see

lyric mountain
#

ids are unique, so "same" doesn't exist

neon leaf
cinder trellis
#

Hello

still thunder
#

Hi

#

Do you need help ?

restive shell
tired panther
restive shell
# tired panther could you send the link of the package
GitHub

Top.gg Auto-Posting made easy. Contribute to jpbberry/topgg-autoposter development by creating an account on GitHub.

peak drum
#

Thnx 😂 now I don’t have to setup my own webserver for posting stats on top.gg xd

hushed robin
#

😮‍💨

#

hi

tired panther
civic scroll
#

but for you to properly do code you will need your phone set up

#

you will at least need a terminal

still thunder
#

318

#

😈

civic scroll
#

but out of all that i'd recommend having a compooter

hushed robin
#

whats that

lyric mountain
still thunder
#

With code

peak drum
hushed robin
#

clan?

still thunder
#

Yup

#

Server

civic scroll
still thunder
#

With 700 people 😈

civic scroll
hushed robin
#

token grab?

spark flint
#

clan for what KEKW

hushed robin
#

what

still thunder
hushed robin
#

that sounds sussy

lyric mountain
#

@rustic nova sussy topic here

hushed robin
#

bruh

civic scroll
spark flint
rustic nova
#

brr

#

no tos topics please

#

thanks

still thunder
hushed robin
#

🧑‍🌾

tired panther
lyric mountain
#

ah ok

neon leaf
#

will this make sure everything it outputs is at max 64kb?

class PassThrough64K extends Duplex {
    constructor() {
        super({
            read() {},
            write(chunk: ArrayBuffer) {
                let chunkCount = Math.ceil(chunk.byteLength / size(64).kb()), index = 0
        
                while (chunkCount) {
                    this.push(chunk.slice(index, index + size(64).kb()))
                    index += size(64).kb()
                    chunkCount--
                }
            }
        })
    }
}```
(when passing in ArrayBuffers)
tired panther
earnest phoenix
#
  1. The forEach() method doesn't wait for promises to resolve, use a for loop, unless you don't care about that
  2. In this case that file variable will be initialized in every iteration, so it'll always be 0 regardless of you incrementing it, put it outside the forEach() call
wheat mesa
#

(Also incrementing inline inside of a function call can be difficult to read, but you do you)

clever torrent
#

I need help with making a bot

#

I want to make and add this to my server but I have no idea on how to do it

earnest phoenix
runic junco
#

hi

#

check my bot please

deft wolf
#

Okay, im gonna check it

winter pasture
gilded plankBOT
#

@runic junco

topgg When will my bot be reviewed?

Currently our average bot reviewal time is around one week or more.

Because of this — and because some bots take longer to review than others due to their features — we can't guarantee your bot will be reviewed as quickly as someone else's in the past and we also can't guarantee your bot will be reviewed within that timeframe. There is no exact time for how long bot approval can take. There is no way to check your bot's position in our reviewal queue, but remember you're not first and you're not last!

You may edit your bot's page as much as you like both before and after it's reviewed and this will have no impact on its place in queue.

You can read more about our bot reviewal process in this support article: How the Bot Reviewal Process Works.

topgg_ico_bulb In the meantime, please make sure your bot follows all of our Bot Guidelines for a quick and smooth approval!

clever torrent
eternal osprey
#

does anyone know a good button style, color, etc for java?

#

that will match my background cuz i am lost

quartz kindle
#

for java?

#

lmao

eternal osprey
#

javafx

earnest phoenix
clever torrent
earnest phoenix
#

It doesn't require any knowledge of GitHub nor coding, just follow the steps, it's very straightforward

clever torrent
#

So the first thing I have to do is fork it and just add everything on that, right?

#

and the rest is what you've just explained

earnest phoenix
#

You can choose to fork it but that's not necessary, you can just directly clone the repository using Git

#

Though if you want to fork it then make sure to make it private, or else others would be able to see your credentials

clever torrent
#

Ohhh ok

#

Thank you

earnest phoenix
#

You're welcome

tough star
#

Um guys.. is GalaxyGate good enough for discord bot hosting ?

quartz kindle
boreal iron
#

Incredible performance at a much lower cost like I heard

quartz kindle
boreal iron
#

Nope

quartz kindle
#

where

boreal iron
#

Tf Tim

#

You're drunk?

#

Hetzner

quartz kindle
#

ah lol

boreal iron
#

Should check them out

#

The benchmarks in the forums are damn good

quartz kindle
#

pretty nice

#

2 cpus and 4gb for the same price as 1 cpu 2gb

#

no US locations yet tho

boreal iron
#

Not yet but soon

quartz kindle
#

nice

#

idk if the C lib i need works on arm

#

gonna need to test that out

boreal iron
#

Sooner or later a lot of stuff will probably port to ARM

#

Or literally rewritten

#

I mean the efficiency of this architecture is a lot better

#

Dunno much applications that require a high single core Glock other than gameservers

#

It will most likely become the future technology for the next few years

sage bobcat
boreal iron
#

Ah lol

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.

boreal iron
#

Didn't even notice but auto correct is doing fun stuff sometimes

neon leaf
#

mostly letters are flipped or completely different

feral aspen
#

My chrome suddenly started using 100% of the CPU for a couple of days now and has been laggy, any reasons as to why?

feral aspen
#

Look at this, WTF.

quartz kindle
#

lmao

feral aspen
#

Alright, I've pressed such so.

quartz kindle
#

so look for which tabs are using a lot of cpu and ram

#

maybe theres a leak in one of them

feral aspen
#

I have to monitor, right?

quartz kindle
#

or an infinite loop, or a crypto script idk

quartz kindle
#

all tabs that are not active should use 0%

feral aspen
#

Hmm, I'll see what stats show next time I lag.

feral aspen
#

It updated once and got this.

#

And it crashed, chrome just closed its process. I re-installed Chrome, hopefully it's fixed now.

quartz kindle
# feral aspen

GPU process is for graphics rendering, often used by video players

#

it should not be running on its own, there is usually always something else using it

feral aspen
#

Yeah, however, it keeps going like this then crashes:

#

Browser increases in memory footprint then closes the entire chrome process.

wheat mesa
#

I know there’s some webpages that have memory leaks somehow and cause my browser to fill up on memory until I eventually crash, it could be a tab you have open

summer torrent
#

nvm it is browser's task manager

lyric mountain
#

There's a setting to disable that tho

#

But it becomes sluggish, esp on windows

quartz kindle
#

yeah sometimes there are weird bugs about it

#

ive seen both "fix this by enabling hardware acceleration" and "fix this by disabling hardware acceleration"

wet wedge
#

help?

wheat mesa
#

Help… with what?

sharp saddle
peak drum
#

In discord.js v14 you need to add const { channelType } = require("discord.js") then you can do canalTexto.type == channelType.guildText

If I remember correctly

#

@wet wedge

wet wedge
#

is discord v13

peak drum
#

Then it should work xD

wet wedge
peak drum
#

But your vanTexto won’t return true

wet wedge
#

sure?

peak drum
#

No I’ll give you an example hang on

#

You can send the embed like this interaction.reply({ embeds: [embed]})

#

If you already replied to the interaction you can send it like this interaction.channel.send({ embeds: [embed]})

#

Remove the if statement

#

You don’t need to check if it exist or if it’s a text channel because in order to execute a slash command those are required you can’t send a slash command in a voice channel and you can’t send a slash command in a channel that doesn’t exist

deft wolf
#

But you can send slash commands in dms

#

With bot ofc

peak drum
#

^

#

Goodluck @wet wedge 🤗

wet wedge
wet wedge
civic scroll
peak drum
#

Remove this if (canalTexto && canalTexto === 'GUILD_TEXT') {}

civic scroll
#

they must log something in the console

peak drum
civic scroll
#

nah don't do the "probably"

civic scroll
#

i want you to do the following

peak drum
#

Alright your choice xD it doesn’t run because if it

civic scroll
#

first, click on the line of the statement to assert breakpoints

#

then hit F5 to enter debug mode

#

run the command again

peak drum
#

You don’t need to check if interaction.channel exist because it needs to exist to run the slash command xD

wet wedge
#

@peak drum could you connect and see my screen on the voice channel?

wet wedge
civic scroll
#

did you understand the code you wrote

deft wolf
#

Im not sure about interaction.guild.me

civic scroll
#

again, try debugging first

civic scroll
wet wedge
civic scroll
#

what are you waiting for? test it

deft wolf
#

Ah, okey

#

Mb

civic scroll
#

you don't even open the console ExuGone

#

bro's not debugging fr

wet wedge
civic scroll
#

i don't say prove

#

i said, run the bot and test the command again

wet wedge
#

xd

civic scroll
#

stop the instance, hit F5 in VSC

#

now we are talking

peak drum
#

XD

civic scroll
#

now revert the code to original

#

okay see that line 16 in editor?

#

hover on the line number to reveal red dot, click on it

peak drum
#

Yea goodluck xD

civic scroll
#

bro changed file PensiveWobble

#

line 16

wet wedge
#

????????

civic scroll
#

you don't see line numbers?

#

damn

civic scroll
peak drum
#

You know what I’ll run it real quick xD

#

See what it does

wet wedge
#

I don't understand

civic scroll
wet wedge
#

you lost me at the part of removing the if

peak drum
civic scroll
#

watch my screen now

#

bro didn't even understand debugging

wet wedge
#

ah

civic scroll
#

the point of the debugger is to inspect runtime behaviour

#

the line numbers are on the left

#

i want you to hit a breakpoint at line 16, where the if statement lied

sharp geyser
#

Who uses debuggers? Just know every possible way your code can error

civic scroll
#

@wet wedge not debug console, the code editor

#

@wet wedge

#

see the gray "16" on the left??

#

hover on it

#

those are line numbers

wet wedge
#

YES

civic scroll
#

hover your mouse on the number itself

#

you will see a red dot

wet wedge
#

but I don't understand what I have to do

civic scroll
#

click on that red dot to insert a breakpoint

civic scroll
#

and click

#

DAMNIT

#

look at my stream again

peak drum
civic scroll
#

yeah good

#

now, run the bot again

#

and then do the same thing that lead to your problems earlier

#

by running a command idk

#

then the program will hang (it's fine because the breakpoint has been hit)

#

yeah now redo what's causing your problem

#

instead of showing me the logs

#

okay

#

wait

#

hover on the variables

#

like canalTexto

wet wedge
#

And now?

civic scroll
#

HOVER ON IT

#

see its value

#

this thing

#

hover on the variables

#

do you get what i say

#

hover on this exact thing

#

so the channel is present

#

now hover on this

#

or scroll down to see the type field

#

hover on "type"

#

for me

#

thanks

#

yeah you see

peak drum
#

try defining the canalTexto like this ```js
const canalTexto = interaction.guild.channels.cache.find(c => c.id == interaction.channelId)

civic scroll
#

the value is GUILD_VOICE and you were comparing equality with GUILD_TEXT
so the comparison failed and the block never ran

civic scroll
#

also don't use that

peak drum
#

xD

civic scroll
#

the cache is already a Collection

#

you can use .get

#

@wet wedge don't do anything

#

at this moment

wet wedge
#

module.exports.run = async (client, interaction) => {
  const player = client.poru.players.get(interaction.guild.id);
  if (!player) return;

  if (!interaction.guild.me.voice.channel) {
    player.destroy();
  } else if (interaction.guild.me.voice.channel.members.size === 1) {
    // Si solo hay un miembro en el canal (el bot), detener la música y desconectarse
    player.stop();
    player.destroy();

    const canalTexto = interaction.guild.channels.cache.get(interaction.channelId);

    if (canalTexto && canalTexto.type === 'GUILD_TEXT') {
      const embed = new Discord.MessageEmbed()
        .setTitle('Música Detenida')
        .setDescription('No hay nadie en el canal de voz. La reproducción de música se ha detenido.')
        .setColor('#ff0000')
        .setTimestamp();

      await canalTexto.send({ embeds: [embed] })
        .catch(error => console.error('Error:', error));
    }
  }
};```
civic scroll
#

and it's not GUILD_TEXT so the condition canalTexto.type === 'GUILD_TEXT' failed thus the block did not execute

#

that could happens because voice channel has its own text channel inside it

#

you might want to change the condition

wet wedge
#

do not hit me Ojitostristes

civic scroll
#

i assume you can write that code means you have some familiarity with coding itself and the ide you are using

#

smh

wet wedge
civic scroll
#

big question.
did you write all this by yourself

wet wedge
civic scroll
#

did you actively participate in the bot's coding

#

if not, you should learn now

#

what you were using are old js

wet wedge
#

I only did the headler and the commands, to each his own

civic scroll
#

module.exports was for CJS legacy

civic scroll
wet wedge
#

learning something new for me is very difficult and even more difficult to put it into practice.

civic scroll
wet wedge
#

is question?

wet wedge
peak drum
#

canalTexto.type === "GUILD_VOICE"

wet wedge
rustic nova
#

cloned bot lol

lyric mountain
#

aurel smelling cloned bots from a mile away lmao

wet wedge
deft wolf
#

Bot cloned from github

wet wedge
#

it's not a clone if we basically change 80% of the code

neon leaf
#

with code do you mean translations

deft wolf
#

When changing to v14, you will have to rewrite even more code yourself

wet wedge
#

several functions of the code such as skip and play did not work and we had to rebuild the code.

#

and almost all the code was obsolete

#

we also added embedded messages and adapted the code to make it work.

#

we only use the event structure

pale vessel
#

thumbnail as embed image Monkas

#

that's one way to get declined

peak drum
#

😂

deft wolf
#

There's nothing NSFW on YouTube TROLL

lyric mountain
#

human anatomy educational videos: my time to shine has come

earnest phoenix
#

SORRY

wet wedge
neon leaf
frosty gale
#

can you give a bit of detail and steps on what you do to go from compressing to decompressing and seeing the result?

neon leaf
#

well decompressing is just typical browser stuff, nothing special, for the server it worked fine until I started respecting backpressure of streams, so Im pausing when I hit the backpressure of my writestream (not actually one but the same rules apply) and once I wrote my data I resume it: https://pastes.dev/U7RDKLiiPQ

frosty gale
#

so everything works fine when you dont pause/resume the compression?

neon leaf
#

yeah, I suppose the 500kb limit is just when backpressure starts being too much

fallen talon
#

can anyone help me?

deft wolf
#

If you don't tell us what we're supposed to help you with, how are we supposed to help you?

fallen talon
#

is about this

#

for some strange reason it does not send the message of the new video uploaded

slender wagon
#

It's against our morals

fallen talon
earnest phoenix
fallen talon
earnest phoenix
#

Huh?

slender wagon
#

she is prolly not calling the function

fallen talon
slender wagon
#

oh

earnest phoenix
slender wagon
#

that's on the api u are using

slender wagon
fallen talon
slender wagon
slender wagon
earnest phoenix
# fallen talon shows a quota exceeded error

That's coming from the YouTube API you're using, it means that you've reached the maximum amount of times you can make a request to it for today or for whatever duration it has set

slender wagon
#

you might try to set the limitators for your users tho

fallen talon
fallen talon
slender wagon
#

Projects that enable the YouTube Data API have a default quota allocation of 10,000 units per day, an amount sufficient for the majority of our API users

#

here is a listing of their quota "cost"

#

so you can sort of manage

fallen talon
#

is there another way to get it but without the api?

slender wagon
#

unsure

fallen talon
#

:c

earnest phoenix
#

@fallen talon you're making a request to their API every 10 minutes, I would recommend making a request every 30 minutes to avoid exceeding the quota as the YouTube Data API is pretty strict about usages

fallen talon
#

:c

earnest phoenix
#

That's a bit of a though luck then, the YouTube Data API gives you 10,000 quota points to spend on API requests, each time you make a request to the search.list endpoint, it costs 100 points, basically you can only make 100 requests

fallen talon
#

:c

earnest phoenix
#

The only thing you can do to avoid that issue is to scrape data from YouTube but that goes against their ToS

fallen talon
#

What if I don't use the api?

rigid maple
#

How can I train a font in tesseract.js

earnest phoenix
fallen talon
#

What can I do?

earnest phoenix
rigid maple
fallen talon
# rigid maple i have a font file and i want to train tesseractjs

To train Tesseract.js with a custom font, you'll need to follow a series of steps. Here's an overview of the process:

Prepare Training Data:

Create training images for each character in the font. You can use software like Adobe Photoshop or GIMP to generate images with the desired font.
Generate corresponding ground truth files (GT files) for each training image. GT files contain the text that Tesseract should recognize from the training images.
Generate Box Files:

Use the Tesseract training tools to generate box files from your training images and GT files. Box files contain information about the location and size of each character in the training images.
You can use the tesseract command-line tool provided with Tesseract OCR to generate box files.
Create Training Data:

Combine the training images and box files to create the training data required by Tesseract.
Use the tesseract tool to create the training data by running a command similar to the following:

tesseract [image].tif [output-base] nobatch box.train
Generate Traineddata:

Use the training tools to generate the traineddata file, which contains the trained model.
Run the following command:

unicharset_extractor [output-base].box
mftraining -F font_properties -U unicharset -O [output-base].unicharset [output-base].tr
cntraining [output-base].tr
combine_tessdata [output-base].
Train Tesseract.js:

Now that you have the traineddata file, you can use it with Tesseract.js.
Include the traineddata file in your Tesseract.js project and use it for OCR recognition with your custom font.
Please note that training Tesseract is a complex and time-consuming process that requires a good understanding of the tool and the training data preparation. It may require multiple iterations and adjustments to achieve satisfactory results. For more detailed instructions and examples, you can refer to the Tesseract documentation and training guides available online.

slender wagon
slender wagon
slender wagon
#

or chatgpt

slender wagon
fallen talon
slender wagon
#

yes you have the built-in fetch

#

you can just use fetch(whatever params)

fallen talon
#

I asked bard if I can use something else instead of the api and those liberias came up.

fallen talon
rigid maple
fallen talon
#

I learned it the hard way

earnest phoenix
# fallen talon can I use axios and cheerio?

Yes though avoid using Axios, use the global built-in Fetch API, for example:

import { load } from 'cheerio';

const html = await fetch('https://youtube.com/@xQcOW/videos')
  .then((response) => response.text());

const $ = load(html);

// Scrape
#

(@xQcOW being the channel username)

fallen talon
fallen talon
earnest phoenix
#

Correct, replace TU_CANAL with the channel ID

fallen talon
wet wedge
sage bobcat
#

One message removed from a suspended account.

radiant kraken
#

god this is so annoying

why the hell does this request returns 400 in Flask

POST /webhook HTTP/1.1
Authorization: Bearer asdf
Connection: close
Content-Type: application/json
Host: someurl.repl.co
User-Agent: topgg (https://github.com/top-gg/rust-sdk) Rust/

{"server_count":3000,"shard_count":null,"shards":null,"shard_id":null}

/webhook source:

@app.route('/webhook', methods=['POST'])
def webhook():
  print(request.headers['Authorization'])
  print(request.is_json) # True
  data = request.get_json() # fails here
    
  print(data)
  return 'OK'
radiant kraken
#

wth is wrong with Flask

sharp geyser
#

You’re doing something wrong

radiant kraken
#

what's wrong with this json string

{"server_count":3000,"shard_count":null,"shards":null,"shard_id":null}
sharp geyser
#

Well you’re sending asdf as your token silly

#

Show me your token 😉

radiant kraken
sharp geyser
#

But nah seriously let me take a look real quick

#

Nothing inherently looks wrong with that

sharp geyser
#

It might be that the api itself isn’t getting sent valid json

radiant kraken
#

its a test data

#

for testing my rust SDK's autoposter

sharp geyser
#

Mmmm

#

Yea I don’t see anything wrong myself unless I’m just blind

radiant kraken
#

damn i must be blind

peak drum
#

Ask chatgpt sometimes it truly helps

#

Just ask what could be wrong with your code and it gives some reasons as of why and provides you with an example of how to fix it

#

It doesn’t always work but it’s worth a try

civic scroll
peak drum
#

Yes I did xD but to lazy

civic scroll
#

shut cho lazy ahh up

#

a language model can not understand context

peak drum
#

But most of the time it does

civic scroll
#

your code might reference other parts outside of it

civic scroll
#

you never know if llm introduce another vulnerability to your code

peak drum
#

True but you don’t copy past

#

Just use it as a reference

civic scroll
#

even so, having a wrong direction to aim into is also wrong

#

circle down, inspect values

#

atop being lazy

radiant kraken
#

with print() statements

#

still didn't work

peak drum
#

Lmao that is how I debug 😂

civic scroll
#

you don't print

#

you assert breakpoints

radiant kraken
#

idc

#

if it works it works

civic scroll
#

like literally halt the program's execution to inspect

radiant kraken
#

how do you assert breakpoints

civic scroll
#

with print it just continue running

civic scroll
#

and make sure you have a debugger installed

radiant kraken
#

i'm not using vscode

sand meteor
#

Where can I share code??

radiant kraken
#

i'm on the replit editor here

civic scroll
#

click on line number

civic scroll
sand meteor
civic scroll
#

huh

#

then send a pastebin link

#

duh

#

if your code's short you can send here

#

depends on what

#

there is also #topgg-api if you have problems about it

#

for other stuffs then this channel

radiant kraken
#

@civic scroll the breakpoint didn't work

#

i don't think it works with servers

civic scroll
#

should work with any

#

hang on

radiant kraken
#

again

#

back to the problem

#

request.get_data() yields a b''

#

despite the request content being ```
POST /webhook HTTP/1.1
Authorization: Bearer asdf
Connection: close
Content-Type: application/json
Host: theurl.user.repl.co
User-Agent: topgg (https://github.com/top-gg/rust-sdk) Rust/

{"server_count":3000,"shard_count":null,"shards":null,"shard_id":null}

sand meteor
civic scroll
#

HTTP 400 (Bad Request)

#

maybe get_data doesn't parse the entire body

radiant kraken
#

it does parse the entire body

#

that's the point of request bodies

#

here's the request body as a rust string literal ```rs
"POST /webhook HTTP/1.1\r\nAuthorization: Bearer asdf\r\nConnection: close\r\nContent-Type: application/json\r\nHost: theurl.repl.co\r\nUser-Agent: topgg (https://github.com/top-gg/rust-sdk) Rust/\r\n\r\n{"server_count":3000,"shard_count":null,"shards":null,"shard_id":null}"

radiant kraken
#

@civic scroll OH I FINALLY FIXED IT

#

i forgot a Content-Length header

peak drum
#

XD

civic scroll
earnest phoenix
radiant kraken
#

nothing

wary kettle
#

I get Error: Missing Server Count

#

Please help

civic scroll
#

send error stack trace and the code that you think is problematic

wary kettle
# civic scroll send error stack trace and the code that you think is problematic
const { plural } = require('../Structures/Utils');
const { Client, Intents } = require('discord.js');
const { AutoPoster } = require('topgg-autoposter');

module.exports = {
  event: 'ready',
  async run(bot) {
    // Set initial presence
    let totalUsers = 0;
    bot.guilds.cache.forEach((guild) => {
      totalUsers += guild.memberCount;
    });
    bot.user.setPresence({
      activities: [
        {
          name: `${totalUsers.toLocaleString()}`,
          type: 'WATCHING',
        },
      ],
    });
    bot.logger.success(`${bot.user.tag} is now logged in!`);
    bot.logger.info(
      `Loaded ${bot.commands.size} commands for ${bot.guilds.cache.size} guild${plural(bot.guilds.cache.size)}.`
    );

    // Update presence every hour
    setInterval(() => {
      totalUsers = 0;
      bot.guilds.cache.forEach((guild) => {
        totalUsers += guild.memberCount;
      });
      bot.user.setPresence({
        activities: [
          {
            name: `${totalUsers.toLocaleString()}`,
            type: 'WATCHING',
          },
        ],
      });
      bot.logger.info(`Updated presence with ${totalUsers.toLocaleString()}.`);
    }, 60 * 60 * 1000); // 1 hour in milliseconds

    const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES] });

    const ap = AutoPoster('key', client);

    ap.on('posted', () => {
      console.log('Posted stats to Top.gg!');
    });

    ap.start();
  },
};
#
Error: Missing Server Count
    at Api.postStats (/workspace/FWbot/node_modules/@top-gg/sdk/dist/structs/Api.js:84:19)
    at DJSPoster.post (/workspace/FWbot/node_modules/topgg-autoposter/dist/structs/BasePoster.js:64:18)
#

This is the code and the error

#

"discord.js": "^13.12.0",

deft wolf
#

Theres no client

#

Change it to bot

#

Or, no

#

Wait

wary kettle
#

ooo

#

it worked

deft wolf
#

Why do you create client in ready event

wary kettle
wary kettle
#

it doesnt update

earnest phoenix
wary kettle
radiant kraken
earnest phoenix
#

It's alright

earnest phoenix
wary kettle
#

But the server count on top.gg isnt changing

#

does it take time?

earnest phoenix
#

That's literally why I'm telling you to show your new code, and it shouldn't log that twice at the same time

#

It shouldn't take that long to update I'm sure

civic scroll
wary kettle
#

It's working now

#

just took some time

celest swan
#

Seome know where to advertise my bot?

deft wolf
fast fulcrum
neon leaf
#

does anyone know if nginx respects proxy-authenticate headers in any way?

quartz kindle
#

its only ever used when returning a 407 error

#

idk if nginx automatically adds it when returning a 407, but possibly not because the header is used to specify which authentication method is needed, which has to be configured

earnest phoenix
civic scroll
earnest phoenix
#

Oh

civic scroll
#
  1. why
#

i'm not asking you

#

did you write that code?

latent rapids
#

What happens when you reach 100 votes? I forgot.

summer torrent
#

$15 credit

hushed robin
#

guys whats the best tool for web scraping in javascript

spark flint
hushed robin
wheat mesa
#

Me when web scraping is against 99% of websites’ TOS’s

hushed robin
#

it's not

wheat mesa
#

Well then tell us what website you’re scraping

hushed robin
#

but i'm not anymore

#

because it's made so badly

#

too hard to scrape

spark flint
pale vessel
#

it's really good

#

it's basically jquery

hushed robin
#

i tried it

#

but i didn't figure out how to do what i wanted to so i quit

pale vessel
#

I see

#

what a bummer

hushed robin
#

❤️‍🔥

#

i think it's mostly the websites fault

stark abyss
#

pov: you write code with trial and error without learning

      for (let key in data.tags.customizedTags) {
        const pictureUrl = data.tags.customizedTags[key][Object.keys(data.tags.customizedTags[key])];
        const pictureKey = key;

cursed

stark abyss
#

messy as it looks, does what I want it to

hushed robin
#

looks fine to me

stark abyss
#

I think I made it too complicated

hushed robin
#

🧐

pale vessel
#

🗿

hushed robin
#

😱

pale vessel
hushed robin
#

guys can i ask a question

stark abyss
lyric mountain
hushed robin
#

it is

#

it's just badly made

#

l website tbh

lyric mountain
#

But it did succeed against a scrapping attempt

hushed robin
#

😐

#

side effect of being badly made

lyric mountain
#

If you want to be a scrapper you need to understand that you're in the grey zone

#

Scrapping isn't illegal, but they'll do everything they can to prevent you from doing it

hushed robin
#

no

#

this isn't purposely done to prevent scrapping

lyric mountain
#

It might also be generated by some framework

hushed robin
#

this is not a corporate website the website is made with one of them website builders

lyric mountain
#

React for example generates utterly ugly html

hushed robin
#

squarespace i think it's called

lyric mountain
#

There's your answer then

#

It's ugly because it's generated

#

Html will only be readable if the site was written with html

hushed robin
#

how can i make it less ugly

lyric mountain
#

You don't

hushed robin
#

i wanna scrape it but it's so messy

#

idk how to do it with all this mess

lyric mountain
#

As I said, if u wanna scrap you'll need to fight the environment

hushed robin
#

😵‍💫

#

that sounds hard

lyric mountain
#

Nobody will make it easier for scrappers

hushed robin
#

i am not a scrapper

#

💀

lyric mountain
hushed robin
#

so

pale vessel
#

give up

civic scroll
#

wait till bro find out style classes gets refreshed every render

hushed robin
#

awhile ago

#

☹️

pale vessel
#

it's ok to give up

#

you can try again later

#

or never again, that's fine too

hushed robin
#

i don't think it's possible

#

so yes never again

pale vessel
hushed robin
#

👿

quartz kindle
#

what do you even want to scrap?

#

if its in the actual source, then its easy

#

it doesnt matter how ugly the code is, its just a matter of finding a substring in a string

#

if what you want isnt in th source, then its gonna be much harder

hushed robin
#

what is the source

pale vessel
hushed robin
#

this does not help

fast fulcrum
#

Just 6h 🍿

hushed robin
#

🖐️

jaunty basalt
#

Hey someone, plz help me.
So I created an add emoji command which adds an external emoji to the server, the code works perfectly with a non-animated emoji, but as I try this with an animated emoji, I get the error message (that I put in the catch err statement).
Please help me fix it.

Code: https://sourceb.in/m6gzl0k86S

#

My bot just respond with the reply that i put in catch err statement. I can't log error in the console since I am out of my city so I can't use PC

#

If anyone don't mind, then please try running this code with an animated emoji and tell me how to fix, please!

civic scroll
#

yeah they are random (depends on UI library they are using)

#

either that or the class are gonna be extremely generic

hushed robin
#

im not an html programmer