#development
1 messages Ā· Page 198 of 1
but it should be under Help -> Check for updates
doesn't matter much
if u have educational version then keep it, shouldn't matter
enable "Add open folder as project", for convenience
the rest doesn't matter
oh wait, judging by the icon u downloaded the ultimate version
u need a license to use ultimate, else it's a 30-day trial
use community edition
vscode is a code editor, intellij is an ide (editor with integrated dev tools)
Yeah ikik but will i be only using intellij
yes
Ok
did you install git already?
Still same thing
press install
that's just to select where you want to put intellij on the start menu
now launch it
done
it'll prompt you to customize some things, chose your flavor
click new project
select empty project
type a name for your project
then click create
oh and tick "Create Git repository"
add sample code?
no
wait ur in the wrong menu
it's "Empty project"
not "New project"
new project will create a managed project, which is too much for you to deal with for now
:)
hmm, ur missing a folder there somehow
what should i do
well no matter, right click on the empty space below scratches and consoles
hm wait, no, it wont show an option
odd, yours dont have the project folder above External Libraries
should i re install?
close intellij first, go inside your project folder
right click, then press Open as project or smth
it has main folder now
ok, good
no, not inside .idea folder
call the new folder "src"
dont touch the .idea folder, that's where project settings are stored
ok
inside src create a folder called java
why isnt it showing empty project
anything u want
i created src
show how you current project looks like
ok, right click it and create a new folder called main
dont ask again and add
done
inside that folder, create yet another folder called java
so it'll look like src/main/java
you created a file then, delete it
done
actually, tbh we can ignore that specific structure
you have only the src folder right?
yeah
done
now everything inside that folder will be treated as actual code
right click on it, click new and create a new package
now, do you already have a github account?
done
yeah
the naming is fairly important
delete it, let's use the proper naming standard
ok
it should be called com.github.username
replace username with your github account display name
inside src?
yes
done now?
now we start creating the actual code files
okay
right click on the newly created folder and create a java class
java class?
you can call it whatever, naming stardard is TitleCase
name?
main file inside that github folder?
wdym?
Main, not main
the standard naming rule in java (and javascript) are
- TitleCase classes
- camelCase methods and variables
- SCREAMING_SNAKE for constants and enums
did you rename the class or created another?
deleted and created another
ok
now lets make it write something for the sake of starting
lemme first explain the class structure
ok
package is where in the tree your class is located, you shouldn't need to worry abt this on intellij or any decent editor, but it's a thing to know
ok
public means the class is visible outside that file, there are also private which is the opposite
if you dont put either, it'll be a package-private class, only visible to classes in the same folder
class means it's a class
Main is the name of it
then inside { } is where your implementation (the code) will be
you must ALWAYS close braces
intellij will warn you if you forget to do it and the code wont run until you fix it
similar to c++ till now
oh you already know c++, good
that'll skip the introduction then
the syntax will be 99% similar to c++
ive studied python in 1st sem and im studying c++ now in 2nd sem
so ik bit basic stuff
ok inside the class, write ```java
public static void main(String[] args) {
}
``` or if you're a civilized 21st century developer that doesn't want to just rant about java, type psvm and press enter
this will be the entry point, similar to c++
inside it, let's write something to console
System.out.println("Hello world!");
``` or just `sout` -> enter
psvm will do what?
yes
psvm is the shortcut to add the entrypoint in intellij
some other editors might have it different
so itll write public void...
yes
when the popup appear, if you press Ctrl + Q it'll show you a description of it
M should be captial or small?
small, exactly as psvm generated it
methods are camelCase in java, like in c++
in general use the same naming rules as you learned in c++, they'll be pretty much equal
ok
methods like?
ah right, methods are what you call functions
we call it method when it's part of a class
you said that class thing so M should be capital there?
main should be TitleCase or camelCase
camel
ok
where
and hello world will appear on the embedded console below
Java uses camelCase for almost everything except class/enum names and enum members
(Another other notable exceptions)
ah, click on Setup JDK
You also donāt have a main class going
Although they mightāve gotten rid of the need for that in more recent JDKs
yes, select that
misconfigured
also write the Main class as waffle said, this is a very recent change that's not to be relied upon for now
Go to download JDK then and select openjdk
get version 21
not 22?
Yeah 21 is LTS I think right
22 is too recent, and not LTS
like?
Either that or 20 is LTS something like that
you'll get a lot of nice features yes, but you rarely will use them in a realistic setting
all class files must have a class declaration
I gtg for a while now, I'll leave it to waffle for a bit
my team was tasked with getting rid of tech debt which meant migrating from JDK8 to JDK21, god damn is JDK21 a pleasure to work with
https://www.codecademy.com/learn/learn-java I recommend following this course btw
still no elvis operator though :(
codecademy has a ton of free courses for java, and that one explains it pretty well for a complete beginner
wtf is elvis operator
what is that for
shorthand for a null ternary
var abc = someNullable ?: otherwise
Even just changing if (a instanceof Type) { Type newA = (Type)a; } to if(a instanceof Type newA) is a blessing
so its like ?? or ||
equivalent to ?? yes
why not just use ??
Java is quirky like that
does not exist in java
They also use -> for lambdas instead of the usual =>
it ran
Just design decisions
Although nothing can be worse than C++ lambda syntax even though python is a close 2nd
gtg dinner
i mean, Rust uses |arg| -> ReturnType { body } 
Yes but that makes sense and isnāt convoluted like C++ās
me when [&](const int &&thing, const *int *otherthing) -> std::unique_ptr<std::optional<uint69_t>> {}
Yeah thatās a certified C++ moment
Back, but currently taking lunch
And yay, my IJ bug report was moved from backlog to in development
Wait till you find out interpolated strings are in incubation phase
Also switches now work with pattern matching, like the instanceof thing waffle mentioned
should i learn java instead of rust chat
rust bein speed, right?
yes
if you're going for something compiled while also not willing to sacrifice your sanity, go for Rust
looking at rust makes my sanity disappear already
ok, back
hey guys
(x+1) + 5 / (x+1), in such a formula, do we basically remove the whole (x+1), or do we substitue it by 1?
so do we either get 6/1 or just 5 as we removed the x+1?
Math in CS problems 
well, in that specific formula you're dividing 5 by x+1
and no, you cant remove even if u were dividing the whole thing
you'd only be able to if it was ((x+1) * 5) / (x+1)
which would be 5
as for why it works this way, it's because you're dividing both sides by (x+1), so it becomes ((x+1) / (x+1) * 5) / ((x+1) / (x+1))
which becomes then (1 * 5) / 1
i meant this
huhh really?
yes, see my explanation above
division counteracts multiplication
addition counteracts subtraction
and only if they are in the same scope
owh goddayum i see
so if it were to be:
(1+5) * 5 / (1+5) you can remove it
but not if it's + or -
when writing formulas, use parentheses to specify order of operation
you wrote it again as dividing the 5 alone
Interesting
Yea, I had to reset Discord and it suddenly changed
rust is the goat
Also, comparing rust and java is not a fair comparison either way
Both do their own things and one is good at one thing then the other
I always advise against it unless its just for fun
Going into rust learning it to try and use it productively without knowing why or for what you want to use it is a bad idea
same goes for a lot of languages
people rave about it, but never ask for help
š
rust users silently suffer or ask in the rust discord
I want to find more rust programmers I can exploit hire
:)
It is
I need more rust programmers tbh
š

and groovy
lol
groovy is awesome, especially to use as dynamic scripting
tho now I'm genuinely interested, what did you find bad about groovy?
with intellij?
weird, was it long ago?
cuz jetbrains support for groovy is pretty fleshed out
perhaps what you're talking about is the lack of references in build.gradle, which is because there's indeed no source at your end so it can't lookup methods or variables
I used groovy for actual codebase, felt as integrated as java on intellij
also use it for my cards' script, which I code from within database manager on ij
reqwest
Hello. I have a problem. So I currently have āreaction rolesā assign a āmemberā role to new users when they react to roles, I have āmee6ā add a verified role to that user once they have clicked the verification button.. users now have full access to the discord but also have both roles attached. Ideally once they have verified and become a verified member, I need the āmemberā role to be removed.. how do I best approach this without manually editing each members roles..
My second query.. I notice some discords have āeventsā show at the top of the discord when an event is live.. is there a bot that will do something similar but show active bounties?
I think it'd be better to ask on those specific bots' support server instead
/\/$/ replace with empty string
Unable to find discord links for them. Iāll keep trying. Thanks for your reply.
for mee6 it's discord.gg/mee6
for reaction roles idk
I could never do rust, the syntax causes me physical pain
What in the fuck
are you doing
š
how do you use this
show me an example
I don't see the issue you are facing for this to have the need to make this
rocket handles this
it won't allow double slashses
yea, i've tested the same thing you are talking about and the request works fine for me
Just to prove it
even if your post or get has a slash at the beginning
it ignores it since there is already one at the top level
I don't see why it would
Unless the url is malformed
and you aren't pointing to the right endpoint
no
wait
yea no
rocket ignores any double slashes
Still a 200
Now would I intentionally do double slashes? no
If you can prevent it do so
cause it could theorectically cause issues depending on how your endpoints are setup
Hey guys, each MAC address is unique right? I came up with an idea but not sure if it's smart to do. I wante to create an encryption and decryption system that uses the mac address of the host to decrypt and encrypt
but to be fair, in protocol calls like ARP etc, the mac address is shared across the whle communication channel so it might also just be really stupid
i am bored so i tried to come up with some cool stuuf
nope
there's a crate for that but i recommend against it
it just feels unnecessary imo
bro got banned from Mee6
the hell did u do?
What war crimes do you have to do to get banned from the support server?
ayo even u has experienced role
Yes, we even had a short discussion about this yesterday 
Iām banned because I mocked NFTs
I donāt
Didnāt
It was in their nft server
The bans link between all servers of theirs
they have a separate server for that?
message link?
Probably said Mee6 sucked
Yes it got renamed
You can start reading from here #development message
At that exact moment, I think Tim got the role
I keep mee6 blocked 24/7
you're not banned there?
i guess not
i thought it was linked
through their bot, i mean
damn

we know
okay?
how do i add an image to my rich presence?
client.user.setPresence({
activities: [
{ name: `Spreading Positivity`, type: ActivityType.Playing },
],
status: "dnd",
largeImageKey: "4443538961_04500644e7_b",
largeImageText: "Spreading Love and Positivity",
smallImageKey: "4443538961_04500644e7_b",
smallImageText: "Spreading Love and Positivity",
});
doesn't seem to work
on the bot or the user
Cuz on the bot you canāt
Unfortunately
Although since Discord added animated avatars for bots and banners, there may be a slight chance
@eternal osprey not for self promo its a example like this is for only for users at the moment
or even
š„
Bots cannot have rich presences
already been told
Your language was indirect. Hearing it from multiple people is good
https://prnt.sc/B6IOnFcUPnHy Why can't I reply to the comments on my bot's page? I give replies and they just don't work or go through, I reload the page and they are gone. First I don't understand why people even raise questions on the top.gg page of the bot instead of joining support server, and second why doesn't the website allow me to answer the comments? 
i
Do I need to generate ssl keys with like letsencrypt if I am using cloudflare origin certs? ( not sure what the difference between the two is as they are generated under the ssl tab :^) )
i forgot what they call it, but they have two modes
i think its flex and strict?
one lets you use any ssl, then cf adds their own ssl on top
yea flex I think you can bring in letsencrypt right?
and the other forces you to use cf's own ssl only
flex iirc is for only client side ssl
and you have to use letsencrypt for server ssl
strict handles both
I think
the client-side only is a third mode i think
ah its full and full-strict
actually you might be able to use letsencrypt in the full strict mode
I dont want to use letsencyrpt tbh
it says it accepts anything that comes from a trusted origin
i mean, it renews automatically
lmao really
yea
the free ones?
yup
dafuq
Origin CA certs are 15 years
i thought they were like 1 year max
lmao
do you have any idea on how to help me
like where do I even start looking
š
This is for the most part the same exact setup as I had on my last vps, except my dns was slightly different
I have a script that auto-renews letsencrypt. Dont have to deal with it
No I wont share :(
no one asked

cool
I will use origin ca certs
that I dont have to renew for 15 years
š
#development message š¤
I have no experience with cf otherwise I would
maybe its not even cf
Thought about getting into it for interaction load balancing
idk where the issue actually is
It says host error and not like a gateway timeout or anything so
Might want to monitor traffic from your app
Does cf give you any logs
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name mail.collegecrafts.io autodiscover.* autoconfig.*;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name mail.collegecrafts.io autodiscover.* autoconfig.*;
ssl_certificate /etc/ssl/certs/mail.collegecrafts.io.pem;
ssl_certificate_key /etc/ssl/private/mail.collegecrafts.io.key;
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:50m;
ssl_session_tickets off;
ssl_client_verify on
ssl_client_certificate /etc/ssl/certs/cloduflare.crt
ssl_protocols TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5:!SHA1:!kRSA;
ssl_prefer_server_ciphers off;
location /Microsoft-Server-ActiveSync {
proxy_pass http://127.0.0.1:8080/Microsoft-Server-ActiveSync;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_connect_timeout 75;
proxy_send_timeout 3650;
proxy_read_timeout 3650;
proxy_buffers 64 512k;
client_body_buffer_size 512k;
client_max_body_size 0;
}
location / {
proxy_pass http://127.0.0.1:8080/;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_buffer_size 128k;
proxy_buffers 64 512k;
proxy_busy_buffers_size 512k;
}
}```
like nginx looks fine
unless I am blind
No idea, I yet to see anything
your nginx is wrong
How?
idk but this is too long
server {
listen 80;
listen [::]:80;
server_name domain.com;
root /root/(project path);
location / {
proxy_pass http://127.0.0.1:3600;
proxy_read_timeout 60;
proxy_connect_timeout 60;
proxy_redirect off;
# Allow the use of websockets
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
mine is just like that
@clear plinth this is several cases where this guy has responded in this channel with either A. chatgpt responses or B. spewing bullshit
please at this point do something about it
I haven't said that
Lmaoo mine simple
server {
listen 80 default_server;
listen [::]:80 default_server;
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
ssl_certificate /etc/nginx/ssl/origin-certificate.pem;
ssl_certificate_key /etc/nginx/ssl/oliverbot.xyz-private-key.key;
root /home/website;
index index.html index.htm index.nginx-debian.html;
server_name oliverbot.xyz www.oliverbot.xyz;
location / {
try_files $uri $uri/ =404;
}
location /api/ {
proxy_redirect http://localhost:5484 https://oliverboy.xyz/api/; #<-- change
proxy_pass_header Server;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Scheme $scheme;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_connect_timeout 5;
proxy_read_timeout 240;
proxy_intercept_errors on;
proxy_pass http://127.0.0.1:5484;
}
}
This is my config for https://amanda.moe
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";
}
}
redirects http requests to the https port
Ah I see
It has some extra stuff that not everyone needs
I unfortunately wont be of much help then
fair enough thanks for trying :)
i use cloudflare bs
that Microsoft stuff is literally just so it can support logging in to other clients like outlook, gmail, etc
@lyric mountain if I remember correctly didn't you help me with mailcow last time (sorry for ping Im desperate)
I looked back in logs you helped me with a similar issue
Not related to email I'm sure, never dealt with anything related
it was the nginx stuff for it
cause I think nginx was the reason it was causing 500 errors
What code is it? 500?
521
What are you trying to access?
this is my current conf
Is the mail server up?
I have the same exact setup as last time
according to docker compose yea
the logs for the mailserver seem clean as well
I see no issues
nothing about my mail stuff
actually looking through the mailcow docker logs it does show some errors relating to the dockerapi component but it seems to have eventually started
https://pastes.dev/jjkktWzmSl
This is one of the errros I found
Uncaught CombinedPropertyError Error: Received one or more errors```
how the fuck can i solve this
like it doesn't even tell me what error it has
it even happens after i use a try catch
where is this error coming from
looks like for whatever reason it cant resolve your domain for whatever youre trying to connect to
socket.gaierror: [Errno -2] Name does not resolve
doubt your dns is fucked so i would double check the domain its trying to resolve
ive been fighting with this bot for hours now trying to get it to see my server for DayZ, it still cant find it, i need help
you need to be more specific
what bot? if its a bot someone made youd be better off contacting the developer or server of it
thats as specific as it gets, ss9 bot isnt picking up my dayz server
you should probably join their support server here https://top.gg/bot/744547656843526226
KillFeed Bot for Dayz console community servers. Auto ban rules break. base raiding alarm. currency system and more.
they can help more than we can
hey guys i need to do a research on computing and sustainability. Would a research on more substainable training methods for convulational methods be a good topic?
I would say that training large AIs (LLMs mostly) as well as using them is very unsustainable right now due to their high energy costs, perhaps doing research on that would be good
damn that sounds good
I once had to train a large image generator AI which took so fucking much power to do. It was running at an almost 100% cpu rate for like 4-5 days.
Might take the resource usage and discuss it in this research
should i be using text-wrap in css?
well yeah the cpu isnt optimised for machine learning tasks which often involves running mathematical functions many times a second on every single neuron in the layer
gpus are great for that because they can do that in parallel very fast
but even for machine learning they arent great
google made their own inhouse chip which performs better than the top of the range gpu apparently at less of the cost
tensor processing unit or whatever
but you cant buy it youd have to use it through google cloud
Damnnn thank you so much for the intel
Idk if you are familiar with these fra@works but itās essentially the same as Hadoop vs spark
Spark is hella good at parallel computing while Hadoop is optimized for sequential things making it bad for machine learning or iterative algorithms
play break in irl
Im sure with enough money you can get one yourself 
it probably wouldnt be economic
google no no wanna
with a contract then maybe
for example a data center having a contract with google then maybe theyd consider it
but unlikely given their have their own cloud
its probably not even that impressive just like how google hyped their bard up during a presentation
power efficient maybe
lol yea
This happens all the time now that my bot is a little bit bigger. Does this happen to anyone else in the 25k server range?
I don't know how to make a bot... I really need someone to help me š
Start with a coding language, learn the basics of said coding language of your choice, and use a library that uses Discord's API to create a bot with it. For example: Javascript has Discord.js and other stuff, Java has JDA, ect ect.
oh alright.
Use ChatGPT for learning
Donāt use it long term tho
I'd defenitly suggest against that because it will promote bad habbits of having chat gpt just write code for you so you realistically wont learn anything.
Do you cluster at all or only use internal sharding?
I don't remember exactly but I think around 25k is when I started clustering for performance gains. I use d.js though so it might depend on your library I'm not sure. I'm no expert
How many guilds do you have per shard?
Haven't done clustering, not even sure what that would be in terms of Discord bots.
I also use Djs, I just use its sharding.
Djs likes to put 1k servers per shard.
I don't have performance issues. I self host the bot on a server at home though.
You should probably look at clustering anyway. Discord bots don't scale well beyond a certain point and 25k is around when I clustering mine. I'd recommend this package. Requires minimal changes to your existing code and it's what most people use.
The first package which combines sharding manager & internal sharding to save a lot of resources, which allows clustering!. Latest version: 2.1.9, last published: 13 days ago. Start using discord-hybrid-sharding in your project by running npm i discord-hybrid-sharding. There are 8 other projects in the npm registry using discord-hybrid-sharding.
I definitely had shard disconnect issues before I started clustering though. I remember restarting my bot to try and fix them.
the junior devs nowadays are spoiled
they have llms are their disposal that can write code
back in my day you had to beg people to help
i've never touched chatgpt 
I really like llms for writing annoying code, the rest is almost always shit output
sharding as much in a single process as you can is the key
ideally you should fit as many shards in a single process as you can until you start getting issues like slow responses or high cpu on a single core
otherwise youre really wasting resources because spawning an identical process that does the same thing is expensive especially for node
@quartz kindle cant you spawn clusters as worker threads perhaps
threads are also distributed amongst cores and you have the advantage of keeping everything under one process and reducing communication between cluster delays
@green kestrel does your library do something like this?
actually nodes worker threads suck as well because you cant directly access another threads memory
not like that
in dpp, a shard has a native thread and a cluster is just a collection of shards in an object
you can if you wish decide to put each of those clusters in a process, or you can put them in an array and run them all in one process, we dont restrict that choice
in triviabot, i run one cluster per process with 8 shards per cluster, 18 clusters total
in seven spells and sporks, its just two and four shards in one cluster process
discord.js doesnt do sharding in a very efficient way as far as i can see
also dpp clusters dont communicate unless you add something outside the lib to make them communicate, they dont generally need to, or to share cache
worker threads have been proven to fail time and time again when handling heavy loads
the way node handles and allocates resources for them is weird, they often crash due to memory issues despite the parent process still having memory available, or sometimes they crash the parent process as well
sounds like a node problem
yup
sounds good I'd keep them in separate threads too
thats why using child processes is recommended
better concurrency as well
I mean in c++ you don't really have an event loop so you'd have to anyways unless you wanna implement one with async or whatever modern c++ comes with
yeah they sound crap no wonder no one uses them
there's so much potential with it though surprised they aren't really focused on them
if they can figure out a way to easily and safely share memory between threads and make them stable it's a game changer
its hard because v8 is not designed for that, they need to keep hacking and modding v8 to even implement basic stuff like that
found this in the ndoe github issues
out-of-memory errors are not recoverable so āļøis not a reasonable expectation. It's a V8 limitation that is not under node's control.
Node does try to terminate workers when it detects almost-out-of-memory conditions but that's a best effort attempt, it's not 100% reliable.
whats the point adding worker threads then
if theyre so unstable its pointless using them in production
they could instead add something similar but more fit for purpose such as for i/o or cpu purposes
if only voltrex wasnt banned for some arbitrary reason we could be pressing him rn
he always has an answer for anything v8 or node related surprisingly
they are good for cpu-heavy workloads
not for long-running memory-heavy workloads
I keep getting the urge to integrate dpp and libduktape
to have a hybrid c++/js emca platform designed for extreme efficiency discord apps
you wouldn't use Discordjs in it, but js mappings for dpp, and dpp cache and native functions
basically instead of "node index.js" you'd do "dppjs index.js" and it would have a binary
the difficulty is automating creation of a duktape wrapper for dpp
Hey guys is this true about dns resolving?
uppose I want to search for google.co.uk
we first of all with our dns resolver request for google.co.uk to the root dns server. it returns us the address of the first TLD .uk.
Our dns resolver then requests for google.co in the TLD server, which searches in the autorative servers of .uk tld.
it returns us now the tld .co ip address.
our dns resolver then again queries tld .co for google. This tld will again then return us the authorative server ip addresses of this tld.
we then again with our dns resolver, try to find google from each authoartive server.
this time it returns the ip address of google.
so i think that it follows structure:
-> root -> tld -> authorative server -> ip of name mapping
where each -> represents one request by our dns resolver.
in the green erros where it says name server for .edu for example, does it return an authrative nameservers of that tld?
that we then again need to query for googleplex for example
because the tld's only save mappings to authorative nameservers, which itself map tld's and other domain names to actual ip addresses.
or does querying the tld automaticlly query it's own authoartiveservers?
is there anything im doing wrong here?
client.on(Events.GuildMemberUpdate, (OM, NM) => {
const OBS = OM.premiumSince !== null
const NBS = NM.premiumSince !== null
if (OBS !== NBS) {
if (NBS && NM.guild.id === config.StaffGuildID) {
const Channel = client.channels.cache.get("1202078134539649075")
if (Channel) {
try {
console.log("Boost Event Ran")
const NewBoostEmbed = new EmbedBuilder()
.setTitle("š New Boost! š")
.setDescription(`Thank you ${NM.user.username} for Boosting RoSearcher Support!`)
.setColor("LuminousVividPink")
Channel.send({ embeds: [NewBoostEmbed] })
} catch (e) {
console.log(`Boost Event Error: ${e}`)
}
} else {
console.log("Boost Channel does not exist")
}
}
}
})
idk what the issue is. but const OBS = OM.premiumSince !== null
const NBS = NM.premiumSince !== null is not needed. You can simply check OM.premiumSince !== NM.premiumSince.
I'll try this and let you know if it fixes it
cache and not fetch
also you should really start using camelCase or some sort of standard cus you've got everything all over the place
time to start playing around with DPP 
why 
i literally did ```cpp
void ping(qp::Bot* bot, const dpp::slashcommand_t& event) {
event.reply("Pong!");
}
just like https://dpp.dev/slashcommands.html
@green kestrel @wheat mesa 
what is qp::Bot?
Read loop ended means an exception was caught by dpp inside an event handler
thrown by your event handler
@radiant kraken take a look at how the example registers commands, you definitely dont want to do it on EVERY on_ready
my custom bot class, inheriting dpp::cluster
oh right i forgot about the once thing 
your way of iterating a vector is awful, theres a nice way:
for (const auto & item : container) {
}
thanks! i haven't touched C++ in 3 years 
people havent been directly accessing iterators like that since like C++14
lmao
when you do command->callback how does that work, what does it do
if youre passing it in by reference or pointer, then spawning a thread, or anything, remember that dpp events occur in a thread, you have to be careful of ownership and lifetime
coming from rust, it enforces this for you, C++ doesnt care
typedef struct {
const char* name;
const char* description;
std::initializer_list<command_option_t> options;
std::function<void(qp::Bot* bot, const dpp::slashcommand_t& event)> callback;
} command_t;
interesting
not sure what in your code is throwing the invalid function call exception
looks like std::runtime_error
ah no i know
your std::function doesnt point to a valid function, its not set yet
thats what is thrown if you do command->callback, but callback isnt yet set to a pointer
its a safety check against *(null)(lol)
really? well...
idk, it seems pretty over engineered
wait really? lmao
yeah
no
this is the simplest multiple command discord bot in dpp that we could come up with
there are hundreds of ways to do the same, the way seven spells works is somewhat like what youre trying to do, not the simple example above
the example above just makes a function for each command
rather than building complex classes
its a struct that isnt defined
do you want the reason? š
yes
ok
so
if you define a template in C++, it decides if its unique based on what you template it to
so template<class X> is unique compared to template<class Y>
we use this to make a unique static boolean, used to determine if that block has ran yet or not
by defining some random class/struct name in the template it gives it the uniqueness
even if you never define that struct
so, whenever you use run_once, if you put a different struct name in there... it will treat it as a unique section
that's insane
yeah i know lol
i can just put struct adjdjsfdsfidsjfdf
but kinda cool
sure
struct cpp_why_you_so_fucked_up
this is how ssod commands are defined:
https://github.com/brainboxdotcc/ssod/blob/main/include/ssod/commands/help.h
https://github.com/brainboxdotcc/ssod/blob/main/src/commands/help.cpp
feel free to steal the files from this if you want to use it
some real useful stuff in there like a mysql db wrapper
youd need include/ssod/command.h and src/command.cpp
commands are registered in listeners.cpp: https://github.com/brainboxdotcc/ssod/blob/main/src/listeners.cpp#L170
i really dont recommend looking at how triviabot does commands
theres SO much stuff in there you probably dont need
like accepting commands from four sources: slashcommands, messages, dashboard code and cron jobs
i need that there, do you?
š
i dont think so
triviabot command handler actually converts slash commands internally to message commands
because that was less rewriting
and passes a state object in, to determine where to route the reply back to
not if youre on a deadline
with slash commands we were all on a deadline
i feel that
oh, and triviabot command handler can externalise a command
basically, spawn a thread, where an external php script executed, and the stdout captured as json and sent back to discord via event.reply
insane
this was used a lot more in previous versions, now only /globalrank and /localrank use it (try them over on #commands)
anyway maybe it's because of std::function? what if i turn it to a function pointer
you can try it and see
but if it really isnt initialised youre replacing a thrown exception with a null pointer dereference
using a function pointer somewhat fixed it
at least now i know it's pointing... somewhere (and the function gets called, but the same error still shows up) ```cpp
std::cout << "WOOHOOO RUNNING!" << (std::size_t)(command.callback) << '\n';
return command.callback(this, event);
@green kestrel IT WORKED! i literally just added a std::cout to the reply callback
```cpp
event.reply("Pong!", [](auto _) {
std::cout << "it works!\n";
});
how
no idea
usually odd behaviour like this is the result of:
last time i had something like this happen was because of undefined behaviour
accessing stuff that's outside of lifetime is UB
the lambda function was empty lmao
I literally said same thing in api channel


I have every channel hidden except this chat
very tim move
things kinda fell off ever since 3rd party bots werent allowed in the server, though it was at the behest of Discord so
hbd btw
thanks!! ā¤ļø
@radiant kraken happy bird day!
tysm experienced! š«¶
the bird is the law
does anyone know any good stripe connect tutorials to build marketplaces?
The api docs
yeah no fax, but itās much easier to learn from implementation first then reference the docs for any issues or specifics based on my use case
It has guides on how to implement
tbf yea its a tiny bit dead without the bots
its what made the server special
but nothing they couldve done really discord put a limit on bots in a server
I also think that they got tired of people using the help command and spamming chat lol
!help mfs
that was the funniest shit
!help and the entire channel got spammed and someone ended up being muted
How to install a text translator .. ~
then some shit turkish bot responds to the help command 2 minutes later
Yup
literally
if(
(((pdiff > 0 && ndiff > 0) || (pdiff < 0 && ndiff < 0)) && ((apdiff < target && andiff > target) || (apdiff > target && andiff < target))) ||
(apdiff < target && andiff < target && target - apdiff < target / 2 && target - andiff < target / 2) ||
(apdiff > target && andiff > target && apdiff - target < target / 2 && andiff - target < target / 2)
) {}
``` i have no idea what im doing, nor if this even works @_@
do i wanna know what youre trying to do
that looks like some collision detection if anything
most readable control flow
(Imagine what this shit looks like if it was compiled down to asm)
im so tired of this crap, i spend weeks thinking about this but have 0 motivation to work on it because i have no clear idea of how to proceed
make a isBetween func, does wonders to make code easier to bugfix
tim_cursed_conditions:
sub rsp, 24
mov r9d, ecx
mov rax, QWORD PTR fs:40
mov QWORD PTR [rsp+8], rax
xor eax, eax
test edi, edi
jle .L11
test esi, esi
jle .L11
.L2:
cmp edx, r8d
setl al
cmp r8d, r9d
setl cl
and al, cl
je .L17
.L1:
mov rdx, QWORD PTR [rsp+8]
sub rdx, QWORD PTR fs:40
jne .L18
add rsp, 24
ret
.L11:
test edi, esi
js .L2
.L4:
cmp edx, r9d
mov eax, r9d
cmovge eax, edx
cmp r8d, eax
jle .L6
mov ecx, r8d
mov eax, r8d
shr ecx, 31
sub eax, edx
add ecx, r8d
sar ecx
cmp eax, ecx
jge .L6
mov esi, r8d
mov eax, 1
sub esi, r9d
cmp ecx, esi
jg .L1
.L6:
cmp edx, r9d
mov ecx, r9d
cmovle ecx, edx
xor eax, eax
cmp r8d, ecx
jge .L1
mov ecx, r8d
sub edx, r8d
shr ecx, 31
add ecx, r8d
sar ecx
cmp edx, ecx
jge .L1
mov eax, r9d
sub eax, r8d
cmp ecx, eax
setg al
jmp .L1
.L17:
cmp edx, r8d
setg al
cmp r8d, r9d
setg cl
and al, cl
jne .L1
jmp .L4
.L18:
call __stack_chk_fail
Math is really hard and complex logic quickly becomes unreadable and unmaintainable. I find it helps if you write down what it is you want to achieve and break it down similar to what Kuu said. I also sometimes write logic in plain english if I'm really stumped
youre welcome
Thanks I hate it
thats O2 optimized as well
its a lot shorter than i thought so i think some of the checks in your condition are redundant and can be simplified
One message removed from a suspended account.
thats tame in assembly terms
((pdiff > 0 && ndiff > 0) || (pdiff < 0 && ndiff < 0)) can be replaced by Math.sign(pdiff) == Math.sign(ndiff)
tho the apdiff/andiff stuff I cant think of a way to be shortened
honestly i should jsut go the long way around it
isolate more conditions and contexts and make the math simpler for each context
instead of trying to reduce code by designing catch-all conditions
You can expand it once you figure it all out I feel like
Reduced code per context can also help spot potential optimizations
One message removed from a suspended account.
One message removed from a suspended account.
ive seen bigger
that's what she said
i said what i said
Hey is there a way in python where I can give rewards based on if a person has voted or not?
API/ Documentation in Python
or something
Top.gg Python library

Afaik no
There is always reflection though
This sounds like an XY problem because you should almost never need to āmodify bytecodeā
ā¦why?
Iām pretty sure that if a method isnāt called by anything the compiler will try itās best to strip it out anyways
well then I think youāll shoot yourself in the foot even attempting anything close to that
java is quite inflexible in that regard i would imagine
you "can"
note the quotes
I say this because I know frameworks that use this
dont ask me HOW to do it tho
I also suggest against removing things from the bytecode, JIT will take care of them the best way possible
like lombok?
well, you can modify bytecode the same way lombok does it, but it does use reflection
i could also technically use a annotation processor
also this is technically reflection too
Again thereās probably a billion better ways to do what you want to do
Java isnāt a fun language to mess with in that regard, Iād say C# is probably the easiest to mess with
gradle has access to the generated bytecode, and as such you can manipulate it with groovy/kotlin
but it'll require a lot of documentation reading
https://www.javassist.org/ and https://asm.ow2.io/ are your best bets if you can access the classloader
the latter is how gradle does gradle stuff
but do you really need to remove it? like, isn't there any other way?
can i get your vsc theme?
sbit looks hella kawaii cute
wait is that intellj?
thankss
do you really need to remove it?
you could also just put those dev-only mixins in a folder and exclude it on gradle
what are mixins? im very inclined to say use macros to fix this situation but im guessing java doesnt support them
mixins are injectable code
whats the use case
when you want to inject code
like, when extending is not enough and you want to change stuff in a built-in class
akin to js prototype, if you will
cant you just put those injectors in another class and exclude it when in production?
if you need to access properties or call methods then extend the mixin and make them protected
messing with bytecode is messier tbf
if you used groovy you could just append/overwrite the original method 
as it has a prototype-like way of doing it
how can i get time stamps generated in my giveaway command?
Put them into the format <t: :> - I personally use this website; https://hammertime.cyou/en-GB
if thats what you mean
but like, if i put ā5 minutesā into my parameter, how can i get the bot the generate that code in that format in the embed with that website?
do i need to npm install anything? or is there a module that does it already? api?
just calculate the next timestamp you need, put it in the <t:....:R> format
that's it
calculate the unix timestamp for that time.
This SO article gives the easiest way to do it (:
you guys are literally the best ever!!! ok iāll read over this, thank you!!
Because the epoch timestamp is basically just how many ms have happened since a certain date (unsure what date it is), so it's as simple as adding X amount of ms to the current date
Good overview (from https://www.epochconverter.com/)
wasn't it 1970
that's when the first unix based system emerged iirc
as shown in the screenshot, yeah it is
and they used that as a timestamp
oowh didn't see that
yo anyone know a really good discord bot hosting site that allows a bulk-upload of ~ 1GB? My bot also converts typescript to javascript so I was wondering if any site exists so that I can run these specific commands to do so? (Specifically pnpm)
Your own vps
1gb of code is an impressive size
most of it is pnpm packages lol
Thanks :)
Yk ur not supposed to upload the packages right?
... uhhhhhh no. So I just ignore the node_modules stuff?
Yes
As long as you have the packages.json file, all dependencies will be downloaded before running
oh damn, sweet
As for the host, there are very few free hosts remaining, only one I know about is oracle
But oracle being oracle, your service might be terminated at moment's notice, so there's always a risk
Ah yeah ok, I'm just using Pebble for now
@lyric mountain For some reason it's not finding the package
have you run npm i prior to running the script?
Heās using pnpm
I'm sane. So sane, it's in. In sane
Going through my Unity project and refactoring from getters and setters to functions to get and set private properties because getters and setter values dont update at runtime in my Unity version
C# interfaces don't allow non getter-setter properties anyways. Why did I choose to go with interfaces? Multi inheritance. Each aspect of a weapon is optional in my game and the goal is to allow mods eventually, so just having some uber script that implements everything my way limits developer freedom
U could've used property get/set
Link?
public bool Something { get; set; }
Are u sure? Also, did you implement them on the classes?
Asking cuz I do use this on godot c#
Btw, an interface isn't the proper thing to use here
Do tell
Use an abstract superclass instead
You cannot multi inherit from classes
Yes, but all weapons will have those properties, you can put the rest as interfaces
Perhaps for just the BaseWeapon interface sure and have people derive from that and add optional interfaces from that, but each interface extends IBaseWeapon anyways
Since the static classes that use the optional interfaces also reference properties from IBaseWeapon
The idea is not having to implement all those methods on every subclass you write
Interfaces aren't exactly for this type of thing
Also regarding this, did you follow the debugger to see if it was reaching the implementation?
I did!
Is there a thread somewhere where cou can ask and give feedback about bots?
yes its on your computer called /dev/null
you send your feedback there
but you would join the bots support server probably to give them feedback or leave a review on their topgg page
/dev/@radiant kraken
I was asking for a Dev2Dev thread/channel and did not request data from /dev/random 
mount /dev/null /home
me
the closest thing is probably this channel then
I donāt see the issue
they copied^@Q#%!@!!!@!@#!@
yeah, both are fairly different to be called copies
big image + large text is a common frontpage layout
dont forget the buttons
Yeah I think youāre overestimating the creativity of people
This is a massively common format
Itās also hard to do much creativity on the internet in terms of web design
You canāt make it overly complex or no one will view it, you also canāt make it too simple (2000 style) or again no one will view it
So you find a format that works and use it, which a lot of sites follow the same format because well it works
I went for a neocities style for https://amanda.moe
Everyone should bring back 90s looks
@sharp saddle
just ask here
people would help you
i'm busy rn
so guys im trying to find bot hosting
What's your budget and how powerful does it have to be
uh budget i dont like talking about that
basically not that expensive
How much would you be willing to pay per month is what I'm getting at
oh
What specs are ur needs?
uh how much is bot hosting?
You can get a vps
It all depends on what you need and how tolerable you are to hosting provider issues
hetzner and datalix have good offers
Yeah
i just want host for one server
around 3-5 usd/month
my budget $10
Hetzer, contabo
How big is your bot and what kind of bot is it?
google has a free forever vps plan as well, where you only pay for excess bandwidth
I personally use GalaxyGate for my bot, but it's $20/m for what I'm getting. Contabo is a decent budget option, but their support team is non existent basically
its private for one server
or the google's free one
Yeah
This will be fine
You can also host off your own network with something like a raspberry pi. I have one for small projects I develop and one of them is a private bot
i dont know how vps work