#development

1 messages ยท Page 1884 of 1

feral aspen
#

Scanning..

#

Yet scanning..

boreal iron
#

wrong channel

round perch
#

its development tho

#

but yeah i get the meme fact

spark flint
#

Not really

round perch
#

oh

#

ill just remove it then

feral aspen
#

Man..

#

Still scanning..

#

Still very slow. ๐Ÿ˜•

solemn latch
#

if your doing a full scan expect a few hours.

eternal osprey
#
 client.on('messageReactionAdd', async (reaction, user) => {
    if (reaction.emoji.name === "๐Ÿ‘Ÿ" && user.id !== client.user.id && !configl.userids.includes(user.id)) {
      console.log(answer)
      console.log(user)
      if(configl.userids.includes(user.id)){
        return message.channel.send("**Sorry but you have already answered this question!!**")
      }
      const filter = m => m.author.id != client.user.id;
    const collector = message.channel.createMessageCollector(filter);
      collector.on("collect", async m => {
       if(m.content == answer){
        reaction.users.remove(user)
           user.send("โœ… **This answer was right!**")
           configl.userids.push(user.id)
     
      }
          collector.on('end', collected => {
            console.log(`Collected ${collected.size} items`);
          });```Why is this code performing twice once i reacted?
#

it keeps on adding up amounts

lyric mountain
#

ur probably not removing the collector afterwards

eternal osprey
#

How would i do that?

quartz kindle
#

if you're only listening to one answer, dont use a collector

eternal osprey
#

so that's why i tried ending the collector for the messages.

#

However, i need to close tthe reaction event too?

quartz kindle
#

you're not ending it

eternal osprey
quartz kindle
#

collector.on("end") means "when it ends, do something"

#

nothing in there is telling it to end

eternal osprey
#

oowh...

#

How would i end it?

quartz kindle
#

collector.end()

eternal osprey
#

would't that close the collector to each and every person that reacted?

quartz kindle
#

yes

eternal osprey
#

yeah that's not really something i want

quartz kindle
#

then what do you want?

#

also, your issue is that your bot is sending "X answered the question right!" multiple times, but the code you showed does not have that text

feral aspen
#

Did that.. done that, nothing.

#

Maleware scanner thing found nothing too.

quartz kindle
#

well, the only thing you can do now is disable everything and re-enable things one by one until you find the issue

quartz kindle
#

in msconfig, do selective startup and disable services and startup items

feral aspen
# feral aspen

According to the chat support with Microsoft Support..

feral aspen
quartz kindle
#

they dont know anything

#

i mean, sure formatting will likely help

#

but everything can be fixed without it if you have enough patience

#

if you dont have patience tho, just format

feral aspen
#

This is why I don't want to format.

feral aspen
quartz kindle
#

๐Ÿ‘

feral aspen
#

Done

#

Restarting now...

earnest phoenix
#

how do i use await inside an eval command?

#

i can't do eval((async() => { code })()) because that will show Promise { <pending> } instead of the code

outer perch
#

why can I only access my FTP through Windows Browser?

hybrid cargo
earnest phoenix
#

ty

#

next problem: how do i render object outputs as a string without JSON.stringify throwing circular errors

#

hmm https://npm.im/jsonc this good?

hybrid cargo
#

u mean to convert the result into a string?

feral aspen
#

I cant fucking login

hybrid cargo
#

inspect it, u can control how deep you want to look into a nested object. And it returns a string

feral aspen
#

@tim

#

@quartz kindle

lament rock
#

util.inspect all the way

#

I wrote my own parser based on JSON.stringify and it supported circular references and it sucked

quartz kindle
feral aspen
#

Something happened and your PIN isn't available.

#

I can't even set a new pin.

lament rock
#

try restarting again?

feral aspen
#

IT DOESNT LEt me login yet dude

lament rock
#

You can still restart from the lock screen

feral aspen
#

Dude

#

I restarted

#

I cant login

lament rock
#

I understand that. If it's saying your pin isn't available and you only restarted once, try restarting again to see if it keeps happening

earnest phoenix
#

problem 3
my bot isn't updating the user's xp
code:

guild = await Models.Guild.findOne({ id: message.guild.id });
        const memberData = guild.members.get(message.author.id);

        console.log("before", memberData);
        memberData.xp += Math.floor(Math.random() * 5);
        if (memberData.xp >= memberData.xpNeeded) {
            console.log("xp biggers");
            memberData.level++;
            memberData.xpNeeded += Math.floor(memberData.xpNeeded * 1.10);
        }

        console.log("after", memberData);
        guild.members.set(message.author.id, memberData);

        await guild.save();

log:

before {
  xp: 0,
  level: 1,
  xpNeeded: 20,
  _id: new ObjectId("614b48dd1acff6a9c5e41458"),
  punishments: []
}
after {
  xp: 0,
  level: 1,
  xpNeeded: 20,
  _id: new ObjectId("614b48dd1acff6a9c5e41458"),
  punishments: []
}
#

why does tab character become 8 spaces

#

@quartz kindle senpai help pls

lament rock
#

Discord sucks

earnest phoenix
#

ikr

#

wait why am i sending the old log

lament rock
#

Your tab settings may also have a part to do with it. I keep my tab sizes set to 2

earnest phoenix
#

my logs say something completely different smh

#

maybe because i forgor to clear terminal

lament rock
#

you shouldn't have to clear the terminal

#

the clear character is also funky with scrolling

earnest phoenix
#

not changing xp

#

how did the += character break

lament rock
#

might want to log data before and after transforming

earnest phoenix
#

yeah i am

#

probably should use hastebin instead of code blocks for logs

#

css

lament rock
#

it's fine since they're not absurdly large. You might want to assign data.xp = data.xp + amount

#

if += isn't working

quartz kindle
feral aspen
#

No man

#

I have accidently disabled all microsoft services

quartz kindle
feral aspen
#

NO.

#

Mann

quartz kindle
#

then what do you have?

feral aspen
#

Nothing

#

I have nothing

quartz kindle
#

then how do you have pin?

grim aspen
#

there should be a way to reset your pc

feral aspen
#

It told me I can setup a pin, but it doesn't allow me

quartz kindle
#

show pic

feral aspen
#

I need a way to enable all microsoft services via cmd prompt

quartz kindle
#

you can open command prompt?

feral aspen
#

Yes

quartz kindle
#

can you open msconfig?

feral aspen
earnest phoenix
lament rock
#

you can start the pc in safe mode with command prompt if you can't open it from the login screen

quartz kindle
#

you should be able to open msconfig from the command prompt

feral aspen
#

No.. it didnt allow me

quartz kindle
#

whats the output of bcdedit

feral aspen
#

It returned something

earnest phoenix
#

imma use a clone object instead of memberData

#

could be a problem with mongoose setters

quartz kindle
#

something what?

quartz kindle
#

:^)

feral aspen
#

It returns the windows boot manager

quartz kindle
#

pic

novel snow
#

Discord JS

earnest phoenix
#

found the problem, i think

feral aspen
#

Sending...

earnest phoenix
#

im using the copy of the document guild before it was saved

#

so im always gonna get xp: 0

quartz kindle
#

then restart

spark flint
#

this channel now belongs to tim

feral aspen
#

Restarting

#

Didnt work

#

Yet needs pin

#

@quartz kindle

#

I need a way to enable all services at once

earnest phoenix
#

I cannot understand WHY it's not saving the document

#

guild.save(err => console.error(err)) gives null

quartz kindle
boreal iron
#

wtf is he doing?

feral aspen
#

Didnt work @quartz kindle

quartz kindle
#

what does "didnt work" mean?

feral aspen
#

Still asks for the pin

boreal iron
#

You should have done a "clean restart" removing all non-Windows services etc. but not your private data

feral aspen
#

.. even though I can't access it or change it

quartz kindle
#

its supposed to enable the built in admin account, you have to restart to get the option

#

btw, does ctrl-alt-del work in the login screen?

#

can you open task manager?

feral aspen
#

It doesn't let me even setup a new pin

quartz kindle
#

does ctrl-alt-del work?

feral aspen
#

No

quartz kindle
#

try renaming your user account folder

#

that should make windows ask you to create a new user

#

in cmd: move C:/users/youruserfolder C:/users/youruserfolderbackup

#

which might also fix the slowness problem btw

feral aspen
#

The system cannot find the path specified

feral aspen
#

Since it has a name

quartz kindle
#

dir

feral aspen
#

How, again?

quartz kindle
#

dir C:/users
or

cd users
dir```
feral aspen
#

The system cannot find the path specified

quartz kindle
#

whats your current path?

feral aspen
#

X:\windows\system32

quartz kindle
#

can you do C:

feral aspen
#

Yes

#

.. but it went to the HDD

quartz kindle
#

isnt that where windows is installed?

feral aspen
#

No

quartz kindle
#

oh..

royal herald
#

hi tim

#

ok bye

quartz kindle
#

why not?

feral aspen
#

I installed it on the SSD

quartz kindle
#

the ssd isnt C:?

feral aspen
#

No

#

On this CMD, no.

quartz kindle
#

what is it then

feral aspen
#

It is now my HDD

#

some other thing

quartz kindle
#

which one is the ssd now

feral aspen
#

it isn't able to read the ssd

#

I have the ssd set as C but now c is the hdd meaning it cannot access ssd anymore

quartz kindle
#

try the other letters

#

D:

#

E:

#

etc

#

see what they are

lunar lance
#

why is my bot not sending messages now ._.

feral aspen
#

WINDOWS @quartz kindle

#

E

outer perch
#

I want ppl to just download files from a certain folder. is Simple HTTP Server enough? or should I go with Apache?

quartz kindle
#

so the ssd is E:?

feral aspen
#

YEs

#

for some f.cking reasons

quartz kindle
#

ok so do it on E:

#

E:/users

feral aspen
#

I have it /Mohammad Hajjiri

#

Will I lose all my files?

quartz kindle
#

no, you're just changing the folder name

#

windows will not find it, and should ask you to create a new account

#

then from the new account you can access msconfig

feral aspen
#

Done

#

Now?

quartz kindle
#

restart

feral aspen
#

That didn't work.

#

Same result

#

It's that I have disabled all the services

quartz kindle
#

then rename your user folder back to the original name

#

just in case

feral aspen
#

What now. ๐Ÿ˜ญ

quartz kindle
#

try this then

ren  E:\windows\system32\config\SYSTEM SYSTEM.BAK
copy  E:\Windows\System32\config\RegBack\SYSTEM E:\windows\system32\config
``` if E is still the ssd
feral aspen
#

What does this do..

quartz kindle
#

load a backup version of the SYSTEM file

feral aspen
#

then?

quartz kindle
#

restart

feral aspen
#

@quartz kindle , do I paste it all, together?

quartz kindle
#

two separate lines

feral aspen
#

Ah Ok

quartz kindle
#

first one renames the original SYSTEM to SYSTEM.BAK for backup

#

second one copies the older version from the RegBack folder

feral aspen
#

Second one didn't work.

urban slate
#

anyone uses quick.db here?

#

i want some help

#

or does anyone know sqlite3 here?

#

wht even is this error?

quartz kindle
feral aspen
#

It says the system cannot find the file specified

#

for the 2nd line

#

Did you mean SYSTEM.BAK for the second line?

quartz kindle
#

no

feral aspen
#

Didn't work then

outer perch
#

@quartz kindle what's the difference between python2 and python3 http servers?

quartz kindle
#

do dir D:/windows/system32/regback

urban slate
outer perch
#

I wanted already filtered info

#

not filtering it myself

feral aspen
#

Parameter format not correct - regback

quartz kindle
#

?

#

its supposed to be a folder, not a parameter

feral aspen
#

@quartz kindle

#
ren  E:\windows\system32\config\SYSTEM SYSTEM.BAK
copy  E:\Windows\System32\config\RegBack\SYSTEM E:\windows\system32\config
#

For this

#

The ren worked

#

.. but the copy didnt

quartz kindle
#

i know, you said already

#

i told you do run dir to see what are the contents of the regback folder

feral aspen
#

dir E:\windows\system32\regback

outer perch
#

how do I make http server a service?

#

apache only?

lyric mountain
outer perch
#

I can't use the console when turned on

#

it was python3's http server

quartz kindle
feral aspen
#

I can

lyric mountain
#

if it's a static file u can serve it directly

quartz kindle
feral aspen
#

File?

quartz kindle
#

go to E:/windows/system32/config

feral aspen
#

Fuck

#

I cant load hive

quartz kindle
#

why?

feral aspen
#

I dont know

outer perch
quartz kindle
#

what happens

outer perch
lyric mountain
feral aspen
#

Load hives is a disabled option

quartz kindle
#

did you select HKEY_LOCAL_MACHINE first?

feral aspen
#

OH

#

YES I CAN NOW

earnest phoenix
#

Can you use argon dashboard MIT license for commercial use?, but on their web page it is labeled as demo

quartz kindle
#

ok so go to E:/windows/system32/config

#

and open the SOFTWARE file

feral aspen
#

Yeah?

quartz kindle
#

when it asks for key name, give it any name

#

like A

feral aspen
#

Then?

quartz kindle
#

now see if you can go to HKEY_LOCAL_MACHINE\A\Microsoft\Windows NT\CurrentVersion\PasswordLess\Device

quartz kindle
#

hmm

#

then go back to HKEY_LOCAL_MACHINE

#

and load hive again

#

and this time open SYSTEM

feral aspen
#

I delete A?

quartz kindle
#

doesnt matter

feral aspen
#

There is no SYSTEM

#

Only SYSTEM.BAK

#

That one?

quartz kindle
#

rename it back to SYSTEM

#

then open it

#

you can name it B or whatever

feral aspen
#

Then

quartz kindle
#

then go to HKEY_LOCAL_MACHINE\B\ControlSet001\Services

feral aspen
#

Then?

quartz kindle
#

now, all services have on the right side a Start value

simple stump
#

I'm trying to have a bot create a support ticket if the ID of the button is support. However, whenever I click the Support button it says, "Interaction failed."

Code:

client.on('interactionCreate', async interaction => {
    if (interaction.isButton()) {
      const filter = i => i.customId === 'support';

      const collector = interaction.channel.createMessageComponentCollector({ filter, time: 5000 });

      collector.on('collect', async i => {
          if (i.customId === 'support') {
              await i.update({ content: 'A button was clicked!', components: [] });
          }
      });

      collector.on('end', collected => console.log(`Collected ${collected.size} items`));
    }
});
quartz kindle
#

These services need to be set to Manual startup (Start = 3):

lmhosts (TCP/IP NetBIOS Helper)
Netman (Network Connections)
VaultSvc (Credential Manager)
Wecsvc (Windows Event Collector)
WbioSrvc (Windows Biometric Serviced)
wlidsvc (Microsoft Account Sign-in Assistant)

And these services need to be set to Automatic startup (Start = 2):

Dhcp (DHCP Client)
EventLog (Windows Event Log)
EventSystem (COM+ Event System)
LanmanServer (Server)
LanmanWorkstation (Workstation)
NlaSvc (Network Location Awareness)
nsi (Network Store Interface Service)
SamSs (Security Accounts Manager)

lyric mountain
#

@simple stump I told u yesterday

quartz kindle
#

maybe

lyric mountain
#

u need to acknowledge the interaction

feral aspen
#

I configure them manually?

quartz kindle
#

yes

#

open each of those services

#

and set the Start value on the right screen

feral aspen
#

Btw

#

I configure the default file right?

#

and set the value data according to its category value

quartz kindle
#

the Start file

feral aspen
#

OH ok

#

@quartz kindle , done.

#

Each value has been modified to its value in the category.

quartz kindle
#

Start=2 and Start=3 right?

#

now you can unload hive

feral aspen
#

YEs.

quartz kindle
#

and restart

feral aspen
#

Where do I unload hive?

quartz kindle
#

go back to A and B

#

select them

#

and file > unload

feral aspen
#

.. and unload?

#

I hope it works.

#

Tf

#

My device ran into a problem

quartz kindle
#

blue screen?

feral aspen
#

Yes

quartz kindle
#

wtf

#

ever time you restart?

feral aspen
#

Yes. ๐Ÿ˜ญ

pale vessel
#

How the hell did that happen, or what have you guys been doing

quartz kindle
#

lmao

pale vessel
#

All I remember was their PC was so slow

#

But that's it

feral aspen
#

I disabled all microsoft windows services in the end.. ;/

quartz kindle
#

he disabled all services, and locked himself out because his windows hello pin thing is enabled

#

so we tried disabling windows hello or re-enabling the services

#

and nothing worked

#

never use windows hello

pale vessel
#

Br, just use normal password

#

Like a sane person

quartz kindle
#

he cant

feral aspen
#

It doesn't allow me.

#

Dude.. my heart beat has been high for the past hour

quartz kindle
#

its very hard to help when i cant see whats going on

boreal iron
rocky hearth
#

With js Date.now(), how do we know the utc time?

quartz kindle
#

can you enter the recovery mode if you turn off your pc 3 times when its still loading?

#

if not, you will need to download windows and put it on a usb

feral aspen
#

I did

#

I am there already

quartz kindle
#

ok

#

can you enter safe mode from there?

pale vessel
feral aspen
#

I'll try.. :/

boreal iron
quartz kindle
feral aspen
#

Still didn't work.

quartz kindle
#

but i think forgot to hide windows services

rocky hearth
pale vessel
feral aspen
#

;/

quartz kindle
#

again, what does didnt work mean?

#

i cant see your screen

feral aspen
#

didnt work in safe boot

quartz kindle
#

you have to describe exactly what happened

#

otherwise i have no idea what any of that means

feral aspen
#

i tried running with safe boot then blue screen happened again

rocky hearth
#

Or does Date.now() always gives UTCยฑ0:00?

quartz kindle
#

ok

#

btw did you rename SYSTEM.BAK back to SYSTEM?

feral aspen
#

I did.

quartz kindle
#

did you rename your user folder back to the original name?

feral aspen
#

I did too

quartz kindle
#

can you try the startup repair thing?

pale vessel
feral aspen
#

Still failed

pale vessel
quartz kindle
#

can you run system restore?

feral aspen
#

I can.

rocky hearth
pale vessel
#

Yes

feral aspen
#

That is just the risky part.. ๐Ÿ˜ญ

pale vessel
#

Well not the exact number but yeah

quartz kindle
#

system restore is not risky

#

its not a reset/refresh

feral aspen
#

It's going back in time.

quartz kindle
#

how much back?

feral aspen
#

MOTHER A WEEK

quartz kindle
#

mother a week?

feral aspen
#

A week

quartz kindle
#

ok thats not a lot

#

it doesnt affect your files

feral aspen
#

Wait

pale vessel
#

Backup all your files and reinstall Windows ez

quartz kindle
#

only installed programs and updates

feral aspen
#

What description?

quartz kindle
#

description?

feral aspen
pale vessel
#

9/9

quartz kindle
#

thats just the reason why the restore point was created

#

it was created automatically when a windows update ran

feral aspen
#

What are the results of doing this?

quartz kindle
#

any programs, windows updates, configs and settings done after that date will be reset

#

files are not affected

feral aspen
#

Files are not affected? So if I edited the file for like 3 hours yesterday and I want to restore back to a month

#

do I lose all the work I did?

quartz kindle
#

no

#

system restore only affects the system

#

not user files

feral aspen
#

Now what do I press?

quartz kindle
#

next?

feral aspen
#

I press on the 9/9?

quartz kindle
#

no

#

the most recent one

feral aspen
#

Oh, alright.

quartz kindle
#

huh

feral aspen
#

Do I do this

#

in cmd?

boreal iron
#

Are you using Windows 10 (Pro)?

feral aspen
#

I am.

#

@quartz kindle

#

I did what the website says..

#

This happened

#

Not bad

#

But the status

quartz kindle
#

its fine

#

select E and next

feral aspen
#

Sec

#

Any other notices before I start?

quartz kindle
#

nope

#

just hope this works

feral aspen
#

Started

quartz kindle
#

in my experience, system restore often fails for no reason as well

#

i dont think i've ever had a pc where a system restore worked lol

feral aspen
#

:/

#

@quartz kindle

quartz kindle
#

see

#

lol

pale vessel
#

Just reinstall Windows at this point

feral aspen
#

.. and my files?

#

I'll lose them all, god dammit.

cinder patio
#

wait what happened

quartz kindle
#

you dont lose your files

#

you can install windows without formatting

#

you can always back them up to your other HDDs as well

pale vessel
feral aspen
#

What am I supposed to update, at this point.

#

backup*

quartz kindle
#

how big is your ssd?

#

do you have a windows install cd or usb?

feral aspen
#

USB

#

Wait..

#

Honestly, I didn't install windows.

#

It's the technician who installed it for us, but I had the key only.

quartz kindle
#

when you install windows, if you dont explicitly format the disk, it will not delete your files

#

it will just replace the windows and programs folders, and create a new user folder

#

even the old windows will probably still be there under a windows_old folder

feral aspen
#

I need my appdata and the files in the desktop. :/

quartz kindle
#

but as a safety measure, you can always copy your user folder from your ssd to one of your HDDs with cmd

#

all of that is inside your user folder

feral aspen
#

Ah..

#

.. so everything that I've installed ever to windows is inside User or?

eternal osprey
#

hey i have a fuction that checks if a user has a role, and then writes it to the database with the normal member in this case (if it doesn't have any roles)

#

however, after someone else writes the command with the OG role, it will do this:

#

It changes both people to - OG

#

only thing being changed which is really weard

#

weird*

lyric mountain
#

"It's the technician who installed it for us"

eternal osprey
quartz kindle
#

cmd

#

copy E:/users/youruserfolder D:/youruserfolder

#

assuming E is the ssd and D is one of the other hdds, and D has enough space

lyric mountain
#

someone was trying to bruteforce my /encoder endpoint lul

#

they were fuckin trying to make a sucessful http request

earnest phoenix
lyric mountain
#

...except it is actually a websocket endpoint

atomic cairn
#

/encoder

lyric mountain
#

ye, I use it to encode frames into a video

#

made it only listen to local requests now

feral aspen
quartz kindle
#

try xcopy E:\users\youruserfolder D:\youruserfolder /E /H /C /I

#

xcopy is a better copy

#

E H C I are this:

#

/E โ€“ Copy subdirectories, including any empty ones.
/H - Copy files with hidden and system file attributes
/C - Continue copying even if an error occurs.
/I - If in doubt, always assume the destination is a folder. e.g. when the destination does not exist.

lyric mountain
#

/E /C /H /I

#

superior order

quartz kindle
#

xD

feral aspen
#

does xcopy "path" work?

quartz kindle
#

it should

sharp thicket
#

c

feral aspen
#

@quartz kindle

#

I have a question, so this backup is going to take about 3 hours or above to copy.

#

.. is there anything else to backup, or no? If so, or not, what do I do do next?

quartz kindle
#

your user folder has everything except installed programs

#

desktop and appdata are inside the user folder

#

the only things that are outside is the windows folder, the program files folders and the programdata folder

quartz kindle
#

meaning just reinstall the programs you need and you should be fine

feral aspen
#

Ah, alright.

#

But documents, downloads and all of that or backed up, right?

quartz kindle
#

sometimes programs also store user files in programdata, so you could check that, but its rare

#

yes, documents and downloads are inside the user folder

feral aspen
#

So nothing else to backup rather than /user, right?

quartz kindle
#

usually not

feral aspen
#

.. ok, once I finish?

quartz kindle
#

boot from the usb and install windows

feral aspen
#

.. and try not formatting, right?

#

Now suppose it did format and do sh.t, how can I go back to my original form?

#

.. do I like paste the user folder to the C: drive?

#

Shit..

#

Errors.

#

File creation error - The file cannot be accessed bt the system

quartz kindle
#

did it stop copying? it should continue copying even if errors are found

solemn latch
#

๐Ÿค” I'm using cloudflare workers to send webhooks to discord.
I'm using global variables to handle rate limits(or at least stop some if someones spamming the "test" button).

When testing the ratelimits work great, resetting like normal, and sometimes they get cleared by restarts(thats fine).
But when properly doing it(same environment, just the request location changes), the global variable resets every time.
From my understanding workers are not supposed to reset every time, they can jump between datacenters or be cleared, but I could try it 50 times and its like it started for the first time every time.

sullen crater
#

how are you storing the global variable?

solemn latch
#

very complex, let ratelimits = new Map(); in the global scope

sullen crater
#

what are you setting it by?

#

like how do u use it / what do you store in there

proven lantern
#

Isolates

solemn latch
solemn latch
proven lantern
#

Looks like you need some sort of cache service

lament rock
#

there should be an owner ids field when you edit your bot

rose warren
#

Dblteam

livid jackalBOT
#

@hybrid coyote

How do I create a team?

  1. Log into top.gg
  2. Go to your profile
  3. Click the Plus button to create a new team
  4. Fill out all the details about your newly created Team (Icon, Team-Name, Description)
  5. Click "Submit" once you're done!
quaint wasp
#

Is there a way to know what a user is listing on spotify with Spotify API?

#

hello ?

solemn latch
#

from the spotify api side? probably, if they authenticate you via the spotify oauth

modest maple
#

@cursive dagger bro

#

oaky

cursive dagger
#

What's up?

modest maple
#
@app.command(
    "foar",
    description=(
        "Foo bar, bar foo."
    ),
    defer_register=False,
)
async def foobarify(search_query: str, ahh: str) -> Response:
    ...

@foobarify.autocomplete
async def all_results(
    # or you can do **options to get all autocomplete specified values.
    search_query: CommandOption = None,  
) -> List[CompletedOption]:
    ...

# or you can do it on a per callback basis
@foobarify.autocomplete(for_="search_query")
async def search_query_options(value: str) -> List[CompletedOption]:
    ...
#

this is what we've ended up doing for the framework

cursive dagger
#

Yeah that's what I'm gonna do too

#

@modest maple wait what's the completedoption type?

modest maple
#

basically just a Pydantic model that takes name and value

#

Roid is basically entirely built around Pydantic for all the conversion and checks so yeah

solemn latch
simple stump
solemn latch
simple stump
#

Ah I see. So change time: 15000 to time: 3000?

solemn latch
#

or just defer it, and update later.

boreal iron
#

The webhook is available for 4s only for you to respond to it.
Defer can be understood as delaying.
After doing so you can respond to the initial webhook for up to 15 min.

solemn latch
#

its 3s isnt it? ๐Ÿค”

simple stump
#

Alright. Thanks

boreal iron
#

Might be 3 or 4. I always forget this one.

boreal iron
#

Yeah nvm 3s

#

Iโ€™m sure I will forget it again KEKW

proven lantern
slim geyser
#

Oรญ

#

Iโ€™m new

solemn latch
spark flint
#

how do i get slash commands on d.py PepeHands

#

i did from discord_slash import SlashCommand, SlashContext but it didn;t work

solemn latch
proven lantern
#

If you hit the same isolate then you have the same memory.

proven lantern
#

each isolate is running in the same memory, but they dont share

spark flint
solemn latch
#

right, but why would it have one isolate for everyone in a region, then one single ip gets a different isolate every single time.

#

like i can get on my vpn and get the same isolate every time

proven lantern
#

maybe because each ip points to an instance with many isolates running on it. it then does a round robin choice

#

i dont think it points to one isolate

#

its pointing to an isolate container with many isolates

proven lantern
solemn latch
#

๐Ÿค” im going to start generating random global ids on script start, then log it in each request.
see whats going on

solemn latch
#

Looked at the cf worker discord, a lot of them recommend using durable objects for rate limits. probably will go that route.

#

weirdly, they also highly recommend doing it in memory using a map like im doing.

somber wigeon
#

How can I delete them, I create many by mistake

errant flax
thorny flume
#

@solemn latch I cleared all cookies and information from my browser and am still getting an empty array

solemn latch
#

the clear cookies fix was for your login issues, not the api issues

#

you really really should be testing using tools, not top.gg

thorny flume
solemn latch
#

the api does not check your login

#

anyway, I'm not really sure how to help further, using a tool like postman to simulate a top.gg vote is the next step.

thorny flume
solemn latch
#

ok, the next debugging step is to use an external tool such as postman

#

unless you have another idea for debugging this issue

thorny flume
#

ok

urban slate
#

yo guys if i make a command which only i can run and which sends a message in all the systemchannels of all the guilds my bot is in will that be against discords tos?

#

like just an embed to tell the updates on my bot

#

after i update it

thorny flume
#

not

urban slate
#

so not against tos right?

thorny flume
#

not

solemn latch
#

it easily can result in a global ratelimit from discord.

#

youll need to be extremely careful with it

urban slate
#

well is 65 servers a lot?

thorny flume
#

depends on how it is used

urban slate
#

for getting ratelimited?

urban slate
#

-send blah blah update

#

it will send blah blah update to every server

earnest phoenix
#

Try to use interval

urban slate
earnest phoenix
#

Wait 3 seconds for each guild

solemn latch
#

the global ratelimit is what, 50 requests a second?
so if you sent 65 messages in 50 servers thats you getting ratelimited

urban slate
#

ohh

earnest phoenix
#

SerInterval

#

Or nwm util wait is bettee

thorny flume
#

look, are you going to send messages to several servers mutually, to understand?

urban slate
solemn latch
#

discord also added this feature anyway,
if you look in #announcements you can "follow" the channel to get notifications in other servers.

urban slate
solemn latch
#

yeah

#

but that feature is specifically to handle these situations

thorny flume
earnest phoenix
#

Guild.forEach(x =>
Let y = x.channel === community
// Wait(300)
y.send()
});

#

I typed it for example

urban slate
#

igghtt i will check it out

urban slate
thorny flume
earnest phoenix
#

It will wait 300ms on each loop

#

Oh ok

wheat mesa
#

How do I send a file through a webhook using the raw API?

solemn latch
next eagle
#

Hello all ,
Can anyone tell me if buttons and messageactionrow can be used for Discord.js Version 12.5?

lament rock
#

v12 is depreacted. Only v13 supports Buttons iirc

lament rock
#

Buttons are an api v9 feature while Discord.js v12 uses api v8

next eagle
lament rock
next eagle
#

Considering there are too many changes needed? ๐Ÿ˜•

lament rock
#

It can be rough depending on how large your code base is. If you use vscode and keep your code properly annotated for perfect or near perfect typings and have checkJS enabled, it's super easy to find where things may go wrong.

rose warren
#

It's not that bad. You don't have a choice anyway. V12 will stop working soon.

lament rock
#

I got the hell out of the djs dependency hell a long time ago and I'm glad. Funny enough though, I wrote my own wrapper to resemble it based around modular libs I rewrote to TypeScript with original dev permission

proven lantern
#

Are new bots declined if they don't support slash commands and are likely to be denied the new intent in April?

lament rock
#

hi flaze

#

It would be unreasonable to decline bots that aren't using slash commands since that change is mid next year. They will be denied the intent though if their only use case is for command handling

#

The only use case I can think of where they wouldn't decline is moderation

drifting coral
#

(โ•ฏยฐโ–กยฐ๏ผ‰โ•ฏ๏ธต โ”ปโ”โ”ป

next eagle
next eagle
wheat mesa
pale vessel
#
const formData = new FormData();
formData.append("file", fileBuffer, { filename: "file.png" });
formData.append("payload_json", JSON.stringify({ content: "hello" }));
fetch(endpoint, { headers: formData.getHeaders(), body: formData.getBuffer() });```ez
proven lantern
wheat mesa
#

Gonna do it tomorrow though, found a solution for it

pale vessel
#

are u at least using a dependency

cold ruin
#

what size should the background image be in the top.gg css

pale vessel
#

last time you were using like a built-in dependency for something and kuuhaku was mad

wheat mesa
#

I was using an old ass part of Javaโ€™s http package

#

Now Iโ€™m using basically the node fetch equivalent in Java

wheat mesa
#

Much much better

pale vessel
#

o good to hear

#

you use maven/Gradle or what, install everything manually?

cold ruin
wheat mesa
#

Just using raw Java, no Maven or Gradle

pale vessel
#

cuz that's a standard

#

e.g. 1920x1080

#

unless I misunderstood

wheat mesa
#

16x9 enjoyers

cold ruin
#

u

#

h

earnest phoenix
#

jpg better or png for a profile card?

cold ruin
urban slate
#

png = better quality iirc

#

compared to jpg

#

guys how do i get the name of a channel mentioned in a message

#

so right now i have this: let chan = message.mentions.channels.first()

#

but how do i get the channels name from this

#

cause console logging chan gives me a whole key map

summer briar
#

not trying to be dumb but, since discord is kinda removing the message intent what module/library, currently has most of the things that the api gives ?
i don't have any problem with switching language in general, but since i like making bots, i need to know what module/library i should use in future

urban slate
#

i thought they were making it privvelaged

earnest phoenix
#

lol

urban slate
summer briar
#

doesn't Deprecation means removing it ?

earnest phoenix
#

you said they are removing message intent which is incorrect

summer briar
#

sorry if i'm wrong

#

my main lang isn't english

urban slate
#

please

summer briar
summer briar
urban slate
#

dm me te link plz

summer briar
#

join by this

proven lantern
summer briar
proven lantern
proven lantern
#

If your bot has unique functionality that cannot be replicated or otherwise implemented with interactions, you can begin applying once we open the queue for this intent in fall of 2021.

#

if you can make your bots features without access to message content then you will be forced to do that

summer briar
#

oh ok

summer briar
proven lantern
#

i use the discord api directly and created an interaction url

#

i moved my hosting from a vps to aws api gateway that calls lambdas

summer briar
proven lantern
#

it's a lot simpler that way

summer briar
proven lantern
#

i think discordjs13 has slash command support

summer briar
proven lantern
#

using the api directly will always give you access to the newest features

summer briar
proven lantern
#

it's easier than working with the libraries

earnest phoenix
#

why the fuck isn't my mongoose model saving

#

it's logging the updated guild data but when I run guild.save it doesn't save the model

cinder patio
#

ยฏ_(ใƒ„)_/ยฏ

#

Why are you using mongoose in the first place ๐Ÿค”

earnest phoenix
#

it looks cool

#

and way better than await mongo.db("botData").collection("guilds").findOne({ guildId: context.guild.id });

cinder patio
#

you're supposed to save the database and the collection in variables, I usually extend the Mongo.Client class

earnest phoenix
#

also mongodb is faster than mongoose

#

what about sql mmulu

#

how about I just do Models.Guild.findOneAndUpdate({ id: message.guild.id }, guild);

#

@cinder patio wtf how does the same object have different object ids

guild = await Models.Guild.findOne({ id: message.guild.id });
const memberData = guild.members.get(message.author.id);
console.log("before:", memberData);
memberData.xp++;
guild.members.set(message.author.id, memberData);
console.log("after:", (await guild.save()).members.get(message.author.id));
#

I somehow fixed it

#

I don't know how

earnest phoenix
#

detritus is a bit hard for beginners but it is WAYYYY better than djs

dense bison
#

e

earnest phoenix
summer briar
#

Does djs have contxt menu ?

prime mist
errant flax
#

aka the latest version

#

djs is always up to date for discord's new api changes

whole surge
#

hey
which hosting should i use for my bot?

errant flax
#

u will eventually have to pay to upgrade ur db

spark flint
errant flax
whole surge
spark flint
#

as Heroku is slow for bots

errant flax
#

maybe google cloud

spark flint
#

google cloud free is good

errant flax
#

i wanna try it but i dont have a payment method

whole surge
#

yeah but i dont have cc

#

and i am broke too ๐Ÿ˜ฆ

errant flax
#

u dont have to pay as the name suggestion "free trial"

#

suggest*

whole surge
spark flint
#

what about paypal?

whole surge
spark flint
#

you can use paypal

whole surge
#

oh ok

#

will it take any money?

errant flax
#

wait is paypal free2use

spark flint
#

yes

whole surge
spark flint
#

the reciever of the money pays the fee

errant flax
#

runs to make an account

whole surge
#

lol

errant flax
#

oh ur talking to him nvm

spark flint
#

ah shit wrong reply

whole surge
#

ok

spark flint
errant flax
#

does paypal requires something

whole surge
#

i mean will it take 1$ for verification and put it back?

errant flax
#

i feel like theres a catch to it lol

spark flint
errant flax
#

ok ill migrate to google cloud in a couple of days DogKek

spark flint
#

paypal is free, they make their money by making money with interest on the money you store

errant flax
#

thx for letting me know!

spark flint
#

and fees

spark flint
whole surge
#

run to make a google cloud account

whole surge
spark flint
#

im sure

errant flax
#

free

whole surge
#

how many day?

spark flint
#

FREE

errant flax
#

google cloud ends in a year of free trial afaik

whole surge
#

and how much ram a bot uses?

#

if it is in 100+ server

lament stump
#

Depends

#

How many commands, how many users use the bot

#

Etc

spark flint
#

mine uses 5% of the 2gb ram it has lmao

whole surge
whole surge
lament stump
spark flint
lament stump
#

Ah

whole surge
#

like in mp not %

lament stump
#

Yeah, imma get it rq

whole surge
#

ok

#

and anyone wanna test my bot?

lament stump
#

It uses 1.25% of 2GB

#

So 20MBish

#

24.03MB to be exact

whole surge
lament stump
#

2 atm

#

But it won't rise that much

#

I had a bot in 100 Servers and it was around 30-32MBish

whole surge
lament stump
#

Ye

summer briar
whole surge
#

2 atm means what?

lament stump
#

2 servers

whole surge
#

ok

lament stump
#

Atm = at the moment

whole surge
lament stump
#

Nah, i have school

#

And need to work on my bot

whole surge
#

ok

#

which hosting you use

#

@lament stump

lament stump
#

Repl

#

Cuz Burbur was kind enough to give me a private one

whole surge
#

k

whole surge
#

please

#

shut up

spark flint
#

no clue

quartz kindle
#

in mp? megapixels?

urban slate
#

guys how to get a channel by its channel id

#

so i am trying to this right now:

#

but then when i try to do channel.send('this is a message')

#

i get this error

quartz kindle
#

youre mixing it up

urban slate
#

is there some other way?

#

oh should i use some other variable?

quartz kindle
#

either .cache.get()
or await .fetch()

urban slate
#

ohh

#

will .get work?

quartz kindle
#

if you didnt disable channel cache, yes

urban slate
#

ohh okk lemme try

prime mist
pale vessel
#

oh no....axios.............

urban slate
#

oh it worked nice thnx @quartz kindle

prime mist
urban slate
#

guys how do i send an embed and a message together?

#

tried doing this

#

didnt work only sent the message

#

not the embed

misty basalt
#

content and embed

urban slate
#

?

quartz kindle
#

on v13 its { content: msg, embeds: [] }

urban slate
#

ohh

tidal kite
#

Hey dude I'm unable to login in top.gg for voting

misty basalt
#

yup

urban slate
#

ight ight thanks

sinful night
#

hi how can i create slash command in discord.py in cog?

quartz kindle
#

idk of you can

#

afaik dpy doesnt support slash commands directly, you have to use the interaction events and create your own

spark flint
#

it doesn't sadly

#

ive just figured our how to use it

blazing umbra
#

,

spark flint
#

so how do i center text using PILLOW / PIL whatever its called

quartz kindle
#

ah yes, comma post

quartz kindle
spark flint
#

alr

earnest phoenix
#

Is it possible to have a subcommand and a subcommand group with the same name?

pale vessel
#

yes

earnest phoenix
#

ty

#

does this seem like a good idea

/mod
 - logs (subcommand)
  
 - logs (group)
   - clear
earnest phoenix
errant flax
#

can u have a subcommand with the same name as an existing sub cmd grp

earnest phoenix
#

yes

#

that's what flaz said

errant flax
#

the more u know

spark flint
#

(sorry for ping)

quartz kindle
#

whats your code?

spark flint
#
draw = ImageDraw.Draw(img)
        W = 1640
        w, h = draw.textsize(name)
        draw.text(((W-w)/2,275), text=name, fill='white', font=namefont)
        img.save(f"levels/{r['id']}.png")```
#

ignore terrible discord indenting

quartz kindle
#

print h and w

spark flint
#

ok

quartz kindle
#

also is W correct?

#

its probably better to get W from img

#

or whatever the base canvas is

spark flint
#

@drowsy crag IT WAS A NITRO SCAM AND ITS GONE

spark flint
quartz kindle
#

also, you want vertical or horizontal centering?

spark flint
#

i don't want EXACT centre (centred width and height), just centered width

quartz kindle
#

centered width will make it go over the pfp no?

spark flint
#

im gonna rearange it all

quartz kindle
#

ah

spark flint
#

profile pic in the centre, then name and level underneath

#

Possible design?

quartz kindle
#

not bad

#

id put level somewhere else

#

like in a tiny place at the edge of the pfp, similar to how discord does with online/offline icons

#

like a badge thing on top of the pfp

#

or even like the [bot] thing after the username that discord does

spark flint
#

so its kinda like a notification

earnest phoenix
spark flint
#

lr

#

alr

#

i need to work out how

#

maybe a red image and place it like the pfp

#

or will that take too long

earnest phoenix
#

seems like a skill issue

spark flint
#

im trying to make it as fast as possibl

quartz kindle
#

if you want performance, first thing is reduce the image size

#

1640 is way too large

spark flint
#

alr

spark flint
#

i could do 1000x500 image

wooden kindle
#
  const emj = {
        guildOwner: ":crown:",
        id: "๐Ÿ†”",
        info: ":info:",
        user: "๐Ÿ‘ฅ",
        channels: ":channel:",
        time: "โฐ",
        scroll: "๐Ÿ“œ",
        server: ":server:"
    }

    const owner = guild.owner
    crt = guild.createdTimestamp - 1623448172016

    const Embed = new Discord.MessageEmbed()
        .setTitle(`SERVER`)
        .addFields(
            {name: `${emj.server} | ServerData`, value: `> ${emj.scroll} Name: ${guild.name}\n> ${emj.id} ID: ${guild.id}`},
            {name: `${emj.guildOwner} | OwnerData`, value: `> ${emj.scroll} Name & Tag: ${owner.user.tag}\n> ${emj.id} ID: ${owner.id}`},
            {name: `${emj.info} | ServerInfo`, value: `> ${emj.user} Members: ${guild.memberCount}\n> ${emj.channels} Channels: ${guild.channels.cache.map.length}\n> ${emj.time} Created: <t:${crt}> (<t:${crt}:R>)`}
        )

    console.log(crt + '   ' + guild.createdTimestamp)

    c = await client.channels.fetch('878045699911090217');
    c.send({embed: [Embed]});
})```
#

so i made this

#

and its not working

#

is there any reason why or no

#

its giving me no error

#

or anything

quartz kindle
errant flax
#

like this

"DEEZ NUTS"
spark flint
#

its for discord devs to use for bots etc

quartz kindle
#

check what is the size when posted as a message

#

and use that size

spark flint
#

alr

earnest phoenix
#

tim wanna see smth cursed

const logChannel = bot.client.shards.get((882906804575674368 << 22) % bot.client.shardCount).channels.get("886971962386182175");
#

i do not understand what my own copied code does

lyric mountain
#

882906804575674368 << 22 is one big fuckin number

lyric mountain
#

let's say you do 1 << 3

#

1 in binary is 1, if you shift 3 bits to the left it becomes 1000

earnest phoenix
#

this was what evan told me to do when i asked how to get a channel (in detritus)
||then i realized this exists: client.rest.fetchChannel||

modest maple
#

I think you meant to shift to the right

#

Aka reduce the number

lyric mountain
#

or let's say 5, which is 101, 5 << 2 becomes 10100

quartz kindle
#

also, if thats js, no way in hell you can do that without bigint

lyric mountain
#

how big would that shit be tho

#

more than 64bit ig

quartz kindle
#

ye

#

the sharding formula is >> 22 not << 22

#

shard_id = (guild_id >> 22) % num_shards

spark flint
#

so im using that

quartz kindle
#

๐Ÿ‘

spark flint
#

i;ve just got to resize and reposition everything now lmao

quartz kindle
#

hence why relative coordinates are important

#

xD

spark flint
quartz kindle
#

5/7

vocal elk
#

i need to make a bot which will register player in game names and sends it when asked