#development
1 messages Β· Page 72 of 1
ah, I forgot slashes
does this look fine?
no
imo given those things
you can have the profile img name, and "manage server" on the left of the box and the stats aligned on the right of it, both vertically stacked
that removes the "welcome" and "stats" though you can keep the "stats" if you'd like
also there are alot of unused space, i hope you will populate em with something

what.
error: syntax error at or near ","
pg.query(`INSERT INTO premium(id, username, discrim) VALUES(${id}, ${name}, ${discriminator})`, (err, res) => {
console.log(err, res);
});
using postgress
await pg.query(`INSERT INTO premium(id, username, discrim) VALUES($1, $2, $3)`, [id, name, discriminator])
ohhh bruh
turns out to be axios 1.2.0s fault, 1.1.3 works
Imagine still using axios
Use Undici instead
Just use native fetch if anything
Imagine not using @ aero/http
how can I shorten total = total + 10?
total += 10
thanks
raw http > undici > *
jk, undici can be better than raw http
when it works
:^)
readable code
error: value "435546546546" is out of range for type integer
i am literally passing it as a integer
Cough BIGINT
if its a user or guild id, prob better to store as varchar(255)
I will keep it there
Before somebody bonks your head
it's indeed a user id
storing ids as strings :X
good boi
Or we have to sort u out of this channel
but
what db are you using?
depending on the lib, it might not support js bigints
hes using postgres
long long
Itβs a unidici wrapper
why do you need an undici wrapper
π€·ββοΈ
Β―_(γ)_/Β―
Why the fuck is it using port 3001 when I have it set to use 3000, port 3000 is what is open on my nginx shit
π
Actually pressed
Try 2999 
bench pressed
Probably hard coded then
It is hardcoded as 3000 but somewhere in vite it probably incremens when it notices something is already using the port
which is fucking nginx
bigint worked very well
why is nginx using 3000
Apache exists as well
Cause I have it set to open on that port and point to my domain
And more modern weird alternatives
why dont you just change its port then?
I mean the nginx port
Cause you dummy

if I change the nginx port I have to make the web server listen on the fucking same port
but UH OH
GUESS WHAT
same issue
DUMBEST FUCKING SHIT ON THE PLANET
How the hell am I supposed to server my website at that domain then
π
Wait I might acutally be dumb
proxy the site through nginx
Proxy pass or what do you wanna do exactly?
I was proxy passing
why do you need nginx to be on 3000 then?
The internal proxy port can be whatever u like to
Passing the external port or default port (80) to another one
Wdym
I followed some shit indian tutorial on setting up nginx so I am a little confused on how this work
This is what I have rn
idk what exactly your setup is and if you know this but you can have multiple nginx configs listen on the same port if you have server_name set
thatt is what the dude told me
wtf
Don't u wanna pass your server name (domain) to another direction?
IDFK fake
You're doing the other way around
This is all greek to me
i am using this property for usernames (discord usernames) is it bad
no
but if you are using a varchar just why?
This is fun 
server {
listen 80;
server_name aarondye.dev;
location / {
proxy_pass http://127.0.0.1:3000;
}
}```
Tf Misty ... drunk boy
and I hope you dont wanna use this setup for production
since running a dev server isnt a good idea
you should build and serve the files via nginx, I can tell you how if you want
Do you assume it's a development server because of the tld?
because he wants to proxy vite
That's the result when watching youtube videos
Idc
Tis but a test my boy
sure go for it
I have no idea what I am doing when it comes to nginx
id assume you know how to build the site though ,right?
_what can go wrong _ 
not much
listen 80;
listen [::]:80; # REMOVE THIS IF YOU DONT HAVE IPv6
server_name aarondye.dev;
root ////PATH TO DIST FOLDER////;
index index.html;
client_max_body_size 100m;
client_body_timeout 120s;
location / {
try_files $uri /index.html;
}
}```
Indeed
I will learn that later
rn I have site to run

Oh yea btw how the fuck do I reference my user dir properly 
I forget basic linux stuff
whats your username?
misty
/home/misty
True.. true after the first bot took your server and the entire datacenter down 
Damn my configuration failed oh no
show it
no
no
make your own namespace somehow in dns resolvers and create your own tld
There's nothing you can't buy tbh
burh, google is still using my old domain, and im third π
oh ur german
yes
Not really a surprise using such a weird name
:^)
You can trust the public internet, there are no evil humans around
_what can go wrong _
True
https://www.youtube.com/watch?v=kgdoVeyoO2E linode is trustworthy people
Fail2Ban helps to protect servers against unauthorized access attempts and brute-force attacks. This tutorial shows you how to install and configure Fail2ban to secure your server.
Chapters:
0:00 - Intro
0:40 - Fail2ban Overview
2:20 - Install and fail2ban.conf
4:15 - Configuring jail.conf
8:17 - Working with Jails
10:51 - Wrapup
New to Linode...
I will watc h this later
Without proper network knowledge and a well configured dedicated firewall it won't solve all ur issues

I have no idea where to start with learning this stuff
so I am just watching yt videos
As long as you're not in my network I'm okay with that 
cause yt has everything
yes
Im concerned because I actually never watched a indian tech tutorial
I just google shit
Maybe just one of an Indian with a different dialect
I never watched tech tut videos πΏ
Liar
Says the guy who shills for PHP
@ Mac we need somebody getting banned here
We need to stop all of these FakE news!
Quiet terrorist
Funny argument, look at the engine of your car, something surprising is in there
You've been using the V8 JavaScript engine the whole time! FakE true JavaScript fan
Eww
We know it!
Maybe if JS would be embedded in php
what
port v8 to php
php engine written in js
is there a way to make dms in discord work like they used to? so i dont have to "accept" them first to reply
is it a setting some where or is it just hard coded like that now
there is this setting
*You've been using our v8 engine 
ourcord
Damn egoism
Another thing -
I saw on Google that this is the way to make invites.
.create("1006248339110637670", { maxUses: 1 })
.catch((e) => e);
What does 1006248339110637670 represent, the Guild ID?
That would make sense.
Alrighty
technically it's possible
const testingServer = client.guilds.cache.get(global.config.guilds.testing);
const invitecode = await testingServer.invites
.create("1043571235898019890", { maxUses: 1 })
.catch((e) => e);
Can someone help me figure out what's going wrong π
This is the result I'm getting for invitecode.url
its the channel id, not guild id
invites are based on channels
(no idea why tbh)
can some one help me with one event
Why tho 
are the permissions correct?
Yup
try ./temps/ly248zki.png
Same error
I remove all listeners after the user starts talking, likewise, I remove them after they are finished, and I remove them when the createListeningStream function runs.
but it still creates 2 stream (i running the createListeningStream function several times)
i want it to create stream only once. when i use createListeningStream function a second time, it will remove old one and add new listener.
log receiver.speaking._events
to see if thats actually where the listener is added
@muted junco
i did it thanks
how to cut equal pieces in cake using python
You probably wanna use a knife for that
bruhh using py
This is so true and factual, it's ours!
ussr anthem plays
Also Discord has apparently added unordered list markdown
But for some reason it only works in forums
Gotta love Discord β¨ inconsistencies β¨
Tables when..?
Probably in the next decade or so 
True... there are far more important emoji projects and ways to pay for nitro at first
And more important badges to pump out
Uhh yeah of course.. how could I forget about that
how can I get the command authors status in discord.js?
You first need the Guild Presences intent, after that you need to access the guild member instance of the command author (<CommandInteraction>.member for interactions, and <Message>.member for messages), and access the <GuildMember>.presence.status property
thanks!
so Ive finally found the issue causing this:
triggerUncaughtException(err, true /* fromPromise */);
^
[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "#<Response>".] {
code: 'ERR_UNHANDLED_REJECTION'
}```
which is because the shard manager is sometimes getting ratelimited and now I have this but it still fails after it waits
error that could be thrown by the manager.spawn() inside the catch block is not handled
I know
the error is from that unhandled function call, there is no other information in your error message
yeah, the problem is still ratelimit, its like a 50% chance if the code will work
and I want to fix that by waiting until the limit is over
well increase the wait time? There is no information about what the actual error is, So maybe try to log the error and see how for how long you are getting ratelimited and just increase the waiting time. If you are already waiting for the ratelimit and it still ratelimits you then obviously you arent waiting long enough
the wait time is 3 times what Im told from the headers I need to wait
what rate limit are you seeing? like wat is the content of that res variable?
the only rate limit that is applicable here should be get /gateway/bot
master tim to the aid
are you running manager.spawn() multiple times for some reason?
do you have automatic shard count, or a fixed number?
this is all my shard code
manager.on('shardCreate', async(shard) => console.log('[0xBOT] [i] [' + new Date().toLocaleTimeString('en-US', { hour12: false }) + '] [END] $$$$$ LAUNCHED SHARD #' + shard.id))
manager.spawn().catch(async(res) => {
console.log(res)
await wait(parseInt(res.headers.get('retry-after')) * 5000)
manager.spawn()
})```
are you starting and restarting your bot too fast?
sometimes, thats where the 50% error rate comes from, I want to fix that by waiting
im guessing the error is coming from fetchRecommendedShardCount() which is called by spawn() when the shard count is auto
afaik the rate limit for that end point is 1 per 5 seconds
so should be fine if you wait for 5 seconds
no need to wait longer than that
weird
is that limit bot based or ip based?
should be based on your bot token
This is my steal emoji command code. I wanna make the bot reply if the server has reached its emoji limit but instead of replying, my bot crashes. The try-catch and catch(err) also won't work, plz help me!
Is there any way I can create a select with attribute multiple but let user also select something that's not as an option? Then it just adds like the others?
what?
ah, u mean the dropdown component
don't think so
yes dropdown select but you can't just select options. Also create if it's not available
I said not just the options available but also user input
i think he means let users dynamically add options to the select menu
so instead of selecting whats already in the dropdown, users can input their own "text" as selection
either way @raw nest no its not possible
i think he means an input box in the dropdown menu
or something
ofcourse you can listen to a message and edit the embed
There's no embed and you don't need the message (event) for that
modal is pretty much the way to go here
For example as button (component) together with your select menu (component)
I just don't know about the sense to let users add options to the select menu, they can select later on
there is no html for that, but you can create such functionality with js
the html <select> element is pretty much useless these days
it doesnt even support proper css styling
almost everyone uses a js-based select menu
there we go
an avi file wtf
dont bother
already downloaded it
lmao
pretty nice
thats basically what they want
with the option to add a custom value
it can yes
how can I export each of my tables into seperate sql files as normal postgres user? (using node pg)
can I use dump with node pg?
you can actually use any app to export your stuff
as long as the database user has the permissions to
so,
const file = await db.query('pg_dump ...')?
ah, k
so for exporting a single table it would be
const file = await db.query('pg_dump oxbot -t usermoney')?
dunno, i'm not dealing with postgres tho, that's why I sent you the docs
ended up with this because I couldnt get dump to work, tbh best code ive written in a while
it just doesnt work correctly
actually it does, nvm
improved:
this doesnt need to be a promise
just remove the promise and the async await
and forEach is better
or even better
just do ```js
output[table] = rows;
lol
bruh
I could do that but I want to translate that json to sql statements in that same loop so that wont quite work
its a promise because I need to wait for the entire loop to complete and when using forEach it just skips the loop since the func is async
I've seen people mentioning slash commands, what's the format to do that?
ty qt
</NAME:COMMAND_ID>
So really I can jus tuse a single slash command Id and name it a million times how I want.
</hello-world-xdxxdxxdx:1046494652683010078>
Nice.
Can look good with message formatting at least.
I just used an idea and gave it a random name, so?
</test:1028020100504231998> will work
Oh are you saying for the command to actually WORK?
No what I mean is, mentioning will work but isn't "clickable"
OH
funny tho Discord seems to have fixed it
Nice lol
you can't click commands anymore which are not registered in your server
it seems like
I can't seem to click the command only in my server even with the same name and ID matching.
</info:1016674038711603231>
Might be because most of my commands take options.
nope
?
not surprised
but it shows the UI in a server the bot and command doesn't even work or is connected to
LOL
I can't even get my own bots command to work in the server it's made for lol.
man discord is so funny
I wonder if that's due to sub command or options or
wdym
you put the right ID in there?
Yes.
where did u get the ID from
console logging the interaction 
ok that's actually NOT the right ID then
I guess the itneraction Id is not the COMMAND Id
no it's not
yeah that makes sense lmao
Oh?
ππ
pog
or this
If I keep posting commands does it technically update the command ID?
Or does the command ID stay the same as long as the name is the same?
as long as you don't register the command AGAIN (for no reason) the ID will always be the same
even on a command update
So registering will always update it?
no registering it, will register it (and replace the previous one)
Even if nothing changed? Lol
since registration is a one time process
yes
that's the issue most people still running into
I wonder if there's a smart way to only ever post one new one then, I made a very crude system to just take all commands build the json and post Xd
yeah there is
fetch the app commands on a startup and add/edit/remove the ones which are not in sync with your locally loaded ones
pretty easy tbh
lemme give you an idea how I do it
I probably should.
looks like this
ignore the fact it's been built to update global and guild commands
lmao
follows exactly the API specifications without using djs stupid enums
it simply fetches all app commands from the API
then flat and format the response
then flat and format my cached command files
then compare both to each other
when a registered command was found but not a locally loaded one with the same "name" it will delete the registered one
and vise versa
when a command has a different description OR different command options it will update the registered command
hmmm
the easiest way of doing that is to transform the entire command object into a valid JSON format (which removes all undefined key/values etc.) and compare them
you have no idea how many times I've just re-registered my commands lmao
yeah most people seem to that as they don't really understand the registration is a one-time process
and this will fuck servers and people continuesly
and sometimes the discord client shows the commands 2 or 3 times due to caching issues
Yeah
as well as executing a command the has been re-registered will also fail etc.
so you simply only register em once, then update or remove them
If you have multiple shards how do you handle generating?
I did some goofy ass solution awhile back, so it fucking registered for each shard
tbh I haven't worked with sharding yet
Due to how the shard manager for d.js wraps the bot client and my bot client was handling command generation.
I don't even know if the registration is required for any shard or not
It was more my bot client does a thing and now X number of bot clients are being spawned thus doing it X times.
π
thats not how it works
forEach is a sync operation, it will still be sync even if you put it inside an async function
an async function only lets other code run when it hits an actual async operation inside it
/info
So I am having the issue of the bounds of the Logo is conflicting with the bounds of the "Hello World" so it is pushing the other below it
<header class={styles.header}>
<div class={styles.container}>
<img class={styles.logo} src="../../logo.svg" alt="Logo" />
<div class={styles.links}>
<p>Hello World</p>
</div>
</div>
</header>
.header {
box-shadow: 0px 8px 6px -6px black;
height: 50px;
}
.container {
height: 100%;
}
.links {
display: flex;
justify-content: flex-end;
padding-right: 10px;
align-items: center;
margin: auto;
height: 100%;
}
.logo {
display: flex;
justify-content: flex-start;
padding-right: 10px;
align-items: center;
margin: auto;
height: 100%;
}
position: absolute;
and put both words nested in the same container
they are nested in the same container no?
No. Hello World is in a child element to the element the logo is in
<div β¦stuff>
<img β¦/>
<div β¦>
// child element. Not the same as the img. Would be put under
<p>Hello World</p>
I'm referring to elements as containers
you should put stuff that should be in the same level under the same element
otherwise you have to mess with z indexing
I think
I may be dumb
Yea but I don't see how I can achieve the effect I want with them being in the same container like that
You want them side by side right?
No
not at all
I want the logo towards the start, and the links at the end
which is why I was using flex-start and flex-end
Notice how the "logo" is towards the beginning of the screen and "Hello, World" is at the end
Issue here is, the logo is pushing the hello world under it
So you want them on the same level
Yes
That's literally what I said
Put them in the same container and use position: absolute; and then use stuff like right: 100%; for the links
Wtf is going on with the container π
Its taking up 100% of the screen instead of 100% of the parent
does the parent have a specific width? or is it also a percentage
is it specified as 50px in its css?
or does it end up as 50px but its declared as something else?
I declare it as 50px
a little curious if anyone has had false positives where google safe browsing incorrectly marks their site as a phishing site
I'm creating a site for my bot
and google thinks it's used for phishing despite there not even being a login prompt on the site at the moment
I'm so confused, why am I getting these errors?
Where do I need to place a : and ,
you probably have a syntax error in some other part of the code that is affecting this line
Your site literally starts with discord, even if it didn't report as phishing it's an extremely bad name to choose
99.9% of all sites that contain discord are scams, I'd not be surprised if google has that name in a blacklist (except for discord.com)
yea, that's what others are telling me too
guess i'll migrate to a new domain
thx
That might be the best solution π
do you think ageifybot.com would cause any issue?
or does adding bot cause an issue
What's ur bot's name? Ageify?
Currently Verify Bot
but I'm happy to change it
if it makes google less sus
still awaiting approval
Like, you can use a domain that has the same name as ur bot
It'll help relate one to the other
renaming it on discord might not be a bad idea then
Btw, depending on what kind of "verification" you do, you'll have a hard time explaining discord how you handle data
i'm sure it was because of the ambiguous formatting
I dont think formatting plays a role in syntax errors, unless u miss a essential stuff like a bracket or sum
i mean the interpreter could read the callback function as
(ch) =>
ch.type === "GUILD_TEXT" &&
ch
and dismiss the other
.permissionsFor(guild.me)
.has([ ... ])
which causes a syntax error
@earnest phoenix

The interpreter will read it all the way through as long as there is no statement/expression terminator, newlines aren't such terminators unless you're using Python
terminating Voltrex soon...
Terminating your internet access and PHP love soon...
My love to php is unbreakable Sir
We'll see 
*php
then what caused the syntax error
I'm gonna send the php motivation group over to you
To increase your enthusiasm

Judging by their IDE also underlining the textChats variable declaration and the var keyword not being highlighted, I assume they have a syntax error before the lines they've shown in that screenshot
var moment
Somebody say PHP? π
XHP
did someone say scratch? Did you hear about how easy it is to "code" with scratch! Even a kid can get accepted to harvard with how smart scratch can make them
Q: if a user opts into dm vote reminders, is that still against tos?
nope, but there should also be a option where they can opt out of it anytime
Does someone know how to convert gif to apng? To upload it to server via discord.js not manually converting it some api... None of npm works
of course, thank you
Does anyone know a bot that automatically deletes cmds from users instant and also bot messages after a certain time?
i dont searching auto purge for all bot messages at a timed time
just that every single bot message get deleted after like 5min
Hey um, while running a nodejs script via cron i keep running into "npx command not found" but if i run the script manually it works fine
am i doing anything wrong
*/4 * * * * export NODE_PATH=src/ && cd /home/izzi-ts && ./cronjob.sh -job 4minute >> /home/izzi-ts/cronjob.log 2>&1
This is pretty much all im doing, in the log it says npx command not found
but if i run the same thing directly as ./cronjob.sh -job 4minute it works
i found it has something to do with bash not being able to find it
?
Why it's not working
Have you tried reading the error?
Debug mode isn't available on VSCode web, so you can't do that
@real rose ^
elite ping
I have a feeling I messed up translation in my bot
nah music is the universal language πΆ 
there just seems to be something ever so slightly off
i fixed it a while ago it's just funny
I recommend using @iamtraction/google-translate npm package.
oh I'm not using node
Then what ur using?
i used kotlin for some reason
Bruh what?
Idk then
I just tried to help
^
Lmao didn't see that
np
@round cove you remember that i18n library I was making? Should I update it at all? I was thinking of making an adjustment so that it looks for json files that are like en-US.translate.json so it doesn't try to pick up random json files
it'd be a small matter to code but I think it'd be nice to add
Sure update it. Might as well if you noticed potential issue.
json π
What else should I support?
I was thinking of supporting multiple formats
properties and yaml-based formats
both have the advantages of not needing to be parsed to be read from
yaml parser would be fun to make
you dont need to parse yaml?
not really, you can navigate without parsing the whole thing
toplevel:
key1: avalue
foo: bar
morelevel:
hello: world
ghi: example
alevel: null
a more palpable example: ```yaml
commands:
ping: Ping
say: Say
8ball: 8 Ball
errors:
no_perm: I don't have enough permissions
blacklisted: You are blacklisted
then just iterate over top-level keys, when you find the category you're looking for simply go "inside" it
ofc you'll want a cache layer so you dont have to stream the file everytime
Also aren't yaml parsers essentially just reading the file and parsing it into json?
yaml slow π
kinda
the trick is that you're not parsing the whole file into memory, but reading the lines directly
u cant do the same with json
whats the best way to mass insert data / update it if it exists in postgres?
I have this json:
Hello: 99,
Hi: 22,
Bye: 77
}```
In my case they are over 10000 keys long though so I cant insert for every one at a time
This is my table:
`word - occurences`
so whats the best way? (node pg)
using batch insert statement with ON CONFLICT UPDATE
INSERT INTO tbl (a, b, c, d) VALUES
(1, 'A', true, 0.5),
(1, 'A', true, 0.5),
(1, 'A', true, 0.5),
(1, 'A', true, 0.5),
(1, 'A', true, 0.5),
(1, 'A', true, 0.5),
(1, 'A', true, 0.5),
...
I actually already do that but I dont know how to make it sql injection safe
well, then u have to insert one by one
since you cant use params with batch insert
would that be a big performance hit? the database is on the same server, aka ~0.005ms ping
databases doesn't care about measly 10k inserts
just use a transaction so you don't happen to interfere with ongoing requests
BULK INSERT 
Forgot pg sucks even more than mysql
COPY seems to be the naming they use for it
nah not really, postgres does have COPY for bulk inserting data, but they specifically asked for "sql injection safe"
yes
but with bulk ops u cant use params, so it's better to simply write individual parameterized inserts
Unsure why someone would want to bulk insert sqli safe
Doesn't really make sense to bulk insert that much things at once, unless that data is given by the user
In that case a dos would be much more of a complication than your sqli
it is given by the user
Yeah then a dos is possible on your dbms 
Which is not ideal
Someone could give your application millions of values to insert
uh oh
So that's even better
Process 10k, then it's down for 10 minutes

it does wait, why would I process everything at once in 10min
Repeat that indefinitely and you know
give an user a single checkbox and they'll manage to crash the whole server cluster
never trust users, never trust what they input
Nonetheless if you want sqli safe, you'd need to insert them one by one
it isnt user given like that, the process is on a crontab
So people can give as many input they want and it will be saved and inserted every 10 minutes
But...?
old data I have lying around that I want to analyze
aka what words are used the most in letters
Yeah then why not just insert everything directly?
wdym? like insert every request directly, not on a crontab?
Like insert your entire data you already have
cuz its way too much
So?
define "too much"
Yeah that's the thing
unless u have more than 200m, don't worry about it
Databases are made to process lots of data
And even then, just leave it running
also first time I'm seeing a database that's made specifically for timelines
Not like some softwares take an entire night or more to build
timescaledb
pixar studios taking 3 days to render a single frame 

Maybe I should pull out my 4 billion rows database example... 
Just took a week to be generated with ~96GB RAM allocated
What should I work on, I lowkey want to learn a new topic/language
machine learning is cool but seems like a lot of setup work
I've been looking into embedded dev but I don't really have any supplies for that atm
how would I go around this in javascript
no arabic bot ?
you dont
either host the image urself, create a chain request "proxy", or if u control that domain add whatever domain ur on to that list
add the domain to the allowed list
how would I do that
If you own the domain/server where the code is hosted, add the domain you've hidden to the list in the Content-Security-Policy to allow it just, like *.cloudfront.net *.google-analytics.com *.kaptcha.com ... but with *.domain.xyz
If you simply use the website and try to embed/display a picture on that website; you cannot do anything about it. You have no control over the header. Contact the support of the concerned website to get more information how you could embed/display your picture on their site.
plot twist: the fan has no leds
yeah lol just spinning so fast its white hot?
POV: you have 15 chrome tabs open
hype!
mod alert
nothing hits harder than realizing light sources in games are using real power to emit light
it certainly isn't a heater
but we will see after I game with it for a few hours!
the case is mesh on 3 sides, really good airflow and doesn't heat up much
real
@radiant kraken solid pretty solid
I love how they handle control flows
for loop to do stuff with an array of items is literally just
<For each={someArray}>
{(item) => <div>{item}</div>}
</For>
and in case it doesn't loop through it all immediately you can add a fallback
this lowkey kinda cool as well
pogging
my bot keeps going off β οΈ
but i have something hosting
it keeps going off ever 5 minutes or sum
my bots never did that before
I kinda wanna make a discord bot just to make a bot dashboard 
More so I can practice web dev tbh but also cause Iβm just that bored
work on my bot's dashboard
:)
Sure if you want something that looks like a 2 year old made it
Two year olds do NOT know how to code in html
Says you
good one
hey has anyone used stripe?
does the card payments decline if no shipping address is provided?
i know these, but a customer whose payment worked once did not work the second time and kepy getting bank has declined error. they even contacted bank and they said they allowed it but im still getting the error
do_not_honor this is the error im getting mmmm
ig nothing much i can do from my end on stripe??
is it possible the website is being flagged by the bank?? how would i verify such things
ngFor="let item of items"
i cant get used to react-like syntaxes, it just looks so weird
solid looks good af on paper but i really dislike its syntax
svelte feels so much better to use
is it possible to exclude an specific character from a regex group?
for example, I want the calc group to not include $ in it
but $ is important to identify where type is
ik I can simply replace that after matching, but was wondering if there's a regex way of not including it
Sup
Can you please tell how to become bot developer and what is needed?
and have it approved
has anyone never used stripe??
yep, not yet but soonβ’οΈ
i
that'll not make a capture group, but it'll still include in the enclosing group
Put it before the capture group or make the main group non capturing and do not capture $
something like (?:$([^somecharsnottocapture]))
that's the thing, I need the outer capture group
I solved this already by simply replacing the character, I don't think there's a way to solve that with regex without resorting to huge reg string
do you know how i can pass billing_details to payment intent? while creating payment intent
pg.query("SELECT $1 FROM premium", [intgId], (err, res) => {
so when i do this the result is way too big
loging the result
is there a way more forward to this
first of all, your sql is invalid
I mean, it is valid, but it isn't returning what u expect
SELECT 1 FROM anything will always return 1
SELECT 'Goat' FROM cars will always return Goat
whatever u put after SELECT will be what columns you want to retrieve, not the condition
basically all i am trying to do is to see if the intgId exists or not
ohh let me see
null Result {
command: 'SELECT',
rowAsArray: false
}
``` log when it doesn't exist
null Result {
command: 'SELECT',
rowCount: 1,
oid: null,
rows: [ { '?column?': 1 } ],
fields: [
Field {
name: '?column?',
tableID: 0,
columnID: 0,
dataTypeID: 23,
dataTypeSize: 4,
dataTypeModifier: -1,
format: 'text'
}
],
``` log when it exists
just check rowCount
to see if a row exists?
That is the way
booleans don't really exist in pg so not like you can get a boolean promise or anything unless the wrapper abstracts stuff for you
first of all, you have an anime profile pic so your argument is invalid
π
uhhh i found out something about the discriminator
if u got a 0 before the other numbers it wont count it

Don't convert discriminators to numbers
they're strings for a reason
oh lol
what is a good formula for biasing a random generator towards one of the sides?
I currently use rng ^ bias, where the lower the bias is, the closer to 1 it rolls
but idk if this is a good formula for that
what's the best way to store an email on postgres
okay i have a problem, Replit...It keeps saying its booting and i wait for minutes...Then my bot goes offline for a while after i hosted it on uptimer 
then it keeps doing this
replit is not made for bot hosting
if you gonna buy a vps it doesn't matter what u are using rn
vps?
Virtual Private Server
I think replit has a lot of issues these days
damn
I just was playing around with it and with zero instances running my cpu usage would max out
and hey woo
they tried to take heroku jobs lmfao
Hi ^_^
hru?
You know, living life. hbu?
same thing man. its nice seeing you again
Same way as everything else
could someone help me through this why it doesnt delete the temp channel when all the members leave?
even when i am using oldstate
First, what discord.js version are you using?
the latest
v14 and nodejs v16 with npm v8
i have gone through documentation. stackoverflow already answered questions and still nothing works
Have you tried logging the value of state.channel.members.size and see if it's the expected value?
yes , on both state and oldstate it logs out either 0 or null, there is a inconsistency
Please log all 3 of state.channelId, wfschannel.id, and state.channel.members.size all at once and show us the values
just did
What's the error?
Show the values
evalmachine.<anonymous>:1
;var Xua=function(a){a=a.split("");MC["if"](a,71);MC.pn(a,3);MC.QO(a,27);MC.pn(a,2);MC["if"](a,36);MC.QO(a,14);MC.pn(a,3);MC.QO(a,68);MC.pn(a,3);return a.join("")};Xua(sig);
^
ReferenceError: MC is not defined
state.channel.members.size logs 1, wfschannel.id logs the id of the channel and state.channelId logs the same id with wfschannel.id
from ytdl dependency
Since it logs 1, it won't delete the channel as your condition requires it
yesterday it was still working good
Looks like you're evaluating something, show code
not me
yes but when i change it to oldstate.channel.members.size it throws me the following error:
node:events:491
throw er; // Unhandled 'error' event
^
TypeError: Cannot read properties of null (reading 'members')
at WFSevent.run (C:\Users\devel\Documents\GitHub\DevLight\events\waitingfor\wfs.js:33:42)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:394:10)
at processTicksAndRejections (node:internal/process/task_queues:85:21)
[nodemon] app crashed - waiting for file changes before starting...
its ytdl-core
i show you full error
evalmachine.<anonymous>:1
;var Xua=function(a){a=a.split("");MC["if"](a,71);MC.pn(a,3);MC.QO(a,27);MC.pn(a,2);MC["if"](a,36);MC.QO(a,14);MC.pn(a,3);MC.QO(a,68);MC.pn(a,3);return a.join("")};Xua(sig);
^
ReferenceError: MC is not defined
at Xua (evalmachine.<anonymous>:1:36)
at evalmachine.<anonymous>:1:165
at Script.runInContext (node:vm:139:12)
at Script.runInNewContext (node:vm:144:17)
at decipher (/home/runner/evobot/node_modules/ytdl-core/lib/sig.js:88:22)
at Object.exports.setDownloadURL (/home/runner/evobot/node_modules/ytdl-core/lib/sig.js:100:31)
at /home/runner/evobot/node_modules/ytdl-core/lib/sig.js:118:13
at Array.forEach (<anonymous>)
at Object.exports.decipherFormats (/home/runner/evobot/node_modules/ytdl-core/lib/sig.js:117:11)
at runMicrotasks (<anonymous>)
The evalmachine in the error stacktrace indicates that you're evaluating code by calling the global eval() function, or running code with the node:vm built-in module, what code are you running?
I'm using the NodeJS "events" module
And it's returning {} as error, nothing more nothing less
You're not supposed to check the old voice state
The event being called to is correct and is actively being listened to
req.body is a string
then how can i check if everyone has left the channel and delete the channel?
i have built the same thing over the past 3 versions of discord.js and none of them behaved like that
By checking the amount of members in the new voice state, if the bot is the only one in the voice channel then delete it
Might be about the client user not members
i am recreating my join to create channel, it is not that the bot is the only one left in the channel and it doesnt deletes it
Or if the bot isn't in the voice channel and nobody is in there, then also delete it, the members property is a collection that includes all of the guild members in the said voice channel, which you can check
Show the event listener
As in?
this is what i did before this change , and still does nothing, i tried creating a collection of temp channels and delete them after nothing, i tried checking the members collection still nothing and now i tried this and still nothing
You said the event that is being emitted is the correct one and is being actively listened to, in order to listen to the event you'd have an event listener, and that is?
You're checking when the bot is still in the channel?
if theres the bot in the channel theres not less than 1 member.
the bot is not joining the channel, only the user join to a join to create vc to create a private voice chat that can add his friends
You got me
As in, the event emitter is undefined
forgot to update a require()
π and its logging 1 when no users or bots are in the channel on newstate.channel.members.size?
its logging 1 as soon as the bot moves me to the channel
That's correct...?
yes i know, but the thing is i need to check the channel after the user/users disconnected from it
Dont worry about what it logs when you join, only when you leave.
when i leave it logs nothing
is the log in the if statement?
move it to the top of the event
Can you show us the entire code maybe?
yeah that might help
let guild = await WFS.findOne({ guildid: state.guild.id })
if (guild) {
let channel = await oldstate.guild.channels.fetch(guild.channelid)
const { member } = oldstate
if(!(state.channelId == channel)) return
let wfschannel = await state.guild.channels.create({
name: `Join to create - ${state.member.user.tag}`,
type: ChannelType.GuildVoice,
parent: channel.parentId,
permissionOverwrites: [
{
id: state.member.id,
allow: [PermissionFlagsBits.ViewChannel]
},
{
id: guild.adminrole,
allow: [PermissionFlagsBits.ViewChannel, PermissionFlagsBits.MuteMembers, PermissionFlagsBits.MoveMembers]
}
]
})
member.voice.setChannel(wfschannel.id)
console.log(state.members.size)
if(state.channelId === wfschannel.id && state.members.size < 1){
wfschannel.delete()
}
}```
thats the code
for the time being, i am stuck on that specific thing
So that's the code inside the voiceStateUpdate event you're listening to?
yes
module.exports = class WFSevent extends BaseEvent {
constructor() {
super("voiceStateUpdate")
}
async run(client, oldstate, state) {
let guild = await WFS.findOne({ guildid: state.guild.id })
if (guild) {
let channel = await oldstate.guild.channels.fetch(guild.channelid)
const { member } = oldstate
if(!(state.channelId == channel)) return
let wfschannel = await state.guild.channels.create({
name: `Join to create - ${state.member.user.tag}`,
type: ChannelType.GuildVoice,
parent: channel.parentId,
permissionOverwrites: [
{
id: state.member.id,
allow: [PermissionFlagsBits.ViewChannel]
},
{
id: guild.adminrole,
allow: [PermissionFlagsBits.ViewChannel, PermissionFlagsBits.MuteMembers, PermissionFlagsBits.MoveMembers]
}
]
})
member.voice.setChannel(wfschannel.id)
console.log(state.channel.members.size)
if(state.channelId === wfschannel.id && state.channel.members.size < 1){
wfschannel.delete()
}
}
}
}
the full event
state.members isnt a thing is it?
It isn't
yes i was changing some things and i wrote it wrong rn
it was state.channel.members.size
corrected it on the snipset
Oh I see what's wrong here
let channel = await oldstate.guild.channels.fetch(guild.channelid)
const { member } = oldstate
if(!(state.channelId == channel)) return
You're comparing a string to an object, which'll never be true
but it doesnt throw error there and it passes on?
It won't throw an error, you're simply just returning
changed it to channel.id
still same behavior
and if i remove this statement then it will just create channels for ever
it indicates if the channel (Join to create) is the one to join and create a private channel, otherwise just dont run the rest of the code
Oh wait I overlooked and didn't realize that you were using the non-strict equality operator, which will call the toString() method of the channel instance when compared with a string
That part isn't the issue as it seems, but you still shouldn't compare them like that
yea but it is and was working but still is bad practice, thanks
so what is the problem that doesnt delete the channel?
Before continuing, please resolve your promises first
Both of the member.voice.setChannel() and wfschannel.delete() methods return a promise, resolve them
You should use the await keyword in this case
i logged them too and still nothing changed, the member.voicel.setChannel() it returns the member,the user and the voice options
I didn't tell you to log them, also the logic in your code doesn't even make sense because you're moving the member to the channel, and checking if the said channel contains 0 members which'll never be the case because you literally just moved the member to that channel
I am moving the member to the channel and I want to check when the user disconnects to delete the channel automatically
You're supposed to check that before moving the member to the channel
It is logging only when the member joins/moves to the channel , not when leaving and that's what i am trying to fix, i used a Interval and it worked for just a time and then just tries to delete a already deleted channel
Because when the user leaves the channel your code won't get to the part you're trying to check, you're supposed to check this right at the start of the event listener
I will try that and will update you on that in a bit
Moved it right after the channel creation and before the member moving and still nothing, and if i put it at the top the newchannel will not be initialized first and throw an error
π€ so this returns
if(!(state.channelId == channel.id)) return
if the channel in the new state isnt the channel the guild has configured right?
Therefore all code below will not run if its not that one channel correct?
yes, when i join in another channel other than the configured one in mongodb it does nothing
it just stops there
So, the channel you just created, anyone joining or leaving it will also return and stop running the code right?
anything below line 12 will never run if someone leaves a channel you just created.
because its not that channel configured in your database.
maybe that's the problem? But the thing is , if i am not checking for this channel it won't create the new channel and will do nothing but maybe this will be the reason that doesn't run the rest of the code the moment i am getting moved, but, when I set an Interval every 3 seconds after I am getting moved the channel would be deleted when I leave from it but it will be delete for ever resulting in a discord api error "Cannot delete unknown channel"
You shouldnt be using an interval here at all
I know but i wanted to see the behavior that it would have
I think you're missing some fundamental parts to make something like this work without using timers.
Which I assume is what Voltrex is typing now.
it was just for testing if anything would change the interval
That's not what I meant, you're supposed to do it right at the start and you'll have access to the channel the member is in:
// Get guild data from database.
const guild = await WFS.findOne({
guildid: state.guild.id
});
// If the guild isn't found, return.
if (guild === null) return;
// Fetch the configured channel in guild.
const channel = await state.guild.channels
.fetch(guild.channelid)
.catch(() => null);
// If it doesn't exist, return.
if (channel === null) return;
if (
// If the ID of the member's voice channel doesn't equal to the main voice channel
state.channelId !== channel.id &&
// And the amount of members in the voice channel is 0
state.channel.members.size === 0
)
// Then delete the voice channel.
await state.channel.delete();
Basic logic
Since all the voice channels you create are the ones separate from the main voice channel, you can assume that it's a channel created by the bot and can be deleted
Or if you want to be more careful, you can use a regex to check the names of the voice channels, and if it matches the name pattern the bot uses to create the channels, you can delete it
I would recommend using names, but you can also store channels created for this purpose in a map, and check that map before deleting.
Just another option
right when i leave i get this error
What's at line 17?
i am just getting the member object from the voiceState so i can move the user there
after formatting the code the error is on line 16
this one?
https://i.imgur.com/FAKpyPb.png
It seems like state.channel is null
yea and I can't understand why
May I ask what intents are you using?
is state a voice state?
yes the newstate
state.channel only exists if the bot is connected, it doesnt exist if the bot is disconnected or leaves
If state.channel is null that means the member is no longer in the voice channel
so we must check when it turns null in order to delete the channel
you have state.channelId !== channel.id
but you also have to check for the existance of a channel





