#development

1 messages · Page 2023 of 1

quartz kindle
#

with sessions you can always delete the token from the db

#

you can give the user a list of sessions and let them invalidate them themselves for example

#

cant do that with jwts

raw nest
#

you can give a jwt an epxiration date

quartz kindle
#

yes but you cant invalidate them manually

raw nest
#

but I guess you can't manually expire right?

#

ah yes

quartz kindle
#

the thing that fb/google/etc do

#

that they show you all your logged in devices

#

and you can make specifict devices logout

#

its done with normal sessions

raw nest
#

aight^^ thanks alot

spark flint
#

How do I sent JSON data in an aiohttp get request?

quartz kindle
#

get requests are not supposed to send any data in the first place

spark flint
#

oh

boreal iron
#

That will also allow you to deauthorize other devices, like in my example

quartz kindle
#

aye aye captain

boreal iron
#

Which also allows you to disable accounts

#

And one query per site request isn't something you should worry about

quartz kindle
#

nothing caching wouldnt solve anyway

#

or a stupid fast db that doesnt need caching

#

(sqlite :^))

boreal iron
#

yeah but what I want to point out is, it has to be requested on each request

#

some account you block, shouldn't have access anymore even for the next request

#

I mean the database has the request cached anyways as long as the table doesn't change

#

but you still have to do that database request

#

And an external centralized database, like mine, can have an impact on that response time

quartz kindle
#

local caching and eventual consistency then

boreal iron
#

nah I don't see any issue here in my case

#

the common response time is about 100ms until the entire page and code is rendered

#

@quartz kindle How’s your API doing? :P I worked very hard the last weeks to finish my 3rd version and the website and I’ve done very good progress

quartz kindle
#

i keep refarctoring it instead of adding the missing stuff

#

lmao

opaque seal
#

what are you building it with?

quartz kindle
#

me? nodejs

#

i think i finally got a somewhat acceptable scaling design, with multiprocess lmdb cache pre-filled with all the ~700k planet ids

boreal iron
quartz kindle
#

rewrote my updating scripts like 3 times

#

trying to get them to be able to update the data without interrupting the running processes

#

separated two monolithic files into two folders of small functions

#

im still not sure about my grep-based full text search

#

but its the only way i can get the results i want, token-based seach indexers always give me lackluster search results

#

and i dont feel like installing something huge like elasticsearch

boreal iron
#

Yeah and the risk of a library in use dropping its support or does major changes seems to be high in the world of JavaScript

#

I noticed as well

quartz kindle
#

yeah, i used to rely on moment-timezone

#

but i wrote something to replace it

#

since its basically in maintenance mode only now

boreal iron
#

Yeah and I was running into the same issue the past years when using and relying on something I had to found out at a certain point the library doesn’t scale well for me or doesn’t do it’s job anymore under certain circumstances

#

And rewriting the entire to get it ruined on the next update sucks as well

#

Doing anything from ground up yourself costs a lot of time but still seems the best way for me if you wanna create something that can last for some years

#

Even if you have redo like thousands of things

quartz kindle
#

yeah

#

im still worried about some things but its too troublesome to change them

#

still, my dependencies are not too bad

#

geo-tz might be a problem in the future, its tied to the iana timezone database which is updated multiple times per year

#

if geo-tz stops updating accordingly it will be troublesome

#

which if its stops being updated, will also screw a lot of people

boreal iron
#

I wonder about adjustments in time zones or new ones

#

I mean how often does that happen…?!

#

Probably rarely

quartz kindle
#

multiple times per year

opaque acorn
#

Raspberry pi 4 to host my bot?

#

Only 50 servers at the moment

quartz kindle
#

sure

#

as long as your internet is good

opaque acorn
neat ingot
#

@quartz kindle Intl module is no help for yourr timezone needs?

wheat mesa
neat ingot
#
Intl.DateTimeFormat().resolvedOptions();
neat ingot
undone rose
#

What is a good D.js framework to use? Is it worth using a d.js framework? Or are there not any that exist that speed up development time and simplofy the process?

quartz kindle
#

not worth

undone rose
real rose
#

I've used frameworks before and iwl they just slowed me down

#

Akario being one of my least favourites

quartz kindle
#

djs by itself is already very easy to use, besides djs is not exactly very efficient to begin with

#

using a framework will not give you much advantages and will contribute to increasing the bloat

lament rock
#

I wanted to make a lib that just only includes some helper classes like Embeds and Buttons and such and wrap that around raw gateway/rest libs in my own code.

I find it impossible to maintain a cacheless version of Discord.js I made because it's just me, so might as well

quartz kindle
#

same

split hazel
#

ignore the context

#

you see the box inside of the box right

#

i wonder what colour i should make it

lament rock
#

lavalink consuming less than 1GB?

#

must not be very large bots then

lyric mountain
#

But well, in my opinion, the buttons are too contrasting and they being differently sized gives a weird feeling

split hazel
#

i changed a bunch up and its looking a lot better

split hazel
#

ok enough suspense

#

i'll be tricking scammers with this

#

thats not the illegal part tho

quartz kindle
#

jim browning is that you

split hazel
#

if you know what i mean

#

overwhelm them with a fake wallet containing 5k+ bitcoin

#

give them login details

#

and conveniently place the transfer to wallet button

#

which will make you install "secure interception-proof wallet protection software"

#

:)

sharp saddle
#

if anyone can help with this :)

#

oh yeah

#

i forgor the code

quartz kindle
#

you'll need an extra div

sharp saddle
#

hmmmmmm

quartz kindle
#

instead of using borders, you add an extra floating div on top of the line, and control it via width and margin (or translateX)

sharp saddle
#

oke

#

wait a second

#

well...

quartz kindle
#

not sure if you'll be able to do it with pure css

#

might need some js

bright thorn
#

anybuddy using hybrid sharding

earnest phoenix
#

Yea i am using

bright thorn
#

then how can we get shard uptime and more...

earnest phoenix
earnest phoenix
#

Same with discord.js sharding manager smiledog

carmine magnet
#

Hello! I'm trying to install git but when I try, I got this error, I've also tested all commands suggested by apt (like apt --fix-broken install) but nothing work

pearl trail
#

sudo apt install git?

nimble kiln
#

He's using root

pearl trail
#

my bad

carmine magnet
nimble kiln
#

If your package manager can't find dependencies on it's own you usually have big problems

carmine magnet
#

:/

nimble kiln
#

Try an apt update first

carmine magnet
#

it doesn't work

nimble kiln
#

updating doesnt work either?

#

Then go and reinstall your vps s1_kekw

carmine magnet
nimble kiln
#

ubuntu groovy, oh my

#

That sounds old af

#

wait no

#

is that 20.10?

carmine magnet
#

idk that's not my vps

pearl trail
#

or maybe try installing one of the unmet dependency, run apt install git again, and check if the unmet dependencies decreased

nimble kiln
#

Do cat /etc/*-release

#

And show the output

carmine magnet
nimble kiln
#

Alright 20.10, one second

#

oh wait

#

20.10

#

That is old

carmine magnet
#

lmao

nimble kiln
#

Do you have backups or that machine?

#

I would recommend just trying to upgrade it to a newer version

pearl trail
nimble kiln
#

Yeah

earnest phoenix
#

Ubuntu 20.10, oh my

carmine magnet
nimble kiln
#

😐

carmine magnet
nimble kiln
#

Then download important configs

#

Your bot config with your token etc.

earnest phoenix
#

Just upgrade to a newer Ubuntu version I guess?

carmine magnet
#

yep i'll

#

should i do the same thing with my vps?

nimble kiln
#

oh my

#

Actually

#

Ubuntu 18.04.4 will no longer receive (standard) support after April 2023

carmine magnet
#

thank you for the information

nimble kiln
#

You could stretch it out until that date

#

But updating to 20.04 isn't a bad choice

carmine magnet
#

i will

nimble kiln
#

18.04.04 isnt the latest version of 18.04 btw

carmine magnet
#

ah ok

split hazel
#

you learn this lesson once but I have to stress do not install any other version of a Linux distro other than LTS on a server

#

on a computer, fine but on a server it will go EOL very quickly

lyric mountain
#

how does ubuntu version enumeration works?

#

like, 20.10 < 18.04

quartz kindle
#

lts is always even number and .04 minor version

#

for some reason

#

.10 is like prerelease, odd number is non-lts release

#

apparently their versioning is based on release dates

#

18.04 released april 2018

#

they always make a new release exactly every 6 months, and a new lts exactly every 2 years

lyric mountain
boreal iron
# lyric mountain what abt 20.10?

Extended Security Maintenance (ESM) provides security updates on Ubuntu LTS releases for additional 5 years. It is available with the Ubuntu Advantage subscription or a Free subscription.

#

xx.04 is a LTS as Tim mentioned

#

20.10 not

carmine magnet
#

okay thank you all for the information

lyric mountain
carmine magnet
#

2020 i guess

boreal iron
lyric mountain
#

but 18.04 was released in 2018

boreal iron
#

Of the mandatory version

boreal iron
carmine magnet
#

You have to fetch the guildmember

boreal iron
carmine magnet
#

member.timeout(ms("2d"))

#

for example

weak grove
boreal iron
weak grove
carmine magnet
boreal iron
#

Did you wrap the html code in code tags?

lyric mountain
#

and I thought battlefield release numbers were confusing

boreal iron
#

wtf

#

how is that confusing?

lyric mountain
#

like, 20.04 > 18.04 > 20.10

boreal iron
#

By naming the release number by the year of it's release

#

No wtf

#

18.04 isnt > than 20.10

split hazel
#

never knew Ubuntu was released in 1804

boreal iron
#

20.10 just does NOT have the ESM

lyric mountain
#

great, that answers the question

boreal iron
#

Because it's not a LTS version

weak grove
# boreal iron Did you wrap the html code in code tags?
<li>Botun Komutlarını Görmek İçin /yardım veya !!yardım</li>
----------------------------------------------

<table id="komuttlarr">
                    <tbody><tr class="header">
                        <th style="width:15%;">Komut İsmi</th>
                        <th style="width:60%;">Açıklama</th>
                        <th style="width:25%;">Kullanım Şekli</th>
                    </tr>
                    <tr>
                        
                        <td>
                            Kullanıcı 
                        </td>
                        <td>
                            Kullanıcı Komutlarını Gösterir.
                        </td>
                        <td>
                           /kullanıcı veya !!kullanıcı
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Moderasyon
                        </td>
                        <td>
                            Moderasyon Komutlarını Gösterir.
                        </td>
                        <td>
                            /moderasyon veya !!moderasyon
                        </td>
                    </tr>
                    <tr>
                        <td>Aboneyardım</td>
                        <td>
                            Aboneyardım Komutlarını Gösterir.
                        </td>
                        <td>
                          /aboneyardım veya !!aboneyardım </td>
                    </tr>
                    <tr>
                      <td> Eğlence </td>
                        <td>
                             Eğlence Komutlarınız Gösterir.
                        </td>
                        <td>
                           /eğlence veya !!eğlence
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Müzik
                        </td>
                        <td>
                            Müzik Komutlarını Gösterir.         </td>
                        <td>/müzik veya !!müzik </td>
                    </tr>
        
                </tbody></table>   
                        
           
 <style>
.columns .bot-img {
     border-radius: 4px !important;
     overflow: visible !important;
     box-shadow: none !important;
     background: none !important;
     box-shadow: none !important;
}

  
</style>
lyric mountain
#

tf

boreal iron
#

lol that interruption :D

quartz kindle
#

Botun Komutlarını Görmek İçin /yardım veya !!yardım

weak grove
#

yes

lyric mountain
#

that tittleless i is cursed

boreal iron
#

Can't actually help you right now

#

Topgg edit & preview function doesn't work atm

quartz kindle
#

preview never worked correctly

boreal iron
#

Amazing how they manage to fuck up each feature of site day by day

quartz kindle
#

you have to save and reload the page

#

dont use preview

weak grove
#

okey

#

okey tenks

solemn latch
earnest phoenix
#

To get the member from the mentions, you can use the first() method on <Message>.mentions.members instead of users, since the timeout() method only exists on a guild member instance

quartz kindle
#

guildus memberus

earnest phoenix
#

So true

#

Show code

#

Have you checked what the message parameter actually is?

#

That error seems to occur because an actual message instance is not being passed as the message parameter

#

Try logging the message parameter

quartz kindle
#

show where you use .run()

#

await command.run(client, message, args);

#

function arguments are passed by order, not by name

#

async (client, member, message, args) => {

#

client is client, member is message, message is args, and args is undefined

slender thistle
#

Is there a big difference to consider when choosing between Vue and React for a project?

solemn latch
#

what changes did you make?

#

🤔 that still doesnt seem right.

(client, message, args)
as thats what you are passing in here

#

function arguments are sorted the same way every time.
so
if you run
someFunction(a, b, c)
and your function is defined as

function someFunction(b, c, d) {
console.log(b) // logs a
console.log(c) // logs b
console.log(d) // logs c
}

js function arguments go by order, not by name.

#

its probably easier to fix it here

quartz kindle
#

function arguments are passed in order, not by name, as i said

#

if you do .run("test")

#

no matter what you write in async run(a, c, b, etc)

#

the first name will always be "test"

#

since you are doing await command.run(client, message, args);

#

the first thing is always client

#

the second thing is always message

#

the third thing is always args

#

does not matter what names you write in your run functions

#

run: async (client, member, message, args) => { it does not matter what names you write here

#

the second one is always gonna be a message

#

the third one is always gonna be args

#

the fourth one is always gonna be undefined because it doesnt exist

wheat mesa
#

(Also you don’t really need a parameter for client, you can access it through basically any structure)

#

Same with member

tulip ledge
#

You do like let time = args.pop()

#

Then you do let user = args.shift()

#

Then let reason = args.join(“ “)

cinder patio
#

we need to see the code

#

for the command

simple stump
#

I have a domain and a VPS as my hoster, and am using Express and NodeJS. How do I expose the web server publicly to the domain?

cinder patio
#

Using nginx as a reverse proxy would be the easiest way to do it

spark flint
#
.setFooter({ text:``, iconURL:`` })```
quartz kindle
#

and setup your dns records to point to your vps's ip address

#

then in your vps you need to run a webserver on port 80 for http and port 443 for https

#

could be nginx with a reverse proxy to node, or node itself, but since ports < 1000 are protected you need to either run node as root or configure your system to give it permission for those ports

carmine magnet
quartz kindle
#

and you have 350 dependencies

#

:^)

carmine magnet
#

fortunately, filezilla have filters

true ravine
#

Anyone have any recommendations for where to host a postgres database, ideally as cheaply as possible

#

I have seen the free tier on AWS RDS which looks tempting, but I'm gonna have to pay for it eventually and I want to minimise that cost

#

I want it to be managed with automatic backups

solemn latch
#

why are managed databases so expensive 👀

split hazel
#

because they manage it for you

solemn latch
#

you know, that makes sense.

split hazel
#

i'd imagine its more work, they handle scaling for you automatically, optimise your database based on your data and performance etc

#

gives them an excuse to charge more even if its automated

solemn latch
#

seems a bit cheaper

quaint rampart
#

what are some projects you guys are currently working on?

solemn latch
#

graphs for my webhook dodad

true ravine
solemn latch
#

is there a reason you need managed?
I feel like managed doesnt make sense until very high usage.

lyric mountain
#

if shit hits the fan they'll handle it for u

solemn latch
#

hmm

lyric mountain
#

database-related, not data-related

quaint rampart
#

@solemn latch your site is broken on mobile

solemn latch
#

yep ^_^

#

most of my sites dont work with safari

lyric mountain
#

like, they're responsible for ensuring everything runs smooth for ur usage

solemn latch
#

since safari stinky 😄

quaint rampart
#

sad

lyric mountain
solemn latch
#

I have no access to safari, so I cant really fix it 😔

sage bobcat
solemn latch
#

or well, refuse to

sage bobcat
#

One message removed from a suspended account.

quaint rampart
#

android <

solemn latch
#

👀 I found out yesterday you cannot lower the res of a video on ios

quaint rampart
#

huh wym

solemn latch
#

my sister needed to send a video for work and cant because of its size.

took like 3 hours to do because ios 😔

quaint rampart
#

i h

#

oh

#

yeah

solemn latch
#

ended up uploading it to one of my sites and downloading it then lowering the res 👀

quaint rampart
#

apple support couldn’t help me with 2 of their own products

#

haven’t been able to pair my apple watch to my phone

#

for a year now

#

support said nothing they can do ab it

solemn latch
#

i've heard thats common, refusing to help fix things.

quaint rampart
#

after making me screenshare 7736363 times

#

their “resolution” to everuthing is

#

“update your phone”

#

😐

solemn latch
#

its really sad, they make some awesome stuff.

quaint rampart
#

fr man

#

makes sense

solemn latch
solemn latch
solemn latch
true ravine
#

Well basically I just want a postgres databse where a) I don't lose data if something goes wrong and b) it's not my fault if I do lose data

lyric mountain
sage bobcat
true ravine
lyric mountain
#

I mean, no service will make u 100% not responsible if u lose data

#

after all, as long as you have access to queries you could always do DROP DATABASE db;

quaint rampart
lyric mountain
#

just setup a cronjob on root user to make periodic backups to the cloud

solemn latch
#

I would not be surprised if thats how even topgg does backups

lyric mountain
#

I do that, pretty easy to setup and reliable enough

#

just dont store the backup on the same server

quaint rampart
#

literally can’t make this shit up bro 🤦‍♂️

lyric mountain
#

forgor the device

quaint rampart
#

joke of a company bro

#

support can’t even help with their own products

#

oh also a couple weeks ago

#

all my reminders got cleared from my phone

#

for no reason

#

100+ birthday reminders gone

lyric mountain
quaint rampart
#

LOL

#

just learn javascript bro 🤓

#

^ everyone’s response to a new coder

winter pasture
#

Personally I always recommend COBOL to new developers
Got to make sure their skills are not relevant so they cant take our jobs 4ktroll

lyric mountain
#

every bank in existence: "We will watch their career with great interest"

winter pasture
#

The one industry I am not going back into is banking/finance
It is fun until you realise all the compliance requirements, outdated tech stack and the lack of freedom

quartz kindle
#

go back to filling up excel sheets

winter pasture
#

Not saying every company is like that, but my sample set of 7 banks, just no

wheat mesa
#

To be fair that’s a lot of responses in here because there’s a lot of “new coders” in here that choose to start with a discord bot

#

Which generally isn’t the way to do things

quartz kindle
#

the problem is not exactly starting with a bot, its fine to start with a bot, but like, at least put some effort into learning along the way instead of blindly typing random stuff until it works by sheer luck

wheat mesa
#

Yeah

#

I guess this is another instance of “correlation != causation” with what I said, but still

#

Generally speaking people want their bots to be complex from the very beginning but lack the knowledge to do so, and end up getting spoonfed instead of learning on their own

lyric mountain
#

what did u input?

#

like, the message

#

well, why not isn't a valid duration

#

for that lib, u probably need to capture the duration string

wheat mesa
#

Enjoy doing that btw

lyric mountain
#

you could also use my method, but idk up to you

wheat mesa
#

Either use a regex or prefix it with a flag like -

lyric mountain
#

ur not inputting 5m

#

ur inputting why not 5m

#

no

#

because 5m why not also isn't 5m

#

you need to isolate the duration arguments

#

well, process each word separately

#

and add to a final sum

#

const words = args[0].split(" ")

#

for (const word of words)

#

as you'd imagine

#

do you even understand what this regex does?

#

what does it do?

#

hm, that's right

lyric mountain
#

if it errors, go to next word

#

OR use the method I said before (?:(?<day>\d+)d)? (for days only)

#

you'd add one named group for each desired unit

#

then loop over each group multiplying the captured value by its millis amount

#

this doesn't need input formatting at all, it captures anywhere in a string

#

no

#

simply .join("") instead of toString()

lament rock
#

.map(...).join("")

lyric mountain
#

better yet, remove the trailling \n and use .join("\n")

lament rock
#

actually joining by 2 newlines would be better because the last entry would have a newline

lyric mountain
#

true

simple stump
#

I'm attempting to use nginx and ExpressJS together, but for some reason nginx doesn't forward to my domain (eltik.net). For express, I'm listening on port 3000:

let port = 3000;
app.listen(port, () => {
    console.log('Listening to port ' + port);
})

And for nginx, I'm using the default config but modified (based on some tutorials I looked up).
https://sourceb.in/KRApiE3OBd

I'm using Namecheap for my domain service and am not quite sure whether I set it up correctly, but I've attached the DNS record thing that I set up.

http://localhost:3000 works perfectly fine, it's just the domain that I'm having issue with. What's difficult is that for ExpressJS, I can connect to localhost fine without nginx, some I'm not sure whether it's a domain or nginx issue.

quartz kindle
#

does http://localhost:80 also work?

#

if 3000 works but 80 doesnt, the problem is nginx

#

if both work, the problem is the domain

#

if both work, try you domain with and without www.

simple stump
#

Oh I see. Thanks! That’s super helpful. I’ll need to change :80 to :3000.

sterile lantern
#
let DM = await message.author.send({ embeds: [q2] })
const filter = m => m.author.id === message.author.id
let sure = await DM.channel.awaitMessages({
            filter, 
            max: 1,
            time: 120000
        })

How come the awaitMessages isn't working here?

#

this is what it's supposed to do:

#
 if (!sure.size) {
            return message.author.send({ embeds: [timeout] });
        }
        if (sure.first().content.toLowerCase() == "cancel") {
            return message.author.send("Prompt cancelled!")
        }
        if (sure.first().content.toLowerCase() == "no") {
            return message.author.send("Prompt has been cancelled since you responded with no.")
        }
        if (sure.first().content.toLowerCase() !== "yes" && sure.first().content.toLowerCase() !== "no") {
            return message.author.send("Did not recieve a yes or no response. Prompt has been cancelled.")
        }```
quartz kindle
#

do you have the direct messages intent?

sterile lantern
#

oh.. completely forgot about that. thanks!

quaint rampart
#

anyone know how to wait for a forEach loop? i tried everything (javascript)

sudden geyser
#

Depends on how you want to wait.

#

If it's async/await, consider using a for of loop instead.

proven lantern
viral spade
#

hello, i am using discord.js and have the problem that my customId field is too long. DiscordAPIError: Invalid Form Body data.components[0].components[3].custom_id: Must be 100 or fewer in length.

I have a lot of information to pass here, f.e.:
Execute function
r[0].setCustomId(`commandsSlash/config-channel.js ${i.member.id} ${id} ${type} noXp`);
r[1].setCustomId(`commandsSlash/config-channel.js ${i.member.id} ${id} ${type} noCommand`);

Component function
const [, memberId, channelId, channelType, type] = i.customId.split(' ');

Do you have any ideas how i could solve this issue?

quartz kindle
#

find a way to reduce the data you need to have there, and optimize it to be more efficient

lyric mountain
quartz kindle
viral spade
quartz kindle
#

for example, you can use numbers for types, onstead of strings

#

you can use numbers to represent other things as well

#

and just have a map to translate them back

viral spade
lyric mountain
#

or better yet:

let str
switch (sure.first().content.toLowerCase()) {
  case "yes": break
  case "no": str = "Prompt has been cancelled since you responded with no."; break
  case "cancel": str = "Prompt cancelled!"; break
  default: str = "Did not recieve a yes or no response. Prompt has been cancelled."
}

if (str) return message.author.send(str)
#

interesting enough, this can become even smaller on java

viral spade
#

or could i make temporary mappings between interaction id and the customObject?

quartz kindle
#

via bigint

#

even hex is more efficient

viral spade
#

ah okey!
would it be bad implementation to completely put the mapping in a new module scoped variable, mapping the interactionId to my custom object? then i would not even need the customId field at all?

quartz kindle
#

you can try doing that as well yes

viral spade
#

ok thanks very much

novel snow
#

Anyone got a way to better protect your token? My bot got a nuker on it somehow and nuked a server, 100% certain no one could've gotten the token in any way, just bad luck? any way to protect against it?

quartz kindle
#

nuked how?

#

did your bot have admin perms?

sudden geyser
#

Do you know how your token got exposed?

novel snow
#

Never have sent it to anyone, never screenshared anything, no screenshots of code, hosted on a vm on my own private server,

#

I am clueless as to how

#

These lads claim they did it apparentlu

quartz kindle
#

did you download/run any suspicious software? like some dude asking you to test a game they made, or something claiming to give you free nitro

viral spade
# quartz kindle im pretty sure you're trying to put data there that doesnt really need to be the...

I was thinking what data i can leave out completely (aside from making it more compact/efficient)... the channelType i do not need, as i can also determine it within the component function.

but how about the memberId of the member thats triggering the interaction? Is the check for "it being the same member" triggering the interaction in the first place and sending the answer in the component function necessary? My mate tells me another user can otherwise answer the interaction.

sterile lantern
#
 await emschannel.permissionsOverwrites.edit('868664428831309855', { VIEW_CHANNEL: true, SEND_MESSAGES: true });```
#

this doesn't work, getting error one sec

#

im giving a role id btw ^

#

not sure why it isnt working

#

nvm im just being dumb

split hazel
#

@quartz kindle really just bought a .org domain for the bait website for £6 💀

#

bet the scammers will feel good about themselves

quartz kindle
#

lmao

#

lets see if you manage to actually get some coins out of them

split hazel
#

i made a similar website before

quartz kindle
#

scammers are more tight about their money than millionaires are

split hazel
#

but it was just a time waster

#

i said "i have money on here" and told them to sign up to the website

#

but the sign up website had a queue of people that lasted 12 hours lmao

#

and at the end it just errors

quartz kindle
#

lmao

split hazel
#

it worked

#

i have whatsapp messages

quartz kindle
#

i told a scammer once i couldnt send bitcoins to him because of "my company's security system" that only allows me to send to wallets from which i have received something at least once

#

he accused me of trying to scam him

#

lmao

split hazel
#

i made him do it twice lmao

quartz kindle
#

ever asked a scammer to send you an id?

split hazel
#

no but i should

quartz kindle
#

i asked one

#

they sent me a fake ass id from google

split hazel
#

i did ask to send bank account though

#

i contacted the bank to report them they didnt care

wheat mesa
split hazel
#

bro really coded himself some bitches

#

this is golden

sudden geyser
#

+ 18 just safeguarding

quartz kindle
#

lmfao

sudden geyser
quartz kindle
#

why is femboy not used

sudden geyser
#

too hot

quartz kindle
#

xD

spark flint
#

is it possible to add stickers with Discord.js

quartz kindle
spark flint
#

that exists?

quartz kindle
spark flint
#

didn't realise that existed

quartz kindle
#

in v13 yes

spark flint
#

i checked docs before, i think i'm stupid

sharp saddle
#

I never saw it

#

Tim is chad

lyric mountain
vivid basin
#

hey uh, my bot got declined for having multiple instances. however, when i tested it out, it only sent one message so i am confused

lyric mountain
#

Show your code for event handling

#

Like, the code that process the commands

wheat mesa
#

Trying to make a simple library for the discord api in C#, how do I connect to the gateway? I keep getting a 401 Unauthorized whenever I request https://discord.com/api/v9/gateway/bot even when providing Authorization: Bearer myTokenHere as a header

#

Nevermind, turns out I needed to do Bot myToken

austere surge
#

f

sharp geyser
#

stupid

#

smh

#

and you call yourself a pro programmer

wheat mesa
#

never called myself that but yeah definitely

radiant kraken
#

or an Application secret

quartz kindle
#

or an Uvuvwevwevwe Onyetenyevwe Ugwemubwem Ossas

radiant kraken
#

agreed

raw nest
#

Refactoring >/< Rebuild?
It's not a too big application and it does work but the code is damn ugly and for others (imo) unmaintainable. I could refactor the whole code and make it better or just rebuild the whole because there are also some things I would have to rebuild anyways because it's done bad and since I found new technolgies etc. I need to make it better/easier.

bright thorn
#

how to get all shards uptime

#

ws didn't give uptime?

austere surge
#

keep a variable of when it was started and use that ¯_(ツ)_/¯

raw nest
#

I have a GitHub repo with some commits and pushes. How can I now get my repo back to a specific commit on github.com itself???

lament rock
austere surge
#

ye

raw nest
#

what‘s the prupose of them then?

earnest phoenix
#

You can rebase the whole GitHub commit history to remove all the commits after a specific commit, or select the ones beyond the one wanted and move them to a separate branch

#

But be careful as rebasing rewrites the history, so you would lose all the commits you've made if you don't know how to work with rebases

simple stump
#

I'm trying to forward my express server to my domain (eltik.net) using nginx, but for some reason I just get a 522 error from CloudFlare.
nginx config: https://sourceb.in/dtRoDZw1AR

Express:

let port = 3000;
app.listen(port, () => {
    console.log('Listening to port ' + port);
})

Extra info:

  • Going to localhost:3000 works fine.
  • Going to localhost:80 works fine.
  • I bought the domain originally with Namecheap and switched over to CloudFlare.
bright thorn
#

run in local host

#

then check its running or not

#

local host mean in vps local host by screen

#

once if it running add cname with www and your ip on cloudflare

marble juniper
#

Do I need the manage webhooks permission to fetch a webhook?

#

Probably an obvious answer yet im still not sure lol

bright thorn
#

yeah you want i am also doing same thing

marble juniper
#

?

earnest phoenix
marble juniper
#

Well I just use the fetchWebhook function on a message of a webhook

#

so idk if that requires the perm or not

#

but probably since I don't have the token

earnest phoenix
#

Then yeah

bright thorn
nimble kiln
bright thorn
#
const jsonData = require("../hints.json");
let uniqueRandoms = Object.values(jsonData)
let numRandoms = 5;
async function hint(guildData){
// refill the array if needed
if (!uniqueRandoms.length) {
  for (var i = 0; i < numRandoms; i++) {
      uniqueRandoms.push(i);
  }
}
var index = Math.floor(Math.random() * uniqueRandoms.length);
var val = uniqueRandoms[index];
let prefix = guildData.prefix
// now remove that value from the array
uniqueRandoms.splice(index, 1);
return val;
}

How can i change prefix value from json object

feral aspen
#

Goodness, which one of these is an array since there aren't any.

tight scaffold
#

so for some reason the test webhook button causes spam in my console, postman doesnt do this

lyric mountain
#

are u replying with 200?

tight scaffold
#

yes

#
[HttpPost("/topggwebhook")]
    [Authorize(Policy = Policies.TOPGG_AUTH)]
    public async Task<IActionResult> TopggWebhook([FromBody] TopggVoteWebhookModel data)
    { 
        _logger.LogInformation("User {UserId} has voted for Bot {BotId} on {Platform}",
            data.User,
            data.Bot,
            "top.gg");
        await _votesCache.AddNewTopggVote(data.User);
        await Events.InvokeTopGg(data);
        await SendWebhook(ulong.Parse(data.User), "Top.GG");
        return Ok();
    }
#

its possible the webhook part is hanging it somehow

#

lemme try wrapping it in a task run

lyric mountain
#

what lang is that?

tight scaffold
#

c#

lyric mountain
#

so it also inherits things from js

#

(and weird annotation syntax)

tight scaffold
#

yeah but its not format strict

#

at all

#
object.


Property;

Is valid c#

#

just complains its not assigned lol

sudden geyser
#

TopGg nooo

tight scaffold
#

thats proper method naming

dry imp
#

ocd nooooooooooooooooooooooooooooooo

pulsar bone
#
file = message.attachments
await message.channel.send(content = 'something', files=file)
'Attachment' object has no attribute 'fp'
#

anyone know this error

#

?

lyric mountain
#

show the entire context

simple stump
#

Thank you for the suggestion. I’ll look into sites-available and sites-enabled 👍 How can I make the port public? Would I have to port forward? Sorry I’m not very familiar with web hosting
EDIT: Fixed I just opened the port publicly haha

slender thistle
neat ingot
#

whats good folks?

simple stump
#

wtf github copilot

sudden geyser
#

probably scanned yanderedev's private repos

simple stump
#

lmao

earnest phoenix
neat ingot
#

you know what sucks ~ when you go to make something 'better' and spend 3 days with everything broke af 😐

sudden geyser
#

insult to injury if you did it on the main/master branch

neat ingot
#

i guess that depends if you count the master as my github backup, or my actual project 😄

#

wait

#

why is the general voice chat 'playing a game'

#

how can voice channels use rpc?

#

wtaf?

#

or is that only cause of the user in the channel?

simple stump
#

if the user has an activity

#

then on hover it shows it

#

its weird

neat ingot
#

yea thats messed up, really looks like the channel has the activity

simple stump
#

yeah

neat ingot
#

but yea i seen the user has it too lol

simple stump
#

"General is playing a game"

neat ingot
#

i wonder, if i join, does my rpc overpower their rpc...

simple stump
#

o i think it shows both

neat ingot
#

hax

#

lol

simple stump
#

General is now playing 2 games

earnest mural
#

ew

austere surge
#

pokmon

pulsar bone
#

whats this error pls help me i have to present the code some where and here i get the error in a part of code which i havn't even edited

pulsar bone
gloomy vessel
opaque acorn
#

interaction.connect(interaction.member.voice.channel) = channel.join() ???

simple stump
#

I'm trying to use express-subdomain to get anify.eltik.net and eltik.net. However, when visiting anify.eltik.net, I receive the error "Cannot get /".

const app = express();
app.anify = express.Router();

app.use(subdomain('anify', app.anify));

// For eltik.net
app.all('/', function(req, res) {
    res.write("a");
    res.end();
});

// For anify.eltik.net
app.anify.get('/', function(req, res){
    res.redirect('/home');
    // Redirect anify.eltik.net/home for testing
});
split hazel
#

well not 10 seconds but you get the point lmao

split hazel
#
app.use((req, res, next) => {
  if (!req.subdomains.length || req.subdomains[0] !== 'anify') return res.status(404);
  else next();
});```
#

something like that i forgot how the middleware api works

split hazel
#

does this trigger you guys

#

cool dont care fuck you

sly shoal
#

Can you write to me who can help me apply for Message Content Intent and Presence Intent?

split hazel
#

i will root as much as i want

tiny ridge
#

I do it too tho lol

split hazel
#

stupid hardcore bull headed linux users

tiny ridge
#

I am just too lazy not to use root lmao

#

I know I shouldn't do it

#

but I just do

#

:)

quartz kindle
#

i use root too lol

#

icba creating a separate account

#

just use ssh keys instead of password and it should be virtually unhackable anyway

split hazel
#

nicre

#

i installed the bleeding edge version of node just to use experimental fetch

#

i do not wish to use node-fetch anymore

quartz kindle
#

i do not wish to be horny anymore

split hazel
#

same

#

meetup?

quartz kindle
#

sure

#

btw you can always install undici on any node version

#

you dont need bleeding edge

winter pasture
#

I mean node 18 is LTS. So should be fine

#

Yet to try it out tho. Hyped for their new built in test runner

wheat mesa
#

Not gonna lie, I've been suffering with the complexity of ASP.NET for the past few days so much that I just tried next.js and this is so fucking easy it's heavenly

quartz kindle
#

damn didnt know v18 is already out, just read the changelog

#

they went straight into v8 10.1 which is not even released yet

#

i mean, technically they already have branches up to 10.3 but their latest blog post was about 9.9

split hazel
#

anyone know how to fix this :c

#

new domain

#

(btw thats scammer backwards)

quartz kindle
#

lmao

#

dns propagation can take a few hours

#

run some propagation checker online

split hazel
#

yeah i know but its too exciting to wait for

#

besides on my phone it works fine so it has to be some local issue

#

so my isps dns propagation is fine

quartz kindle
#

dns cache maybe

#

running on windows?

split hazel
#

linux

quartz kindle
#

idk then

#

on windows you could do ipconfig /flushdns

#

there should be something similar on linux

split hazel
#

going to setup https in the meantime

boreal iron
#

Your router could still be the source

#

It’s also caching results

split hazel
#

i'll try a few things

boreal iron
#

Make sure to configure the TTLs right as well as the zone properties

split hazel
#

yeah subdomain works for me just not main domain

boreal iron
#

Brb

split hazel
#

subdomain is the one i'll be using anyways so i can wait for the cache to propagate on the main one

boreal iron
#

Great new updates

#

Not only I have to scroll down to development each time

#

Also I can’t hide the commands and music channels anymore

#

And the read only channel start board has been moved to hangout

#

🤦‍♂️

sudden geyser
#

Yeah this new structure sucks balls

#

Literally have to collapse and mute a ton of channels to have a half decent experience

boreal iron
#

Yeah

quartz kindle
#

hostile plump takeover

boreal iron
#

Seems like discord is becoming the same mess as the website

sudden geyser
#

Like, the old structure already sucked, but I could at least leave general open. Now I can't even without it becoming too long

boreal iron
#

True

#

Would have been easier to attach a getting started channel at the top without category

#

To “improve” the usability for new users

#

Instead of fucking it up for 200k others

#

I don’t like the present and future

spark flint
#

Boosters is under gen2 now

boreal iron
#

Scratching API v3 off the list and adding time machine to it

spark flint
#

Which sucks

lament rock
#

Locally modified channel positions please

spark flint
boreal iron
#

I may would consider to think about to buy nitro then

#

just joking

#

Now it takes like 3-4s to scroll down the channel list and find this and the api channel somewhere

#

Fuck it, no free support anymore

lament rock
#

Would deter a lot of people who don't know what they're talking about

split hazel
#

for some reason my python script wont work can someone help?

#

CODE

pritn("hello world")
lament rock
#

pain

wheat mesa
#

😈

sudden geyser
#

tired

boreal iron
#

Sad

sudden geyser
#

good

pale vessel
#

you can put anything in any position

#

channels, categories, users

boreal iron
#

Don’t even know how to do that tbh

#

Can’t find anything regarding favorites in any context menu

#

But feel free to tell me pepowot

pale vessel
#

oh, i don't think it's on mobile anyway

#

rip

boreal iron
#

Didn’t see it in the browser version , too

radiant kraken
lament rock
pale vessel
boreal iron
#

I see we gotta live with that mess now

#

😥

rustic nova
bright thorn
#
    if (
      cooldown(client, message.member.id, command) &&
      !client.ownerids.includes(message.member.id)
    ) {
      let timeLeft = cooldown(client, message.member.id, command);
      return message.channel.send({
        embeds: [
          new MessageEmbed()
            .setColor(client.settings.bot.embed_color)
            .setDescription(
              `${emojis.cross} Please wait for ${timeLeft} before reusing the \`${command.name}\` command!`
            ),
        ],
      });
    }

I want to send this message only one time

#

how can i

lament rock
#

set a value saying that the client sent the message recently and then set a timeout for a desired amount of time for when the value resets. If the client sent a message recently, return or wait for the value to be set back before proceeding

acoustic reef
slender thistle
#

Speedy not so speedy

spark flint
#

lol

#

wait is that the toneh who signed up for my website even tho its very far from done KEKW

stiff lynx
#

How can I make a button work only for the first interaction?

spark flint
#

after the first interaction

#

.setDisabled(true)

spark flint
#

no

#

donatey

acoustic reef
#

oh

#

ah yeah i did

spark flint
#

i fixed it now

#

you can actually visit pages now

shut socket
lament rock
#

@earnest phoenix I have a dillema.
In order to provide reloadable modules, modules have to export an object in order to abuse Object.assign so that the end user can just reference the old Object which could have all its old props deleted and then populated with new props and there's no problems there. My problem is "What about non objects?"

I thought about returning the user an Object I can assign new props to later, but the problem is they didn't export an Object, so it won't be like how they may want it.
In my example, I will say that a user has set module.exports as a boolean. Can I use a Proxy to "fake" the boolean and still internally use an Object or is there a better approach to this?

earnest phoenix
#

Well yes you can indeed use a proxy to mimic the value passed and use something else entirely internally, another approach would be to deep copy the value passed in a way that all the properties and methods are also present in the new ones including non-enumerable properties and methods and also symbols, the best approach here would be using proxies

lament rock
#

So, say you proxy all calls to the internal object member that holds the original reference, you can do this?

typeof proxiedBoolean === "boolean"
earnest phoenix
#

Absolutely

lament rock
#

Holy shit

earnest phoenix
#

Proxies are ✨ magic ✨

lament rock
#

okay. Now, regarding this

deep copy the value passed in a way that all the properties and methods are also present in the new ones including non-enumerable properties and methods and also symbols

How would I do this

earnest phoenix
#

You can check the type of the value and return the value or a new value based on the type, for example booleans and numbers have no reference to each other whatsoever, so if you return the same value, it should be fine as they're marked as non-referencable, if you encounter an array or an object, you can use something like Reflect.ownKeys() to extract all properties and assign them to a new object, the same thing for arrays but iterating through all the elements to accurately deep copy them

#

But this can be inefficient, so I'd recommend using proxies, unless you want to test out both of them

lament rock
#

I'll probably have a generic handler to store the old reference in an object and return a Proxy to the user which references the member

#

Thanks a ton. I've been racking my brain over this for years

earnest phoenix
#

You're welcome, always here to help

lament rock
#

@earnest phoenix One more thing. I don't expect you to know as you may not be SUPER deep into typescript, but I'm trying to also provide typings to the user for a module they require through my module. NodeJS.Require() is kinda weird as the typings in @types/node don't seem to do any magic, but when applying the type signature of NodeJS.Require() to my module's require method, nothing really pops up. I tried dynamic import types, but import does not like that and expects a string literal.

earnest phoenix
#

I don't think I exactly understood what you're trying to do, are you trying to export typings through modules and let the user import them using the global require() function?

lament rock
#

no. For example:

const mod = myModule.require("./path/to/mod") // Would just return any
earnest phoenix
#

Hmm, the way you do it returns the type as any when requiring that module? If so, and if that's what you meant then either the path resolver in your IDE wasn't able to resolve that to return the type correctly, or if that actually occurs when passing it into TypeScript, then I'm unsure why that could be happening, it's either because the typings given by @types/node declared by DefinitelyTyped causes it to think that the exported moduls always return an any type in this case, or it's clashing with the value's type

#

In my experience, I've never seen that occur, it has always returned the type correctly

lament rock
#

meant to put typeof import(T), but that doesn't fix anything

#

the return value is dynamic, but I suppose TypeScript just does not like dynamic imports

earnest phoenix
#

What in the seven gates of hell, yeah that's a TypeScript issue, I don't think there's a way to fix that

lament rock
#

damn

#

oh well. Thanks for your time

earnest phoenix
#

Always, anytime

wooden ember
#

anyone know how regex works? cuz I made a bot that saves yt videos but i name the file the name of the video

#

however i need a way of removing all non alphanumeric chars

lament rock
#

string.replace(/[^a-zA-Z]/g, "")

compact briar
lament rock
#

You also need A-Z

wooden ember
#

ah cool

winter pasture
lament rock
#

nvm i flag

#

yeah just realized

wooden ember
#

what does the g mean?

lament rock
#

I'd rather not use flags not necessary

#

global

#

matches the entire string

#

without it, it would just match 1 char

wooden ember
#

oh i see

#

and im guessing that it replaces everything with nothing hence the ''

compact briar
#

yes exactly

wooden ember
#

nice

lyric mountain
#

just use \w

#

\w stands for alphanumeric

topaz lynx
#

Hi, I had a doubt that if I will reduce the permissions my bot requires right now, it will affect my future plans so is it actually necessary to reduce the permissions?

lyric mountain
#

well, you are supposed to request only permissions that are necessary now

bright thorn
#
    let guild = await client.guilds.cache.get("827300553045573682")
    guild.set(arrayOfSlashCommands);

Am sending this because i want to use slash only for one guild

austere surge
#

i think its guild.commands.set

lyric mountain
#

ye, guild.set wouldn't make much sense

bright thorn
#

Got it

austere surge
#

this guild will now only be slash commands

wheat mesa
#

Use await when you need some async function call to finish before going to other code, or if you need the return value of a promise

wooden ember
#

can some one point me in the right direction of how to get a bot to download a file send to a chat?

#

like those image bots that have the edit image commands

quartz kindle
#

get the url from the message and download it with any http lib

wooden ember
#

but how do you tell weather the image has a file or not?

#

bruh wrong whether

quartz kindle
#

message.attachments

wooden ember
#

ah cool

#

thx

proven lantern
#

.filter() should do .filter(a => a) by default

cinder patio
#

what would be the point of that

#

you're just making a shallow clone of the array

#

there are numerous other and more obvious ways to do it

proven lantern
#

i want to remove falsey values

#

but i guess they could only remove undefined. that might be better

#

.filter(a => typeof a !=="undefined")

quartz kindle
proven lantern
#

i want that to be the default

#

i dont like typing

quartz kindle
#

well unfortunatelly its not gonna happen

#

xD

#

well you can make it yourself

#

just override the prototype

#

or create an extended array

proven lantern
#

i'm showing up at the next ecma conference

cinder patio
#

overriding the prototype is fine by me in this case. A little less readable but still ok

final mica
winter pasture
#

If you don't provide the emoji ID Discord does not know where to look for the emoji, as multiple servers your bot is in may have the same emoji name
So it defaults to the emoji name in the server the command ran

final mica
winter pasture
#

And does the bot have permission to use emojis from other servers?

final mica
#

Yeah, it has Admin perms

quartz kindle
#

is the bot in the server where those emojis come from?

winter pasture
#

Humm, weird

final mica
#
                embed1.add_field(name="Special acknowledgements", value=f"{admine} - LateNight Administrator")

Maybe somehow in here is the problem, "{admine}" is a defined emoji

        admine = ":LateNightAdministration:"
quartz kindle
#

why does admine not have the emoji id?

final mica
#

it does

#

wait

#

ig its a formatting problem

quartz kindle
#

idk then, if it worked an hour ago but now it doesnt, and you didnt change anything, then it might be a discord problem, possibly with caching

#

try using different devices to view the message and see if they show the emoji

#

pc, mobile, browser

final mica
#

I just tested it out with another command, and it worked for some reason

quartz kindle
#

¯_(ツ)_/¯

final mica
#

Bruh I'm not sure what I did wrong, somehow that works but anything else doesn't

quartz kindle
#

are you testing in the same channel?

final mica
#

yup

#

Well, on the server where the emojis are, it obviously works, I tried that test command on another server, and it worked, but the userinfo still doesn't show the emojis/it still only shows the name

quartz kindle
#

so it works if its not in an embed?

final mica
#

That could be, lemme see

#

Hm, let me try a test command in the same cog

#

It looks like the cog isn't the problem

#

Ok, so

    @commands.command()
    async def test2(self, ctx):
      e = discord.Embed(description=":LateNightBugHunter:")
      await ctx.reply(":LateNightBugHunter:", embed=e)

This works for some reason

#

Okay, wait, for some reason, it does work in some channels, and in some it doesn't

marble juniper
#

Random but

#

Nodejs v18 is now out

#

incase u missed it

#

was released yesterday lol

#

Also as far as im aware this version should allow you to use native fetch without the experimental flag

#

Might still stay experimental for now though

hidden gorge
#

My bots invite isn't working and idk why

solemn latch
hidden gorge
#

What do I do to fix it?

austere surge
#

make it valid

wheat mesa
#

Don’t provide nonexistent permissions

hidden gorge
solemn latch
boreal iron
#

I mean there's one already existing in the developer portal

wheat mesa
#

^

cinder patio
#

Anyone with experience in github pages... is there a way to make other folders public? For example I've set the pages source to the folder ./docs, but I want to be able to make other files public which are outside that folder, I'm guessing this is not possible? :/

lament rock
#

Never made that work before. Everything is just in a root folder on my end

#

What you could or probably should do is host the files externally and link back to them

#

alternatively, move them to the root

cinder patio
#

o yeah I could do that

#

A little less clean but that'd do it

#

Do you test your workflows on github or is there some software which tests them?

lament rock
#

I run my gh pages through travis ci

cinder patio
#

oh okay

marble juniper
#

Does that mean I can just remove !message.channel from my if statement?

#

lol

cinder patio
#

You can remove the optional chaining

marble juniper
#

Oh I see

cinder patio
#

I mean you could remove the first condition too

#

but you'd be checking if message.channel is null twice essentially instead of doing it once

marble juniper
#

So what is it

#

Do I just remove the optional chaining lol

cinder patio
#

it's up to you

#

either remove the optional chaining or the first condition (!message.channel)

marble juniper
#

I see

cinder patio
#

I'd remove the optional chaining

marble juniper
#

Guess I will do that

#

Also stupid question but can message.author be null

cinder patio
#

whichever you find more readable

#

If it's an automated discord message then yes I think

marble juniper
#

ok

wheat mesa
#

Not specifically related to development, but this is my first time putting together a real webpage with react + nextjs, and my goal is a nice minimal design (I need to choose an accent color though). Any thoughts or suggestions?

#

(ignore the shit at the bottom and the activate windows)

austere surge
#

activate windows

coarse sun
#

hello

const { Client, Intents, Message, MessageEmbed, MessageActionRow, MessageButton, Collection } = require('discord.js');
const config = require("../settings.json")
const Data = require("../models/taglıal")
exports.execute = async (client, message, args) => {
  if (!message.member.roles.cache.has(config.registery) && !message.member.permissions.has("ADMINISTRATOR")) return message.channel.send("Yetkiniz Yeterli Değil")
  let Db = await Data.findOne({ GuildId: message.guild.id })
  let tag = new RegExp(config.tag)
  let x = Db && Db.tagalanlar ? Db.tagalanlar : []
  if (tag.test(member.user.id)) {
    if (Db && Db.tagalanlar.includes(member.user.id)) {
      message.reply("Bu Kişi Zaten Biri Tarafidan Tag Almış").then(msg => {setTimeout(() => msg.delete(), 5000);});
    } else {
      await Data.findOneAndUpdate({ GuildId: message.guild.id, Member: message.member.id }, {
        $push: {
          tagalanlar:
            member.user.id, 
        },
        $inc: { TotalTag: 1 } 
      }, {  
        upsert: true
      })
      message.reply(`${member} Başariyla Tag Aldi`).then(msg => {setTimeout(() => msg.delete(), 5000);});
    }
  } else {
    message.reply("Kullancıda Tag Yok").then(msg => {setTimeout(() => msg.delete(), 5000);});
  }
}
exports.conf = {
  command: "tagaldır",
  description: "",
  aliases: []
}


```how do I adapt this command to v13
austere surge
#

define member :troll:

wheat mesa
#

that's not even valid v12 code

coarse sun
#

how

wheat mesa
#

you never defined member

austere surge
#

oo

wheat mesa
#

react + mantine + tabler icons + typescript = 🤤

austere surge
#

react epico

coarse sun
wheat mesa
#

Have you tried looking at the docs?

coarse sun
#

yes, but I don't understand

wheat mesa
#

embed.setAuthor({name: 'something', url: 'url here', iconURL: 'iconURL here'})

#

something like that

boreal iron
#

Why would you still use that stupid builder method when passing the options as object anyways and not as parameters anymore?

#

embed.author = { … };

wheat mesa
#

no assignment operator needed

boreal iron
#

Oof

#

That justifies to write even more chars?

#

And to use a method which might be deprecated in the future, too or not or yes

#

Who knows what djs fucks up at next

wheat mesa
#

Idk I think it’s just weird to me given that I mostly am used to Java where modifying a property directly is usually a mistake

#

So the getters/setters look more natural for me

#

That’s just my preference

boreal iron
#

Pfff… the opinion of a Java user

split hazel
#

java users when they realise object.getThing().getThingTwo().getThingThree().getThingFour().setThing() is just not practical in other languages

boreal iron
#

But.. but.. but it looks more natural!!1!

#

Ok enough trolling for today

#

Back to my shitty website

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

lyric mountain
#

I like builders bcuz u can put them inside a loop or have conditions on them

#

Also useful to have modular objects

split hazel
#

I wonder if java has any optimisations in place for this

#

I suppose it does since its basically how everyone accesses nested objects

rustic nova
#

I mean you can probably add new variables for stuff you access multiple times

#

Though otherwise no

storm belfry
#

hey, how can I show on the topgg webpage my bots server count?

split hazel
#

calling a function has overhead, especially in an object language like java which adds an additional overhead

#

in languages like c/c++/rust etc it doesnt really matter since the overhead is basically just an extra element on the stack which is likely to not even be on the stack in the first place because of cpu cache

#

ah i missed being in an environment with an actual operating system screaming at me when i access a page that does not belong to me

#

actual segmentation

#

people complain about it but its great because you actually know when youre accessing something youre not supposed to access instead of the program silently running

#

@quartz kindle i think arrays on the stack have their limitations

compact pier
#
  • low level prorgamming language *
split hazel
#

tried passing the dynamically allocated stack to another function and got a segmentation fault

#

no warnings or errors whatsoever at compile time

winter pasture
gilded plankBOT
#

@storm belfry

To have your bot's server count displayed on Top.gg, please read the documentation on server/shard posting.

storm belfry
#

ty

slender wagon
#
$('#myModal').modal('show');```
#

how do i do this with vanilla js

#
document.getElementById('staticBackdrop').modal("show")

tried this but doesn't seem to work

spark flint
#

is #myModal hidden

slender wagon
#

yeah i think so

spark flint
#

to showjs document.getElementById("myModal").style.display = "block"
to hide js document.getElementById("myModal").style.display = "none"

slender wagon
#

so basically what i am trying to do is this

#
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#staticBackdrop">
    Launch static backdrop modal
  </button>
#

the current modal shows with a button

#

i just wanna change this and make it so when the page loads up it will show the modal

#

its bootstrap btw

quartz kindle
#

staticBackdrop is not an id

slender wagon
#
 <div class="modal fade" id="staticBackdrop" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <h5 class="modal-title" id="staticBackdropLabel">Modal title</h5>
          <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
        </div>
        <div class="modal-body">
          ...
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
          <button type="button" class="btn btn-primary">Understood</button>
        </div>
      </div>
    </div>
  </div>
quartz kindle
#

you want to make like a generic button loader that uses the data-bs attributes right?

slender wagon
#

no i wanna get rid of that button

#

and just load it all up with this function

<script>document.addEventListener("DOMContentLoaded", function() {
     document.getElementById('modal').modal("show")
  });
</script>
slender wagon
quartz kindle
#

what is the original css at page load for .modal?

quartz kindle
#

juat open it on dev tools...

slender wagon
#

what do u exactly mean

#

ohhh

#

1 sec

#

the only reason i am not using jquerry is cuz i am not a big fan of it

quartz kindle
#

now change the display rule and see if it shows up

#

also change opacity to 1 on fade not show

slender wagon
#

It's not showing

#

made the overflow x to visible