#development
1 messages Β· Page 270 of 1
ah now i remembered, i went with epyc because the other one doesnt have US location
but yeah europe hosts are much cheaper for some reason
datalix still has these lol
compared to what? contabo?
oh hetzner blocks outbound SMTP dont they
Nah there are some hosts that are German only
ah
You can open a ticket to unblock
that unblock request was easy lol
Has anyone here used Minio with Loki?
Struggling badly with creating a config atm
nice
i think its because ive had my account for a while and verified my ID as well since they forced me to
so i dont need to get manually approved
Ye
been pretty happy with datalix since 2022
If you already paid some bills unblocking ports is easy
Same for verified id
Lucky for me I never had to verify Id because I live in germany
Real
I recently wanted to pay for a server and somehow I have 50TB of traffic on my server without buying any add-ons 
they gave 50tb to anyone that was at a specific data center location due to some migration related downtime
iirc
It's strange because I didn't get any email or anything like that
hm
Most of it is announced in the discord
i need to get more ppl to use my affiliate o I can pay my server just with them again 
i swear backups in hetzner are a scam
if you just take a snapshot once a week or more often you save so much money
RS 1000 G11 iv 12M at netcup - your partner for server, webhostings and domains
I just realized what I'm paying for all my VPS's, I need to just combine them all.
oh not bad
any benchmarks for this one?
Its on the list to check it.
I'm also looking at CCX13 on hetzner
We need a thread dedicated to VPS's
I should probably look into saving some money too
im spending 200β¬ per month on servers
jesus
I just realized I have 5 VPS's
I can combine most of them to something way more reasonable.
i recently canceled galaxygate, so im only paying for hetzner rn
and google, but google is like a few cents per month
Yeah, I'm still paying for their $10 lightning.
I dont even know whats on that server.
I really messed up, I have VPS's with no notes on whats on what.
part of the problem is this but its not like I can remove any here
There might be litterally nothing on my GG VPS
I might just move everything to hetzner since I know hetzner
I just wish hetzner had US based ARM with dedicated cores.
I'd buy that instantly
I just moved most stuff home ~1.5years ago
but homeserver is getting full and I still dont have fiber
This week I'm just going to figure out what each server is doing and build a plan to combine everything.
damn thats also the newest epyc cpus
spicy
It doesnt seem to be much faster than the hetzner ones
left netcup, right hetzner
https://www.cpubenchmark.net/compare/5897vs5088/AMD-EPYC-9634-vs-AMD-EPYC-9654
thats not what they use in their amd vps offers
yeah but its 40+ bucks
AMD Milan EPYCβ’ 7003 and AMD Genoa EPYCβ’ 9654
idk how much slower the 7003 is though
which one is which?
I think its random π idk
that makes no sense lol
its a series, not a single cpu
its from 72xx until 79xx lol
so it means litterally nothing, fun
exactly
its bullcrap marketingt
also, what do thyey use in the netcup shared cpu vps?
is it the same cpus as the root servers?
is it possible to send a ephemeral message when someone's message is deleted?
aha ok, ty
Which web ?
hetzner
π€‘ Expensive
dedicated cores are more expensive
Yeah But Every hosting prefers General
For more profit
& only 8-16 Gb dedicated
π whos your host?
is this more the prices you're looking for?
https://i.imgur.com/pTKeUGr.png
isn't that still hetzner? 
anyone encountering this on azure portal?
ok sorry, my clock was off
Are you able to fix it up?
yep, i synced my time
Glad you got it fixed,have a great day ahead
thanks :D
Azure is so amazingly broken and weird all the time it's a wonder how companies even put up with it
One time i managed to change a setting on the azure directory for internal users that somehow broke my main email account being able to login to the portal.
Tried twice to get support to fix it but they couldn't verify i owned the directory even though it's tied to my email account wtf.
I gave up after a month or two but then discovered a really fking weird mechanic of azure directory.
The first internal user of the directory gets assigned a main_email#internal@onmicrosoft.com and doing a password reset on that forwards it to your main email address and was able to login that way.
aww, but tbh in my experience, their support is like the best. they respond fast (1-3 days) and is very polite
companies opt for headache and suffering just for the sake of using a big name third party
something something better support
Yep!
I like to see what people think of the cheaper plans.
I think people get confused about raw cpu core count and ram. Higher number doesnt mean better. I find it intresting how many people just go for specific core counts and amount of ram rather than the quality of the cores/ram/networking/disk.
thats why benchmark matters
i went for hetzner specifically because of disk speeds
since i need fast file io
benchmarks got me ~1.5 gbps disk reads
on galaxygate it was ~400mbps
and the google free vps is like ~50mbps
lmao
I hate leaving galaxygate behind π¦
I really like their staff
hetzner isn't expensive
its one of the best value hosts icl
I'm getting gold vps in 9.5$
8 gb ram
My friend is a regular customer & he renews like 70 Vps so discounted price
50 Gb nvme ._?
nvme
NVM Express (NVMe) or Non-Volatile Memory Host Controller Interface Specification (NVMHCIS) is an open, logical-device interface specification for accessing a computer's non-volatile storage media usually attached via the PCI Express bus. The initial NVM stands for non-volatile memory, which is often NAND flash memory that comes in several physi...
their other company
What's the average price of 1 gb ram python server ?
any server is a python server when you install python
π€‘
I am talking about some other server providing company which sells servers through VPS
Wanna share a benchmark of the server?
Idh rh
I have not renewed it for last 3 months
ah
@quartz kindle I always lose the command, whats the benchmark command?
I'll check the hetzner one today.
hetzner auction servers are actually insane icl
I hate how much more expensive they are now π¦
if i had to build an infrastructure from scratch with like $150 budget that needs to scale, i'd go for 5x these lol
tbf mines not gone up that much
Its that time of year though, they'll be cheaper late summer.
You get locked in with auction iirc
in the last 2-3 years its gone up like 5eur a month
yeah
they only increased when they had to
yeah, but new ones are more expensive. the 5900x servers were dirt cheap
yeah
should have gotten one at the time π¦
their singapore is $10 more lmao, and 10TB -> 1TB bandwidth
I swear I found a host that did singapore for $5 a month. it was a dedicated server. Wild
I just couldnt justify the location.
i like this one, but its old
https://github.com/jgillich/nixbench
Yep thats the one I was thinking of
this one is also good
https://github.com/masonr/yet-another-bench-script
time to benchmark my pc
good idea, I'll benchmark mine even though I have 40 different things open right now
lmao
geekbench is too slow π¦
do you use wsl or native linux?
which one is this?
my pc
ah xd
I feel like my drive should have been faster. But oh well
I got frustrated with docker, so I'll test the hetzner one real quick
β€οΈ hourly billing

Lets see how this goes ^-^
lmao (the disk is my external drive)
facinating
Fresh hetzner CCX13 @quartz kindle
π this looks awful, am I crazy?
3 servers tested
Left: Hetzner CPX11 5.09/mo
Middle: Hetzner CCX13 12.99/mo
Right: Galaxygate lightning 4gb 10/mo
theres definitely something wrong with that CCX13
which location is it?
ashburn
same as mine
you're on ccx13?
It almost feels like you get 1 core and 1 thread
you can open a support ticket and complain about multicore performance being subpar
or recreate it and try again
from the looks of it, CCX13 uses the same 7003 series cpu
and not the 9654
but it doesnt make sense why multicore performance would be worse than the other one with shared cores
also dafuq happened with the network test
The servers ded
First: Hetzner CPX11 5.09/mo
2 cores: EPYC 7002
Ram: 2GB
Geekbench: failed
Second: Hetzner CCX13 12.99/mo
2 cores: EPYC 7003 or 9654(unknown)
Ram: 8GB
Geekbench: https://browser.geekbench.com/v6/cpu/10845316
Third: Hetzner CAX11 4.59/mo
2 cores: Altra(unknown)
Ram: 4GB
Geekbench: https://browser.geekbench.com/v6/cpu/10845308
Fourth: Galaxygate lightning 4gb 10/mo
2 cores: intel Xeon e5-2697 v2
Ram: 4GB
Geekbench: https://browser.geekbench.com/v6/cpu/10845377
I recreated it, got the same ip. Got way better performance. Waiting for it to finish the geekbench
Benchmark results for a Hetzner vServer with an AMD EPYC Processor processor.
(poor chat, I just want to share stats)
What are you benchmarking?
vpses
weird how that works xd
I probably should have reported it
hey guys does anyone have any idea about kubernetes
so basically i seted up a cluster with load balancer to access the web i got the cluster ip and redirected that with my domain name but now i want to add the ssl certificate anyone know about this thing?
thank you @earnest phoenix
anyone using nginx proxy manager by any chance and got an issue with their ssl settings? i've set up a proxy and the moment im activating http/2, hsts and force ssl, images loading very slow. by that i mean normaly my page waits for it to load and shows the full image. after activating these options, i can watch loading the image from top to buttom, which takes around a full second ;c clearing cache doesnt work
very strange :c
is there a way to debug this thing?
https://sx.f0ck.org/raw/R1FL39p.gif < this is what it looks like
isn't that because of the quality of the picture and your network not enjoying it?
nope, because i had this issue on another vps and project already but ignored it till now
Does this only happen when you change nginx settings?
tbf its not that slow on my other project, but i can tell its because of the ssl settings
yes, and i cant reverse it
even if i turn it off, the images load slowly. it has to do with ssl settings since i just activated it and moments befor i did with an unsafe host, it just worked fine
Oh even when proxied by nginx, just unsecure still it was fine?
jup, as long as no ssl was activated
What does your nginx sites-enabled config look like for your website?
https://sx.f0ck.org/view/qc4EDke.txt
tbf no nginx pro and thats why i use that manager thing :p
i just re-added the proxy host and didnt activate ssl yet and the image loads just fine
Without knowing what those includes have in them; This is what mine looks like for a server I run.
In particular, you may find interest in configuring your SSL.
server {
listen 80 default_server; # [6]
listen 127.0.0.1:80 default_server; # [6]
server_name amanda.moe; # [1]
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2 default_server; # [6]
listen 127.0.0.1:443 ssl http2 default_server; # [6]
server_name amanda.moe; # [1]
ssl_certificate /etc/letsencrypt/live/amanda.moe-0001/fullchain.pem; # [3]
ssl_certificate_key /etc/letsencrypt/live/amanda.moe-0001/privkey.pem; # [3]
ssl_session_timeout 1d; # [2]
ssl_session_cache shared:MozSSL:10m; # [2]
ssl_session_tickets off; # [2]
ssl_dhparam /etc/nginx/ssl/dhparam.pem; # [2] [5]
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384; # [2]
ssl_prefer_server_ciphers off; # [2]
client_max_body_size 5M;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
location / {
proxy_set_header X-Forwarded-For $remote_addr; # [4]
proxy_pass http://127.0.0.1:10400;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
thats a big config though ^^ thanks, ill try it later
You don't need to listen on 80 if you have cloudflare since it will automatically redirect
Also cloudflare origin certs are better to use over lets encrypt especially because it's a wildcard cert for any of the sub domains
ran nixbench on a new dedi
cpu
Sha256 (1x) : 675.11 MB/s
Gzip (1x) : 667.60 MB/s
AES (1x) : 954.40 MB/s
Sha256 (32x) : 12070.78 MB/s
Gzip (32x) : 6881.62 MB/s
AES (32x) : 34863.30 MB/s
disk
- run : 1086 MB/s
- run : 1107 MB/s
- run : 1107 MB/s
- run : 1090 MB/s
- run : 1104 MB/s
Average : 1099 MB/s
geekbench
Single-Core Score : 9126
Multi-Core Score : 83813
Result URL : https://browser.geekbench.com/v4/cpu/18576946
host
OS : linux
Platform : ubuntu 22.04
CPU : 13th Gen Intel(R) Core(TM) i9-13900
Cores : 32
Clock : 5300 Mhz
RAM : 64038 MB
net
CDN : 105.28 MB/s
Amsterdam, The Netherlands : Failed
Dallas, USA : Failed
Frankfurt, Germany : Failed
Hong Kong, China : Failed
London, United Kingdoms : Failed
Melbourne, Australia : Failed
Oslo, Norway : Failed
Paris, France : Failed
Queretaro Mexico : Failed
San Jose, USA : Failed
Sao Paulo, Brazil : Failed
Seoul, Korea : Failed
Singapore, Singapore : Failed
Tokyo, Japan : Failed
Toronto, Canada : Failed
Washington, USA : Failed
Benchmark results for an ASUSTeK COMPUTER INC. System Product Name with an Intel Core i9-13900 processor.
good results
Who provides the dedi?
thatβsβ¦ beast
Thanks Carlos
hetzner
Thats a fancy dedi
why not go ryzen
how much are you paying for it
100usd a month
i guess fine then
arm64 is definitely something i should consider
would half my costs
dont really know if performance will be worse with stuff like postgres
question i have a couple messages i need to check every 3 minutes. What would be the best way to set this interval?
π like discord messages?
I think this will depend heavily.
ARM might perform better in some scenerios
ig ill do some testing with my most common queries
its hourly billing anyway
seems to be very similar speed
x86
Average execution time: 0.0899 ms
root@mcjars-eu:~/mcjars-api# for i in {1..10}; do sudo -u postgres psql -d mcjars -t -c "EXPLAIN ANALYZE WITH spec_build AS (SELECT builds.* FROM build_hashes INNER JOIN builds ON builds.id = build_hashes.build_id WHERE sha256 = '770ce85ae140b88eda9e3b7b7eb66ac72b9025beef80178893b389a50cc98fb3' LIMIT 1), filtered_builds AS (SELECT b.* FROM builds b INNER JOIN spec_build sb ON sb.id = b.id OR (COALESCE(sb.version_id, sb.project_version_id) = COALESCE(b.version_id, b.project_version_id) AND sb.type = b.type) WHERE b.type != 'ARCLIGHT' OR ((sb.project_version_id LIKE '%-fabric' AND b.project_version_id LIKE '%-fabric') OR (sb.project_version_id LIKE '%-forge' AND b.project_version_id LIKE '%-forge') OR (sb.project_version_id LIKE '%-neoforge' AND b.project_version_id LIKE '%-neoforge') OR (sb.project_version_id NOT LIKE '%-fabric' AND sb.project_version_id NOT LIKE '%-forge' AND sb.project_version_id NOT LIKE '%-neoforge'))) SELECT *, 0 AS build_count, now()::timestamp as version2_created, '' AS _version_id, 'RELEASE' AS version_type, false AS version_supported, 0 AS version_java, now() AS version_created FROM spec_build UNION ALL SELECT x.*, mv.* FROM (SELECT * FROM (SELECT b.*, count(1) OVER () AS build_count, min(b.created) OVER () AS version2_created FROM filtered_builds b ORDER BY b.id DESC) LIMIT 1) x LEFT JOIN minecraft_versions mv ON mv.id = x.version_id;" | grep "Execution Time" | awk '{print $3}'; done | awk '{ sum += $1; n++ } END { if (n > 0) print "Average execution time: " sum / n " ms"; }'
Average execution time: 12.4211 ms
root@mcjars-eu:~/mcjars-api#
aarch64
Average execution time: 0.0927 ms
root@mcjars-eu-testing:~# for i in {1..10}; do sudo -u postgres psql -d mcjars -t -c "EXPLAIN ANALYZE WITH spec_build AS (SELECT builds.* FROM build_hashes INNER JOIN builds ON builds.id = build_hashes.build_id WHERE sha256 = '770ce85ae140b88eda9e3b7b7eb66ac72b9025beef80178893b389a50cc98fb3' LIMIT 1), filtered_builds AS (SELECT b.* FROM builds b INNER JOIN spec_build sb ON sb.id = b.id OR (COALESCE(sb.version_id, sb.project_version_id) = COALESCE(b.version_id, b.project_version_id) AND sb.type = b.type) WHERE b.type != 'ARCLIGHT' OR ((sb.project_version_id LIKE '%-fabric' AND b.project_version_id LIKE '%-fabric') OR (sb.project_version_id LIKE '%-forge' AND b.project_version_id LIKE '%-forge') OR (sb.project_version_id LIKE '%-neoforge' AND b.project_version_id LIKE '%-neoforge') OR (sb.project_version_id NOT LIKE '%-fabric' AND sb.project_version_id NOT LIKE '%-forge' AND sb.project_version_id NOT LIKE '%-neoforge'))) SELECT *, 0 AS build_count, now()::timestamp as version2_created, '' AS _version_id, 'RELEASE' AS version_type, false AS version_supported, 0 AS version_java, now() AS version_created FROM spec_build UNION ALL SELECT x.*, mv.* FROM (SELECT * FROM (SELECT b.*, count(1) OVER () AS build_count, min(b.created) OVER () AS version2_created FROM filtered_builds b ORDER BY b.id DESC) LIMIT 1) x LEFT JOIN minecraft_versions mv ON mv.id = x.version_id;" | grep "Execution Time" | awk '{print $3}'; done | awk '{ sum += $1; n++ } END { if (n > 0) print "Average execution time: " sum / n " ms"; }'
Average execution time: 10.5827 ms
root@mcjars-eu-testing:~#
is the arm server cheaper?
yes, half the price for same amount of ram but one less core
the second execution seems to be a measurable improvement.
arm is a CAX11, x86 is a CPX21
(hetzner)
im probably gonna switch, then I can also add a new location
@quartz kindle hetzner told me its because I got a 7003 cpu on one of the instances and a 9000 series on the other...
that doesnt make sense.
that's one salient command
Lol
x86
Summary:
Success rate: 100.00%
Total: 22.8425 secs
Slowest: 1.8352 secs
Fastest: 0.0094 secs
Average: 0.0570 secs
Requests/sec: 875.5602
Total data: 34.03 MiB
Size/request: 1.74 KiB
Size/sec: 1.49 MiB```
aarch64
```root@mcjars-eu-testing:~# oha http://localhost -n 20000
Summary:
Success rate: 100.00%
Total: 19.6447 secs
Slowest: 0.8049 secs
Fastest: 0.0097 secs
Average: 0.0491 secs
Requests/sec: 1018.0850
Total data: 34.03 MiB
Size/request: 1.74 KiB
Size/sec: 1.73 MiB```
very interesting
on some endpoints its double as many req/s as on x86
I guess this will be getting deployed tomorrow
Why are you querying localhost xD
Not testing the networking, testing the hardware.
yes
well an embed to be more precise
wait no
i will be updating the embed every 5 minutes or so
Is this a big bot? if its only one server can you enable message intent.
what am i saying
get events when it changes
not even that
sorry
so
i just check the db every 5 minutes
but i was just wondering if i should do it with a timeout or how
so you're checking your own db?
yeah and updating an embed based on it
with such few queries I'd poll it with an interval.
If your database supports pub/sub I think thats the way to go
i will look into that last option
cuz the bot could grow
im using postgres combined with prisma
now that part i set a side for the moment.
Now i was looking into a feature i am making.
Some users request access to certain channels which sends a message to the creator of the channel to accept the join request.
Should i just insert the user id thats requesting access in the "accept button"
like custom_id
allow_join_{userId}
thats gonna save me much more time and space since i don't have to generate a custom id and use the statemanager like i do with the other complicated interactions
Thats how I'd handle it.
just gotta update the handler, once again
am i doing too much or overcomplicating things here?
i made handlers for each interaction
Pretty normal by todays standards.
There's already a bunch of stuff running on the server but decent
This is tested with a c# asp.net api app
ye i wont bother rewriting for now
thats fucked
I personally encrypt it using a predefined hash + guild id
i always though discord handled that in the backend
i guess im stupid
in this case it doesn't matter much cuz i still verify who is clicking the button
that u cannot intercept since it requires someone's session right?
ye
Best practice is to never trust the client always do server side checks explicitly
thing is i never knew these would go through the client
ik that sounds stupid
i just never looked into interactions
it doesnt sound stupid
I thought the same
discord should really do this in backend
but oh well
fr
A Support bot for the 0x7f6 Server. Contribute to 0x7f6/bot development by creating an account on GitHub.
im gonna look into that ty
Since I havent been in the bot dev scene in a while
why does it matter
What can someone do by intercepting the interaction? Reply back to it themselves? I mean if they have the interaction data the id doesn't matter no?
I mean they could make the interaction ping atEveryone
they could store the data, manipulate the data and provide incorrect values etc
From my understanding an ecnrypted ID wont solve anything
one sec
getting up the docs
they have security headers
Understandable
You can see that here https://discord.com/developers/docs/interactions/overview#configuring-an-interactions-endpoint-url
Isn't that something discord handles tho?
they even do it for you
No, it's something you handle on the webhook side
unless you use the gateway
then it's handled like a gateway event
The easiest way to explain it
is like an SSL certificate
Discord provides a signature in the request in the HEADERS when they send the request to your web server. This uses your PUBLIC_KEY and the rawBody
if the body doesn't match the same at what discord sent it wont be valid
The signature is like an advanced Authorization header just based on content and key
Since at the end of the day its being sent through discord and relayed back to you
so you have to verify its coming from discord and not someone sending it themselves
Yup, you got it
I still think that its a stupid situation to even have possible but what else can they do
Since interactions don't rely on the gateway to function afaik
No but they send user data with interaction requests
they send message data too etc
They send message data?
I havent used interactions in forever so I honestly wouldnt know
I used em when they were initially released
Are you strictly web socket driven with messages?
Gotcha β lost the desire?
I just maintain one bot at this point haha
Yea they do
If it's a message context interaction (right click message -> apps) you get that message and that's even without the message context priv intent
There's also a sometimes set message property in the interaction body but I've not the slightest what that is
You can have interactions sent over the gateway for a built in load balancer, but if Discord sends you a reconnect OP, you're fucked
If they send you the OP while interactions are incoming*. By the time you're resumed and Discord sends you the events you missed which would include interactions, they're already expired
thanks clang-format
why is it a bunch of 64s
because it was originally like this
W
what on earth is that
no wonder cpp code looks horrible and unreadable sometimes
hi @solemn latch this is perfect for u
np
that is actually just a type / annotation c++ code doesnt actually look that bad
some of the slightly odd and unintuitive operators in the newer standard also make it look a lot more scary to beginners but in reality its just a better version of very clean C code
Hello guys, anyone can help boost my server members?
no
no
no
no
no
theres no way this is the indended way
use utoipa_axum::{router::OpenApiRouter, routes};
use super::State;
mod index {
use crate::{models::Extension, routes::GetState};
use utoipa::ToSchema;
#[derive(ToSchema, serde::Serialize)]
struct Response {
success: bool,
extensions: Vec<Extension>,
}
#[utoipa::path(get, path = "/", responses((status = OK, body = inline(Response))))]
pub async fn route(state: GetState) -> axum::Json<serde_json::Value> {
axum::Json(
serde_json::to_value(&Response {
success: true,
extensions: Extension::all(&state.database).await.unwrap(),
})
.unwrap(),
)
}
}
pub fn router(state: &State) -> OpenApiRouter<State> {
OpenApiRouter::new()
.routes(routes!(index::route))
.with_state(state.clone())
}
@solemn latch
@zinc fable
how ironic

hello chat
Hi everyone guys, please explain to me (And better show an example) how a simple API works in order to get the votes of your bot, I have not been able to understand why nothing works for several hours, installed topggpy version 2.0.0a0 and still get some errors that I can't even find on the Internet, tried different ways, but I don't need too complicated ones, I don't have a server and as far as I understand, I need them for webhooks, I need simple python code to get voice data
I'm confused, your whole question was about top.gg votes, but it ends specifiying you need voice data.
why do you need vote data for voice?
I'm sorry, I use a translator, so maybe I made mistakes. I want to get information about when people vote for my bot on top.gg, but I don't need a webhook, not a way through aiohttp, but simply getting data about votes for my bot in json format, if possible. I have worked with some APIs and have not yet encountered such difficulties in handling...
My idea is to just get this data and give out some kind of game currency for users who voted for my bot.
You'll want to use webhooks for vote rewards, that's the ideal way.
Otherwise you'll have to have a "claim" command and use get_user_vote
Link to webhooks: https://topggpy.readthedocs.io/en/stable/webhooks.html
Link to get_user_vote: https://topggpy.readthedocs.io/en/stable/api.html#topgg.DBLClient.get_user_vote
I've already read a bunch of text from all these documents... And I realized that a webhook needs its own server, which I don't have yet, I wanted to implement it in my own way and it's easier for me to work with the json format, as far as I understand, I won't be able to receive data so easily?
You can fetch the data using get_user_vote, but you wont receive an event when someone votes. So you'll need a command for them to claim the reward.
Now checked after your hint and probably understood how it works. That is, a person will vote for my bot and he will need to enter, for example, the /checkrewardvote command, which, through calling the get_user_vote and passing the ID of this user, will check whether this user voted for my bot today, I understand correctly?
yep!
The last question, I apologize for my stupidity, will it work the same daily for users right? That is, they will be able to receive a reward once every 24 hours? Or will I already have to implement this somehow inside the bot?
You'll need to track whoever you've already given a reward for.
Users can vote once every 12 hours, so you'll want to make sure they havent already claimed it recently.
Okay, I get it. Thank you so much. It was necessary to immediately come here for help and not spend several hours trying to understand everything alone
Again, thank you so much
dont yall love how, when you fix one bug right. 13 others just spawn in
no lies no deceit, just wire this Bitcoin wallet!
Hmm i might think about creating an adventure game bit like stardew valley but more action/adventure mechanics similar to harvestmoon where it has spirits.
The first colored rings being ligh, earth, water, dark, fire and air spirits that unlocks basic game mechanics and then the outer ring being the text messages with more advanced stuff.
The spirits can also unlock extra perks and buffs like a tech tree for each spirit.
does anyone know how i can like extend a type from a module? to include one of my customer types?
const user = type("string.base64");```
I have this module called arktype. and im trying to add a `string.hex` type
that way i can do something like that
const user = type("string.hex")
Does the module have arktype supported?
If it doesn't you'll likely need to use Arktypes infer method, then just union them together.
Yeah arktype is the module
Iβm trying to extend the module to add my custom type
You're extending arktypes types?
yea
just arktype
i think arktypes is a different module
Then I assume it's just &
const hex = scope({
root: type("string").narrow((str, ctx) =>
/^[0-9a-fA-F]+$/.test(str) ? true : ctx.mustBe("a valid hexadecimal string")
)
}, {
name: "string.hex"
}).export();
declare module "arktype" {
interface wrapped extends Ark.wrapped {
hex: string
}
}
the type method has a couple of defs. im trying to extend that to also include string.hex and i need to give it a validator
so in theory the expected outcome is
const hex = type("string.hex")
they have this
So you're adding a validator too?
I think you might just want to make a PR to their github at that point.
trying to yeah. just want it for my project
si it not possible to add a new definition?
i see type has like 4 defs
type<"string.hex", Type<never, {}>>(def: "'string.hex' is unresolvableβ"): Type<never, {}> (+2 overloads)
when i click on type this is what i see
Since I have never heard of arktype I'm not really sure.
If you only are performing this validation a few times just use 'string' and do the hex checks in .narrow
im asking in general tho. like doesnt have to be this module. for any module if i wanted to extend its type how would i do it. cause I done this for djs library but there I just added new methods so i didnt have issues.
but here im trying to modify the type def of an existing method
like im trying to add an overload
I don't think you're extending a type here, you're creating a new constraint in arktype
right
If you're just looking to extend arktype does that with unions.
but it doesnt give me auto fill like type(string.hex)
i did something like this for my discordjs
now i can access sendMessage anywhere by using discordjs lib methods
Yeah that's a constraint arktype doesn't support.
yeah so im trying to extend it in my project so it can support
like im trying to create my own def and add it as a overload
if that makes sense
But it wouldn't actually do anything if you added just the type.
that way if someone types type(string.hex) my method gets executed
yeah i need to add the method i know
I think you need to edit arktype codebase to do that.
I can't see anything suggesting you can add your own constraints any other way.
hmm,
Other than .narrow
but i could add my own method to discord lib and use it in my project no
Because it's just types
no those are actual methods
i implemented them
so now i can use message.sendMessage() without issues
message object is from discord lib. i extended it to add my custom method
i added the type for typescript to be able to compile it. for it to know these methods are accisible
tryna do the same with arktype
You could try, but I don't think extending this way Arktype will be reliable. But you just showed how you can do it.
I'd still really recommend forking over extending here.
its just for a small project anyway so it should be okay. yeah i tried to do this but it just doesnt work.
hmm
Or using .narrow(the proper way)
im not sure how to add another overload method to existing one
cause type has 4 defs. you can use type in 4 diff ways.
type({ name: "string" }) or type("string") etc
i just need to add another def where its hard coded type(string.hex) and then i add my validator there
idk if im making sense here
You are, I just don't understand why narrow doesn't work if this is a small project. Thats exactly what this is for.
Adding your own validators
narrow works. but its like an assignment XD and they said i gotta make it work with how its similar to string.base64
Ah, your working on someone elses stuff?
nah its my assignment
So they want you to fork it?
Open Source Contribution, they want you to fork it π
actually im not sure. cause forking it makes it easy. i know where to add everything
hmmmmmm
Lmao
its 2 line change if i fork it lmao
Well that whole conversation was a waste of time

π
i mean im just thinking are they this dumb to give an assigment thats 2 line changes?
Yeah
makes no sense
Oh well
or maybe i overthinking it
i was like "if i fork it its 2 line changes. why would they make the assigment so easy"
It seems to not be a coding question, more of can you understand other peoples work question
ig
thanks 
Question: When using discord.js' autoComplete, I noticed when I am setting the result to a variable, the name is being set but not the value. I recalled that it's suppose to set the value and I was wondering if anyone knew why this was happening.
//the subcommand
{
name: 'playsong',
category: "Playlist",
description: 'Play a specific song in your selected playlist',
type: 1,
options: [
{
name: 'user',
description: 'The user who owns the playlist you want to play',
type: 6,
required: true
},
{
name: 'playlist',
description: 'The playlist that has the song in it',
type: 3,
required: true,
autocomplete: true
},
{
name: 'song',
description: 'The song in the playlist',
type: 3,
required: true,
autocomplete: true
}
]
},
//the returned values
await interaction.respond(choices.map(choice => ({ name: choice.title || choice.song_name, value: choice.playlist_id || choice.song_url })));
//variable set
const song = interaction.options.getString('song');
console.log(song);
//console logged: Green Day - Boulevard Of Broken Dreams (Cover By 2 Shadows) (the choice.song_name not choice.song_url)
C# users, do you prefer
A: List<PageBuilder> pages = [];
B: var pages = new List<PageBuilder>();
?
they are both the same type though
yeah lmao, just asking opinion
since i upgraded my net to 9.0, my rider recommends me to use var instead of type, but for that specific case, i can do both
@hidden gorge what about access
i opened error.log
https://github.com/arktypeio/arktype/pull/1351 I just made my first open source contribution! lesgoooooooo
Made small changes to support string.hex validator. Implemented and tested.
oh it's really just log
this issue has been angering me for weeks
what is 172.96.141.177:9000, is it up?
its an express server and its up
you sure you can curl it? curl https://172.96.141.177:9000 ?
uhh
or use -k option, i've never used proxy to https with nginx so i might not know
curl -k https://172.96.141.177:9000, that should bypass ssl
nope
is the nginx running in the same machine with the 172.96.141.177:9000 ?
yes...
try use proxy_pass http://127.0.0.1:9000
in the default?
in where you set that proxy_pass
done
now what?
nginx -s reload and try curl -vvvv http://localhost/ again
well this happened
thats http
with your previous method, you're doing this, which i'm pretty sure not good. you want nginx to directly access the project server if possible using localhost
i do not understand that
ok, try this sudo lsof -i :443, to find is nginx listening to 443 or not
oye well nginx isn't listening to 443
do you listen to 443 in your nginx proxy config?
yes don't do that, nginx is already running with systemctl
not that ik of
well you should listen to that, if you want to use ssl. in your proxy config, add
listen 443 ssl;
listen [::]:443 ssl;
and reload
in the default?
yes
try this again
if still nothing, restart nginx
my bad, you should add
ssl_certificate /full/path/to/origin/certificate
ssl_certificate_key /full/path/to/key
find them, use this docs https://developers.cloudflare.com/ssl/origin-configuration/origin-ca/
ok
upgrade? are u setting up websockets?
huh
idk i was just told to add it..
i'll be back im gonna go take a break so i dont have a breakdown
this is the config for my bot's site
php 
Yall good?
why does the first one just return 302?
its a redirect
redirect http to https
port 80 = http
port 443 = ssl (https)
oh
it's just so people dont access through http, to enforce https
u can do that on cloudflare too, I just do it on nginx side cuz it'll be global
cloudflare you say...
im wondering what everyones use case for cloudflare is nowadays
i used to use it for all my sites but realised i absolutely dont need it
oooo php? What are you using it for?
heavily considering making my next site using some sort of php framework
CDN, reverse proxy
I think that's the bulk reason
Got most of the docker features working except for a few things in stacks and containers
Since im using ko-fi for memberships in my bot, i decided just to check users roles for premium.
Now my question is, should i check every 5 minutes all the members of a certain role and keep their membership boolean checked as true, or should i check their roles when they use the bot's premium features.
(The premium features can be a bit forgiving, i don't mind the users having a few minutes of extra premium time)
-# i cant use stripe or patreon
icba honestly this is why i went with this two options
the bot is only going to be in one massive server
Well speaking from experience I used to use roles to manage it too and it just felt like such an unstable system
I spent a day figuring out how to do handle the webhook and building out my own system to handle expirations and stuff and it worked and felt much better
would it be more than a day?
Depends on your experience
no sorry, would it be more than a day that patreon wouldn't update the users role?
since my premium features would only be 2 commands which have long gaps in between
its not rapid usage
Oh Iβm not sure
im guessing most people use it out of cyberattack paranoia
ie ddos protection, etc
but yeah you absolutely dont need it, plus more often than not it gives you more issues than it solves
dont most vps services offer some kind of ddos protection nowadays?
i think hetzner does
if you dont pay for extra ddos protection galaxygate null routes your servers ip so if you want free ddos protection i guess
although i cant imagine it would be too difficult to accidentally leak a servers IP
Cloudflare is more than just about security though xD you have the entire dashboard, domain registrar, free ssl cert (sub-domain wildcard), cached resources on cloudflare which is faster, API, email forwarding, dns management and custom page rules.
yeah i guess that too, their global cache is nice to have
lets just say, cloudflare is not needed in most startup projects
Cloudflare also detects and blocks AI/scraper bots and common vulnerabilities too
although on the free ssl part i think by allowing the server-cloudflare tunnel to be unencrypted promotes being lazy, it defeats the whole point of TLS if the part between cloudflare and your server is unencrypted traffic
Some services only provide DDoS up to a certain amount of bandwidth. Which may never be reached by most people. Though CF is a global solution and their bans/rate limits would affect not just some small site but rather even if someone chooses to attack a small site protected by CF, they'd get bonked everywhere
though i know they offer using your own certificate to encrypt traffic between cloudflare & site
does cloudflare activate attack mode automatically on the free plan? i swear by default it just allows all traffic through
I think you're mistaken, it's the flexible ssl mode that does that you need to enable full ssl mode
yes the flexible mode, hence why i said it promotes laziness
thoguh i know they have the full mode as they should have
in nginx traffic is usually routes unencrypted locally which is ok and secure enough
Cloudflare is the proxy rather than traffic going directly to your server/nginx
as soon as you exit your server your traffic can get intercepted and eavesdropped on
If you have the firewall setup right you can block all traffic (aside from your own ip) and then add a cron script to automatically add cloudflare ips with port 443 to firewall
Nothing really, I was just lazy and copied the same config file I was using in phppgadmin
That block isn't needed, but doesn't hurt to have either
any good data services other then MongoDB for Web Uses?
any relational DB, Postgres, mssql, mysql, etc
Ok i just need it to store article data, user subscription data and admin stuff
what would be the best
You can use anything for that
ok
If youβre looking for SaaS solutions, supposedly DynamoDB is pretty easy
SaaS?
i dont even understand
I prefer self hosting most personal projects
im probably gonna self host the Database
If youβre looking to self host your database, Postgres is probably the way to go
Easy to set up with docker
Supports ARM-based hardware natively
fun
do i gotta restart my vps istg
nooe
this annoys me
ok wtf now nothing is installing
oh
Follow Postgresβs installation guide
Should be easy. Even easier if you just use their docker image
If you do this you donβt even need to install Postgres on your vps directly, itβll install it into your docker container
ok postgres broke my damn vps
6 crashes in 5 minutes
Somehow I doubt thatβs Postgresβs fault
One of the most widely used database packages for Linux, Iβd imagine itβs pretty stable
then again this happens when i SSH with VSC
Then you have a terribly slow VPS
Still
Iβd just selfhost at that price point
4gb rpi is 50-60usd, and you own it forever
cant
dont got the bandwidth nor equipment
Doesnβt require a ton of bandwidth, but I can understand not wanting to have it powered 24/7
And the setup is a bit more complex than a provisioned VPS that handles that stuff for you
planning to soon enough actually buy a xeon server in person so i can my own VPS fully controlled by me
Most vps companies do 4 GB for $10-$12 not sure how you found one that gives less xD
plus i need it to also manage in car stuff from away
so im gonna invest in a mini rack
This is overkill no?
Crazy electricity bill
Also a bit weird how you're maxing 100% cpu on a 4 core ryzen cpu
what are you running
An RPI is truly a great entry level self host, cheap to buy and super cheap to run
With standard electricity prices around me I think it costs me something like $20/year to run it if it was at 100% CPU for an entire year
Capable of hosting some basic stuff, obv not gonna handle thousands of requests per second flawlessly but it works for proof of concept stuff
Can easily host an ASP.NET API + Postgres db within docker containers
its gonna be used for more then just the Website too
1 second
Also if you go for a xeon build I highly recommend against a windows installation
ok so yk how police cars connect to a server to get info on a person?
Ubuntu server is nice
@wheat mesa
sure
to be fair with a vps you pay extra for the server maintenance, reliability, using and risking their network and ips, easy upgrades, etc
but in this case that is extremely overpriced please try hetzner
Why is there 2 lines on website :/
idfk
Soβ¦ youβre making a webserver
Yeah a VPS is nice for elasticity and such, but personally I wouldnβt pay for one until I have a proof of concept for a project
Thatβs why I have my rpi
Also btw the car would usually talk to an API service either from the website or a seperate program π
Temporary hosting for dev until it warrants cloud services
^
gonna do that
Your car will never directly connect to your VPS, your VPS would expose a port that directs requests to an API that handles everything else
my network no no wanna allow inbound traffic so i couldnt even if i wanted to π¦
besides something feels off having a front facing web server alongside personal devices and network
maybe if you isolate yourself properly
i've been planning this for years ik how im gonna do it
The way I have it for dev is that I have a VPN as my only open port, then the pi allows traffic through the tunnel only
Itβs not really safe to directly expose ports to the internet
Or well, even if it is, Iβd prefer to not have my home network overrun with requests
If you need any server/linux help we could also help or i would personally help you with the nginx stuff and your cert issue
Since you're using cloudflare flexible personal api data and auth stuff isn't secure atm
I've been getting better at frontend xD although i hate dealing with fonts
Ngl you have the motivation and productivity level that I wish I had
Only just started working on it again after being ill for the last month but having a lot of C# experience helps
Currently at work procrastinating after solving a 12 hour ticket in 15 minutes
Ticket: Why my computer no worky
Ticket was a 1 line of code fix
10 minutes of debugging
5 minutes of branching and creating PR and reading said ticket lmao
At least it was C# tho
I hate when I have to deal with the js
π wherever that guy went that was asking to make a discord bot: https://discord.com/developers
Learning a bit of how docker works atm there is some cursed/old stuff need to figure out how to create containers and manage docker compose files in a good way and also see how Portainer does it.
My most annoying issue with docker is how messed up the docs and api are with different wordings and date times
Integer, integer 64, RFC 3339, regular date time
Also the fact only that one uses CreatedAt
WHY!!!
someone let the interns work on the docs π
String with no format specified is actually diabolical
You must wait till day 13 to know it
Use pug
Its the only front end templating I will ever fuck with
yet another frontend framework/tool/language π
Vue is the only thing I will ever accept now
Powerful when it needs to be, simple when it doesnβt need to be crazy
i like svelte it feels like how you described vue, personally
The long description of the bot supports CSS
You'll be matching classes of the site
Can edit the css in your browser and I believe there's a preview button as well to see your changes without publishing
K
Welp i forgot and my brain cant remember
const { SlashCommandBuilder, EmbedBuilder } = require('discord.js');
module.exports = {
data: new SlashCommandBuilder()
.setName("credits")
.setDescription("credits"),
async execute(interaction) {
const embed = new EmbedBuilder()
.setColor(0x0099ff)
.setTitle('Credits')
.setDescription(`credits`)
.addFields(
{ name: `Developer`, value: "**Developer** @bitter granite \`welper\`", inline: false },
{ name: `Creator code`, value: "**Comming Soon**", inline: false }
)
.setFooter({ text: `Vote at top.gg [Coming soon]` })
.setTimestamp();
await interaction.reply({ embeds: [embed] });
}
};
whats the thing called for me no add userinstall
I believe both the Node and ws package Websocket impl try to follow the WHATWG spec
So performance could be similar
I actually am not sure
I realized you said bun and I said Node. I meant to say I believe runtimes implementing Websocket follow WHATWG
Since that seems to be the hip trend
Wow. I tried the node built in method of running ts files. While the prospect of eliminating a build step is cool, my project had to switch from commonjs to esm since you couldn't use the import statement at all and require has no types for imported modules which blows. Then my npm module to reload files on change didn't work because they're making all properties of imports readonly. It's an Object. Just lemme mutate it ffs
The hot reloading of files not working was the nail in the coffin to say this sucks. I might have a work around, but god do I hate it
Wonder if there would be any benefits to SLI 2 3090s
Asides for VRAM availability
Apparently not
well it technically doesn't run them, it just removes all the types
in a later revision, they added support for enums and namespaces
I still dislike esm a lot
Gave me an excuse to try the esm version of a few modules
7h of work to just discard changes in git though
@harsh nova Alll the 3.2 USB ports on my mb just went out
now I only have the high speed ones

Oh shit wrong channel but yea
Get a pcie card if you have to
I've been thinking about getting one and all mine still work anyway.
It likely isn't dead dead
probably just a bad update since it happened after the bios updated
ah, yeah
then its savable
Check your bios settings, theres features that can mess with 3.x
Yea
I will figure it out
if anything i will reach out in pc part picker discord
they are better equipped than me
Oh that's not great
I really really need to get back into PCB design
Poor GPUs 
nice
nice
lol
the dust isnt going to clean itself
and who said that isnt de-ionised water which is safe for electroncs :)
water itself is quite safe too its only an issue when you power it on because the water will short out stuff
its not if the surface is unclean ^-^
Whats the real difference between REST and gRPC
I know one typically uses HTTP/2 vs HTTP/1.1
or so i've heard
grpc uses protobuf
rest uses json
Can you elaborate more? I am not too sure what using protobuf versus json is in terms of performance, useability and or reliability
protobuf is a binary format, its faster, smaller, more efficient than json
but it requires a pre-defined schema
ie both client and server need to load a schema file
then messages are encoded/decoded based on that schema
grpc is basically like a stack that defines a bunch of rules, including the use of protobuf for messages
grpc is basically using websockets with protobuf
So, with GRPC is it still required to do stuff like end-to-end encryption yourself?
well, its just ssl
basically wss, websocket over ssl
Ima be so for real, I dont really know much about websockets or what not
I am trying to make a chat app and I want the traffic between the client - > server -> client to be secure.
I may sound like an idiot but I gotta ask

well actually you dont need websocket, it uses http2 server push
Really?
Dont you need websockets for real-time updates?
If a user sends a message every user needs to receive it
or at least every user subscribed
not anymore
basically, http2 allows you to keep a connection open
Oh thats sick
and http2 has a feature called server-push
which allows the server to send something without needing a client to requiest first
Oh cool
so I can send a message to every client that is / has connected to the server before?
the client needs to be connected

like if its on a website, the page needs to be open on the browser
I see
what if I am using like a mobile app
and I need to send a notification about the new message
similar to discord
How its a notif like
"Server Name" - "User" : "Message"
basically the app needs to connect to the server when it opens
the connection will stay while its running
but if you close the app and reopen it, you will probably need to connect again
How does discord still send notifs even when the app isn't running?
Like I can close discord entirely on my phone and still receive notifs
phone push notifications is something else entirely
on android it goes through some google service
Ah okay
on apple it goes through some apple service
Makes sense
I will look into using grpc then
Seems like it could be fun to play with
@pearl trail do you know what i should do with this warning?
i don't know much about go 
use json.Unmarshal(body, &voters)
yes, that should be it
thanks!!! β€οΈ
np!!
switch to rust because pointers are unsafe
oh wait thats go
im going to guess its a memory safe language
continue
rust has taught me to be a lot more careful when it comes to race conditions and thread safety in c/c++ because it yells at you when you try do something unsafe without locking
so the rust experience is actively paying itself off
these function names are starting to get obnoxious i need to tone it down
war crime function name
i hate these 1602 LCDs they draw so much standby current even when the backlight isnt on
this was so painful to code
it supports 8 custom chars
so I constantly have to swap out characters to display my dots
i see youre also querying it directly instead of having a chip which handles the display register manipulation where you only need to connect like 3-4 pins
are you using a library for that
yeah, I ordered a one-color oled, ill hope thatll give me a better experience
get a touch one its a bit more difficult since you have to deal with the touch calibration but its more fun and versatile
although i think there are tons of libraries that handle all that
Tbh that's a really good name. Very descriptive
Wayyyy better than c# / java naming conventions where it'd be called functionFactoryThatDpesStuffIdkJustImagineALongAssName()
don't forget in C#, if it's async, add Async (best practice)
Ping on join & giveaway
@warped summit Just to be transparent. You seem to post a lot of ad content.
Showing off what you work on is fine, but the way you're going about it is closer to an ad than a 'hey look at this cool thing'
this is a warning for self promotion and ads
aws s3?
the hetzner s3 base price turns me off
π what 1tb for $5.99?
lol
Oh no I was just showing off
Lets be real, most people just suck at naming things
Backblaze is the same price with no minimum
Backblaze is also really really slow
I use backblaze right now
I spend more on upload than anything tbh.
Imo, you're trading cheaper now for more expensive the moment your egress goes up pretty much at all.
π cf r2 is pretty neat
backblaze has a bandwidth alliance with cloudflare, so if you serve your files through cloudflare you don't pay for egress
You still do, just the egress costs are zero for the first 3x your storage.
so if you store 1gb you get 3gb of free upload
then it costs the normal rate
Which is why you get these weird situations you get charged more for storing less.
As in like response time? Whatβs the difference between using backblaze with cloudflare and using cloudflare r2
Iβve got a couple different things using them both but they seem exactly the same performance wise for loading pictures at least
re naming methods
it's usually better to be overly descriptive then under descriptive
π going good so far now almost done with docker container stuff
If you don't use cloudflare, yes. If you do, it's completely free
Is this similar to portainer's "stacks" concept?
Yup although technically stacks isnt really a portainer concept more of a docker compose file



