#development

1 messages Ā· Page 62 of 1

spark flint
#

am i stupid

#

yes

#

ok

#

😭

lyric mountain
#

map is a function

boreal iron
#

Show the code please

boreal iron
tribal crow
spark flint
#

so js if (member._roles.some(role => staffRoles.includes(role => role.id))) return 0; else if (member._roles.some(role => highLevels.includes(role => role.id))) return 3600000; else if (member._roles.some(role => mediumLevels.includes(role => role.id))) return 7200000; else if (member._roles.some(role => lowLevels.includes(role => role.id))) return 10800000; else return 21600000;

#

or am i misinterpreting this

boreal iron
#

Both are just items of your array, aren’t they?

fervent moss
#

Im stupid i cant figure out this thing...
I'm making an /emoji-search command
I cache emojis from client by a doecifig term and set it in array now how do i do it like emojis show up in button when i use command and laso when i press button it get added to server?

spark flint
#

yeah

boreal iron
#

So array.some(role => other_array.includes(role));

spark flint
#

how did it take this long for me to get this sorted

boreal iron
spark flint
boreal iron
earnest phoenix
spark flint
#

yes

boreal iron
#

lmao

spark flint
#

yeah but what does that have in relation to yandev

#

idek what that means 😭

earnest phoenix
lyric mountain
spark flint
#

ah

earnest phoenix
#

C# - didn't expect that there kappalul

surreal sage
#

Anybody know a dependency where you can input HTML and get a .png returned?

#

Kinda like making a puppeteer screenshot but without puppeteer

#

Ping on response

lyric mountain
#

you cannot "input html and get an image"

#

those libs use some kind of internal browser to render the webpage and THEN screenshot it

earnest phoenix
#

as someone who uses shard for the first time in his life, this is good


userCount: async function (client) {
    var count = 0;
    var shard_guilds = await client.shard.broadcastEval((c) =>
      c.guilds.cache.map((guild) => guild.id)
    );
    shard_guilds.forEach((guilds_S) => {
      guilds_S.forEach((guild) => {
        count += client.guilds.cache
          .get(guild)
          .members.cache.filter((member) => !member.user.bot).size;
      });
    });
    console.log(count);
  },
lyric mountain
#

html by itself is just code, useless without a browser to interpret it

earnest phoenix
#

No need of specifically a browser to render HTML and get a picture out of it

earnest phoenix
lyric mountain
#

the var

#

never use var, always let

lyric mountain
earnest phoenix
lyric mountain
#

either use let or const, depending if u need to change the value or not

#

never var, var is a curse from darker times

boreal iron
#

Java devs trying to make the world better but infecting 3 billion devices with their malware

#

smh

lyric mountain
#

without java you'd not have credit cards

boreal iron
#

IM PAYING CASH BITCH

lyric mountain
#

php programmer most wanted by interpol

boreal iron
earnest phoenix
#

return count why Promise { <pending> }

var count = 0;
    const shard_guilds = await client.shard.broadcastEval((c) =>
      c.guilds.cache.map((guild) => guild.id)
    );
    shard_guilds.forEach((guilds_S) => {
      guilds_S.forEach((guild) => {
        count += client.guilds.cache
          .get(guild)
          .members.cache.filter((member) => !member.user.bot).size;
      });
    });
    return count;
#

(for of)

lyric mountain
#

var, again

#

and use forof for iterating, instead of forEach

#

forEach is pretty bad for its overhead

earnest phoenix
#

that's why var mer const cannot be edited

lyric mountain
#

use let

earnest phoenix
#

oo

#

and I know it will be for of

lyric mountain
#

let is literally the non-psycho version of var

#

use userCount for retrieving guild user count

#

or memberCount, I don't remember

#

instead of retrieving the member cache

earnest phoenix
#

filter bot

#

member count includes bots

lyric mountain
#

yes

earnest phoenix
#

console.log anyway
returns the value

lyric mountain
#

then the error isn't there

earnest phoenix
#

oo

lyric mountain
#

if console.log is returning the value, that is

earnest phoenix
#
tools.userCount(client).then((err) => {
      console.log(err);
    });

return 4
why

lyric mountain
#

cache usually doesn't keep everything at all times

#

so it'll never return the real value

earnest phoenix
#

How can I find out the truth?
bots filtered out

lyric mountain
#

well that's an issue

earnest phoenix
#

pretty good

lyric mountain
#

I imagine u have some kind of xp system right?

#

or currency, whatever

earnest phoenix
#

I don't have any at the moment, I just want to write the user numbers in the status, but it doesn't show the truth

lyric mountain
#

do u have anything that stores users in the database?

earnest phoenix
wheat mesa
#

That’s… not how that works 😭

earnest phoenix
#

not yet but there will be

wheat mesa
#

await tools.userCount(client)

#

You have to await promises

lyric mountain
#

it'd be better if u used your database to get the user count

earnest phoenix
#

await aaaaaaaaa

wheat mesa
#

Otherwise you’ll be constantly spamming the API and potentially getting ratelimited

earnest phoenix
#

Requests it every 15 seconds

wheat mesa
#

Yeah. That’s bad

#

Because there is no ā€œusercountā€ endpoint, it is getting the counts of each guild one by one

earnest phoenix
#

since KuuHaKu said db that's why I'm going to use it

lyric mountain
#

well, db as in any kind of persistence you might come to use

#

for sql it'd be a simple SELECT COUNT(1) FROM users

earnest phoenix
#

I'm pretty good at db

#

but thanks

lyric mountain
#

"at db" ok

earnest phoenix
#

@lyric mountain so how is this api stuff?
Client.js (MEssage create)

if (message.author.bot) return;
    if (message.channel.type === 'DM') return;
    // Add a connect listenerű
    let prefix = cc.prefix;
    let lang = cc.lang;
    socket.emit('getServerData', {
      guild: message.guild,
    });
    socket.on('getServerData', (res) => {
      prefix = res.prefix;
      lang = res.lang;
      if (message.content.startsWith(prefix)) {
        const [cmdName, ...cmdArgs] = message.content
          .slice(prefix.length)
          .trim()
          .split(/\s+/);
        const command = client.commands.get(cmdName);
        if (!command.data) {
          if (command) {
            command.run(client, message, cmdArgs, prefix, tools);
          }
        }
      }
    });

ws (socket.io)

let con = app.con;
socket.on('connect', (socket) => {
  socket.on('getServerData', (res) => {
    con.query(
      `SELECT * FROM guilds WHERE id=? LIMIT 1`,
      [res.guild.id],
      (err, row) => {
        if (row.length === 0) {
          con.query(`INSERT guilds SET id=?, name=?`, [
            res.guild.id,
            res.guild.name,
          ]);
        }
        socket.emit('getServerData', {
          prefix: row[0].prefix,
          lang: row[0].lang,
        });
      }
    );
  });
});
#

problem 😢

#

for the second message, the socket returns value twice

lyric mountain
#

Because u have .on inside .on

#

So for each connect event, u start listening to getServerData

#

Connect doesn't happen only once

earnest phoenix
#

where?

#

oo

lyric mountain
#

Second line from ur second code

earnest phoenix
#

ok, but if there is no connect, the socket will not receive the other events

#

for the second message, message content console.log

#

duble send

earnest phoenix
#

bug fixed

boreal iron
lyric mountain
#

connect is an event by itself

#

put inside it what u need to run after estabilishing connection, ONLY

#

not other events

earnest phoenix
#

I've been using it ever since and it works perfectly, so thank you for your kindness, kisses on the cheek ā¤ļø

lyric mountain
#

doesn't mean it's the proper way to do it

boreal iron
#

never change a running system

rustic nova
#

discord

#

for fuck sake

tribal crow
boreal iron
#

${userFtchd.username}#${userFtchd.discriminator} is the issue

#

a member object doesn't have that properties

#

an user object does

#

so access the user object

#

userFtchd.user.username

#

userFtchd.user.discriminator

#

or much more easier

#

replace ${userFtchd.username}#${userFtchd.discriminator} by ${userFtchd.user.tag}

#

The Discord "tag" (e.g. hydrabolt#0001) for this user

tribal crow
#

aaaah

#

i forgot

#

lemme try

#

tysm

boreal iron
#

šŸ‘

worthy egret
#

bro can someone add Rem the discord bot because im trying on fucking top.gg but it does not wanna work

tribal crow
#

Ok i don't know if this is a problem or if its a result of them not being in the same server as the bot, but rn it only displays the people from one server

worthy egret
#

pls help me i want the rem bot

boreal iron
#

dude, this isn't a support server for whatever bot

worthy egret
#

jesus christ im just saying i cant get the fucking bot i do the im not a robot type of shit because i am trying so fucking hard and i feel like ninja losing fucking fornite

tribal crow
#

Do you have a minute, FakE?

#

or

#

many minutes?

wheat mesa
#

Go to their support server

worthy egret
#

😦

#

ok thanks

wheat mesa
#

We don’t know anything about specific bots

tribal crow
#

nvm

boreal iron
worthy egret
#

i dont fucking know where the fuck is the fucking support server

boreal iron
#

stop crying around like a kid, my gosh

#

we don't know either

tribal crow
# boreal iron sure, what's up

ok so whenever it continues (after finding users thats no longer in the same guild as the bot), it just skips them. I want to then place #4 to #3, #9 to #4 and then keep going like that until it reaches #10

boreal iron
#

you need to do it differently entirely

quartz kindle
#

push them to a new array for example

boreal iron
#
const users = UserProfiles.sort((a, b) => b.bank - a.bank);
const members = [];

for(const user of users)
{
    const guild = interaction.client.guilds.cache.get(user.guildID);
    
    if(!guild) continue;
    
    const member = await guild.members.fetch(user.userID);
    
    if(!member) continue;
    
    members.push(member.user);

    if(members.length === 10) break;
}

for(let i = 0; i < members.length; i++) embed.addField(`#${i + 1}`, `${members[i].tag} - \`⌬ ${fNum(user.bank + user.wallet)}\``);
#

keep in mind what I said earlier

#

that's an horrible solution and you will get ratelimited hard, probably

tribal crow
#

im trying somehting rn

boreal iron
#

what I wrote as example will iterate through your user list until you have 10 reachable members

#

or until any sorted user has been "looped throgh"

tribal crow
#

so i will get ratelimited by using that code?

#

better with 5?

boreal iron
#

will it could happen, yes but probably not

#

it would make sense to store 10 user IDs in an array then request them at once but yeah...

#

I assume you will be fine, might take a second or two

tribal crow
#

ok so when i try to log the money thats in [i]'s bank, it somewhy logs 2 different banks

#

it logs [i]'s bank and someone elses

boreal iron
#

Hmm?

#

You need to show us what you mean

tribal crow
#

let dbUser = await UserSave.find({ userID: `${members[i].id}` }); console.log(dbUser[i].bank)

#

when logging

#

it logs [i]'s bank and one other bank

#

the other bank is the same bank if i log dbUser[x] (x = any number)

boreal iron
#

Where’s the code?

#

Inside the loop?

#

Also why dbUser[i]?

#

Is it an array as result of your database request?

#

I doubt

tribal crow
#

yeah

#

its inside the for loop

#

when i log dbUser[i]

boreal iron
#

There are two for loops freerealestate

#

Just show me a screenshot of the code please

#

Ah I see what u mean

#

I didn’t notice the user.bank and wallet

#

before members.push(…) just add member.user.data = user;

#

Then in your last line when pushing the embed field change user.bank to members[i].data.bank

#

Same for wallet

#

I didn’t notice you actually don’t need the entire user object, but just the tag

#

Gonna update my code real quick

#
const users = UserProfiles.sort((a, b) => b.bank - a.bank);
const members = [];

for(const user of users)
{
    const guild = interaction.client.guilds.cache.get(user.guildID);
    
    if(!guild) continue;
    
    const member = await guild.members.fetch(user.userID);
    
    if(!member) continue;
    
    user.tag = member.tag;

    members.push(user);

    if(members.length === 10) break;
}

for(let i = 0; i < members.length; i++) embed.addField(`#${i + 1}`, `${members[i].tag} - \`⌬ ${fNum(members[i].bank + members[i].wallet)}\``);
#

This one will do the job

tribal crow
boreal iron
#

Yeah this doesn’t include a check if the member exists in multiple guilds

#

Log bank and wallet

tribal crow
#

would that be hard to do

boreal iron
#

I wonder why they are nan

#

No it’s not hard to do

tribal crow
#

same

tribal crow
boreal iron
#

Did u log bank and wallet?

tribal crow
#

wdym

boreal iron
#

console log bank and wallet inside the second loop to see why it’s NaN

tribal crow
#

they no longer are tho

#

with that code

boreal iron
#

Ah

#

Now the name is undefined again?

tribal crow
#

yep

boreal iron
#

Lemme see if the property was already used

#

One second

#

Please add console log user directly after members.push()

#

And show the console log output

tribal crow
boreal iron
#

Oh the object is probably frozen

#

Ok try to replace the line user.Tag = member.tag by:

let tmp = user;
tmp.tag = member.tag;
members.push(tmp);

#

Don’t add two times members.push() please

#

I assume the database result is a frozen object which means we can’t modify it like adding the tag property

#

We will know for sure if that’s working

tribal crow
#

stays the same

#

undefined name, money works

boreal iron
#

Please log tmp now and show a screenshot of the code

#

Just to make sure

tribal crow
boreal iron
#

Why topten.length

#

And Not members.length

#

Also remove the database query of the second loop

#

Entirely

tribal crow
#

forgot to replace it before i took the pic

#

but its members. now

boreal iron
#

Ok it’s still not editable

#

Wtf

#

Ok then let’s do this:

#
const users = UserProfiles.sort((a, b) => b.bank - a.bank);
const members = [];

for(const user of users)
{
    const guild = interaction.client.guilds.cache.get(user.guildID);
    
    if(!guild) continue;
    
    const member = await guild.members.fetch(user.userID);
    
    if(!member) continue;
    
    members.push({ tag: member.user.tag, data: user });

    if(members.length === 10) break;
}

for(let i = 0; i < members.length; i++) embed.addField(`#${i + 1}`, `${members[i].tag} - \`⌬ ${fNum(members[i].data.bank + members[i].data.wallet)}\``);
#

This will work

#

Dunno why the copied object wasn’t editable, too

#

That’s beyond my JavaScript knowledge

tribal crow
#

tag is still undefined

earnest phoenix
#

The tag property does not exist on a guild member

tribal crow
earnest phoenix
#

You're supposed to access the user property which is the user object of the guild member, and then access the tag property

tribal crow
#

so member.user.tag?

earnest phoenix
#

Yes

tribal crow
#

eeey

#

it works

#

tysm voltrex and fake

boreal iron
#

Man i fucked up my own shit

#

Told him it doesn’t exist and still provided the wrong code

#

lmao

tribal crow
#

ok

#

still have some minutes, fake?

boreal iron
#

I updated the code above

#

But I’m working right now

#

So I’m not available unfortunately

tribal crow
#

thats fine

#

thanks for helping me!

boreal iron
#

So go on

earnest phoenix
boreal iron
#

For real

#

Couldn’t even remember what I was telling him 5 mins ago

#

That’s the critical line

#

Guess I’m too old already for this shit mmLol

tribal crow
#

those mins over?

boreal iron
#

Go ahead

#

Still something wrong with it?

#

We blame Voltrex then for it

#

Oh no

#

He’s still here

tribal crow
#

nope, just need help making the code that makes it max 1 guild per user

#

so like the guild they have the most money in

boreal iron
#

Uhm

#

Why didn’t you tell me that earlier?

#

You just want the highest user per guild in your leaderboard?

tribal crow
#

no

tribal crow
boreal iron
#

Ah

#

Quite simple

#

All you have to do is to search members before doing members.push() if there’s already an user object with the same ID in there

#

If so, you edit the wallet and Bank properties and add the current value to it

#

The inventory etc doesn’t seem to matter for this leaderboard, so it doesn’t need to be changed

earnest phoenix
#

anyone know the code to keep a bots message at the very bottom even if someone sends a message into the text channel?

boreal iron
#

Right before member.push()

#

I hate mobile coding

#

Lemme paste it together

#
const users = UserProfiles.sort((a, b) => b.bank - a.bank);
const members = [];

for(const user of users)
{
    const guild = interaction.client.guilds.cache.get(user.guildID);
    
    if(!guild) continue;
    
    const member = await guild.members.fetch(user.userID);
    
    if(!member) continue;
    
    const findUser = members.indexOf((member) => member.data.userID === user.userID);

    if(findUser)
    {
        members[findUser].data.wallet += user.wallet;
        members[findUser].data.bank += user.bank;
    }
    else members.push({ tag: member.user.tag, data: user });

    if(members.length === 10) break;
}

for(let i = 0; i < members.length; i++) embed.addField(`#${i + 1}`, `${members[i].tag} - \`⌬ ${fNum(members[i].data.bank + members[i].data.wallet)}\``);
tribal crow
#

tysm!

boreal iron
#

Err that will not work

#

find creates a new array

#

One second

#

Lemme edit the code once again

#

should be working bow

#

Thank you auto correct

surreal sage
#

Is it possible to simulate document.active whilst it isn't active using puppeteer

#

?

#

Window focus*

boreal iron
#

@tribal crow keep my update in mind

uneven tartan
#

ive got a lil bit right here

#

const mentioned=roleIDs.some((roleId) => message.content.includes(roleId));

#

returns t/f ofc

#

however i need the id

#

any idea?

#

damn i talk everyone dip 😭

wheat mesa
#

I don't understand the question

quartz kindle
#

or filter with includes if you want more than one id

boreal iron
earnest phoenix
stark abyss
lament rock
radiant kraken
#

hi, i need a help with C's variadic arguments

this is the main function that declares it:

size_t args_count = cprintf_count_args(start);

printf("args count: %d\n", (int)args_count);

if (args_count == 0) {
  return false;
}
    
va_list vl;
va_start(vl, args_count);

then that function calls another function and passes the va_list to said function, it seemed to have crashed here:

const char * s = va_arg(vl, char *);

i don't see any reason to crash here, anyone have an idea?

#

do va_list only work if it's used in the same function that declares it?

neon leaf
#

Because of some Limitations I need to set my postgres db to C.UTF-8 instead of de_DE.UTF-8, will that break anything?

lyric mountain
#

Mysql is the weirdo that has 533 different collation for each table

#

Whatever ur doing is probably related to database locale, not charset

#

In which case, it'd only break local datetime, since the timezone offset would change

#

So you'd need to update your columns to reflect this change

spark flint
#

How can i emit a message from a Socket.io client with Node.js?

sharp geyser
pale vessel
#

you're not helping

lyric mountain
spark flint
#

I tried that

#

Didn’t work

lyric mountain
#

check the docs then

#

tho I'd recommend using actual websockets instead of socket.io

#

but it depends on what ur using it for

spark flint
#

its for a lil proxy system im making

#

using a websocket is proving to be more efficient

#

for my bot, its making API request to a user set URL, and its making the request from a 2nd VPS with all the details being sent via websocket

lyric mountain
#

you should use a websocket then

#

socket io has way more overhead than a normal socket

#

plus it's not guaranteed to use sockets 100% of the time, it'll happily switch to polling in certain situations

earnest phoenix
ocean jay
#

Quick question, does HTML or MD work while making a Long Description for my bot?

rustic nova
#

yes both work

ocean jay
#

Ah okioki tyyy

radiant kraken
earnest phoenix
# radiant kraken Does it have to be `char` though? Documentation and examples on `va_start` are v...

yes you can pass in ints, but you have to tell the compiler what type of argument you expect the va_arg to return, in this case you are getting a string so you have to tell it that you are getting a string (char *), now if you want to use int, you will have to tell it that you are getting an int argument with the va_arg, there are many types you can use, you need to find the one that you want and use it in the va_arg, if you want to pass a string, use char *, if you want to pass an int use int, etc...

radiant kraken
#

what do you pass in the second argument

#

it confuses me

earnest phoenix
earnest phoenix
radiant kraken
#

fixed it, apparently it was because of me passing a va_list by value instead of a pointer (i expected for va_list to be an alias to a pointer type... oh well)

reference stack overflow thread: https://stackoverflow.com/questions/3168056/va-arg-returning-the-wrong-argument

radiant kraken
#

how did this even segfault iara_why_sob i literally just called a function

main.c:

#include <cprintf.h>

int main(void) {
  printf("a\n");
  cprintf(NULL, "What's your favorite color? %fr\n", "red!");
  // ...
}

cprintf.h:

#include <stdarg.h>
typedef struct { ... } cprintf_t;

// CPRINTF_EXPORT expands to nothing in unix
CPRINTF_EXPORT bool cprintf(const cprintf_t *in, char *fmt, ...);

cprintf.c:

#include <cprintf.h>

CPRINTF_EXPORT bool cprintf(const cprintf_t *in, char *start, ...) {
  printf("CALLED\n");
  // ...
}
``` `a` is printed to the console but not `CALLED` for some reason, it worked in Windows but not in unix platforms
earnest phoenix
radiant kraken
#

what's wrong with that? the NULL pointer hasn't even been used yet

#

using NULL does not automatically mean immediate segmentation fault

earnest phoenix
#

The function dereferences it at the start, so it's probably crashing right away

#

And you should use const char* instead of char*, since you're not modifying the string

radiant kraken
earnest phoenix
#

Assuming that in is a pointer to a struct, it will try to dereference it to get the first member of the struct

earnest phoenix
radiant kraken
#

no? that's how va_list works

earnest phoenix
#

wait

radiant kraken
earnest phoenix
#

The function that cprintf() calls isn't visible outside of the current translation unit because of the CPRINTF_EXPORT macro. On Unix, this macro expands to static, resulting in the function being local to the translation unit. On Windows, this macro expands to __declspec(dllexport), which marks the function for export from the DLL

radiant kraken
#

no, it doesn't, in cprintf.h it's declared as follows:```c
#ifdef CPRINTF_DLL
#ifdef CPRINTF_BUILDING
#define CPRINTF_EXPORT __declspec(dllexport)
#else
#define CPRINTF_EXPORT __declspec(dllimport)
#endif
#else
#define CPRINTF_EXPORT
#endif

earnest phoenix
#

You need to compile both cprintf.c and main.c with the same definition of CPRINTF_EXPORT. What you currently have is a mismatch between the definition of cprintf.c and main.c

earnest phoenix
radiant kraken
#

exactly

#

i wasn't using a DLL

earnest phoenix
#

mhm

radiant kraken
#

i was just testing in WSL

#

i never said i was

#

oop looks like i fixed it on accident

#

it worked when i tried to compile main.c with an object file (cprintf.o) but not when i archive it to a libcprintf.a for some reason

#

i love C/C++ linking so much ā¤ļøšŸ’–iara_inlovenull_inlove

earnest phoenix
radiant kraken
earnest phoenix
#

Discord js v13

#

@ me

radiant kraken
earnest phoenix
#

You are using the non-dll build of the runtime and you are not linking to the static CRT library (msvcrt.lib), so cprintf() is not found

#

there we go

radiant kraken
#

dude

#

i am in linux

earnest phoenix
#

oh LMAO my bad my bad

#

so no more issue?

#

your code has been fixed?

radiant kraken
#

no

#

not at all

#

it working in an object file does not give any clue to what's happening

earnest phoenix
#

try this

main.c:
#include <cprintf.h>

int main(void) {
  printf("a\n");
  cprintf(NULL, "What's your favorite color? %fr\n", "red!");
  // ...
}

cprintf.h:
#include <stdarg.h>
typedef struct { ... } cprintf_t;

// CPRINTF_EXPORT expands to nothing in unix
bool cprintf(const cprintf_t *in, char *fmt, ...);

cprintf.c:
#include <cprintf.h>

bool cprintf(const cprintf_t *in, char *start, ...) {
  printf("CALLED\n");
  // ...
}
#

I did a lot of stuff, but the main thing is that I removed the CPRINTF_EXPORT from cprintf.h and replaced it back in cprintf.c after the function prototype weirdsip

radiant kraken
#

removing CPRINTF_EXPORT won't do anything, since it expands to nothing

earnest phoenix
#

I see, but it actually did something. It changed the function name to cprintf in the header. So when I built it and then did nm on the resulting object file, there was no "_cprintf" in the object file, but there was a "cprintf"

#

but if you want to use that too, wait

#

main.c

#include <cprintf.h>

int main(void) {
  printf("a\n");
  cprintf(NULL, "What's your favorite color? %s\n", "red!");
  // ...
}

cprintf.h:

#include <stdarg.h>
typedef struct { ... } cprintf_t;

// CPRINTF_EXPORT expands to nothing in unix
CPRINTF_EXPORT bool cprintf(const cprintf_t *in, char *fmt, ...);

cprintf.c:

#include <cprintf.h>

CPRINTF_EXPORT bool cprintf(const cprintf_t *in, char *start, ...) {
  printf("CALLED\n");
  // ...
}
#

Output:

a
CALLED
What's your favorite color? red!
radiant kraken
#

what did you even change

earnest phoenix
#

compare the main.c to the old one

#

changed the %fr to %s

radiant kraken
#

that's a part of the library

earnest phoenix
#

%fr is not a valid format specifier weirdsip

radiant kraken
#

that's a part of the library

earnest phoenix
#

what's the matter

#

it's still not a valid format specifier

radiant kraken
#

%fr will make it print as a red text on the screen

#

cprintf is a custom function from the library, which is !== to printf

earnest phoenix
#

If %fr is used, then the program will try to print floating point numbers as a string, and since we are not passing in any floating point numbers as an argument to cprintf(), the program will try to access null pointers and will give segmentation fault error. Thus, %fr was replaced by %s

radiant kraken
#

the problem is that the program can't even reach the first line of the function, that is printf("CALLED\n");

#

the main part of the problem is probably on linking it

earnest phoenix
#

well removing the %fr worked, I can't help you then if that's not what u want

radiant kraken
#

you were mistaking cprintf with formatted standard library functions like printf

earnest phoenix
#

Just wanna ask bot devs here if u have any idea: can bots start forum posts? what about webhooks?

eternal osprey
#

hey guys i have a question about c++ arrays.

#

Imagine my max is [40][60] in a 2d array.

#

Why must i use <= in a for loop when writing to the array

#

but only < when reading?

#
 for(int i = 0; i < NO_OF_ROWS; i++){
    for(int j = 0; j < NO_OF_ROWS; j++){
       
    (universe[i][j] == Live) ? d = LIVE : d= DEAD;
    test += d;
   }
   test+="\n";
   }
   cout << test;```This is reaing
#
 for(int i = 0; i <= NO_OF_ROWS; i++){
    for(int j = 0; j <= NO_OF_COLUMNS; j++){
    z = input.get();
   if(z != EOF){
        if(z == LIVE){
            universe[i][j] = Live;
            
        }else{
universe[i][j] = Dead;

        }```writing
radiant kraken
#

does it change if you switched from <= to < though

eternal osprey
#

yeah

#

it would add a tremendously big number like 3068932053952

#

in my array

radiant kraken
#

you were accessing/modifying the array out of bounds

#

<= won't work since it would access the array out of bounds in the last iteration

eternal osprey
#

if i run a google test wihtout <=

#

it tells me that the array is not correct

#

i will show some more code one moment

#
bool read_universe_file(string filename, Cell universe[NO_OF_ROWS][NO_OF_COLUMNS])
{
ifstream input;
char z;
input.open(filename);
if(!input.fail()){
  
   for(int i = 0; i <= NO_OF_ROWS; i++){
    for(int j = 0; j <= NO_OF_COLUMNS; j++){
    z = input.get();
   if(z != EOF){
        if(z == LIVE){
            universe[i][j] = Live;
            
        }else{
universe[i][j] = Dead;

        }
        
   }else{
    input.close();
    return true;
   }
      
   }
   }
}else{
    return false;
}
    // pre-conditions, post-conditions, implementation
}```
radiant kraken
#

consider this:```js
const array = [1, 2, 3, 4];

for (let i = 0; i <= array.length; i++)
console.log(array[i]);
``` the last output would be undefined, right?

eternal osprey
#

yup because its index starts at 0

#

however that isn't what i find strange

#

it's rather that my google test is telling me that it doesn't work until i use <=

#

instead of <

neon leaf
quartz kindle
#

the last item in the array is reserved for the EOF character

whole quail
#

how can i fix this?

rustic nova
#

by not responding to the interaction before, you have done so on that one if check and done so in the end

sharp geyser
#

I don't miss this chat

wheat mesa
#

I miss developing discord bots but I also don’t

boreal iron
slender wagon
#
pg.query("INSERT INTO premium(id, name, age) values(18, 'Grainger5445', 18)", (err, result) => {
    if(!err) {
        console.log("Here is the resul: " + result.rows);
    }
    console.log(err, result)
    pg.end();
})

Ok so i am trying to insert data using postgres but when i open pgadmin the data doesn't show up in there

lyric mountain
#

oh no

#

please dont store the age as a number

lyric mountain
sharp geyser
#

Why not store the age as a number

#

smh

slender wagon
slender wagon
lyric mountain
#

most pg libs work with transactions

#

think of it as a "bulk edit"

#

it doesn't confirm the changes until u commit

#

it makes sure there are no concurrency issues

lyric mountain
slender wagon
#

i am not finding the command to actually commit

solemn latch
#
slender wagon
#

yes

solemn latch
#

iirc, if you're just using queries you don't need to commit. that's only for transactions.

slender wagon
#

then why is it saying no rows found on pgadmin

boreal iron
#

what's tje result and/or error?

slender wagon
#
Result {
  command: 'INSERT',
  rowCount: 1,
  oid: 0,
  rows: [],
  fields: [],
  _parsers: undefined,
  _types: TypeOverrides {
    _types: {
      getTypeParser: [Function: getTypeParser],
      setTypeParser: [Function: setTypeParser],
      arrayParser: [Object],
      builtins: [Object]
    },
    text: {},
    binary: {}
  },
  RowCtor: null,
  rowAsArray: false
}
boreal iron
#

hmm, looks like 1 row count was affected

#

and you're sure the table doesn't hold the row?

slender wagon
#

positive

boreal iron
#

inserting multiple times without ignoring should return an error

#

so if that's not the case, it's indeed not inserting

#

is the database locked?

slender wagon
#

i tried like 3 times

#

and no error

#

same result

lyric mountain
#

try committing, just to be sure

#

queries aren't excluded from transactions

slender wagon
slender wagon
lyric mountain
#

if db was locked it'd fail

#

both optimistic and pessimistic locks would return an exception

lyric mountain
#

check the docs

slender wagon
#

bruh i cannot find anything about commits

boreal iron
slender wagon
#

i might as well be blind

boreal iron
#

probably

#

soon

#

finally

neon leaf
#

how can I make a function require json options so it shows in vscode? (nodejs)

quartz kindle
#

either jsdoc comments or typesdcript declarations

neon leaf
#

how exactly would the jsdoc be for jsons?

lyric mountain
#

u dont jsdoc a json, u jsdoc a model

#

jsons cant have comments

earnest phoenix
#

Well they can, JSONs with comments exist but you can't declare a type definition for it in it's own JSON file

lyric mountain
#
{
  "comment": "This is technically not a comment"
]
neon leaf
#

I think I wrote that bad, I have a json object as an argument and want to document its possible values

lyric mountain
#

that's uhhh...I don't think reverse documentation is possible

#

not without a model

earnest phoenix
# neon leaf I think I wrote that bad, I have a json object as an argument and want to docume...

Then you can use JSDocs, using the typedef directive allows for such declaration, for example:

/**
 * @typedef {object} Bar
 * @prop {string} baz
 * @prop {number} [biz]
 * @param {Bar} bar
 */
function foo(bar) { ... }

You can also do it this way:

/**
 * @typedef {object} Bar
 * @prop {string} baz
 * @prop {number} [biz]
 */

/**
 * @param {Bar} bar
 */
function foo(bar) { ... }

To separate the typedef declarations

neon leaf
#

thank you so much!

#

how can I put multiple jsdocs in one file without them overlapping each other?

sudden geyser
earnest phoenix
boreal iron
#

ujm

rustic nova
#

ah yes have my spaghetti code be used on rockets

sudden geyser
#

either submit your code or get in the bread line

boreal iron
#

I guess Tim will need quite a few more donations

#

To buy that

#

finish typing voltrex

#

can't wait the entire day for you

earnest phoenix
earnest phoenix
boreal iron
#

lol

#

shut up smirk

#

Why dd is so fucking slowly, Mr. Voltrux?

#

should probably use rsync instead

#

my fucking gosh

#

that will take forever

maiden urchin
#

Hey

#

Does anyone know why a server would refuse to load my bot's Integrations.

#

There's a server that persistently wont show my bot on its Integrations page thus loads no slash commands. I can't recreate it on my server or a test one at all (The bot is in 4 shards total)

#

It works for them literal days after an update but whenever the bot is update that server has like 2-3+ days of downtime

boreal iron
#

Did they already try to kick the bot and reinvite?

maiden urchin
#

Yep multiple times

boreal iron
#

probably a broken server then

#

saw already so much people complaining about issues with bots, permissions, guild settings not saving etc.

lyric mountain
maiden urchin
#

Many

#

Too many for me to count

lyric mountain
#

iirc the limit is 50 integrations

maiden urchin
#

Maybe 30+

#

Yep, I counted and they have 50 total @lyric mountain

#

tysm.

#

I notified the issue was that

boreal iron
#

interesting that's the limit

#

good to know

lyric mountain
#

lul

rustic nova
#

ah yes

#

guilds with over 50 bots

#

much

boreal iron
#

must be chaos

earnest phoenix
sharp briar
#

I couldn't imagine 50+ bots in one server. We have like 20 and that's more than enough to accomplish everything we need them to and even have backup automod in case one goes down for maintenance

quartz kindle
sharp briar
#

Dammmnnnnn

quartz kindle
#

every single approved bot was added

sharp briar
#

That's a bit different though it's not a regular server

quartz kindle
#

ye lul

round cove
round cove
#

I think Xig or Marco used a bot.

lyric mountain
stable eagle
lyric mountain
#

It is, people use fire to deprive fire of oxygen

surreal sage
#

{ ...object[key], key: key }
This is in an object.keys for each loop,
Let's say object[key] is { "test": true }
The end result would be { "test": true, "key": key } right?

#

Or else how would I make that happen

#

(I'm converting an object to an array and I want to know each key when changing data in the original object, I'm iterating over the array to find something)

#

yup nvm

earnest phoenix
#

how to delete comments in top.gg?

quartz kindle
#

yes, the spread operator works in objects similarly to how it works in arrays

surreal sage
#

It's a nice thing

#

why does new Array exist lol

quartz kindle
#

everything in js is objects, and as such they all have constructors

#

there is new Array, new Object, and lots more

surreal sage
quartz kindle
#

in practice tho, most of these are useless, except for very specific use cases

#

new Array for example has one specific use case

#

if you need a fixed size array and you know the length, new Array will give you better performance

#

for example

#

there are no fixed size arrays in js, but its possible to initialize an array with a starting size using the Array constructor

#

which gives you a performance boost as long as you dont exceed it and force the array to be resized

wheat mesa
#

no stinky reallocations needed

quartz kindle
#

i'll reallocate you

wheat mesa
#

reallocate me to a university I want to go to please

quartz kindle
#

you will be reallocated to brazil

wheat mesa
#

if I get to live near you and kuuhaku then I accept

earnest phoenix
#

Can anyone plz tell me what to write in code so that when the button is clicked, then the message gets edited
(Slash command v13)

solemn latch
#

we don't spoonfeed code here, sorry

earnest phoenix
narrow lotus
#

Largatha

quartz kindle
#

or interaction.update()

#

dont remember which

earnest phoenix
#

Ok ty

neon leaf
#

lets say I do something like this

urls.add('/ok')
urls.add('/aaa')

console.log(urls)```

How can I make the result be
```{
  "/ok": 'ee',
  "/aaa": 'ee'
}```
? (nodejs)
#

Yes I need a custom function for it

lyric mountain
#

and no u dont need a custom function for it

neon leaf
#

even if I want functions as content?

lyric mountain
#

u didn't say u wanted functions as content

neon leaf
#
  "/ok": async() {
    console.log('hi')
  }
}```
neon leaf
#

a function to add functions under urls

lyric mountain
#

urls['/endpoint'] = theFunc

neon leaf
#

can I do it with a custom function?

lyric mountain
#
function foobar(endpoint, func) {
  urls[endpoint] = func;
}
#

it's literally the same thing

#

just boilerplate

neon leaf
#

does that also work if the function is in another file? aka that the variable gets assigned correctly?

lyric mountain
#

what variable?

neon leaf
#

urls

lyric mountain
#

urls is supposed to be in a single, main file

#

not in many files

#

can u give me the full context?

neon leaf
#

ok, scrap that, I got it.
Why cant I assign this the urls directly though?

lyric mountain
#

I think u need to declare the field beforehand

#

also u dont need to export it that way

#

u can export the class directly

neon leaf
#

this is the error when just using this

lyric mountain
#

because this cannot be anything else than this

#

it's the same as saying "Blue is yellow" or "I am him"

#

I am i, this is this

neon leaf
#

how can I then make this.urls be the default thing that you get when accessing the class?

lyric mountain
#

you don't

#

that's now how oop works

#

you can, however, extend map

#

that way URLgen will be a subclass of Map

neon leaf
#

🧐

earnest phoenix
#

In which, all of the instantiated instances will have their own values, the default ones in your case if you want to call it that

#

Unless you mean you literally want this.urls object to be returned when you access the class, which won't work because that's not what classes are

#

You can just use an ordinary class, hold this.urls as a property, and access it like <ClassInstance>.urls, which would work just fine

quartz kindle
lyric mountain
quartz kindle
#

ah i misread

lyric mountain
#

what they tried to do is

class URLs {
  constructor() {
    this = {}
  }

  set(url, code) {
    this[url] = code
  }
}
...
const urls = new URLs()
urls.set("foo", "bar")
quartz kindle
lyric mountain
#

it'd work, without the constructor

quartz kindle
#

yeah

lyric mountain
#

tbh the whole thing makes no sense, as I said before it's just boilerplate

#
const urls = {}
urls["foo"] = "bar"
slender wagon
#

hey guys i still can't figure out postgres

#

i am commiting but it doesn't seem to work

#
Result {
  command: 'COMMIT',
  rowCount: null,
  oid: null,
  rows: [],
  fields: [],
  _parsers: undefined,
  _types: TypeOverrides {
    _types: {
      getTypeParser: [Function: getTypeParser],
      setTypeParser: [Function: setTypeParser],
      arrayParser: [Object],
      builtins: [Object]
    },
    text: {},
    binary: {}
  },
  RowCtor: null,
  rowAsArray: false
}
#

dies

lyric mountain
slender wagon
#

yes

#

is there a way i can log the branch i am at

#

but i am pretty sure it's the same one

#

since it's giving me no errors

surreal sage
#

I'm working on image processing, I have a nice large array full of rgba but each rgba values are not in invidual arrays

Aka, 0,0,0,255,0,0,0,255 (2 pixels)
What would be the best way to sort this?

#

Uint8Array*

#

Possibly .subarray() whilst iterating?

#

Or .slice?

lyric mountain
#

(num >> col_index * 8) && FF

#

RGBA = (num >> 8) && FF

surreal sage
#

😨

lyric mountain
#

RGBA = (num >> 16) && FF

surreal sage
#

i am beginner this is intermediate

lyric mountain
#

this is beginner tbh

surreal sage
#

😨

lyric mountain
#

int colors are just arrays but as a number

surreal sage
#

I want to start with having them in proper arrays

#

For each pixel

lyric mountain
#

do what I just told u to

#

also it ain't for each pixel

surreal sage
#

🄶

lyric mountain
#

pixels are encoded in rgba format

#

...can u stop with the emotes?

surreal sage
lyric mountain
#

that ain't how it works

surreal sage
#

R,G,B,A?

lyric mountain
#

no

surreal sage
#

That's how I receive it

lyric mountain
#

no, u receive the number

#

the number is what u want

#

FF FF FF FF
R G B A

#

tho usually I see A at the 4th index

#

but anyway

#

it'd be the same as [255, 255, 255, 255]

#

if u convert to hex [FF, FF, FF, FF]

#

then if u append FFFFFFFF which is a number

#

all u need to do is access the index for the tone u want

#

(num >> 8) & FF is the same as num[1]

surreal sage
#

What does ">> 8 & FF" do?

lyric mountain
#

>> 8 means "shift 8 bits to the right"

#

so FF FF FF becomes 00 FF FF

surreal sage
#

I think you're gonna have to spoon feed me for this one

lyric mountain
#

& FF is a mask, to exclude the other tones

#

so (00 FF FF) & FF becomes 00 00 FF

solemn latch
#

šŸ™ˆ

lyric mountain
surreal sage
surreal sage
lyric mountain
#

just follow the damn formula (num >> index * 8) & FF

#

replace index with the index of the tone u want

#

num is the number

surreal sage
lyric mountain
#

what are those?

surreal sage
#

What I believe I needed

lyric mountain
#

that's a gray square

#

if those are colors

surreal sage
#

I know

lyric mountain
#

then use it?

surreal sage
#

About right

lyric mountain
#

tho u should learn how to extract colors too, very few apis will return pixels as an array

surreal sage
lyric mountain
#

ah yes, yet another dependancy

#

wcgw

surreal sage
#

abt right

lyric mountain
surreal sage
#

"If it works, it works"

lyric mountain
#

where did I put that cow meme

surreal sage
surreal sage
#

8 bit int aka 0 - 255
How could I make this a 0 - 1 float?

lyric mountain
#

you dont

#

well, u could, but why?

#

for that it's simple rule-of-three formula

#

value * max / total

quartz kindle
#

or just divide by 255 lol

lyric mountain
#

yes, I just passed the formula

quartz kindle
#

most people dont speak robot

#

they want english

twin shoal
#

Am I missing something when trying to get an iframe to appear on my bot page?

#

It doesn't seem to work regardless of what I do

lyric mountain
#

Also, is the site https?

twin shoal
twin shoal
lyric mountain
#

Iframe needs a closing tag

#

It can't be self-closed

twin shoal
#

I tried it with one and it didn't work

#

That's why I switched it to a self close

lyric mountain
#

Well self-closing is guaranteed to not work

#

Who's your ssl provider?

#

Cloudflare?

twin shoal
#

Yes

quartz kindle
#

any errors in the console or network tab?

#

it should have an error there if the iframe refused to load or was blocked

twin shoal
#

No, no errors in relation to my site

#

I don't even see the iframe element in the html

quartz kindle
#

using the preview button or saving and refreshing the page ?

quartz kindle
#

tried force reload / disable cache?

twin shoal
#

Yeah

#

I already have cache disabled by default

quartz kindle
#

try a different browser

twin shoal
#

I just did

#

Nothing

quartz kindle
#

indeed theres nothing there

#

either top.gg broken or its removing the iframe, or it didnt save/update your changes

solemn latch
#

šŸ¤” I'm assuming you solved it, seems the iframe is working

lyric mountain
#

Perhaps it's browser issue, if woo can see it

wet apex
#

Hi. Guys I am looking for best and affordable hosting for my small bot that I am planning to expand in near future. Do you guys have any recommendation?

A help would be appreciated a lot. Btw I am looking something for bot with around 1000 servers.

Free feel to ping if you want to help me regarding this :)

lyric mountain
#

Contabo

#

Also u don't need to worry if ur target is 1k servers

#

That's very little for a computer

#

Unless your code is terrible, that is, otherwise focus on polishing it along the way

wheat mesa
#

1k could probably be hosted on free hosts like oracle tbh, unless it’s a music bot

ocean jay
#

The error is in the bin

boreal iron
ocean jay
#

oh, but I do have permission

#

I added the application.commands thingy

boreal iron
#

There’s no permission to set just a scope you have to invite the bot with

#

Then kick the bot and reinvite it using the link including the appropriate scope

ocean jay
#

o okioki

wet apex
# lyric mountain Contabo

I was searching online and found about digital ocean. What is your opinion on that?

Which one is better digital ocean or contabo?

wet apex
boreal iron
#

DO has just the largest amount of bots and compromised servers I know

#

Literally already blocked like half of their entire network

#

(probably more)

#

Not much better than OVH tbh

supple oriole
#

Use contabo.

earnest phoenix
#

use DO

radiant kraken
radiant kraken
earnest phoenix
#

(num >> color*8) & 0xFF;

earnest phoenix
radiant kraken
#

bit-masking is awesome tbh

earnest phoenix
#

Not sure why over complicating stuff

radiant kraken
#

very underrated

#

i can compress an entire function into a one-liner

earnest phoenix
#

https://sourceb.in/1ueLp7Pmuj

This is my button handler. Plz tell me what to write in code so that, only the command user can use the button and if any other person use it, the bot replies- You cannot use this button!

Bc i am doing buttons for the first time

#

Related to discord.js

Plz help!!

woeful hedge
#

I-

earnest phoenix
#

Anyone can help plz?

lyric mountain
#

0xFF = 255
0xFF00 = 65280

dry imp
lyric mountain
#

you need to shift the bytes to the first 2 spots to get a 0-255 range

radiant kraken
#

wait

#

maybe a different constant

wet apex
lyric mountain
#

the formula I passed is the shortest form already

#

shift index * 8 bytes to the right, mask out other bytes

dry imp
dry imp
#

havent tried it myself since i dont really have a bot to scale but i think you should try it

wet apex
midnight haven
#

Hi

#

??

dry imp
#

though i hardly know a bot that uses more than 4gb of ram other than music bots, so its up to you and your bot requirements

wet apex
wet apex
earnest phoenix
#

Old big music bots used in thousands/millions of servers take hundreds of GBs of RAM kryptonShrug

quartz kindle
#

depends a lot on how its built, but for example if a single mp3 file has 3-5mb, put 100 of them in memory and its instantly 500mb, plus if you need to convert the stream into discords format, then its pretty much double the amount for holding the original plus the converted, then when you switch tracks you basically quadruple the amount until the old files are properly freed from memory

wet apex
quartz kindle
#

but the worse is not really memory, its the cpu it takes to convert the audio format live

#

unless all your files are already discord compatible

#

but stuff like youtube for example is not, it needs real time conversion

wet apex
#

Tim what you think how much a bot like mee6 takes when it comes to ram and cpu?

wet apex
quartz kindle
#

hundreds of gb of ram

#

rhythm had several tb of ram

earnest phoenix
#

Yeah

quartz kindle
#

but they probably use distributed systems at that point, so its not a single server

wet apex
quartz kindle
#

for example split the bot into 10 separate servers, each with 256gb ram and 32 cpu cores

wet apex
quartz kindle
#

or if they use stuff like kubernetes for example

quartz kindle
#

then its like thousands of small servers

wet apex
earnest phoenix
#

container orchestration system

wet apex
quartz kindle
#

there is no fast tracking for bot reviews

earnest phoenix
#

Mostly used for easier software deployment, scaling, and management

earnest phoenix
wet apex
wet apex
quartz kindle
#

kubernetes is like

#

you give it a piece of code

#

and it spawns servers for you as needed

wet apex
earnest phoenix
#

k8s are pog

thorny field
#

Wanna make discord bots for people and get money from it, I already made a fiverr gig but does anyone else know where I can get some work?

quartz kindle
#

so as you grow, more and more servers are spawned with the same code

#

automatically

lyric mountain
#

that's why I dropped my music module long ago

#

not worth all the headache and resource drain

shadow stratus
#

Sorry if this is the wrong place to ask, but my discord bot has reached 100 servers and I feel uncomfortable giving discord my ID. If anyone wants to join as a maintainer and help verify it, I would greatly appreciate it. https://top.gg/bot/835198432796737536
I abandoned it for some time because of the ID requirement, but recently started to work on it again

#

Links are currently dead right now, but stack is discord.js, but I've been moving it to typescript. Maintaining the bot isn't exactly a requirement, it's just the ID part that's important

lyric mountain
#

don't trust anyone with your bot

#

for someone else to verify your bot in your place, you'd have to pass ownership to them, meaning that person could simply steal your bot out of the blue

shadow stratus
#

Well my two options are either let it die or find someone I can trust with it, so don't have much choice sadly :/

#

I appreciate the notice though

lyric mountain
#

or you trust discord with your id

#

it's a serious business, if anything happens they get punished anyway

#

it's not like ur giving ur id to some random alley goods dealer

shadow stratus
#

I understand, but I feel like the ID is very unnecessary, it's just a chat app.

lyric mountain
#

not really, they aren't asking your id to use the chat app

#

they're asking because they need to verify you are who you say you are for using sensitive data and potentially destructive endpoints

#

they ask for it so they can prevent you from creating alt accounts for your scams (if any)

shadow stratus
#

I mean, can't they let a bot that doesn't use those endpoints or sensitive data scale without providing an ID?

lyric mountain
#

they cant

harsh nova
#

Doesn’t discord use stripe for id verification?

lyric mountain
#

ye

#

imagine this hypo scenario: you do steam scams to steal people's accounts

earnest phoenix
#

They're trying to prevent bots that scam people after becoming slightly bigger than usual

lyric mountain
#

your bot gets verified and joins in 1000 servers

#

discord bans u after a while

#

u make another account and repeat ad infinitum

#

now add an ID to the equation, the loop is broken

wheat mesa
#

Your ID is only used to prevent abuse

#

IDs are something that a massive company like discord has to be very VERY careful with handling

lyric mountain
#

ye, having one leaked could shutdown discord

wheat mesa
#

They don’t want to steal your identity, they want to protect the users of your bot

lyric mountain
#

well, stripe in this case

earnest phoenix
#

The important part is that Discord doesn't even get to see your ID, only Stripe does

shadow stratus
#

What I mean is that some bots don't want the verified sign. I think verified is cool for people who want the sign, but I think it's a wrong choice for them to let the bots who don't want that sign not scale. People can always create alts and create new bots on those, each one holding 100 users, which makes verification pretty useless in this scenario

lyric mountain
#

since discord doesn't hold any info abt ur id

wheat mesa
#

Huh?

#

That doesn’t make any sense lol

lyric mountain
#

they only hold if ur identity was verified or not

wheat mesa
#

Why would you not want your bot to be verified…

lyric mountain
#

stripe is the one to handle the id

shadow stratus
lyric mountain
#

the sign is just a collateral effect

wheat mesa
#

You’re not verifying for the sign, you’re verifying so that discord can prevent abuse of user data

lyric mountain
#

like, if you're verifying just for the sake of the sign then I'd laugh the hell out of you

wheat mesa
lyric mountain
#

also limiting to 100 servers is to contain the possible damage, way better than having no limit

shadow stratus
#

I mean here is what would be cool:

  • Locked down API
  • Same questions asked but without the ID
  • Can join an infinite amount of servers
wheat mesa
#

Yeah, no

#

Not how that works

#

An ID is a way to prevent abuse by making sure that people have accountability on the internet

#

Otherwise you are completely anonymous to discord and you can just keep abusing their service by creating more accounts and more bots if you get banned

#

They don’t want big bots mishandling large amounts of sensitive user data

lyric mountain
#

ye, discord already tracks your IP, but any vpn could bypass that

#

an ID tho, you cannot fake that legally

earnest phoenix
# shadow stratus What I mean is that some bots don't want the verified sign. I think verified is ...
  1. Verification isn't supposed to be the user's choice, because that's not how verification works
  2. This is a good way to prevent a ton of abuse
    Bot gets verified after you give in your ID -> your ID is held to prevent abuse -> your bot gets detected for abuse -> gets disabled or even removed -> your make another bot and try to get it verified -> declined because you can't provide that same ID, to prevent abuse, unless you have many other IDs
  3. Discord doesn't even see your ID, only Stripe does; which is trusted by millions of people, and many companies use it
lyric mountain
#

and if u do, you have real, legal issues

wheat mesa
#

You can retrieve a lot of sensitive data about users just based on their statuses

#

Imagine if you had a massive bot tracking everyone’s status unknowingly to the users

#

Then it gets banned for that

lyric mountain
#

the only, ONLY thing discord holds is isUserVerified: true/false

wheat mesa
#

Then you just create another bot, and another, and another

shadow stratus
#

I mean if they are allowing bots to get the same data up until 100 servers, is it really sensitive? If a scam bot joins 100 servers, then the scammer can just make a new alt

wheat mesa
#

100 servers is absolutely nothing in the grand scheme of things

wheat mesa
#

They want to prevent abuse in large numbers

#

Imagine if rhythm decided to nuke everyone’s servers when they got shut down

lyric mountain
#

scamming 100 servers is bad, yes, but WAY better than say, 1.000.000

#

discord could simply say "You cannot have your bot in more than 1 server without verification", that'd kill any scam attempt

#

however, people would hate it

#

so they settled at a sane number

#

not too much to be a WOMD but also not too little as to make people mad

shadow stratus
lyric mountain
#

sending a single message is technically destructive with enough servers

#

almost all endpoints become destructive when u reach a certain number of servers

earnest phoenix
#

Also most real bots I've seen have never had an issue with this, they've just provided an ID and never looked back again

lyric mountain
#

isn't stripe used by banking app btw?

earnest phoenix
#

It's not really an issue, except for those who don't have IDs but Discord also provides ways around that, such as providing other types of documents (driver's license, passport), or using other people's documents, such as your friends' or your parents'

shadow stratus
#

Ye, stripe is a banking app I think

earnest phoenix
#

Stripe isn't a banking app, it's used by banks

#

They handle document processing and verification

lyric mountain
#

or using other people's documents, such as your friends' or your parents
in this case, losing the ownership of the bot

#

since u need to transfer during verification

earnest phoenix
#

Yeah, you must transfer it to a team

#

Although you'll still be considered the main owner

shadow stratus
lyric mountain
#

most dont fall for it, but some are just too dumb

#

multiply those "some" by 1000, 10000, 100000, whatever, even in small quantities the damage would be huge

shadow stratus
lyric mountain
#

that'd kill bots that use dms

solemn latch
#

Yeah, lots of unverified bots use dms a lot for valid uses.

lyric mountain
#

ik a lot of bots that show their help command on dms to prevent pollution

shadow stratus
shadow stratus
earnest phoenix
#

That contradicts with the idea of preventing abuse, in an extreme level; so verification literally just gets obliterated out of the way

solemn latch
#

That won't work though.
Our bot luca sends a lot of dms, but its not verified, and it'll never be able to get verified.

earnest phoenix
#

Because a lot of bots don't even use privileged intents and such, which would cause a lot of abuse

lyric mountain
shadow stratus
lyric mountain
#

if I had to be verified to be able to use dms, I'd never reach 100 servers

#

because my bot's sole purpose is said game, which requires dms

#

so I'd need to develop an entirely different bot until I reach verification threshold

shadow stratus
#

So first 100 servers -> same as now, after 100 servers you have two options:

  • Locked down
  • Verification
lyric mountain
#

HOWEVER, it'd not be the same bot after verification, thus people would either remove my bot or lose whatever they set up to it

#

see the problem here?

shadow stratus
lyric mountain
#

that returns to my "bot would need to be drastically changed to conform to api limit changes" point

shadow stratus
#

Well if you need more API requests, you have to verify, which is the same as now pretty much

lyric mountain
#

if my bot could show player hands before 100 servers, but suddenly lost that ability, it'd have to become an entirely different bot after lockdown

solemn latch
#

The solution you are giving imo isn't something the vast majority of bot owners would go for.
Discord would need to do a ton of work for a very small set of bots.

#

It just isnt economical for them.

lyric mountain
#

as much as I hate giving my info to anything, I understand their choice from a technical point

solemn latch
#

A webhook based bot it might make sense to allow that, I guess?
Ie only responding to interactions.

lyric mountain
#

me?

solemn latch
#

No, I mean applications with no server cap without verification.

lyric mountain
#

ah, yes, you have no limit if u only use webhooks

solemn latch
#

Technically speaking is possible now.

lyric mountain
#

tho u also cant get any info abt the server at all

#

but yes, it works

#

btw, not with interactions

#

I mean raw webhooks

shadow stratus
#

Here is an example for where the locked down API is good enough
You have a bot that just replies whenever it gets some a command (like a -weather command that is rarely used)
If the API is limited to 10 messages a minute, and that command is rarely used in an average server, then you won't have any problem at all

solemn latch
#

So discord would never go for something like that

lyric mountain