#development
1 messages · Page 90 of 1
good
ok I can't figure this out rn, gonna be done for the night
if anyone has suggestions on how to implement a subcommand handler, lmk (feel free to ping me)
Just check for the command's name
mods?
@solemn latch NSFW and racial slurs ^
Is there a way to
Dammit, didn't mean to send that, just opened the channel and it was already typed -.-
you could delete it
now i was able to try and it doesn't play the audio file as you said
i try this: https://stackoverflow.com/questions/61777531/nodejs-capturing-a-stereo-pcm-wave-stream-into-mono-audiobuffer
but i got a error like this, Since the data retrieved with getChannelData from Stackoverflow returned Float32Array, I concat the buffers and converted them to Float32Array and used it like that and since it is saved as unsigned-integer, not signed-integer, it will be in the range 0-65535, not -32768-32767. I couldn't solve this problem even though I made the necessary adjustments
message.contentand message.embed seem to be empty when the message is an interaction reply. but fine if it is a normal message sent by a bot. Is this intentional? Is there any way to get around this?
@quartz kindle even after using the nodes stream/promises i still get this error
Which OS is better for Linux VPS?
CentOS 7x64
Debian 10x64
Debian 11x64
Ubuntu 18x64
Ubuntu 20x64
Mikrotik
The fuck is mikrotik
YOOO CHATGPT IS THE BEST!!!!
i prefer ubuntu 20x64 for me
An OS usually found in routers
At least all the times I saw it was for network monitoring
Codeing
isn't it quite inaccurate?
Codeing what?
Anything really
Adding "v14" doesn't change anything at all, so it's best to look at the documentation anyway
Y’all gotta stop relying on ChatGPT and thinking it’s right. 9/10 times it’s pretty much wrong
ChatGPT's training cutoff was 2021
Yeah
v14 came out later
like who was in paris
I am a language model and my training data only goes until 2021 so I can't provide you information about 2022 events, but if you are looking for general information, you can check the 2022 calendar and schedule, sports events, political elections, and major holidays, you can also check public predictions and forecasts for the year. However, it's worth noting that many events can happen in 2022, some of them can be positive and some of them negative, it depends on the context and the location, so it would be hard to predict all of them.
on stackoverflow you just get like 5 answers and in the comments it's always someone like "actually this is wrong for x, see y's answer it's better"
what if you ask "what will happen in 2022"
Same thing
did we all die in 2012
then how did it know that it's an event from the future
kinda sus
when will the end of the world happen
I am a language model and my training data only goes until 2021 so I can't provide you information about 2023 events, but if you are looking for general information, you can check the 2023 calendar and schedule, sports events, political elections, and major holidays, you can also check public predictions and forecasts for the year. However, it's worth noting that many events can happen in 2023, some of them can be positive and some of them negative, it depends on the context and the location, so it would be hard to predict all of them.

And then you get bashed by a 46 year old dude named victor who started programming when he was 5
this is the year
no
"how do I do X in java"
+9999 "use guava"
- -3 "don't want to"
- +500 "then use apache commons instead"
A lot of node q and a's include answers of libraries no one has heard of and are just bloat providing very simple and mundane processing
Just like the leftPad fiasco
That's why don't recommend stack overflow to new cs students and anyone in my uni
I mean, leftpad was just npm being stupid in structure
(Not the leftPad thing)
Discord has been a better dev resource to me than any google search

which is kinda cringe
yeah a bit
Honestly, imo google is way better once you understand what things are called.
I generally can find whatever much faster via Google or reading documentation.
I do a lot of rubberducking on discord
But it’s a really useful resource because other people get to criticize your work from a perspective that you haven’t thought of before
even if you don't understand it google's a better source 95% of the time
As feedback i don't really trust it.
A beginner trying to learn might get advice from another beginner which isn't good.
Google has that risk too
can plop in a cryptic error message and likely find what's wrong with at most 3 links
you really don't need someone else to ask when you're good at searching. I've found a lot of issues by just searching github repositories with certain error messages
I think that's the issue for most people in the beginning, not knowing what something is called, not knowing how to read documentation, or even how to read error messages.
well if you're beginning you don't know where to go
so asking initially is expected
there aren't many reliable sources for beginners
I think I disagree with that.
there are hundreds of online courses ranging from free, to very cheap(or start with a free trial).
for very little money some courses cover everything you'll need to know as a beginner for the first year or so. I've seen some which even go into the topic above, how to search on google for more information on your own.
How can I add screenshots of my bot in the bot page
i don't use it for libraries, instead i use it to diagnose (i am dumb)
I honestly hate guava
apache is at least modularized so u can get what u really need
guava is just a huge bloat all around
if(message.attachments.size == 0)
{
message.reply({ephemeral:true, content: `:x: **You are only allowed to send images in this channel!**`})
return message.delete()
}```Would it be possible to actually ephemeral send a message reply?
Or is it only for interactions
You cannot send ephemeral replies on message commands
aight thanks!
Also, you must keep in mind that message.attachments are also different types of files, such as .txt files
If you really want users to only be able to upload photos in your channel then you need more than that
How do you use choices? I can add them I just don't know how to call them so
return //statement
}```
is it get choices?
check the docs for ur lib
I did there's abit on how to add it but I'm struggling on the bit to call it and return the string.
the same page will also tell you how to retrieve the selected options
I found the page! Sorry for wasting your time!
don't worry, whenever you have questions regarding "how to do X" related to discord, always resort to the official docs
any half-decent library will have docs for all methods and objects
so I have an array with alot of objects (could be over 500), each has a type property, how can I delete every object with the type prop set to x except the last one?
iterate
pretty vague but I think I know what you want
like, iterate can only mean one thing
use a for loop, check if the item is an object, if it has your property then delete it
Once the index = array length - 1 you're at the last item
Which you wanna skip
just make sure to create a copy of the array just so u don't run into concurrency modification issues
and not skip indexes for deleting items
alr, thanks
Sowwy haven't been online the last weeks
post your error
we do not help with other peoples bots. If its an error on the website when voting, goto #support and be more specific about your error and what it's saying instead of going "Please help" because that doesn't give much context. If it's another persons bot giving you an error, you need to goto their support server and ask there.
Still can't figure out how to handle subcommands
Ideally I'd be able to just do new SubcommandClassThing() in a parent command's options array, but I just can't figure out how to make the types compatible
Can show you an example how I handle em tomorrow
faucet0x1efd3b626b4814848b995a12e52fa2c0e7d7fbbc
?
crypto ❤️
mkay, imma check it all out, thx
Canvas is the ol' reliable
how does discord still not have mutually exclusive options for interactions
And this is the exact reason I don't use slashes
Quite literally the only reason I use slash commands is because auto complete + database is pretty nice.
The reason is you're just too lazy to implement em
Nah, I depend on context-dependant args
Also, my command handler works for both systems, all I need to do is to upload as slash
Hmm is it a great idea to support both of them
I need slash commands because localization is quite important for me
you can do localization with regular commands though
I prefer interactions interface wise since it standardizes a lot of things
Aint no way you said sorry like that as a grown man L
sowwy
I want to write a function but I can't think of an easy way, when I enter seventeen as input, it should give me 17 as output.
or fifty one => 51
that's going to need some semi complex parsing
you could try tokenizing for example fifty and one and since there's 2 tokens fifty must be in the 10ths and one in the 1s then add them together
or use a library
make sure to ignore tokens like and though
please dont just have several ifs containing checks or a whole dictionary with any number possible (unless single digits)
I'm printing to chatgpt 😃

You gotta need to go with the time
lmfaoooo
I forgot to uncomment a piece of code that checked for typos in my bot, waited ~4 days for a review and they typo'd.
I love coding
its so fun
Sometimes it happens unfortunately
yep, my fault in here
one could even say it was a skill issue
annoying part tho is that the bot works, except for that specific part it seems. I'll try to QA some more but rn I'm just gonna sit around ig
This is most likely because you take the number of servers from the cache and not all servers need to be in it
Try to fetch the servers with fetch() but be careful because this creates a direct request to the discord api and you may get rate limited
You can also save the servers where your bot is in the database and take the number of servers from the database
you cant fix it
discord does not show real guild count on their authorization page
they show approximate guild count
also yikes admin perms
:^)

they'll ignore this part, they always do
until the bot token gets leaked and 30+ servers get nuked (leading to account ban)
that or the classic "why is it taking so long to reach X servers?"
use topgg lib https://docs.top.gg/libraries/python/
Only when it’s more than 1k iirc
Under 1k is always the exact
how can i solve this error
when showing an error you also need to show the code
one has no meaning without the other
# This example uses topggpy's webhook system.
bot.topgg_webhook = topgg.WebhookManager(bot).dbl_webhook("/dblwebhook", "password")
# The port must be a number between 1024 and 49151.
bot.topgg_webhook.run(5000) # this method can be awaited as well
@bot.event
async def on_dbl_vote(data):
print(data)```
you literally copied the example code
do I need to replace somthing?
yes you do, and you shouldn't simply copy example code mindlessly
ask #topgg-api for further help, apparently the issue is that bot.topgg_webhook.run(5000) cannot be where it currently is
wat
you cant fix something that's on discord's side
you cannot control what discord shows on that page, and what they show there is not necessarily exact, they use approximate counts in that page, not exact counts
what things that I need to replace?
🥄
the page you copied the code from explains everything
The error seems to explain what needs to happen too
Hey 👋, does anyone have already setup an Authentication with Symfony and Ldap ? (Symfony 5.4)
anyone has got this error? I am using vite..
idk if i need to add something to vite.config
What version of nodejs are you using? node --version if you’re not sure
My guy be using node 8
I’m thinking it’s probably pretty old
That's invalid JavaScript code, I'm suspecting you're using a bugged version of React-Native
Hello, currently I am helping run and improve a discord that does weekly clips. Their current vote/rating system is not automated. I plan on automating this with a bot. Before doing a re-structure and switching to a weekend poll for voting. I wanted to see if there was a bot that could keep track of weekly ratings on clips and just give us a list of who voted on each clip. This is needed as one of the rules is, if you submit a clip you must rate every other clip that has been submitted for the entire week. The rating system is also done by using reactions 1️⃣ - 
It would also be useful to be able to DQ people that don't vote on all clips and then just automatically post the winner at the end of the week with runner-ups and all. Just not sure if there is a bot out there that specifically does this.
I don't think there's a bot that does that at all, that's a very specific use case
Probably not. This sounds very much like a server-specific feature
is there a bot that does any of that at all? even portions of that?
No as far as I'm aware
But should be easy to implement, you can ask for help if you need any about implementing it here
oh how would I go about that? Ive never made a bot or anything like that before
I want a code when someone vote the bot the bot send msg to a channel v14 js
True, it doesn't sound too complicated, especially since it's just reactions and maybe some fun with the database
Are you decently familiar with any programming languages?
Unfortunately no 😦
If you only need it for message on channel and nothing else then you can use one unofficial site which is very cool at least in my opinion
Then here's what you can do:
- Choose a beginner friendly programming language such as JavaScript or Python, and learn it to a decent point, there are tons of guides online (many of them are free), and once you've done that you can get going
- Choose a Discord API library for the programming language you've learned, such as discord.js for JavaScript, or discord.py for Python
- Look up how to create a Discord bot application through the Discord Developer Portal and set it up with the Discord API library you chose (the libraries themselves have a comprehensive guide so I would recommend reading through those)
And now the part where you implement that:
- Setup a database for your bot, so that you can save the users, votes, and clips, that corresponds to each of them respectively
- Implement a command that the users can use to opt-in to the voting game or whatever, and also one to opt-out before the game (or whatever) begins
- Once it starts, you can check the contents of each message sent and get the clip, and react to it with the reactions you mentioned (1 through 10)
- Collect the reactions and the users who reacted, disqualify those who didn't react in time
- Determine the winner by the highest vote count attached to a clip by looking through your database
And that's pretty much it
If that sounds complicated then that's fine, because these terms and methods are new to you, most likely
If you don't want to do it yourself you can hire developers to do it for you via platforms like Fiverr or similar
this isnt chatgpt bro
Wow this is alot here. Thank you so much! ill see if I can handle this if not then off to fiverr
You're welcome, good luck on your development journey
no they're saying that no one here is going to spoon feed you that
your asking a prompt like this chatgpt
My bot is gpt
ok ask your bot
XD
hey
does anyone know why my recording sounds like there's a nuclear war going on?
function createListeningStream(receiver, userId, user) {
const opusStream = receiver.subscribe(userId, {
end: {
behavior: EndBehaviorType.AfterSilence,
duration: 100,
},
});
const oggStream = new prism.opus.OggLogicalBitstream({
opusHead: new prism.opus.OpusHead({
channelCount: 2,
sampleRate: 48000,
}),
pageSizeControl: {
maxPackets: 10,
},
});
const filename = `./recordings/OfficerEventMeeting.pcm`;
const out = createWriteStream(filename, { flags: 'a' });
console.log(`👂 Started recording ${filename}`);
pipeline(opusStream, oggStream, out, (err) => {
if (err) {
console.warn(`❌ Error recording file ${filename} - ${err.message}`);
} else {
console.log(`✅ Recorded ${filename}`);
}
});
connection = await joinVoiceChannel({
channelId: voiceChannel.id,
guildId: voiceChannel.guild.id,
selfDeaf: false,
selfMute: true,
adapterCreator: voiceChannel.guild.voiceAdapterCreator,
});
/* Add voice state to collection */
client.voiceManager.set(interaction.guild.id, connection);
await entersState(connection, VoiceConnectionStatus.Ready, 20e3);
const receiver = connection.receiver;
/* When user speaks in vc*/
receiver.speaking.on('start', (userId) => {
createListeningStream(receiver, userId, client.users.cache.get(userId));
});
I put these 2 functions toghether into 1 code block, they initially belong to different buttons.
I am trying to record a WHOLE voice channel instead of just 1 user
likely because you are writing multiple steams into the same file
which basically destroys the file
Well yeah thats the whole point as i am trying to record the whole file
channel*
so far i've only encountered how i can record 1 user ids voice but that's not really what i want
you need to merge the streams through an audio mixer/encoder, before writing to a file
do you by any chance already know a package that i can use for that?
most people use ffmpeg for pretty much everything, including that
ah i see
i will try to find out how i can merge the pcms together into 1 using ffmpeg
thanks!
i could use this i guess
tho it takes a mp3 and not pcm so not sure how it will work
hey, I don't know if this is the right channel, but can somebody tell me how to put an image in my bot description by having the imgur link?
You can just use an <img> tag with the src attribute set the Imgur link
Remember that you have to link to the image directly, not to the Imgur page, you can do that by adding the i. subdomain to your Imgur page link, and adding an extension, such as https://i.imgur.com/<image page ID>.png
Hey, I have discord.js v14, instead of doing Util.parseEmoji ig I need to do this??
const { parseEmoji } = require('discord.js');
let e = parseEmoji(emoji);```
Depends on the autoposter of the Top.gg API library you're talking about
ello
Hey
Yes
Ok dude
Lmao
so that's why bot devs have a lot of monitors
I haven't developed a single bot for like 3 years
Currently in the process of making my bot not monolithic and well, it can be split up into a ton of processes. Super easy to scale now theoretically. I'm sure there will be plenty of bugs when I try to do it in the real world, but this is really good.
The fact that the dashboard still works 100% is incredible
damn. Songs take me back to when this place still invited devs' bots and I with some other people would be jamming and showing off each other's bots 💪
lol Like minecraft 😄
memories comes back
My dashboard is little too futuristic

Does topgg disclose users ip address to bots??
No
topgg doesn't even know the ips
why wouldn't it
if you vote for a bot, you visit the site and therefore top.gg does know your IP address
we don't share the IP to bot devs, but if they have a iframe in their bot description, they could still get your IP that way (because your browser will load their site)
ah wait, I read it as "does topgg disclose bot ips"
does anyone know why this doesnt make the text blue on screens less than 500px? (tailwind)
max-[500px]:text-blue-500
Its works different
so
if you need text blue on page below 500 px you need to setup custom config or i 640 is ok you can use like:
class="text-blue-500 sm:text-green-500 lg:text"
Read little about "Mobile First" strategy
Heyo - never have had a issue with this until midnight last night when my bot started getting a little weird. My command handler is initalizing before the bot has connected the WS causing things to not correctly run when I call certain API commands on discord.js any fix around this if I am using a extended class of the base client inside a constructor?
Probably going to want an async init method that you await before calling .login
setting up a nextjs project sucks
i gotta use nginx and pm2
and the domain configuration
thats normal website setup
except for pm2, which isn't really necessary for a site
cough Apache lives forever cough
hi!
how can i check if a user is part of a guild or not?
{"name":"DiscordAPIError","stack":"DiscordAPIError: Unknown Member\n at RequestHandler.execute
getting this cuz this checks if a user has a specific role in a specific server
You would either need the guild member's intent to get events you can use to cache the state
or GET /guilds/:guild_id/members/:member_id
If it returns a 404 then it means that either your client isnt in the guild or the member isn't in the guild
sounds great gonna try it! thanks alot!
although doing this often goes towards your CloudFlare ban countdown if you exceed so many 400 status codes in a given time
ah so any other suggestions? cuz basically i have a dashboard
users with a specific role can access this dashboard only and i have this function
const checker = (
await client.guilds.cache.get("958809457645723678").members.fetch(id)
).roles.cache.has("987034716140081242");
return checker;
}```
this returns an error if the user isnt in the server though
maybe instead of fetch i could us has
Use the .? operator to return early if there’s a null
They don’t do the same thing
tried doing it like that, didnt work
async function check(id) {
const checker = (
await client.guilds.cache.get("958809457645723678").members.fetch(id)
)?.roles.cache.has("987034716140081242");
return checker;
}
what happens when you run it? it should work, the code is correct
same error i had above
can you show the error?
wait tryin smth
ah i think i know why
members.fetch does not return undefined like members.cache.get when it doesnt find a user
it throws an error
so you have to do it like this ```js
const checker = (
await client.guilds.cache.get("958809457645723678").members.fetch(id).catch(() => null)
)?.roles.cache.has("987034716140081242");
Really? Seems like kind of a bad design choice...
Glad that detritus is getting maintained again soon
but imo its cleaner like this ```js
async function check(id) {
const member = await client.guilds.cache.get("958809457645723678").members.fetch(id).catch(() => null);
return member?.roles.cache.has("987034716140081242");
}
damm long time, haven't heard anything about that lib
last time i tried detritus it was slower than djs
i tested the time it took for the data to go from websocket to being emitted by the library's raw event
🐐 gonna try it out
like how long does it takes, to send a message?
no, like most libraries use ws for the websocket connection
or how long it takes, to log the bot in
between the packet being received by ws and the library emitting the event, the library does a lot of stuff
like creating the structures and classes
mhmm, still don't get it
a very basic example of what the libraries do would be like this ```js
ws.on("message", data => {
const object = JSON.parse(data);
if(object.t === "MESSAGE_CREATE") {
const message = new Message(object.d);
client.emit("messageCreate", message)
}
})
i basically measured the time it takes for that to happen
Ohh
unpacking/parsing the data and building the structures
the language itself wont make much difference, its more about how efficient the library is
but yes, a c++ library will likely be faster
like D++
rust and c++ are roughly equal
Golang should be faster than js/py but slower than c++/rust
afaik golang has some interpreter layer
yea
its not pure machine code
and executables in general are larger in go
I think C++ convert to assembly, idk
assembly is a way to read machine code
you can ask the compiler if you want to
yes
I though machine code is 0 and 1
assembly is just more readable
so can rust
i think i've fixed it
just added this to my vite.config
import java.util.Scanner;
public class students {
static Scanner in = new Scanner(System.in);
static int group_size;
static int[] id_numbers;
static String[] names;
public void allocate() {
System.out.println("Please input the group size: ");
group_size = in.nextInt();
id_numbers = new int[group_size];
names = new String[group_size];
}
public void Push_new_users() {
for(int i = 0; i < id_numbers.length; i++) {
System.out.println("\nPlease input one name, id combo: ");
String non_seperate_name_and_id = in.nextLine();
String seperate_name_and_id[] = non_seperate_name_and_id.split(",");
String name = seperate_name_and_id[0];
String id = seperate_name_and_id[1];
id_numbers[i] = Integer.parseInt(id);
names[i] = name;
System.out.println("\nSuccessfully added student with name: " + seperate_name_and_id + " and student id: "
+ id);
}
}
}```hey guys, does anyone know why when i run this i get the error: Index 1 out of bounds for length 1
I did some research and found out that when i remove the .split() and in.nextline() it works perfect.
Must i clear the in.console after each iteration?
Holy please use smaller variable names
I mean, too small is bad, too long alas
Yea
What line causes the index error
String id = ... I suppose, but am on mobile so I can't understand a thing
Also u need to show what ur inputting
And don't use nextInt() when dealing with free console input, it can and will break
Instead get it as String and check if it's a number before using it
ah i think that i solved it
Yeah that was indeed the problem
what my scanner was doing, was actually taking the previous input and using that. However, i then declared a new scanner inside the class and it worked
I'd suggest initializing the variables on their declarations btw
and removing static from them
oh, and adding private final
i know final, not private
i just started the java course
so maybe they didn't teach us that yet
java likes when u specify scopes
private means the variable won't be accessed from outside that class directly
yeah i have encountered that already wahhaha
ahhh i see
So public can be accessed anywhere, private only within the classes they are used in, static means that a method can be called without specifying an object, and public the opposite (so you need an object), eventually public static means that it can be used both ways?
static stays after object reinitialization
static means a variable/method is class-bound
owh yeah my bad.
yeah class-bound
so u can do TheClass.something()
if u change a static value, it'll change globally
I fr dont wanna touch java anymore lmao
owh really? That's interesting
whereas a public class doesn't?
oowh damn ofc i keep mixing them together
access modifiers are private, protected, package (or the abscence of any mod) and public
from least visible to more visible
i see, thank you! I will definitely learn these things 🙂
also use camelCase for variables
so far ngl, i like this language more than c++ and js
and PascalCase for classes
my eye started to twitch as soon as I saw snake_case being used
am back
scope modifiers are static and nothing at all
just remember that static stuff will reflect changes on every single place
and that static constants wont be garbage collected ever
could you use static to actually create a call-by-reference function?
no
static is always class-bound
if u want reference-bound stuff simply dont add static
we also use camelCase and PascalCase in c++
huh
i've learned to always use _
I mean you don't have to follow those style guidelines
public class Example {
public static void doStuff() {
...
}
public void doOtherStuff() {
...
}
}
Example.doStuff() works
Example.doOtherStuff() will error
new Example().doStuff() works (with a warning)
new Example().doOtherStuff() works
got it?
think about it as if static members live on the class
yeah i do now!
always remember to be explicit regarding your scopes and accesses
the thing that got me confused a little bit was this part:
void doStuff() {
...
}
is short, yes, but java doesn't like that
But i understand it now
imagine we have a static int test = 0; and i later on in a function change its value to 1, it will globally be changed right?
i see, finally i can get to work confidently. Thanks for all the help!
the other thing to know is that you should always initialize variables on their declarations when possible
and if they're a collection (or array), declare as final
yeah in this case i wanted to dynamically create an array based on input
and solved it by just []; it.
wouldn't final give an issue?
yes if you're doing like u were
because it's like const right? We want to constantly change array so that it stays dynamic.
owh yeah i see
because allocate isn't the class' constructor
public class Students {
private final int groupSize;
private final int[] ids;
private final String[] names;
public Students() {
System.out.println("Please input the group size: ");
groupSize = in.nextInt();
ids = new int[group_size];
names = new String[group_size];
}
}
``` would work just fine
they're still beginning, teacher will probably introduce collections later on
or anything that implements the List interface
I have no clue whay arraylists are
they're equivalent to js arrays
they can resize dynamically
whereas an array can't
Owhh huh how? Because we are creating a new instance of the int and string arrays they are not erroring out?
but don't worry abt this for now
a constructor allows final properties to be set
since a constructor is called when an instance is created
Oowh i see, yeah this course is OOP and we mainly must just figure things out on our own, but i will get to it later on i hope.
it's equivalent to declaring the values directly on the declaration
the static variant of a constructor is ```java
static {
...
}
but u probably wont use it ever
there are many more keywords and modifiers, but time will teach u the remaining
ahh i see, thank you very much!
Really helped me to understand the basics
because these classes, public, static etc really got thrown at me like a truck
java likes having everything declared explicitly
people hate this part because it's verbose, but I like it for its charm
also it helps a ton debugging
yeah, but ffs, sometimes I don't wanna handle an exception
I'm just grateful no other professors in my uni use java
not all exceptions need to be handled
only those that can potentially crash your runtime
yeah but dealing with those when I don't want to is a pain
because now I have to add a try catch block and move everything up, because I don't want to move everything inside the try catch block
one of the reasons why I don't use java
u can just defer to the caller
the other one is well, JVM
yeah but you'll end up marking main with all the exceptions you didn't handle if you do that
I just don't want to use java anymore
understandable
To be fair I’m more concerned about structure and maintainability, I love detritus for the structure not the speed
Heyooo how do we show how many servers our bot is in on top gg?
Doesn't seem to be want to populate...
I love Serenity for the speed!!! 🚀 🔥 💪 😎
I love lean 💜
In all seriousness, the libs I maintain are fast and have great introduction to the raw API
libless >>>
I would fucking hate having to maintain a codebase like that. If you take a look at CloudStorm, I consider that like bare minimum to a comprehensive gateway connection basis
Fuck it, make yourself the HTTP server and respond to requests with voice recognition
yeah, i made my own ws just for discord :^)
Is that something that has been finished or is this on your todo list?

fuck it, make your own os and make the bot run natively in the bios
call the unix http method
calling the unix http method is too lazy, write the assembly instructions yourself

It's done already
https://github.com/timotejroiko/tiny-discord/blob/master/src/WebsocketShard.js
Tim gave me permission to use it and I slimmed it down a lot and converted to typescript.
https://github.com/DasWolke/CloudStorm/blob/master/src/structures/BetterWs.ts
It's fucking fast
Shameless plug 
It's related and picking apart of the actual ws code took time
turn your bot into a bootloader and make your computer be the bot
I was studying the "CORS", and I came across a doubt. I wanted to know, when I use an API with "CORS" configured for specific domains, and I use this API on a machine, without a site/domain, if there is any restriction or something like that
or use "CORS" as an IP access control tool, for example
app.use(cors({
origin: ["myip", "youip"]
}))
could you elaborate what you mean with youip
cors allows you to tell the browser what requests it should be able to process. So if your browser is trying to reach out to notexample.com while being on example.com, the cors headers are able to restrict that
ok
so could i create a login system and just pass the headers that would work fine?
this in a node environment
you want to make an api only usable in a specific website? or also allow access to authorized users?
I'm creating an API for a Bot client's systems
type: add coins, remove coins, etc...
but I am creating other systems, a kind of partnership, which will be on the bot website, they will be able to add coins as a reward, and so on
use an api key system
the bot has an api key to access the api
and the website has a server-side script that has the api key
I thought of this method. but in that case I won't need the cors?
no you dont need cors, because the api is never accessed from the browser directly, only from a server-side script
like a php file or a express.js route
Which OS is better for Linux VPS to host discord bots?
CentOS
Debian
Ubuntu
Mikrotik
Ubuntu is the king compared to all the others, it just has everything you need, and most software you would need is compatible with it
how come i completly clear the cache from a website and even after hosting it into another server it still shows the vercel one
but when i open it on a browser i never used it shows the current one
You're probably not clearing the cache properly
i am definetly clearin git properly
That has nothing to do with Git
Or did you mean "clearing it"?
What web browser are you clearing the cache with and using what steps to do so?
both clearing it manually
and
this
could it be the dns
I said what web browser
but still why does it work on some browsers and in some it don't
edge
Go to the website you mentioned, press the F12 key and click on the "Network" option at the top, after that press CTRL + R to clear all the cookies and the cache for that specific website
same thing
anyone aware of any postgres function that accumulates arrays?
for example, transform ```
1 | {1, 2}
2 | {3}
3 | {}
4 | {4, 5, 6}
5 | {7, 8, 9, 10}
into ```
1 | {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
array_agg isn't an option because it'll create a 2d array (and will error since one of the arrays is empty)
For anyone using open AI for a Discord bot for ChatGPT 3API
TO AVOID SLURS PLEASE USE THIS LINE OF CODE
const filter = gptResponse.data.choices[0].text;
And what does that change?
they probably spent many hours trying to fix something and wanted to share the solution
too bad it means nothing without context
nvm, made an aggregate myself
wait
are you literally calling to chatgpt in your source code and getting the response?
no way
I just made the src 💀
api call
How can I wait a command inside a for loop?
I write the data to that file with fs, but it deletes that file before it can process the exec line, so the exec line cannot be used
How can I wait for the exec line?
I tried to create a new promise but it didn't work
await new Promise(res => exec(command, res));
or if you want to look for errors
const result = await new Promise((res, rej) => exec(command, (err, stdout) => err ? rej(err) : res(stdout)));
there is no need, there will be no error 😃
That's what you'd like to think :)
thanks i'm trying now
also, fs has a promise api, otherwise you're just pausing the thread with sync methods
thanks did work
Can anyone point me to where I can find information on Discord's premium bot subscriptions? Last i heard it was being tested with bigger bots, but I want to know when it'll come out for all bots.
don't think they gave an estimate for official release
how can i add attachment in for loop
I want to create as many attachments as file paths inside the array
make an array of attachments
i did
u can add up to 10 attachments per message
then just send it
thanks
I was going to apply for bot commentators, where is it done?
hey guys
public void Push_new_users() {
for(int i = 0; i < id_numbers.length; i++) {
Scanner in = new Scanner(System.in);
System.out.println("\nPlease input one name, id combo: ");
String non_seperate_name_and_id = in.nextLine();
String seperate_name_and_id[] = non_seperate_name_and_id.split(",");
String name = seperate_name_and_id[0];
String id = seperate_name_and_id[1].replace(" ", "");
id_numbers[i] = id;
names[i] = name;
in.close();
}
```how come that this returns me: "No line found"?
It's to do with the scanner but why
still using giant variable names I see
actually, disregarding all java naming and formatting convention
I am changing the names once i have resolved all big issues
as there's no need to fix variable names when the whole function isn't even working
fixing the names usually helps finding errors
Also doing String name[] is archaic C syntax and should be avoided whenever possible (pretty sure the compiler warns you of it too)
Yeah split told me that i must do it
otherwise it errors
No
String[]
That's the proper syntax for that
It's only supporting the other version because C convention never dies™️
oowh damn
I'd recommend you only open 1 scanner for the entire method instead of destroying it and reopening after each loop
public void pushNewUsers() {
try (Scanner in = new Scanner(System.in)) {
for(int i = 0; i < ids.length; i++) {
System.out.println("Please input one 'name, id' combo: ");
String input = in.nextLine().split(",");
names[i] = input[0].trim();
ids[i] = input[1].trim();
}
}
}
see, much better to read
yeah i see, i haven't had try yet so i don't really know what it does/means
could've split by , + too to remove the need of trim
that's try-with-resources
I see i will change it rn
Scanner implements the interface AutoCloseable, so u can do that
As soon as i just declare 1 scanner on top of the file and use that scanner in the methods it returns me this
that's because ur not checking for any lengths
java is not js, if u try to access an invalid index it'll error
hmm i see, but its coming from the nextline pretty sure
yes, because of what I said
ur supposing that it'll have 2 indexes
but java is not js, invalid indexes will error
see the code I sent
it doesn't have size check, but it should be much easier to fix than the original thing
Owhh i see what i did wrong
I told u 2 times 😭
public void Push_new_users() {
for(int i = 0; i < id_numbers.length; i++) {
System.out.println("Please input one name, id combo: \n");
String non_seperate_name_and_id = in.nextLine();
String[] seperate_name_and_id = non_seperate_name_and_id.split(",");
String name = seperate_name_and_id[0];
String id = seperate_name_and_id[1].replace(" ", "");
id_numbers[i] = id;
names[i] = name;
}
}```but with this code, we are just constantly asking for a name and id combo, and it will then be splitting the string into 2 parts. That's always going to be only 2 indexes for all i's.
so how is it even occuring i am lost wtf 😭
I will, i just try to understand this error first
major buffer issue
before i can input this it already errors
on top of the file under the class definition
also, what ide are u using?
Also ideally you'd have a static Scanner here instead of opening and closing scanners nonstop
import java.util.Scanner;
public class students {
boolean ErrorFound = false;
Scanner in = new Scanner(System.in);```
the lack of access modifiers and casing hurts me inside
I just started java 2 days ago, my bad 😦
I just want to know what abomination of ide they're using that it's allowing that
please tell me it's not eclipse
intellij IDEA is where it's at
eclipse is shit, like, if I called a pile of shit "Eclipse" it'd sue me for moral injury
there's virtually no reason not to use idea
I mean, unless ur coding on a potato
I am going to use intllij
yes please
so the problem with the code was Eclipse?
also don't mind that it'll make your whole code yellow
since it'll "kindly" ask you to refactor your names/formatting
no, it's something else
but by not using a bad ide it'll make it much easier to code
Okay i see
also, use a debugger on idea
it'll allow u to step line by line to see what value each thing is returning
while idea is installing
do you have any idea what might be the problem
with that line
System.out.println(in.nextLine())
lemme do that
look at what ur dealing with
also remember that nextLine will advance the scanner
so for group size 1 it worked
i ma try it with 2 now tho
So the first part worked but then it was stuck.
And when i typed enter (as the confirmation text didn't popup while it exceeded my group size), it errored
u need to learn how to debug
System.out.println(Arrays.toString(seperate_name_and_id))
aight uno secundo
this is prob because it errors out while i didn't even input anything just yet
the in.nextline() is bugging
because when i enter the 2
see, the array is empty
and i do another ssytem.out it goes to the next line
i think it's on how the scanner is defined
also yes, sout will move to the next line cuz it'll print to the console
So instead of using a static scanner and using the in.nextline() everywhere (as that's probably causing the issue)
how can i fix this then?
^
has the advantage of not keeping a scanner open needlessly
I don't really want to use try as i honestly don't fucking now what it is, and not even sure whether we can use it
then just remove it and close the scanner at the end of the function
You could also pass the scanner by reference, it'd be a bit odd but would work lol
okay will do
and report back with what happens
public void Push_new_users() {
for(int i = 0; i < id_numbers.length; i++) {
System.out.println("Please input one 'name, id' combo: ");
String[] input = in.nextLine().split(",");
names[i] = input[0].trim();
id_numbers[i] = input[1].trim();
}
in.close();
}```
still same issue
wtf
doesn't scanner eventually close itself
when the program ends yeah
but that's more or less the OS just killing the process
other than that I'm pretty sure it doesn't close itself
Made my own encoder and decoder for custom IDs for components and it works fantastically.
These examples are over the limit, but it's a lot of info being encoded.
plus mine can encode bigints
json.stringify also doesn't include keys which values are undefined while mine does. If I wanted mine to be json with extra steps and save more characters, I could also not encode void
Streams are kept open indefinitely
But they're still bound to the process, so it dies with it
Nonetheless, open streams are common causes for memory leak
u still need to create a stream
when I said "simply delete the try" I meant try itself
not what's inside it
scanner implements closable / autoclosable which is eventually closed by the jvm
which returns me data[1], data[2], data[3]. How can i then get only data without data[1].
like .trim?
they only close if you call .close()
or use it within a try-with-resources
scanner is even more dangerous since it'll receive constant input so the gc can't touch it
for regular streams it might get garbage collected once the influx of data ends, but gc works in mysterious ways
so u might have something hogging memory for a long time before gc notices it
oh I think I get it now
I was thinking of classes like bytearray(input/output)stream where closing is unnecessary
ur probably closing them already
u probably use it like this right? ```java
try (var baos = new ByteArrayOutputStream()) {
...
}
it's very likely since intellij will put a big yellow fix if u don't
that's a try-with-resources, it's equivalent to ```java
var baos = new ByteArrayOutputStream()
try {
...
} finally {
baos.close();
}
I use a method akin to that
tf are enhanced switches
switch (value) {
case 1 -> {
...
}
case 2 -> {
...
}
default -> {
...
}
}
which allows ```java
String str = switch (value) {
case 1 -> "Hello";
case 2 -> "World!";
default -> "Goodbye!";
}
can we use += for string concat in java?
oh so none of that break nonsense
yes, note that it allows u to dump the branch value directly onto a variable
and it's getting even better in the next release
String str = case (someAnimal) {
case Person p -> p.getName();
case Dog d -> d.getOwner().getName();
case Cat c -> c.getHooman().getName();
default -> "Unknown";
}
more special keyword types should just be expressions tbh
wdym?
like with the case of switch now, where you can assign it to a variable
makes lots of things much easier to write
ah yes, they call it "pattern matching"
I wish it reached groovy-levels of switch enhancing one day
no it's not pattern matching
Hey imagine that i have an object Students
and another array that contains the students
would i access each student individually like array[i]
assuming you know the index sure
I have a ton of questions of design choices.
1: numStud seems pointless if you can get the length of the array.
- displayStudents wouldn't need the Group name param if you can access the all Array in the function. You'd do all[i]
oowh
what did they ask you to do with it
I see you're applying a lot of c/c++ concepts there
java isn't as raw as them
also, u don't need \n line terminator
System.out.println() already includes it
I need to display my student names
for (Student s : students) {
System.out.println(s);
}
then just override toString() to make a custom line format
public static void welcome() {
Scanner scan = new Scanner(System.in);
System.out.println("Welcome, how big do you want the group to be?");
int size = scan.nextInt();
Group group = new Group(size);
for(int i = 0; i < size; i++){
System.out.println("Please enter a student: ");
String nonSeperated = scan.nextLine();
String[] seperatedArray = nonSeperated.split(" ");
int studentNumber = Integer.parseInt(seperatedArray[0]);
String studentFirstName = seperatedArray[1];
String studentLastName = seperatedArray[2];
Student newStudent = new Student(studentFirstName, studentLastName, studentNumber);
group.addStudent(newStudent, i);
}
group.displayStudents();
}``` This is my main
i already used all[i] but i can't display the firstname attribute of it
override toString, print the object itself to the console
@Override
public String toString() {
return "banana";
}
will print ```
The group now contains:
banana
banana
banana
banana
if u have 4 students
sigh
but firstnames doesn't seem to be recognized
yes because u made it private
doesn't matter who did it
if it's private u cant access it from outside its class
what should i do then?
i prob need to pass a Group name to the method as a parameter
show the class
public class Group {
private Student[] all;
private int numStud;
public Group(int amount) {
all = new Student[amount];
numStud = 0;
}
public void addStudent (Student name, int place) {
all[place] = name;
}
public void displayStudents(){
Student cursor;
String allStudents = "The group now contains: ";
for(int i = 0; i < all.length; i++){
}
}
```this is the group
public static void main(String[] args) {
welcome();
}
public static void welcome() {
Scanner scan = new Scanner(System.in);
System.out.println("Welcome, how big do you want the group to be?");
int size = scan.nextInt();
Group group = new Group(size);
for(int i = 0; i < size; i++){
System.out.println("Please enter a student: ");
String nonSeperated = scan.nextLine();
String[] seperatedArray = nonSeperated.split(" ");
int studentNumber = Integer.parseInt(seperatedArray[0]);
String studentFirstName = seperatedArray[1];
String studentLastName = seperatedArray[2];
Student newStudent = new Student(studentFirstName, studentLastName, studentNumber);
group.addStudent(newStudent, i);
}
group.displayStudents();
}```the main
public class Student {
private String firstName;
private String lastName;
private int stNumber;
public Student (String fName, String lName, int sNum) {
this.firstName = fName;
this.lastName = lName;
this.stNumber = sNum;
}
}
```the student
that's all?
yeah
well, then u cant
whaaat
because ur teacher locked the class from the world
what should i do then
he did
u don't, unless u go into reflection black magic u cant access those properties
how tf do i show all the groups then
ask ur teacher if they forgot to add getters for the student class
that's because name isn't an array
name is a group, which is an array of students right?
ur making it worse
please for the sake of gaben's dog, type . and press ctrl + space
what the fuck
public static void welcome() {
Scanner scan = new Scanner(System.in);
System.out.println("Welcome, how big do you want the group to be?");
int size = scan.nextInt();
Group group = new Group(size);
for(int i = 0; i < size; i++){
System.out.println("Please enter a student: ");
String nonSeperated = scan.nextLine();
String[] seperatedArray = nonSeperated.split(" ");
int studentNumber = Integer.parseInt(seperatedArray[0]);
String studentFirstName = seperatedArray[1];
String studentLastName = seperatedArray[2];
Student newStudent = new Student(studentFirstName, studentLastName, studentNumber);
group.addStudent(newStudent, i);
}
}``` I could prob drop the actual for loop here to eventually show all the users
however, it doesn't look great and i want to use a method
yes, welcome to typed languages
ctrl + space is all u need
the stuff u get in that list is everything u can access in that class
anything that isn't there (you guessed it) cannot be accessed
see there's an addStudent method there?
that's how u add students to it
i know
...if u know then use it
for printing there's nothing u can do
how can I make it so that if bot.servers isn't a value, then it returns 0?
without a toString override or getters u have no way of accessing the values
My dumbass forgot bot.servers isn't a boolean and used ||
lmk if u know a fix
put || 0 inside the script block
Not a script
I'm just doing bots[i].servers = japidata.data.bot.approximate_guild_count;
And japidata coming from the npm module
I have used addstudent
lok
i pushed a new student in the group
how the fuck is that code erroring btw
as soon as i am entering a number it just poof fucks me over
just look at what the IDE tells u
"" is not a number
use the debugger
click on the line numbers on the left side and run it by clicking on the bug
I see, but this is probably the scanner issue that we talked about before
imagine i am fucking closing the scanner again
can i reopen it or sumthing wtff
public static void welcome() {
String allUsers = "Group now contains: \n";
Scanner scan = new Scanner(System.in);
System.out.println("Welcome, how big do you want the group to be?");
int size = scan.nextInt();
System.out.println(size);
Group group = new Group(size);
scan.close();
for(int i = 0; i < size; i++) {
System.out.println("Please enter a student: ");
String nonSeperated = scan.nextLine();
String[] seperatedArray = nonSeperated.split(" ");
int studentNumber = Integer.parseInt(seperatedArray[0]);
String studentFirstName = seperatedArray[1];
String studentLastName = seperatedArray[2];
Student newStudent = new Student(studentFirstName, studentLastName, studentNumber);
group.addStudent(newStudent, i);
allUsers += studentFirstName + " " + studentLastName + "s"+ studentNumber + "\n";
scan.close();
}```
use the debugger
i restarted my bot today and suddenly its having a problem with .setName and sending to a channel defined from client.channels.cache.get
this issue is not across the board. I have multiple commands/functions that utilize client.channels.cache.get and only two are having this issues
i have verified that the channel ids are correct
these logs have been running for about a year now with no issues. Im using djs 13.6 Has something changed?
Your issue is cache.get
Nothing is ever guaranteed to be there at any given moment
Channels will only be there after some channel-related event happens
Your issue is probably related to Java’s Scanner buffer. After you use scan.nextInt() and then try to use scan.nextLine(), the newline character after nextInt is called is not cleared, and so all the nextLine returns is ""
the channels are used pretty often so i would imagine that would stay in the cache but ill just use .fetch instead. thanks
anyone know what causes node-schedule to duplicate my cronjob?
the below is exactly what i'm experiencing, it runs fine at first, but after a day or two the cronjob starts running twice.
@wheat mesa bro fuck nginx man
this shit pissing me off
2023/02/01 22:42:35 [emerg] 90914#90914: cannot load certificate "/etc/letsencrypt/live/mail.aarondye.dev/fullchain.pem": BIO_new_file() failed (SSL: error:0200100D:system library:fopen:Permission denied:fopen('/etc/letsencrypt/live/mail.aarondye.dev/fullchain.pem','r') error:2006D002:BIO routines:BIO_new_file:system lib)
How fix
If the code that creates a cron is run more than once, then it will run however many times it's run. An example would be for bots like client.on("ready"
The ready event can fire multiple times. If you want to ensure it's only run once, then replace on with once
it's not
@neon leaf you available to help with nginx stuff?
then it sounds like a lib issue you can't control other than waiting for a fix from dev or using a different library or making your own solution. It's simple to do math for how much time is remaining in a specific time frame like hour and then using setTimeout to run after the clock strikes the hour for example
yeah I’ll probably just find another library
Bro nginx keeps telling me port 80 is in use but thats what my website is being served on
is the in-process server running on 80
e.g. server.js spawns on 80 and nginx.conf wants to use 80
the process is on port 3xxx
nginx is looking at 80
server{
listen 80;
listen [::]:80;
server_name aarondye.dev;
root /home/misty/Portfolio/dist;
index index.html;
client_max_body_size 100m;
client_body_timeout 120s;
location / {
try_files $uri /index.html;
}
}
server {
listen 82 default_server;
listen [::]:82 default_server;
server_name mail.aarondye.dev autodiscover.* autoconfig.*;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name mail.aarondye.dev autodiscover.* autoconfig.*;
ssl_certificate /etc/letsencrypt/live/mail.aarondye.dev/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/mail.aarondye.dev/privkey.pem;
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:50m;
ssl_session_tickets off;
# See https://ssl-config.mozilla.org/#server=nginx for the latest ssl settings recommendations
# An example config is given below
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:81/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; # Needed since the 2022-04 Update for SOGo
client_body_buffer_size 512k;
client_max_body_size 0;
}
location / {
proxy_pass http://127.0.0.1:81/;
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;
client_max_body_size 0;
# The following Proxy Buffers has to be set if you want to use SOGo after the 2022-04 (April 2022) Update
# Otherwise a Login will fail like this: https://github.com/mailcow/mailcow-dockerized/issues/4537
proxy_buffer_size 128k;
proxy_buffers 64 512k;
proxy_busy_buffers_size 512k;
}
}
this is my current conf
I was adding in my mail server stuff and went to go restart nginx and not its saying port 80 is in use
Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
udp UNCONN 0 0 154.53.63.48:28015 0.0.0.0:*
udp UNCONN 0 0 154.53.63.48:28016 0.0.0.0:*
udp UNCONN 0 0 127.0.0.53%lo:53 0.0.0.0:*
tcp LISTEN 0 4096 0.0.0.0:995 0.0.0.0:*
tcp LISTEN 0 4096 127.0.0.1:7654 0.0.0.0:*
tcp LISTEN 0 4096 127.0.0.1:18983 0.0.0.0:*
tcp LISTEN 0 80 127.0.0.1:3306 0.0.0.0:*
tcp LISTEN 0 4096 0.0.0.0:587 0.0.0.0:*
tcp LISTEN 0 511 127.0.0.1:6379 0.0.0.0:*
tcp LISTEN 0 4096 0.0.0.0:110 0.0.0.0:*
tcp LISTEN 0 4096 0.0.0.0:143 0.0.0.0:*
tcp LISTEN 0 511 0.0.0.0:80 0.0.0.0:*
tcp LISTEN 0 4096 127.0.0.1:81 0.0.0.0:*
tcp LISTEN 0 4096 0.0.0.0:465 0.0.0.0:*
tcp LISTEN 0 100 0.0.0.0:28017 0.0.0.0:*
tcp LISTEN 0 128 0.0.0.0:209 0.0.0.0:*
tcp LISTEN 0 100 0.0.0.0:28084 0.0.0.0:*
tcp LISTEN 0 4096 127.0.0.53%lo:53 0.0.0.0:*
tcp LISTEN 0 4096 127.0.0.1:19991 0.0.0.0:*
tcp LISTEN 0 244 127.0.0.1:5432 0.0.0.0:*
tcp LISTEN 0 4096 0.0.0.0:25 0.0.0.0:*
tcp LISTEN 0 4096 127.0.0.1:442 0.0.0.0:*
tcp LISTEN 0 4096 127.0.0.1:13306 0.0.0.0:*
tcp LISTEN 0 4096 0.0.0.0:4190 0.0.0.0:*
tcp LISTEN 0 4096 0.0.0.0:993 0.0.0.0:*
tcp LISTEN 0 4096 [::]:995 [::]:*
tcp LISTEN 0 4096 [::]:587 [::]:*
tcp LISTEN 0 511 [::1]:6379 [::]:*
tcp LISTEN 0 4096 [::]:110 [::]:*
tcp LISTEN 0 4096 [::]:143 [::]:*
tcp LISTEN 0 511 [::]:80 [::]:*
tcp LISTEN 0 4096 [::]:465 [::]:*
tcp LISTEN 0 128 [::]:209 [::]:*
tcp LISTEN 0 244 [::1]:5432 [::]:*
tcp LISTEN 0 4096 [::]:25 [::]:*
tcp LISTEN 0 4096 [::]:4190 [::]:*
tcp LISTEN 0 4096 [::]:993 [::]:*
Which I can see why its saying that, but if I am restarting it, shouldn't it just like yknow work since 80 is already nginx
Alright I fixed that issue but now mailcow won't use the mysql shit so I give up for the night
I got the active developer badge. Can you give me the bot developer role?
oh i understand
Tbf i didnt even fuck around with mailcow, just put it on a docker lol
In the code below, while depthWS WebSocket is stable, tickerWS WebSocket works on its own, sometimes it returns empty, sometimes it returns different symbol data.
const { excluded_err_bad_request } = require('../!data/Binance/datas/!excluded_err_bad_request/FuturesOrderBook.json');
module.exports = (data, wss) => {
for (const symbol of excluded_err_bad_request) {
try {
const tickerWS = new WebSocket("wss://fstream.binance.com/ws/" + symbol.toLowerCase() + "@ticker");
tickerWS.on("message", d => tickerWebsocketData = JSON.parse(d));
let tickerWebsocketData = {};
const depthWS = new WebSocket("wss://fstream.binance.com/ws/" + symbol.toLowerCase() + "@depth20@0ms");
depthWS.on("message", depthData => {
const depthJsonData = JSON.parse(depthData)
});
} catch (e) { console.error("Error!", e) }
}
}```
do you have any solution suggestions?
how are you using this code?
the way its arranged looks very wrong for most use cases
is topgg have api error to any one 504 gatway timeout
5xx means serverside issue
Yea well for some reason it’s not working >:c
did you change anython or is it still like this?
anyway, the database stuff could just be a mess up, try running ./helper-scripts/update.sh (or something like that) in mailcows folder
Still like this, but im not even home rn
I’ll have to wait
You helped a ton with this
But I notice I have to keep putting the port when I go to the mail server on the web
Why is this?
That might be hard as I’m doing it on my phone with terminus but let me try
try using this https://pastes.dev/gxyKw9YRo8 for mailcow
and this for nginx
Check if the ports are correctly set
Thats what fucked me over
yeah, I fixed that for him in the configs
My god you are a godsend
One last question tho
How can I make my emails not look like whatever@mail.aarondye.dev but rather just whatever@aarondye.dev I assume this is something I do in the ui under email config
yeah, just add aarondye.dev as a domain in the admin panel
it doesnt need to be mail.xxx
I dont think so
Alright let me try
For some reason the password I set for my mailbox isn’t working on sogo
Nvm
Forgot to use the extension @pulsar oliveye.dev
Oops
Sorry random person
poor aarond
Okay I promise last question, it emails but sends to spam, why does this happen?
that can have alot of reasons, most likely your server is too new or you forgot some dns records
well what do you have?
I have all the ones from the docs minus the advanced setup
these are mine
Those are the ones I have as well
then its just a bit of waiting, I guess.
what did you test with? gmail?
Minus the e google thing
I used proton as it’s the only thing I have access to rn
mine is on 3 lol
So I’m screwed?
not sure, Id just wait and see if it works, else you should ask your host for a non flagged ip
I have 2 ips actually
Let me see if the other one is flagged
My other one is on 1 
Should I follow any of this?
I dunno

hi 👋 (all good)
Well it no longer goes to spam 
It took me 24h just to get this to work 💀
Networking ain’t my thing
zamn
[error] 239#239: *688 connect() failed (111: Connection refused) while connecting to upstream, client: (client Ip), server: (mywebsiteurl), request: "GET / HTTP/1.1", upstream: "http://[::1]:3000/", host: "(serverip):443"
hey so i finished setting up my nextjs app on my vps. It works fine until it randomly stops working and it displays the image below, i check my nginx logs and it shows this error. Anyone of you knows what the cause could be?
Improved my data saving json string encoder and decoder more and now it all works regardless of what data is thrown at it except for functions, symbols or classes.
decided to use the null character � as the delimiter between items since practically nobody uses that character meaning I won't have to escape as much or anything
No regular expressions
was much easier to do it without regex tbh

