#development

1 messages Β· Page 229 of 1

desert verge
#

It was 3 audio drivers activated at startup

#

one wavesvc

#

two from realtek

quartz kindle
#

waves is not a driver, its an amplifier/enhancer/effects provider

#

realtek can be split into parts, for example the realtek control panel is a separate program from the actual driver

#

ravbg64 = background process
rtkngui64 = graphical user interface / control panel
waves = effects and shit

desert verge
#

ah ok

quartz kindle
#

on my pc i have like 4 lol, realtek driver, cirrus logic amplifier, dolby audio enhancement

#

and intel smart audio

pearl trail
#

nvidia moment

urban delta
#

guys i need help

#

i don't know why it's not accepting some unicodes

#

but i'm getting this error on unicorde

#
py", line 1240, in load_grammar
    tree = _parse_grammar(grammar_text, grammar_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\User\AppData\Local\pypoetry\Cache\virtualenvs\rp-utilities-2cgrnvKo-py3.11\Lib\site-packages\lark\load_grammar.py", line 969, in _parse_grammar
    raise GrammarError("Unexpected input at line %d column %d in %s: \n\n%s" %
lark.exceptions.GrammarError: Unexpected input at line 93 column 342 in <string>:

u"\u09E0-\u09E3"]/ | /[u"\u09E6-\u09FE"]/
frosty gale
#

whats the actual problem

#

i didnt catch the memo

tiny verge
#

Tes

pearl trail
frosty gale
#

tf

#

definitely tried uninstalling all traces of drivers?

#

reboots as well ofc before trying to install anything

#

just uninstalling them likely doesnt unload them from the kernel

pearl trail
frosty gale
#

if anything that error looks like the hardware is unsupported aka the driver is wrong

#

i'd try getting the hardware name/id of the speaker or whatever youre trying to use and searching it on google

sharp geyser
#

thats what I said!!!

#

Great minds think alike /j

quartz kindle
#

so theres nothing wrong

#

still dont know why the install failed tho, he downloaded the drivers directly from laptop manufacturer

sharp geyser
#

well

#

Unless people are walking to hell

#

I think I fucked up

#

πŸ’€

quartz kindle
#

stairs for cats

sharp geyser
#

bruh

#

ima be real tim

#

I wrote this code

#

but even I dont understand it

#

😭

#

I literally blacked out writing it

quartz kindle
#

you incorporated a spirit who wrote the code for you

sharp geyser
#

ong

sharp geyser
#

the people in the cs50 discord are super nice

#

still not the full solution but I got 1/2 of it done

lyric mountain
sharp geyser
#

indeed

#

I solved it tho

#

and made it print upright

lyric mountain
#

nice

sharp geyser
#
#include <stdio.h>
#include <cs50.h>

int main(void)
{
    int n = get_int("How big do you want the stairs? ");

    for (int i = 0; i < n; i++)
    {
        /**
         * First iteration: i = 0; j = 0; j < 1 (i + 1); j++; print 1 #
         * Second iteration: i = 1; j = 0; j < 2 (i + 1); j++ print 1 #, loop again j = 1; j < 2 (i + 1) print #; loop again j = 2; j < 2 break out;
         * Third iteration: repeat i cant write all that out
         */
        for(int j = 0; j < i + 1; j++)
        {
            printf("#");
        }
        printf("\n");
    }
}
#

This is the first part done

#

but now I have to figure out how to make it go from

#
##
###
####
#####
######
#

to a right aligned one

#

so that will be fun

#

:p

eternal osprey
#

Why does the map like this return me:

#

but with only one element it does actually return me the prices

sharp geyser
#

maybe you have one without a price?

quartz kindle
sharp geyser
#

want to step on my stairs?

#

might fall in

#

but its okay

lyric mountain
#

now put steps on it

#
_
#_
##_
###_
####_
#####
sharp geyser
#

uhm sir

#

Im not doing that

#

πŸ’€

#

that above wasnt even what I wanted

#

I was trying to right align it

#

and fucked up

#

right

#

im doing something wrong

#

I basically want the output like

     #
    ##
   ###
  ####
 #####
######
#

hm

quartz kindle
#

lel

sharp geyser
#

my code no workey tim

#

can you give me some guidance without telling me the answer

quartz kindle
sharp geyser
#

:O

#

Wait thats genius

#

FUCK

#

I did an oopsie

#
#include <stdio.h>
#include <cs50.h>

void print_pyramid(int steps);

int main(void)
{
    int n;
    do {
        n = get_int("How big do you want the stairs? ");
    } while (n < 1);

    for (int i = 0; i < n; i++)
    {
        print_pyramid(i);
    }
}

void print_pyramid(int steps)
{
    for(int i = 0; i < steps + 1; i++)
    {
        for (int j = 0; j < steps - i; j++)
        {
            printf(" ");
        }
        printf("#");
    }
    printf("\n");
}
#

wait no I didn't even do what you said

#

hm

lyric mountain
sharp geyser
#

load-bearing?

lyric mountain
#

it's a joke

#

u forgot the column that sustains the weight of the stair

sharp geyser
#

keep in mind this is for an intro to cs class so I can't use any advanced techniques

lyric mountain
#

and now it's collapsing

sharp geyser
#

I can only use what has currently been taught

#

like variables ,loops, functions and conditionals

lyric mountain
#

it was a jokeeee notlikenoot

sharp geyser
#

oh

lyric mountain
#

also funny enough u kinda made a fibonacci stair

sharp geyser
#

bro dont joke with me rn I am like a noob

#

😭

lyric mountain
#

oh nvm, it's actually 0 1 2 3 4

sharp geyser
#

lol

#

I honestly dk what I should do here

#

I barely got the left aligned stair

#

my original idea was to just print out a x by x box and then replace however many # with spaces to make the stairs

#

but I can't do that and submit it

lyric mountain
#

well, you can do it fairly simply by using the same method you use to make an ascii loading bar

sharp geyser
#

ah yes i've made one of those

lyric mountain
#

u can use the same concept

sharp geyser
#

remember it like it was yesterday

lyric mountain
#

the max would be the number of steps

#

then the % would be the step chars, the remaining would be spaces

sharp geyser
#

I know the general idea of what I need to do

lyric mountain
#

invert it to make it right-aligned

sharp geyser
#

my issue is I can't seem to get it to work

lyric mountain
#

use the loading bar concept, it'll make it much easier for u to mirror horizontally the stair

sharp geyser
#

I just need a hint as to where I should start generating these spaces

quartz kindle
#

from the beginning

#

:^)

lyric mountain
#
char stepChar = '#';
char spaceChar = ' ';
for (int step = 0; step <= steps; step++) {
  for (int i = 0; i < steps; i++) {
    print(i <= step ? stepChar : spaceChar);
  }

  printf('\n');
}
sharp geyser
#

ima be real

#

even if that worked

#

I cant do it

#

I have to use stuff from the lectures

#

and Im also not looking for actual code im looking for guidance

#

I learn nothing by getting just fed code

#

Thank you though

sharp geyser
#

#
#
# 
##
##
#  
## 
###
###
#   
##  
### 
####
####
#    
##   
###  
#### 
#####
#####
#

had to make some changes because of how C is

#
    char stepChar = '#';
    char spaceChar = ' ';
    for (int step = 0; step <= steps; step++) {
        for (int i = 0; i < steps; i++) {
            printf("%c", i <= step ? stepChar : spaceChar);
        }

        printf("\n");
    }
sharp geyser
#

but yea

#

Im not looking for actual code

#

im looking for more of a point in the right direction

#

Im trying to learn CS at a deeper level, the lectures i've taken so far is about how to use conditionals, loops, functions and variables in a efficient way and get you to think how should they be used and when they should be used

#

moreso loops, conditonals and functions

#

What I have so far is correct in a way, its just the problem set wants it right aligned.

quartz kindle
#

its always gonna follow that rule (assuming monospace fonts)

#

so all you need to do is count how many characters are missing from each step, and fill it up with spaces

#

you always print steps-i spaces and i characters

sharp geyser
#

yea

#

hm

#

its just I need to print these spaces along with the #

#

because the # should come after said spaces

quartz kindle
#

yeah

#

print steps-i spaces then print i characters then print newline

sharp geyser
#

right

#

but....how

#

because i've been trying to do that

#

and I assume I need another for loop right?

quartz kindle
#

your main loop is managing newlines

#

so inside that you need another loop to manage characters per line

#

inside the main loop, you can have either two loops, one for spaces, another for #s, or you can have one loop that handles both like kuuhaku showed

sharp geyser
#

I mean

#

Its still not working

#

Oh well

#

ima try again tmrw

quartz kindle
#

then translate gthe code

#

:^)

sharp geyser
#

no ty

#

that would be cheating

#

I dont cheat

quartz kindle
#

how would it be cheating

#

it would be like writing with a pencil then rewriting the same thing with a pen

sharp geyser
#

the problem isnt the language bro

pearl trail
#

ong

sharp geyser
#

doesnt matter what lang I write this in

#

its my thinking

#

im not thinking logically

#

I could attempt this in js and still fail

lyric mountain
#

@quartz kindle what's a good frame size for sending moderately big binaries through websocket

#

like, png images

quartz kindle
quartz kindle
#

unless you wanna be specific for some special use case

lyric mountain
#

well, if I set too low it'll take an eternity to finish no?

quartz kindle
#

you mean spliting a payload into multiple messages right?

#

websocket can do that but doesnt really need to, as tcp will already do it anyway

lyric mountain
#

yep

pearl trail
#
      #
     ##
    ###
   ####
  #####
 ######
lyric mountain
#

wasn't necessary to invert step iterator

#

just replace stepChar with spaceChar

lyric mountain
pearl trail
lyric mountain
#

I've split it into 1024 byte chunks, now it doesn't crash, but idk what's the recommended value

lyric mountain
quartz kindle
#

i believe thats the default for node streams for example

lyric mountain
#

64k? like, no byte rounding?

quartz kindle
#

with byte rounding

#

node default seems to be 16k actually

lyric mountain
#

aight, so 2 ^ 14

quartz kindle
#

nvm

#

The stream will be read in chunks of size equal to the highWaterMark option. In the code example above, data will be in a single chunk if the file has less then 64 KiB of data because no highWaterMark option is provided to fs.createReadStream().

#

nvm again

#

i guess they set 64k for fs, but 16k otherwise

#

ornot

#

lmao

lyric mountain
#

that's confusing lul

#

I'll go with 16k

sharp geyser
#

@lyric mountain @quartz kindle @pearl trail I managed to solve it without using your guys solution

#

It was actually staring me dead in the face 😭

sharp geyser
#

There's the code if any of you want to look at it

#

keep in mind it may not be efficient, but thats not the goal rn

pearl trail
#

damn

#

that looks more complicated than ours

sharp geyser
#

Honestly looking at it

#

and now with my more extensive knowledge on how loops work

#

its easier for me to understand

proud plover
#

Hey, if for example I add "r" rated truth and dare questions in my discord bot. Do I have to change anything on top.gg ?

sharp geyser
#

You will have to lock it to nsfw channels now

proud plover
#

Yea sure, nothing else right?

sharp geyser
#

You can say it now features mature content

#

but you cant mention anything explicitly nsfw

proud plover
#

Um but i was seeing other bots on top.gg which do the same, they haven't mentioned it

sharp geyser
#

You're allowed to say it has mature content, but you can't say what that content is or go into detail describing it

#

If you see any bots doing such, report them and mods will handle it when they can

proud plover
#

No, I mean they haven't mentioned it has mature content

sharp geyser
#

wdym?

#

They just don't say anything?

proud plover
sharp geyser
#

Well that's okay as well

proud plover
#

Why?

sharp geyser
#

The rules on nsfw bots on top.gg is a gray area

#

you can have an ansfw bot, you just can't go out and say its an nsfw bot in detail

#

The only rules is

  1. No nsfw bot pfp
  2. No nsfw name
  3. No nsfw in the description
  4. Nsfw commands must be locked to the appropriate channels
proud plover
#

Ohhhh, thanks :)

sharp geyser
#

If a bots main purpose is nsfw though they likely need to say so in their description e.g
"This is a bot containing mature content"

proud plover
#

:o I see

#

Thank you :)

sharp geyser
#

Im not a bot reviewer or mod tho so take what I say with a grain of salt

#

I am just regurgitating what I see other mods say

eternal osprey
bitter granite
pearl trail
#

ooo

#

so imma spam feet pic on someone's dm

proven lantern
#

can a bot move a user to a different voice channel using the HTTP API and not using sockets?

proud plover
pearl trail
#

oh or is that the op op thingy

#

nvm my bad

#

seems like no you can't

frosty gale
proven lantern
#

sorry

frosty gale
#

good stuff

frosty gale
#

odd way discord designed to do that but ok

pearl trail
#

oooo

quartz kindle
#

you could also start i at 1 instead of 0 and avoid having to do i+1 twice

#

also, you're probably not yet allowed to use memset right?

#

otherwise that would be the ideal way of doing it

desert verge
#

Then without db option:

#

this means I have to create a test db and add the permissions to my user to this db

lyric mountain
#

@quartz kindle if a websocket is sending data, but the connection drops midway, should I restart from beginning or continue where I left?

#

I'm confused whether the operation is aborted or the server continues waiting for the remaining data

frosty gale
bitter granite
#

Dm a mod

#

a mod

#

just dm the person that has this role

pearl trail
#

؟

bitter granite
frosty gale
desert verge
#

Ppl, I did everything, but idk why, I tried with axios, fetch and tried in https and http but I just can't get a response from my webapp / rest api

#

Like I have a server hosted

#

and another that is my bot

#

In the same server but not the same port

#

I can access to my bot on my browser

#

and even the / of my first server in the console

#

but why it can't make a request in a nodejs process ?

#

bro wtf

#

it works in local

#

But it doesn't work hosted

#

(timed out)

deft wolf
#

You forgot to blur the IP in the card title

desert verge
#

rip

frosty gale
wooden ember
#

any one know if bot's usernames will go about some sort of migration like user acounts did?

frosty gale
#

you have to open up the ports so outside traffic can reach the server

wooden ember
#

or the DNS is fucked

desert verge
#

Well, it's so strange because my two nodejs processes are hosted on the same server (same IP)

frosty gale
desert verge
#

yes lol

#

but it's not the same port

frosty gale
#

how are you trying to do it

#

code?

desert verge
#

Even this doesn't work

#

It works locally

#

(with the public IP)

frosty gale
#

try 127.0.0.1 or localhost instead of 0.0.0.0

desert verge
#

but hosted it is just blocked

#

I tried localhost

#

The error is cause: Error: connect ECONNREFUSED

#

Well

#

I'm trying 127

#

Again

#

That's not a time out

#

It's just refused

#

I'm gonna try to use sockets

frosty gale
#

no reason why that shouldnt work

#

so youre definitely running the code on the server

#

and that server definitely has an app running on port 1027?

desert verge
#

yes

#

it's my bot

lyric mountain
#

1027 is a risky port

desert verge
#

And my bot also have a webapp

desert verge
lyric mountain
#

why not?

deft wolf
#

Let me guess

#

Shared hosting?

desert verge
lyric mountain
#

but well, if it's giving econnrefused, then there'll be a lot entry on your webservice provider

desert verge
#

I just have access to pterodactyl panel and sftp

lyric mountain
#

like nginx

desert verge
#

yes there is

#

nginx

lyric mountain
#

See the logs for the reason

desert verge
#

the IP alone even redirects to my first nodejs process πŸ’€

desert verge
#

I don't have logs

#

It's a docker

#

I'm gonna try to connect to the server with ssh

#

I can't

pearl trail
#

ah,, dockerized bot and server or whatever you try to use?

lyric mountain
pearl trail
#

if they're on a different container, make sure they're in a same docker network, and then check the api's docker IP

desert verge
#

it is the same IP

#

the two dockers

#

everything

lyric mountain
#

Oh wait, that's not going to work, u can't use localhost with your public port

pearl trail
#

yes

lyric mountain
#

You're internal port is likely different to public port

pearl trail
desert verge
pearl trail
#

first, do you use docker?

lyric mountain
#

Why are u trying to make a request to localhost?

desert verge
#

to check if my nodejs process of the bot is online or no?

lyric mountain
#

From localhost?

desert verge
#

No?

lyric mountain
#

Like, you're trying to access your bot status from within the same server?

desert verge
#

I started with public ip and port

#

it didn't work

pearl trail
#

bro didn't answered my question

#

alr

desert verge
#

But not the same IP

lyric mountain
#

How's it the same server but not same ip?

desert verge
desert verge
pearl trail
neon leaf
#

usually for pterodactyl, 172.18.0.1 is the loopback

#

to the host

desert verge
#

I'm gonna try it

lyric mountain
neon leaf
#

for cross-container, thats impossible in ptero (fully internally)

desert verge
lyric mountain
#

U said it not the same ip but now it's the same ip

desert verge
#

No

lyric mountain
desert verge
#

???

pearl trail
#

πŸ’€

desert verge
#

Ah

#

I meant port

quartz kindle
pearl trail
#

we're getting confused with this one πŸ”₯

desert verge
#

sorry

#

Same IP but not same port

lyric mountain
#

Let's start from the start, where are you trying to access and from where?

desert verge
#

I want to make an http request (my status service / vote handler server) to my bot http express app to see if it's online

lyric mountain
#

Ok, did you try using port 80?

desert verge
#

Both of those processes are in a docker, thoses docker are in the server

desert verge
lyric mountain
#

80 is http port

desert verge
#

My processes don't have the same port

pearl trail
desert verge
#

Nah I will show u

#

for me

desert verge
pearl trail
#

are your things in the same container?

desert verge
#

You saw ?

pearl trail
#

so your api want to access the bot?

quartz kindle
#

have you tried those ip addresses and ports instead of 127.0.0.1?

desert verge
lyric mountain
desert verge
#

And I get timed out

quartz kindle
#

what about external ip?

desert verge
#

It's the first time it does that

#

external ip ?

lyric mountain
#

Public ip

desert verge
#

It's all public IP

pearl trail
#

seems like your bot isn't open

#

i can access the api but not the bot

quartz kindle
#

so if you type that ip address and port in a browser, you can access all of those, right?

pearl trail
#

not the bot, for me

desert verge
#

I can access the bot express app from my browser

#

it's port 1027

pearl trail
#

what i can access:
FluffyMod API -> returns hello world
FluffyMod -> returns OK

what i can't access
FluffyMod Website -> ERR_CONNECTION_TIMED_OUT
HubGames Bot -> ERR_CONNECTION_TIMED_OUT

desert verge
#

Yeah

#

HubGames Bot is not mine

#

It's not the actual bot i'm requesting

#

FluffyMod Website and HubGames Bot are offline

#

it's normal

#

green and yellow is online

pearl trail
#

you want your api to access fluffymod right? sorry i got confused πŸ’€

desert verge
#

yes

#

It works in local

#

but not when hosted

#

yeah it's loading a long time on my server

desert verge
desert verge
#

it should work

pearl trail
#

technically and theoritically you can access by using the public ip

quartz kindle
#

when a connection comes into the machine, there are iptables rules that rewrite the packet based on port number, so that it instead has a target IP address of the Docker container's internal IP instead of the host machine's IP. This packet then gets sent to the right container based on its internal IP.

The problem is that these rules do not run when the packets originate from the local machine, so you end up trying to connect to the given port on the host, which is closed. Normally the Docker container would intercept connections to this port making it look like the port is open, but in this case you're accessing the port directly on the host network, behind the Docker intercept.

pearl trail
#

does pterodactyil give container's ip?

#

never used it so... /shrug

quartz kindle
#

in any case i guess the "correct" way of handling this would be to create an internal network and place both containers in the same network

#

so then they can communicate via internal ips

pearl trail
#

yes

desert verge
#

It worked before...

desert verge
pearl trail
desert verge
#

Ah

pearl trail
#

the container's private ip

pearl trail
desert verge
#

I can create a child_process to run this command

#

I'm gonna try with a subdomain

#

like noip

neon leaf
surreal sage
#

pterodactyl only exposes ports via docker

#

not sure how it works with multiple public IPs on one machine

desert verge
#

How can I proxy the IP ?

frank jolt
desert verge
#

What?

lyric mountain
#

like, instead of sending the requests to your server directly, you'd send to the proxy server and then it'd send to the actual server

past field
#

is there a good place to get bot avatars created?

solemn latch
#

I like using inkscape

#

Unless you're planning on paying someone to make one

past field
solemn latch
#

I'm awful at it πŸ˜„

past field
#

lawd i have no idea how to use this

lyric mountain
#

well, nobody does at first

desert verge
#

😭

#

it does nothing

desert verge
civic scroll
desert verge
#

It's not mine

civic scroll
#

oh good

dusky idol
#

Hello I'd need some urgent help, my bot automatically keeps going offline after running for 2-3 minutes and this behavior is not normal at all.
I restart it, it runs for a while and then goes offline again while the server keeps running.
I tried hosting it both locally and on cloud but same results. I've no idea what's causing it

#

Moreover there are no rate limit errors in logs either

solemn latch
#

are you logging ratelimits?

dusky idol
#

and it should not be due to rate limit

solemn latch
#

Most bot libraries silence ratelimit errors

dusky idol
#

Because I don't think a bot goes offline when it gets rate limited

dusky idol
solemn latch
#

what library are you using?

dusky idol
#

it started happening a hour ago

solemn latch
#

πŸ‘€ this library is weird

#

its missing some key things to help diagnose your issue.

dusky idol
#

well what can I do now

solemn latch
#

Or the docs just dont mention them.

I'd reach out to a community that has people who use disnake

dusky idol
#

it could be because of mongodb as well, no clue

#

but this has never happened before

#

and running for 2-5 minutes, then going offline is very weird

quartz kindle
dusky idol
#
  async def on_ready(self):
    print(f'We have logged in as {bot.user}')
    await bot.change_presence(activity=disnake.activity.Game(
      name="Type jjk tutorial to get DM guide!"))
#

this

#

yes

quartz kindle
#

use them and see what it says

dusky idol
#

I'm listening to on_error

quartz kindle
dusky idol
quartz kindle
#

use them to print information

#

and see what is going on

dusky idol
quartz kindle
#

print whatever the event gives you

dusky idol
#

can you show a sample code

#

for on disconnet

quartz kindle
#
  async def on_disconnect():
    print('bot disconnected')
dusky idol
#

i mean thats not going to help

#

its just going to print that it disconnected

#

not tell me why

quartz kindle
#

it is going to help because it will give you proof that it actually disconnected and not just froze and got stuck

#

and then you can combine it with other events like on_gateway_error and see if that prints anything

quartz kindle
#

and it will give you the exact timing of the disconnect

dusky idol
#

so what if it prints it

quartz kindle
#

so you can combine it with other logs like your database, and see what the bot was doing when it disconnected

dusky idol
#

lets hope, I'm panicking for now

quartz kindle
#

the more information you have the better, even if you dont have an actual error message, there is a lot of things you can figure out just from having the exact timing of when things happen

dusky idol
#

like whoever is running a command to get some idea

#

but I don't think its happening because of it

#

like "disconnected"

#

how am I supposed to proceed

#

I'm feeling clueless here

quartz kindle
#

can you check the bot's cpu usage from task manager or htop?

#

when it disconnects

dusky idol
quartz kindle
#

i mean when it gets stuck

dusky idol
#

yeh its somethinglike that

#

16.9%

#

nothing more than that

#

and this started happening all of a sudden without me making any big changes to bot's code

quartz kindle
#

you can try an experiment like this:

while True:
  print("running")
  time.sleep(10)

that will make the bot print "running" every 10 seconds forever
the goal is to see if the bot stopped working because it froze or if it really disconnected, if it stops printing every 10 seconds that means the program is freezing

#

also, did you setup the gateway error event?

#

disnake.on_gateway_error(event, data, shard_id, exc)

#

also this one disnake.on_shard_disconnect(shard_id)

#

i have to go out rn, will be back later

dusky idol
#

Do I just define it with the main bot class

#

Where on ready function is

#

My bot is auto sharded

solemn latch
#

@solemn latch

deft wolf
#

Woo

solemn latch
#

NyNu

#

Like a new bot ID?

#

Submit the new bot

#

just like you did the first time

#

We approve by bot ID

#

Yep, you'll have to submit it the same way.

#

We dont support that. I'm not sure what you want me to say.

#

We approve by bot id, so if you have a new one, you have to get approved again

warm surge
#

You can’t

solemn latch
#

This is just going to keep going in circles.

warm surge
#

In general you cant change bot id

earnest phoenix
#

Not just in general

solemn latch
deft wolf
#

Everything is possible here, this channel has its own rules

warm surge
#

lma

sharp geyser
#

ong

#

they cant stop us

#

we rule this place

#

mods are the outlaws

quartz kindle
#

ie:

async def on_shard_error(event, data, shard_id, exc):
  print(event, data, shard_id, exc)
quartz kindle
neon flicker
#

Is there a way to check if a provided ID leads to an actual user even if the bot has no mutual servers with the user?

#

Either with Discord.js or the API itself

quartz kindle
#

the only way is to try to fetch the user

neon flicker
#

And it technically requires mutual servers though

quartz kindle
#

nope

#

any user can be fetched

neon flicker
#

Oh thanks

sharp geyser
quartz kindle
#

there are things inside accounts that are restricted of course, but the general public account information is always available

sharp geyser
#

Still think thats dumb

solemn latch
#

Even private mode on most sites still will list usernames

sharp geyser
#

Imagine you managed to get someone's id

#

well that ID alone tells you nothing

#

supose the person is a stalker tho

#

well now they have a way to get in touch with them

quartz kindle
#

i mean

#

you dont need to do that to contact them

sharp geyser
#

I mean, without their username yes you do

quartz kindle
#

cant you just <@id> on a random chat and right click?

sharp geyser
#

thats if you are in a server with them

neon flicker
sharp geyser
#

they can change their username

#

they cant change their id

#

so if they change their username, leave all servers you are in

neon flicker
#

But ID's provide public information so it's fine in my opinion

sharp geyser
#

well if you have their ID

#

now you can contact them again

neon flicker
#

Not really, you'll just have the eligibility of checking their public profile

sharp geyser
#

IDs are public information yes

#

no?

neon flicker
#

What else would it provide?

sharp geyser
#

You can fetch all information discord deems public on them

#

username included

neon flicker
#

Yes and it makes sense in my opinion

sharp geyser
#

It doesn't

#

Why would you want to look up random users not in your server

#

Other than to creep on them

#

What practical implications do you have to need that information

neon flicker
#

To check if the ID actually leads to a user

solemn latch
#

I do it from time to time πŸ‘€

#

Dming people for mod reasons mostly, but I've also been redirected to contact someone via their ID

sharp geyser
#

practically

neon flicker
#

Well, a simple example

sharp geyser
#

If your bot is in a server with someone then yes their ID leads to a user

#

you shouldn't need to fetch from outside the servers your bot is in

#

That is impractical and quite frankly odd behaviour

neon flicker
#

Well, imagine a system where you allow your bot's users (that are guild administrators/owners) to blacklist people from their guild

#

In this case you shouldn't let them enter random numbers as ID's

#

But it would still be their problem so anyways

#

Yes I just noticed that it's pointless

#

But it still makes sense in my opinion tho

sharp geyser
#

"Yes I just noticed that it's poiintless...But it still makes sense in my opinion tho"

#

That's very contradicting

neon flicker
#

Unneccessary, but makes sense

#

What makes sense is that we can still get their public information via their ID's

#

What is pointless is to implement that validation into the system that I talked about above

sharp geyser
#
  1. You should not be blacklisting users not in your server, especially based on no evidence that is terrible moderation skills
  2. You shouldn't be looking users up outside of your servers, as that is morally wrong prying into other people (while the information isn't very identitive to who they are sometimes it can be)
neon flicker
#

Well, about the first one they might have left from the server after doing whatever they've done

sharp geyser
#

they will be in cache

neon flicker
#

For how long

sharp geyser
#

until your bot restarts.

#

if they didn't ban them during that time well

#

not your fault

#

its on them

#

You can only do so much to hand hold them

#

Not to mention

#

just add that id to a blacklist, and if they join back ban em then

#

realistically you never should have to fetch a user outside of the servers you are in

#

there are ways not to

#

its just lazy

neon flicker
neon flicker
#

It was hard to understand them at all

sharp geyser
#

Being able to fetch user info based on ID also allows people if they really wanted to just try random ids until they get people, and now they have a list of people they can attack without actually sharing a server with them

#

Little far fetched

solemn latch
#

πŸ‘€ very

sharp geyser
#

but still a possible outcome if people wanted to waste their time

solemn latch
#

You would just get those IDs from a server if that was your goal

neon flicker
#

Well, can bots even send direct messages to users that they share no mutual servers with?

solemn latch
#

users can too

sharp geyser
solemn latch
#

Why would you not want to?

neon flicker
sharp geyser
solemn latch
#

It takes what, 60 seconds to make a discord account?

You'd make an alt and join

sharp geyser
#

Sure you can go into servers and get user ids, but now there is the possiblity you get banend from those servers

neon flicker
#

For collecting ID's?

solemn latch
#

you dont even have to join too, previewing a server is valid

sharp geyser
#

Discord now bans accounts after a few minutes without a verified phone number

solemn latch
#

πŸ‘€

sharp geyser
#

if they immediately join servers

solemn latch
#

I have like 6 alts, I've never run into that

sharp geyser
#

"Suspicious activity"

#

I've ran into it a lot

#

Making alts to test my bots

neon flicker
#

It occurs if you join way too many guilds in a short period

sharp geyser
#

I obv dont have an extra phone number

sharp geyser
neon flicker
#

Wait so it's enough to join a single guild to get suspected?

solemn latch
sharp geyser
#

Sometimes

sharp geyser
neon flicker
solemn latch
#

yeah, but you'd be taking time between joining servers was my point

sharp geyser
#

You can spread the generator across multiple processes

neon flicker
#

For Discord

sharp geyser
#

whereas making accounts, getting ids / dming users gets. you banned if you dont have a verified phone number on a new account

#

those scam accounts join a hundred servers most likely

#

and just dm people

#

thats why the yare always giving you links to discord servers or emails

solemn latch
#

If your goal is to collect random IDs you wouldnt have to join a ton of servers, or have a ton of alts.

A couple dozen servers is all you need to get millions(if not hundreds of thousands) of real user IDs

sharp geyser
#

because they will get banned shortly after

sharp geyser
#

My only point is

#

the possiblity of it being there is the problem

#

Like Baicon said

#

if all you want to do is verify the user exists

#

you don't need their id,discrim,flags,username, etcetc

#

Now I know the reason they provide that information is because its also used to fetch users in guilds to

solemn latch
#

That will always be a problem because of response headers.

Even if discord denied access to that information, they're still going to give a 403 header, not a 404.

sharp geyser
#

Anyway, this conversation has drawn out long enough. Food is here I gotta eat

sharp geyser
#

Honestly time to make a Discord User List /j

solemn latch
#

Lol, get in contact with restorecord

neon flicker
solemn latch
#

they'll help

sharp geyser
#

restorecord?

solemn latch
#

The one that sells user data or whatever it was

neon flicker
sharp geyser
#

spy.pet?

#

Man you gotta get those badges up

solemn latch
#

I intentionally avoid badges

dusky idol
# quartz kindle those are not arguments you pass, those are variables the function gives you

I see, well thanks for helping me.
The error automatically fixed itself and bot stopped going offline after 1-2 hours.
Well worse than a bug is a bug that fixes itself, but eh it appeared out of blue by itself too so could be anything.

Just hoping to not face such problems in future, if I do then you'll see me back here.
Also going to implement the on shard error function just incase it ends up being useful to dignose later on

neon flicker
#

Well, is it normal that it sounds way too complicated to create a dashboard with a simple design even tho I've worked with 3 programming languages so far? The point is that I've not worked with CSS and HTML, especially besides with JavaScript at once

solemn latch
#

I wouldnt use just html and css and JS though, I'd look into a framework.

neon flicker
#

What should I prefer over it?

#

Like Python?

solemn latch
#

JS itself is fine, just a framework for JS will help.

neon flicker
#

Oh my bad, framework

solemn latch
#

Svelte, react, nextjs, vue.

quartz kindle
#

html+css ftw

solemn latch
quartz kindle
#

yup

solemn latch
#

sounds like an htmx user

neon flicker
solemn latch
#

Yeah.
I use nextjs, its extremely powerful

neon flicker
#

I don't know which languages or frameworks are prefered for them so

#

Thank you

solemn latch
#

Any one of those will do fine.
React is the most popular
Nextjs I think is next, but Nextjs is just react with some stuff to make it easier.

neon flicker
#

And with these frameworks I would be able to design a functioning dashboard/site right?

#

It sounds really useful ngl

surreal sage
#

i think vite is just a server

#

nextjs has a lot of extra stuff making it a plain production ready thing

quartz kindle
#

and svelte is the weird cousin nobody talks about but is actually a genius

neon flicker
#

LOL

sharp geyser
#

Web Dev is the area a lot of new devs avoid

#

so don't be embarassed or afraid that you are different

#

Even some veteren developers avoid web dev

#

Its a handy skill to have, and puts you in leagues with full stack developers, but its perfectly fine also not doing it if you really don't want to

sharp geyser
neon flicker
sharp geyser
#

I myself avoid it

#

I absolutely hate web dev

#

πŸ’€

neon flicker
#

Well, it's normal tho(ugh)

#

But I think it's a major plus to have a dashboard for my bot

sharp geyser
#

Indeed

neon flicker
#

Instead of having slash commands with 5 options, it's less complex to manage things like this

sharp geyser
#

Im not saying don't make one

#

just dont be scared if you are uncomfortable

solemn latch
sharp geyser
#

Because at the end of the day, we all are with new things

neon flicker
sharp geyser
#

If you aren't uncomfortable trying something new then we might start questioning if you're not insane /j

neon flicker
#

LOL

sharp geyser
#

Something I myself recently learned after 7 years of programming

neon flicker
#

Well, indeed I always get stressed when I hear brand new things that I have to undersatnd of

sharp geyser
#

Is its okay to be uncomfortable in the world of programming, more so CS

#

Being uncomfortable just menas you dont quite understand it yet, and that uncomfortable ness goes away once you start actually diving in and learning

solemn latch
#

The worst thing in web dev is the beginning.
Then one day it just clicks

sharp geyser
#

Even then, you can be a veteren programmer, know the ins and outs of web dev, but therei s always something new to learn

#

That uncomfortable feeling never truly goes away, it just becomes more apparent that its not a bad thing.

solemn latch
#

That part never stops.
I'm excited for the next 3-4 years, there's been a few things that are getting released on browsers in the past few years.

sharp geyser
#

You won't always understand something from the get go

#

its how you move forward is what matters

#

Im the prime example of that tbh

#

I've been programming for 7 years, and recently I started feeling more and more uncomfortable. I know the syntax, I know how the langauge works on the surface. What im doing works. The thing that bothered me is how did it work, why was it working, how do these things together make that outcome or how do I put what I know into a solution.

#

I decided to take a step back from all my projects, and focus on what I didn't teach myself (because I am fully self taught)

neon flicker
#

I really appreciate for telling those, as I've been having the uncomfortability for around like a year, especially while searching about AI, because I understand how it works but I have no idea how it's programming worked

sharp geyser
#

Yup!

neon flicker
#

And there aren't really too many sources to take a look at in order to see how it's programming works, all I know is the libraries that are used widely to create AI projects

sharp geyser
#

one sec

#

Right so I don't know how much time you want to spend

#

But what I decided to do was take a intro to CS course through harvard x edx

#

It's been helping me bridge the gaps in my knowledge and allow me ot think about programming differently

#

It is 100% free

#

The only paid thing is the cert at the end if you want it

#

Which honestly are useless

sharp geyser
#

specifically AI with python

#

But its not restrictive to just python

sharp geyser
#

Its a 7-10 week thing

#

completely self paced

civic scroll
#

i learnt them last semester
now i forgor πŸ˜”

sharp geyser
#

all the lectures, sections and notes are free to download

#

Im currently going through their CS50x course (intro to cs)

#

Its been an eye opener and has allowed me to apply my knowledge in different ways to produce more efficient outcomes (albeit still not the most efficient due to how new I am to this way of thinking)

neon flicker
#

It's probably such a helpful thing, tho it takes time to realise it
Like it took me long to acknowledge that I've been using JavaScript and that I never understood it, I was just using it to develop a bot

#

And it was nothing but Discord.js knowledge, as I was also using bot templates (which I still do to avoid time I spend), but I keep trying to learn it in a deeper way

sharp geyser
#

https://hatebin.com/mnqrusuayn this code I wrote for one of the problem sets, not the most efficient, but I later discovered (through the help of a friend) a more efficient way to write it without loops

int main(void) {
  int change;
  do {
    change = get_int("Change needed (in cents): ");
  } while (change < 0);

  int coins = 0;

  // Calculate the number of quarters
  coins += change / 25;
  change = change % 25;

  // Calculate the number of dimes
  coins += change / 10;
  change = change % 10;

  // Calculate the number of nickels
  coins += change / 5;
  change = change % 5;

  // Calculate the number of pennies
  coins += change;

  printf("Coins received: %i\n", coins);

  return 0;
}`
sharp geyser
#

Yes they are helpful for quick things

#

but if you want to actually learn the language avoid it

#

It will force you to make your own, and discover how to do it

#

Just know, this channel is here for a reason. If you ever get stuck and need help we are here to help guide you in the right direction.

#

Don't be afraid to ask for help

neon flicker
sharp geyser
#

We all start somewhere

#

My very first messages in this channel was how to log stuff to the console πŸ’€

#

(granted not on this account so luckily no one will ever know the other embarassing things i've asked)

neon flicker
#

Because I've been shamed in a huge bot list server just for solving a problem on my own, and not responding to people. They assumed I'd have to respond while I was stressfully looking for solutions

sharp geyser
#

Anyone who meets you with hostility are just angry at themselves

neon flicker
#

πŸ™

sharp geyser
#

Some people don't like thinking back to their newbie days

#

They expect what they had to struggle to learn, you should already know

neon flicker
#

Exactly, programming is such a complex thing especially for beginners so it's normal to ask "non-sense" questions

#

Which I found out way too late, getting ashamed in that bot list server had gotten me traumatized

sharp geyser
#

Ahaha

#

I can't speak for any other servers or anyone else

#

but you will always be welcome to ask your "non-sense" questions here

neon flicker
#

How thankful I am

sharp geyser
#

I myself still ask nonsense questions

#

:^)

#

7 + years of programming btw

neon flicker
#

It's pretty much normal though, last year I was asking people how to upload a module on npmjs

lofty ginkgo
#

If the user hasn't voted, I get this error: Expected the value to be an object, but received string instead

sharp geyser
#

uploading modules is something even I don't know how to do really and i did it twice now

sharp geyser
#

not just the message

#

but the stacktrace as well

neon flicker
#

And I accidentally uploaded all my computer on that site, but thankfully my WiFi wasn't enough fast to upload them all before I cancelled the progress

sharp geyser
#

Lmao

lofty ginkgo
sharp geyser
#

Where is this coming from

#

because there should be more than just that

#

like what line it comes from

lofty ginkgo
sharp geyser
#

right

neon flicker
#

I feel like programming is one of the only sectors where it's harder to produce something than finding out the idea

sharp geyser
#

log the entire error

#

just the message doesn't help

sharp geyser
#

I made the dumb decision to try and start a company with my lack of knowledge

neon flicker
#

Lol it happens, I also did the same mistake by created a game studio (even tho it was just on Roblox), and I thought it would actually accomplish something with only building and programming

lofty ginkgo
sharp geyser
#

Show the full error please

#

Not just the message

#

There should be a bunch of other stuff below it

quartz kindle
sharp geyser
#

Actually the only thing that could return that error is setEmoji

lofty ginkgo
sharp geyser
#

setEmoji takes in an object

lofty ginkgo
quartz kindle
#
.setEmoji({
  id: ...,
  name: ...,
  animated: ...
})
sharp geyser
#

^

#

I forgot they made it that way now

#

iirc you used to be able ot pass in a literal like that

#

but not anymore

#

basically just put the topgg in name and then that string of numbers after : as the id

#

animated is optional

#

technically they all are but that means you dont have to specify it

sharp geyser
#

https://hatebin.com/mnqrusuayn what is this called talking about how calculate_quarters calls calculate_dimes, then that calls nickeles and so on so forth

#

Its not really recursion is it?

#

the way it was defined in the programming language book i was reading to make my own programming language was higher/lower presedence evaluation

neon flicker
#

Oh wow

sharp geyser
#

iirc all of them are free might be some exceptions

neon flicker
#

I really appreciate it a lot

sharp geyser
#

They offer a lot on different topics

#

Math, Business, CS, Law, etc etc

#

Some even combined

#

CS Law is a thing

#

CS Business

#

Basically how to apply cs to law and business

lofty ginkgo
#

@sharp geyser I think it's true but I still get the same error

sharp geyser
#

I 100% recommend checking out the CS50x course though as its an introductory course and will help with all the other CS courses

proven lantern
lofty ginkgo
#

Okay

#

Sorry

sharp geyser
sharp geyser
#

They have 507 courses tho on various subjects

#

they aren't all free tho obviously but there are some free ones

#

A lot of the paid ones are super cheap tho

#

Like 30$ is the cheapest ones

#

πŸ’€

lofty ginkgo
#

It's true?

quartz kindle
#

its pretty much just function stacking

sharp geyser
#

icic

quartz kindle
#

or function call nesting

sharp geyser
lofty ginkgo
sharp geyser
#

also you dont have to specify animated if you dont want to

#

its optional and defaults to false

quartz kindle
sharp geyser
#

^

quartz kindle
#

appears in a lot of languages

sharp geyser
#

not really

quartz kindle
#

also in js

sharp geyser
#

Havent ran into it much

quartz kindle
#

its literally when you reach the limit of functions inside functions

sharp geyser
#

icic

quartz kindle
#

each function call is piled on top of the stack

sharp geyser
#

I notice this method is used a lot tho in some application forms

#

is it inherently bad?

quartz kindle
#

its not bad, as long as it doesnt get too big

#

functions inside functions basically create a situation where the code cannot continue until the inside of it finishes

#

each function call gets added on top of the stack

#

and then when the final funcion call is reached, it then starts resolving the values from the top until it returns to the bottom

#

thats basically where the function overhead comes from, and why its a tiny bit slower

#

although compilers will often inline functions for you so it doesnt really matter

#

function inlining = copying the body of the function and replacing the function call with it, eliminating the call

wheat mesa
quartz kindle
wheat mesa
#

It’s where SO gets its name

sharp geyser
#

Ah

#

thats what that is

#

waffle

#

check out my C code for the problem sets

#

its top tier (not really)

#
#include <cs50.h>
#include <stdio.h>

void print_row(int spaces, int row);

int main(void)
{
    int n;
    // Grab input from user only accepting numerical non-negative values
    do
    {
        n = get_int("How big do you want the stairs? ");
    }
    while (n < 1);

    for (int i = 0; i < n; i++)
    {
        /**
         * Iterations:
         * 1. n - (0 + 1) = 5
         * 2. n - (1 + 1) = 4
         * 3. n - (2 + 1) = 3
         * 4. n - (3 + 1) = 2
         * 5. n - (4 + 1) = 1
         * 6. n - (5 + 1) = 0
         */
        // Print bricks with the spaces being `n - (i + 1)` (see above) and bricks being `i + 1`
        /**
         * 1. i + 1 = 1
         * 2. 1 + 1 = 2
         * 3. 2 + 1 = 3
         * 4. 3 + 1 = 4
         * 5. 4 + 1 = 5
         * 6. 5 + 1 = 6
         */
        print_row(n - (i + 1), i + 1);
    }
}

void print_row(int spaces, int bricks)
{
    /**
     * This for loop handles printing the spaces based on the formula made in the first for loop.
     * It makes sure to take into account the number of bricks placed down during the iteration and minus it by the total rows to be made.
     */
    for (int i = 0; i < spaces; i++)
    {
        printf(" ");
    }
    for (int j = 0; j < bricks; j++)
    {
        printf("#");
    }
    printf("\n");
}
#

here is another

#

πŸ’€

wheat mesa
#

Solid

sharp geyser
#

I wish I could find out a better way to do that one

#

cuz ik I dont need 3 loops for the printing of the stair

wheat mesa
#

I’m not a huge fan of C because it can get tedious but it’s definitely a good language to learn

sharp geyser
#

Its been fun

#

this harvard course has rekindled my passion for programming

neon flicker
#

Well, I think I should've learned of HTML before attempting to use Next.js

sharp geyser
#

before this I was lowkey thinking of abandoning cs

#

πŸ’€

sharp geyser
#

you will be using html

neon flicker
#

Yep, because I just have no idea how to design a proper site for the dashboard

sharp geyser
#

you dont need a dashboard immediately do ya?

#

if not then take time practicing

quartz kindle
wheat mesa
#

HTML is the structure of the website, it’s like the bones in your body. CSS then makes the structure look good

neon flicker
#

Yes, it's nothing urgent

sharp geyser
#

Im sure its not disallowed

#

they said you can use previous knowledge

#

just note if you ask for help someone may not know what you are doing

#

πŸ’€

#

Im interested though

#

How would you?

sharp geyser
#

basically everything that makes you you

neon flicker
sharp geyser
#

That uses dynamic routing

quartz kindle
wheat mesa
#

Next.js usually handles routing for you, I believe there is a quick start guide that teaches you how to use routes and such

sharp geyser
#

Woah wtf

#

Ima try that out rn

neon flicker
sharp geyser
#

so * basically means numerable

#

or more than 1

quartz kindle
civic scroll
#

you can do more with verbs as well

sharp geyser
#

hm

#

there we go

#

adding 1 to it works

#
      #
     ##
    ###
   ####
  #####
 ######
neon flicker
sharp geyser
#

although now there is an extra space after the last row where there shouldn't be