#development
1 messages Β· Page 246 of 1
can i ping a category?
arigato kuuhaku-kun
I feel the whole (x = y) operation is redundant, what do y'all think?
It's either way going to assign the value of y (as a result of x being null) to x.
wdym?
As in, why not x = x ?? y;?
well, their example is shitty
operator combination is always value = value operator newvalue
value = value & newvalue becomes value &= newvalue
I saw this article, but it also didn't make sense.
ah, that makes sense now
basically, if you have x = x ?? (x = func()) func will never be ran if x isn't null
whereas in x = x ?? func() it will
If x isn't null in x = x ?? func(), why would it execute func()?
The value of x is x, we don't need func() no more as x isn't null.
idk, that's what it's saying
& it doesn't make sense. π
I asked ChatGPT, it rephrased from one example to another. π
I never knew this assignment operator existed; I studied JS before it came out.
either way, JIT will make those optimizations pointless
the only optimization that is worth doing is using |0 to trunc a double, instead of casting to int or doing parseInt
Is there a way to load gifs on canvas faster?

I hate it taking 5 seconds to load a 300kb gif
This ultimately leads me to the question on the difference between those statements:
// Question -> Why is `x ||= console.log("y evaluated")` not equivalent to the first statement but the second statement?
var x = 0;
x = x || console.log("y evaluated");
x = x || (x = console.log("y evaluated"));
console.log(x)
the former is evaluated to false
the latter is null
when using a || b remember that js is coded with spaghetti and parmesan, if you use a boolean operator it will evaluate to a boolean if no valid value is returned
if ur intention is to assign if x is null then always use ??
otherwise do the full thing and if (x) x = console.log()
both evaluate to undefined? or you're talking about something else
hi misty :)
ah, in this case I confused then
all 3 are evaluated tho?
and in this case, neither is
y is it evaluated
sup
i think what they are trying to say here is just about emphasizing the short-circuiting effect
how are you?
its not that a ?? b is different than a ?? (b), is just that they use the () to emphasize that the contents of () are never reached if the operator short-circuits
Went from using
Facepunch.Sqlite (Rust's own sqlite dll that wraps sqlite3) -> Sqlite.Data.Sqlite (Official sqlite3 dll) -> Microsoft.Data.Sqlite -> EF6 -> EFCore -> LiteDB
hi
Finally stuck with LiteDB cause I said fuck it we using embeddable dbs
I honestly was just trying to get EF6 / EFCore to work because of the challenge
Realized its not worth it to try and force it to work in .net standard 2.1

When you can't even use migrations
slay! good job :)
proud of ya

Idk why Facepunch made their own
It blows
or im just not smart enough to understand their usage
facepunch as in the same gmod facepunch?
Yuh
Facepunch that made Gmod, Rust and some other random game
This is with their Facepunch.Sqlite dll
So im curious what they do internally
How does it work, and why is it needed if itβll both return the same result? π
If itβs just going to assign the value to x in the end, why does it do it again in the parenthesis, if you got what I mean.
...facepunch made rust?
ah, no, it was mozilla
wait lmao, u were talking about the other rust
it's not my fault if 3 things share the name rust 
but we were talkin in the context of games 
iron oxide
π
Rust the game, rust the language and rust the stuff that happens to metal when is wet
rust the movie
also do yall ever just
source code of many tv apps on the tvs memory
they fucking put the source code of the apps on the storage
ive also found a very interesting tv api while surfing through the code that can do stuff from installing apps to changing system config
which i might reimplement and use
funny versioning method
why bother with version numbers, just ship the code with the product
fr
i would love to rewrite my apps ui with SAF UI (internal ui framework used in system apps) but its also confidential
it looks so good tho
mfs out here getting paid 6 figures a year to do this
also some stuff are not available sadly
did i mention that the devs have a very broken english
tbh, it's not a bad idea if you can somehow prevent the files from being deleted
(samsung devs are korean)
also you can factory reset the tv by recompiling and reinstalling from the source
bro atleast make it inaccessible for the normal user
I think it was supposed to be 
one of the folders is inaccessible
its the firstscreen (home menu) but the compiled code is still there
well compiled as in js code
i believe its how they chose to explain the short-circuiting effect, in the same way how operator precedence is explained
i could prob make a better app store for this piece of shit os :teef:
tv app store are always shitty
for example, when you explain how a + b * c works, you show them a + (b * c)
so when you explain how a ??= b works, you show them a ?? (a = b)
you have to change your tv region just to view other region apps
there is no difference in execution nor result, its used simply to illustrate the concept
but if you have the api url and the required headers you can just change the countrycode in the url :trolley:
just install ubuntu on the tv and get a tv app
i really wish there was an install app function but for wgt file
https://www.youtube.com/watch?v=eAsmTGDwRRg hell nah they already thought of it
Ubuntu TV is an Ubuntu GUI designed to increase usability on a television. It requires Ubuntu 12.04 to install but is not well supported anymore.
Twitter: @_sudotech
Want to support the channel? Bookmark and use my Amazon Affiliate link: http://amzn.to/2lzHxNz
Gear I use:
Camera: Panasonic G7 - http://amzn.to/2jZJgKV
Microphone: Audio Technic...
you cant install other oses
let alone run your own binaries in the os
due to security measures
another thing i like about the confidential/private api is that i can debug apps that i cant normally
Hmm, but can't I explain a ??= b as a = a ?? b or that won't work?
The only thing I'm misunderstanding is its sole need of adding a (a = b) while other operators don't.
you can, but the idea is to emphasize that b is not only "lower priority" in order or precedence, but completely removed/unreachable depending on the result of the operator
its just to emphasise the difference between something like a += b and a ??= b
It'll take a while to get it, but that means it's not redundant; the paranthesis, right?
a += b is the same as a = a + b
a ??= b is the same as a = a ?? b, but not in the same way as the one above
because in the one above, both a and b are always evaluated
which is not true for the other one
im guessing they just want to emphasise that particular difference
ohh, looking at it that way gives an image
a = a ?? (a = b), so it will start from the paranthesis, right? in the order of precedence
no, in this case they use the parenthesis for the opposite reason
to show that the they are isolated
The way I look at it is that b will always be assigned to a (due to paranthesis) but if a (before-hand) is truthy, then that value will be assigned to a. (from their perspective)
yes but that is not what happens, its the opposite
the entire expression on the right-side does not exist unless the left-side fails the check
If we do it in the equivalent method? a = true and a = a ?? (a = console.log(1)), what's going on here? I just want to visualize what's happening here.
- open the back cover
- remove everything except panel, and power supply (to power the panel)
- buy a hdmi to xx-pin lcd converter
- grab a raspberry pi, connect everything
- close back cover
- done
and use kodi
same thing happens
if a doesn't exist? it logs 1?
its more accurate to explain it like this
a ??= b is the same as a = a ? a : b
has anyone used gif-encoder-2?
im facing some blocking code issues.
ctx: CanvasRenderingContext2D,
x: number,
y: number,
buff: Buffer,
callback?: () => void
) => {
try {
const gif = parseGIF(buff);
const frames = decompressFrames(gif, true);
if (!frames) return;
const gifEncoder = new GIFEncoder(
ctx.canvas.width,
ctx.canvas.height,
"neuquant",
true,
);
gifEncoder.start();
gifEncoder.setQuality(30);
gifEncoder.setRepeat(0);
// gifEncoder.setFrameRate(30);
// add the already created canvas as the first frame
drawImage(ctx, frames[0], x, y); // need to draw first frame
callback && callback();
gifEncoder.addFrame(ctx);
console.log("gif started");
console.time("gif");
for (let i = 1; i < frames.length; i++) {
// avoid blocking code
await new Promise((resolve) => setImmediate(resolve));
const f = frames[i];
drawImage(ctx, f, x, y);
// To draw items on top of gif you need callback here on each frame
callback && callback();
gifEncoder.setDelay(f.delay);
gifEncoder.addFrame(ctx);
}
await gifEncoder.finish();
console.timeEnd("gif");
// need to continue rest of the drawings
return gifEncoder;
} catch (err) {
loggers.error("canvasGif.drawGifOnCanvas: unable to draw gif", err);
return;
}
};
yes, only if a is null or undefined
how do i fix this 
alright, one last thing...
var a; a = a ?? (a = 4); console.log(a)
It will log 4 as a result of a at the left operand being undefined, right?
who writes code like this wtf 
and yes if a is undefined or null it'll print 4
but if a is 0, it wont print 4
I'll move on with this, better to understand. π
Yup, trying to understand the paranthesis use-case.
i mean its just a shorthand
a ??, means a should have some value. even if it is 0 this will be true
but a ? : means a will be falsy even if a is 0
a ? : is just a shorthand if else
Yup
tim help
im getting cuk blocked by blocking code
yes
wat
this

what is the issue?
its causing event loop block
its mainly the for loop thats doing that, but i have setImediate there
idk why its still blocking
how big is the gif?
how large is the resolution?
hmm, not too big but 169 frames is a lot
it should not block the main thread in the same sense as a while(true) would, but it can starve or slow down the event loop
try with a setTimeout instead
hmm
setTimeout is slower than setImmediate, maybe it gives the main thread more breathing space
otherwise you could use workers
lemme try with settimeout then
nopt its still blocking
no, i never bougth it, but i heard good things
add performance timers on your code
see where exactly it is blocking
ig last resort, i did add timers
it is blocking exactly in the loop
i added a "start gif" log
and whe that appears no other command works
until it completes
it takes 8s
which is a lot
that doesnt make sense
fr
i mean
8 seconds is a lot
even with a setTimeout, other code is given what, 4-5ms to do its thing? then it blocks for 100ms?
and it does that 169 times in a row
5ms for other code to run, and 100ms drawing the frame
lemme time how long it takes to draw 1 frame
i mean i do have other images to be drawn but they take less than 100ms
which is still a lot but my lappy isnt great
but it loads in 20ms on my server
check timers for each line, drawImage, calback, addDelay, addFrame
yep
also, is this a gif that users upload? or is it some predefined gif you use for many things?
user uploads it. but im making sure its not more than like 2mb. the reason this was is 5mb is i was testing and i didnt realise i uploaded a lower reso gif which was like 800kb but due to the fitting im doing with sharp it bloated.
ok so frame drawn is less than 50ms
frame added is more than 150ms
so thats 2s
hmm, so not much you can avoid there
i guess a worker will be needed then
i was gonna ask what setimmediate is but i got my answer

@frosty gale I faced a similar question and successfully solved it by researching online. Regrettably, I can't share direct links here. Feel free to message me, and I can share some helpful resources with you.
Really? I'd love to hear more, Jackson!
I'm surprised a man of your caliber is willing to help me out.
WOW!
How did you get into Top.gg
This is so crazy chat
he didnt reply
how come that i can still see the category while for my user the view channel option is disabled?
all other roles i ahve are set to / as well
each individual channel probably
if you're doing the category permission after creating the chanels
then it wont update
i synced them with the category
o
idk its so strange
must be missing something small
hmm
no i don't think so i went through everything rn
look wtf
am i tweaking or is discord
it says no access but i can still see them bitches
the last image with the "gives access to" is basically after making the channels visible again
idk what this tomfoolery is
uhhh, sorry, could you reword this?
wdym "see the category while for my user the view channel is disabled"?
also, it's impossible for you to hide a channel from yourself, but you can use "view server as role" feature to see as your members would
i joined as a normal member
i clicked on the hide category button, and well it shows my user and then view channel β
so that's good
but i can still see that category
buttt, my embed shows No Access so i am confused
could you screenshot the permissions screen?
cuz I'm still not understanding how exactly ur doing the setup
it's okay i got it fixed
i didn't set it to private
i got one other question for you ku
function twoSum(nums: number[], target: number): number[] {
for(let i =0 ; i < nums.length; i++){
let remainder:number = target - nums[i];
nums[i] = Number.MAX_SAFE_INTEGER;
let index:number = nums.indexOf(remainder);
if(index !== -1) return [i, index]
}
};```
this is a very simply problem, i tried to stay away from 2 nested loops and came with this soltuion. You got any improvements regarding runtime?
what is that supposed to be?
it returns the indices of 2 numbers in the nums array, that sum up to target
so:
nums = [1,5,1,2], target = 7:
returns [1,3]
I'm unsure why you need that
but well, sometimes it's better to just use the simple way and let runtime optimize it
if you use a map you can make it faster
const std = @import("std");
pub fn twoSum(allocator: std.mem.Allocator, nums: []const i32, target: i32) !?[2]usize {
var map = std.AutoHashMap(i32, usize).init(allocator);
defer map.deinit();
for (nums, 0..) |num, i| {
const complement = target - num;
if (map.get(complement)) |j| {
return [2]usize{ j, i };
}
try map.put(num, i);
}
return null;
}
pub fn main() !void {
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
defer _ = gpa.deinit();
const allocator = gpa.allocator();
const nums = [_]i32{ 2, 7, 11, 15 };
const target: i32 = 9;
if (try twoSum(allocator, &nums, target)) |result| {
std.debug.print("Indices: [{}, {}]\n", .{ result[0], result[1] });
} else {
std.debug.print("No solution found\n", .{});
}
}
did you know that you define where i starts in zig for loops without using =? pretty cool
starts at 0
for (nums, 0..) |num, i| {
starts at 1
for (nums, 1..) |num, i| {
thats essentially still a nested loop, because nums.indexOf will also iterate through nums just like a loop will
not sure how much more optimized an array.indexOf is compared to a for loop, if it even is
how should i do performance tests between rust and zig? is there a website that will do it for me?
leetcode doesn't support zig yet
wow so much fastness
is the rust runtime slowing things down by 2x? why is rust so slow?
zig users grasping at straws to appear superior to other languages in any way
the performance is amazing
here's the time for zig when running in safe mode. that's a more fair comparison
how can i make this optimized for rust?
oh nice
rust 17,529 microseconds
zig 10,487 microseconds
a bit closer when they are both optimized
zig users when they find out about cold starts
the timers start after the cold start
zig would be even faster if the cold start time was included. zig has a simplier runtime that takes less time to init

One message removed from a suspended account.
don't be violent.
One message removed from a suspended account.
One message removed from a suspended account.
sounds like something someone who wants to hammer a rusty nail through someone's foot would say
One message removed from a suspended account.
wtf :(
they are grieving. rust died
W
C# is a really good language
asp.net sells it for me
if it wasnt for go it would be my primary language
Sorry but I prefer the negligable "drawback" in performance than the unreadable zig code you post here
Failed executing console command 'b' in 'Economics v1.0.0 by misty.dev' [callback] (Object reference not set to an instance of an object)
at void Carbon.Plugins.Economics.CheckBalance(BasePlayer player, string command, string[] args)
at object System.Reflection.RuntimeMethodInfo.Invoke(object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture)
C# can suck my balls
My code has not changed since I pushed it to github

First time testing it to see where I left off and this shit happens
zig is "only" 70% faster. shame
versions are stored in csproj
you are using reflection though so wouldn't surprise me if something fucked up there
No idea what those words mean
System.Reflection
reflection
dynamically invoking stuff at runtime
do you do a null check on baseplayer
zig supports reflection at compile time
im fine with zig more or less but it's funny dismissing it's benefits
okay cool i'm talking about c#
C# doesn't have that feature unfortunately
...because it has runtime reflection
Fun fact, doesn't even run
Nothing in that method runs
Had a friend test it on their rust server and it works for them so I chalked it down to my rust server broken asf
must be something with the lib you're using idk
is uh
Amanda here?
i forgot the username

@lament rock i remember you had shared your code for gif encoder, can u help me make it async
I followed your stepsn and got things to work but its blocking the event loop
You know they aren't the only ones who can help right
alr so, how can i make this non blocking code
export const drawGifOnCanvas = async (
ctx: CanvasRenderingContext2D,
x: number,
y: number,
buff: Buffer,
callback?: () => void
) => {
try {
const gif = parseGIF(buff);
const frames = decompressFrames(gif, true);
if (!frames) return;
const gifEncoder = new GIFEncoder(
ctx.canvas.width,
ctx.canvas.height,
"neuquant",
true,
);
gifEncoder.start();
gifEncoder.setQuality(30);
gifEncoder.setRepeat(0);
// gifEncoder.setFrameRate(30);
// add the already created canvas as the first frame
drawImage(ctx, frames[0], x, y); // need to draw first frame
callback && callback();
gifEncoder.addFrame(ctx);
console.log("gif started");
console.time("gif");
for (let i = 1; i < frames.length; i++) {
// avoid blocking code
await new Promise((resolve) => setTimeout(resolve, 0));
const f = frames[i];
console.time(`frame-drawn-${i}`);
await drawImage(ctx, f, x, y);
console.timeEnd(`frame-drawn-${i}`);
// To draw items on top of gif you need callback here on each frame
console.time(`frame-bc-${i}`);
callback && callback();
console.timeEnd(`frame-bc-${i}`);
console.time(`frame-delay-${i}`);
gifEncoder.setDelay(f.delay);
console.timeEnd(`frame-delay-${i}`);
console.time(`frame-added-${i}`);
await gifEncoder.addFrame(ctx);
console.timeEnd(`frame-added-${i}`);
}
await gifEncoder.finish();
console.timeEnd("gif");
// need to continue rest of the drawings
return gifEncoder;
} catch (err) {
loggers.error("canvasGif.drawGifOnCanvas: unable to draw gif", err);
return;
}
};```
currently for some reason idk why it keeps blocking the event loop, especially when the drawing is complete and it is sending back the data on discord
Maybe something inside .finish
iirc nodejs also holds a thread up while its processing and wont continue until it releases when using async
yeah
It's not perfect
the Papi guy was also using the same gif encoder so thought best to ask him
I also wasn't sayng that I could help, but its better to post your code here rather than pinging a specific person at 3am
js is beyond me now a days
im rust boi

its 1pm for me
i can wait no rush
im getting into rust. i might just do the whole gif on canvas thing using rust
do you have any lib recommendations?
wtf why is discord send message taking 6 seconds
??
im sending an attachment
and it takes 6s? wtf
it has to upload to discords CDN
remember that
check how big the file is
and your upload speed
bbut like shouldn't it be async?? the culprit is this send message
it is blocking the event loop lol
my next message is not being sent until the one sending the attachment completes
then something in your code is stopping it
but i timed everything
the only time it blocks is when .send() is still in progress
then idk what you can do tbh, the upload issue is Discord 
is this js or python
js
const msg = await message.channel.send({
files: [ attachment ],
components: buttons ? [ buttons ] : []
});
console.timeEnd("message sent");
if (msg) {
sentMessage = msg;
}```
this all im doing like wtf
the creating attachment takes .05ms
console.time("message sent");
context.channel?.send({
files: [ attachment ],
components: buttons ? [ buttons ] : []
}).then(msg => {
console.timeEnd("message sent");
if (msg) {
sentMessage = msg;
}
})```
i'd personally do that
because then its sending the message sent after the message is sent
and why would that be blocking like tf
but doesn't block the event loop
because its await
await means wait until the function finishes running
and the function is taking 6 seconds to finish running, so its blocking other events for 6 seconds
yeah but the thing is my other command before this was already processed but it waited until this message was sent to send the oehter one
wait
async / await is not supposed to block things no?
it shouldn't block other requests
it does
if itβs in the same function, yes
idk then
ik it waits until the function finishes but like
might be because your device canβt handle that much
i believe you are running into a different problem there
its not normal for a message to take 5 seconds to be sent
and most discord libs send messages sequentially
tbf im trying this on my local machine so there is a network latency
i see
thats why djs is shit
thats the way they handle rate limits
you send two messages to the same channel, they are gonna be sent sequentially
that makes sense cause its waiting for 1 message to be sent than sending the message which was already processed
actually ig adding an attachment is why its taking longer?
becuase if i just send some text message it doesnt lag much
so if you time your other command as well, you might see that its not actually being blocked, just its response is getting queued
you are uploading a 5mb gif
if your internet sucks, that is gonna suck
nah my internet is fast. i always seen latency cause im from like asia region
and my discord server is in us
it takes 100+ ms to send normal message
hmm
maybe jsut for the attachment i could do that
that would bypass djs's rate limit system
ok but now like how do i compress optimize the gif
im using sharp to resize it. and it says set the transparency to #000 to make it smaller
but i still see the gif becomes larger after it resizes
is there nothing for gif similar to mozjpeg
are you using gifencoder's optimization options?
yea that too
im using sharp to only resize it
which creates a bigger gif, then use gif encoder to draw on canvas
with optimzation opts
but anyway im exploring rust to see if i can draw the gif and canvas faster
and simply send it back
what about the workers?
but workers are also gonna be slow no?
the entire canvas with gif drawing is taking 6s - 8s which is absurd
so ye there 3 things i need to optimize
yeah its gonna be slow
ideally you would want a multi-threaded gif encoder
that could encode frames concurrently
yeah, how do i do that hto 
isnt it gonna mess up the order?
if i tried to maybe use promise.all
promises aren't multi-thread, you'd need something that uses node threads or lower level wrappers
you'd have to try different libraries
they both claim to be very fast by using native code / wasm
my major gripe with gif is that it's very very very hard to stay within discord limits
especially if u allow user upload
i also found this:
https://github.com/pichillilorenzo/gifski-command
its a wrapper for gifski, multi-threaded rust library
Thanks Iβll check them out
i'd just do it without a lib
but it depends on what youre doing
One message removed from a suspended account.
someone said reflection? 
One message removed from a suspended account.
reminds me of elf comics
erm you did a bad job of making fun of me
but can you handles find classes on their own?
But I have one like that already
Could it be cuz it was accepted before I joined the server?
Exactly
You can ask for a role in the #support channel and as soon as a mod sees your message, they will give you the role
that's not a substitute for reflection at all
ok nvm i misunderstood what tey are
what's the point of having that on top of reflection
also doesn't exist as a concept in C#!
when i send emails with nodemailer why is my email getting in the spam inbox?
Why do other businesses appear in my regular mailbox lol
it likely has nothing to do with nodemailer
and to do with your email server IP or domain
i am deadass using my hotmail account to send it over
const mailOptions = {
from: '"xxx" <yyy@hotmail.com>',
to: recipient,
subject: "Email confirmation code",
html: HTML,
text: `We had problems displaying the layout of the email. Instead, below you can find a fall-back textual version of the email.
Here is your email confirmation code: ${ID}`,
};
My auth options:
const transporter = nodemailer.createTransport({
service: "hotmail",
auth: {
user: "yyy@hotmail.com",
pass: "pass",
},
port: 587,
secure: false,
});
i am not using a custom domain
Or MUST i have a custom domain?
check the 2nd and 4th answers
mail servers are extremely picky and petty with marking mail as spam
your emails need to perfectly conform to the rfc standard for starters
Use this it's very helpful and tells you everything that's getting your mail penalised https://www.mail-tester.com/
mail-tester.com is a free online service that allows you to test your emails for Spam, Malformed Content and Mail Server Configuration problems
years of trying to combat mail spam introduced some very shitty heuristic detections that most providers use nowadays for some reason
if anything it's an insult calling them a heuristic
i got a 9/10 my shit still getting spammed
i got my from already set, also did the thing that was said in the 4th answer
look
why are you not getting 10
my reverse dns is not matching the sent dns
from in the transporter, not in mailOptions
idk if i can control that though? That's something hotmail does for me..
owh really?
that's a deal breaker for most providers
immediate spam mark
const transporter = nodemailer.createTransport({
service: "hotmail",
auth: {
user: "yyy@hotmail.com",
pass: "pass",
},
from: "yyy@hotmail.com", // <--
port: 587,
secure: false,
});
really?
because it's used as a method to check if the ip you're sending mail from matches the domain
i can't really fix that lmao
any other free email providers that support nodemailer?
I know gmail has one
used to have that error because i actually left out the from in the transporter thinking it was in the optionsMail so i didn't have to add twice but once i added it to the transporter it worked
why is it failing the reverse dns though
does hotmail not have one?
might also be the fact that hotmail is used a lot for spam so providers like to penalise it
i tried it didn't work
NOOOO
gmail has the same
tf
why the fuck am i blacklisted on the chinese email list
i'ts over for me, i can never go to china
i have no idea why youre getting sent to spam
i thought the emails were sent on the behalf of whatever provider youre using which attaches their reputation along with it?
-10000 social score
Nope, the provider only provides, they don't take responsibility for any email sent
Unless the receivers add you to their contacts, or you have your address known and proved, you'll be sent to spam when automating messgaes
but does SMTP add anything to the email that shows it was not sent from the provider?
like if i use smtp to send an email from my google account, does the receiving end see that it was not sent from google itself?
zod or joi
Small question: If your bot is mention-based (you have to mention it to interact with it) how do you notify the reviewers that its the case?
mention it in the bot's description
When you submit a bot there is a field called "note to reviewer" or something like that
You can edit this while your bot is still in the queue afaik
Try restarting your Discord
I put it yesterday... I knew I shouldnt have trusted DDP when there wasnt a save button...
@sharp geyser hey question
listen 80 default_server;
listen [::]:80 default_server;
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
error_log /var/log/error_log;
ssl_certificate /etc/nginx/ssl/origin-certificate.pem;
ssl_certificate_key /etc/nginx/ssl/oliverbot.xyz-private-key.key;
server_name oliverbot.xyz;
root /home/website;
location = / {
try_files $uri $uri.html $uri /homepage/index.html =404;
}
location = /status {
try_files $uri $uri.html $uri /status/index.html =404;
}
error_page 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 421 422 423 424 425 426 428 429 431 451 494 495 496 497 500 501 502 503 504 505 506 507 508 510 511 /error;
location = /error {
try_files $uri $uri.html $uri /error/error.html =404;
}
location /api/ {
proxy_redirect http://localhost:8000 https://oliverboy.xyz/api/;
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:8000;
}
}
server {
listen 40;
listen [::]:40;
server_name domain webster.lol;
root /home/webster;
index index.html index.htm;
location / {
try_files $uri $uri.html $uri /index.html =404;
}
}``` is this right for 2 web servers?
i'd suggest you put those in different file. while it still works, but why not
itβs says on nigxy i can put them in same files
while it still works, but why not
yeah well, unless you have tons of proxies, that should be fine
Alright
Itβs going be a bit before i reload nixgy server cuz i havenβt bought the domain yet (pay check comes in a few hours) and my friend is helping me with this as well
why did you mispell nginx numerous times
oooo
what does that "Status: active" mean? what is active? because when i executed that, ufw is disabled (i can access any ports outside the rules)
Active != Enabled
For the specifics between the contradictory statuses, I'm not certain. I just blindly know from experience that they're different
Itβs habit
hi
you should put port 80 and port 443 in two separate server blocks, unless you dont mind your website being reachable without SSL, but thats kind of not safe these days
what if you enable this
is that cloudflare or what?
yea
then you wouldnt need a port 80 at all
coming back to yesterday, what can i do?
const transporter = nodemailer.createTransport({
service: "Gmail",
host: "smtp.gmail.com",
port: 465,
secure: true,
from: '"xxx" <xxx@gmail.com>',
auth: {
user: 'xxx@gmail.com',
pass: "google_pass",
},
});
const mailOptions = {
from: '"xxx" <xxx@gmail.com>',
to: recipient,
subject: "xxx Code",
html: HTML,
text: `We had problems displaying the layout of the email. Instead, below you can find a fall-back textual version of the email.
Here is your email confirmation code: ${ID}`,
};
,```
i am still getting in the fucking spam
if i can't fix this i might have to buy a custom smtp server
man bin that shit
your code takes up the whole screen
What is this language???
Is that js??
Istg, why no people use normal, compuled languages
And I have to understand whatever this is
Hey
??
Ar least this has semi colons
Dw, im just womp womping about life
i am just defining an object and using nodemailers package, are you good in the head brother?
well, js is mianly used for website development... you know, offering back and frontend solutions
idk how you want to dynamically change the document with langauges like java and c++, but if you know how to lmk
π€
Nah jk
Does anybody know why it isn't sending a notification of my live
https://srcb.in/TS6H7zeqPA
I have no clue what youre saying
God dayum
Isnt this like
A discord bot development server or smth
XD
Anyways ill shut up now
Im yapping nonsense
Fr
anyways, if anyone else knows what i can do to help my smtp transporter my sanity will thank you
One message removed from a suspended account.
is there any good api that lets me do a simple get request and get back an image with text from a query param in it
email clients use what you're using to send mail without the Gmail client so you're doing something wrong
keep in mind your config might be fine it just might be the subject/email contents that get flagged as spam
gmail doesn't exclude it's own emails from spam
but I wouldn't expect good results for whatever you want to use this for by piggybacking off of free email services
Nah i did but still havenβt reload it, just woke up
I know Dylan told me
Hey has anyone worked with telegram before?
If yes is it possible to fetch all members of a specific group using a bot?
Check their documentation out
I don't understand their documentation at all, I'm too spoiled by the simplicity and readability of the discord.js documentation
But I managed to find something like this if it's of any use to you
Their docs are ass
I personally used the telegraf.js wrapper but it was just some simple messages
Issue is this requires an actual user, not accessible using a bot
Yeah same i am using telegraf, no functions to get channel members
At the bottom it says that bots can use this method
Ah sounds wonderful let me see
least spoiled discord js developer
i keep getting error when i try to use unicode in this grammar:
https://pastes.dev/tHi00e9D3o
why is this happening?
i try to put unicode of all languages
but whatever i try it don't work
why it use to work before with unicode
and now it's not working?
@quartz kindle
One message removed from a suspended account.
my ssl doesnt work its on port 433
i meant 443
listen 80;
listen [::]:80;
listen 443 ssl;
listen [::]:443 ssl;
error_log /var/log/error_log;
ssl_certificate /etc/nginx/ssl/origin-certificate.pem;
ssl_certificate_key /etc/nginx/ssl/oliverbot.xyz-private-key.key;
server_name oliverbot.xyz;
root /home/website;
location = / {
try_files $uri $uri.html $uri /homepage/index.html =404;
}
location = /status {
try_files $uri $uri.html $uri /status/index.html =404;
}
error_page 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 421 422 423 424 425 426 428 429 431 451 494 495 496 497 500 501 502 503 504 505 506 507 508 510 511 /error;
location = /error {
try_files $uri $uri.html $uri /error/error.html =404;
}
location /api/ {
proxy_redirect http://localhost:8000 https://oliverbot.xyz/api/;
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:8000;
}
}
server {
listen 8080;
listen [::]:8080;
listen 443 ssl;
listen [::]:443 ssl;
ssl_certificate /etc/nginx/ssl2/origin-certificate.pem;
ssl_certificate_key /etc/nginx/ssl2/webster.xyz-private-key.key;
server_name webster.xyz;
root /home/webster;
location / {
try_files $uri $uri.html $uri /homepage/index.html =404;
}
}```
One message removed from a suspended account.
can you help faithie
One message removed from a suspended account.
nginx
One message removed from a suspended account.
doesnt work can mean many things including the port being unreachable or nginx removing your / folder
Wdym?
for which website?
Itzwebster.xyz
My ssl on oliver is fine
Ssl for Itzwebster.xyz isnβt working
why is the server name webster.xyz
OH SHIT
lmao
i switch it back to 80
I was trying figure out why its not working
alr
do unverified bots have a limit for the amount of users can use it in dms or is there just a server limit
anyone know why when i have the ref, the Choices is re-rendered whenever theres any changes (but when i remove the ref, it isn't) - it shouldn't be re-rendered everytime because whenever i remove an items it's instantly added back
Component: https://gist.github.com/fronkdev/66d64f6b430fea59374887c9a6bb82a4
Choices: https://gist.github.com/fronkdev/8177c28f6d0d7bc8ac02d1bdd37d2483
i believe the cause is because of useImperativeHandle(ref, () => instance, [instance]); but im not sure how else I'd approach this
it was an overcomplicated and nerdy way of saying "what's the error"
Genuine question what language should i learn next it has to be multithreaded
I only know js and ts atm
rust or go is probably a safe choice
how do I properly do this
The : is a type annotation and you aren't declaring an initializer
You want to use an =
uhh where
Ah nvm im r word
regsdfg
One message removed from a suspended account.
rust is everything but safe π
Honestly, I'd try placing parenthesis surrounding the type annotation because the = might be interpreted as something else currently
Whats the underline say even
Are you certain that the first param of every ClientEvent[T] is the Client
uhum no
wait
i think its because event var isnt as const
Maybe
yess
also, I wouldn't type annotation index using a typeof variable unless the signature is too complex to reconstruct
english please
but in this case it isn't, though I'd still just use
ClientEvents[keyof ClientEvents]
instead of typeof event
ehmm
defeats the purpose of the event constant
it wouldnt give the proper ...args for it then
Whats the purpose anyways if its type signature is overwritten to be keyof ClientEvents
β¦
Perhaps I have been spoiled by the enlightenment of raw gateway interaction. I just have one listener for all gateway messages and then switch case off that listener for each event and dont even abstract any of it behind classes that dont even do much useful
30 line index.ts !!
Langs I wish I learnt from experience with Discord bots and in a couple of startups: C#, C++, Java, Python. I've never seen any production app using Rust 
I dont understand the question, pretty much any language can be multi threaded
Just depends on how much you want to suffer to accomplish that goal
i thought rust was awesome
how so
What this error?
It means it couldn't make the request to the url you put in there
Either your webserver isn't online, or you gave it an incorrect url
uhm
what's the error
IpAddress:5050 is online
Maybe you have a package missing?
GuildMemberRoleManager does not implement iterator
it evaluate for all possible types
if it doesn't fit the constraint, the error will be thrown
if you are sure that it is only string[] at the time of using it, explicitly cast it as such
Ya'll how do I get the bot developer role?
do not use type unions with incompatible type signatures
Looks like an invalid component to me @surreal sage
whatt
Guess you can't use IPs then
Meaning it doesn't make sense and or isn't valid.
also okay suppose i have A | B where A extends Array and B extends Map
consider:
// const variable: A | B;
variable.has("blabla");
what happens when variable is actually A?
Can't use ipNetwork:port?
Guess not
consider
for (let item of variable) {
what happens when variable is B?
@surreal sage
im so confused
| when using two types is a union type, just because one side is an iterable (aka array in this case) doesn't mean the other side is as well
two types have incompatible signature (a method you try to use is not available in the other types of the union)
im more confused as to why the type is that
did you set it?
Well
your mistake then
wha
Its hard to say without context
simple put
if a var is of type A | B and you wanna call var.someMethod() for example
then both type A and B must have someMethod method implemented
because it exists in one type of the union, the manager
im so sure that i didnt
usually that roles should be a Collection
Well you had to of
what is its actual type
Its discord.js
their classes extend other classes, that extend other classes that extend more classes
they didn't drop it
this is java corporate hell
Theres a class that has 5 layer deep inheritence
Also, they don't abandon collections
its just a "cache" property
they use collections for cache
5
do modals still only support text inputs?
I think so
It seems to me that they have plans to do so, but it is possible that something is still limiting them
More than a year yeah
datetime slash command option type was also data mined at some point
Like a year ago or something as well
It has never seen the light
they have dev teams working on these stupid projects most of us see as pointless but bring in revenue, especially since discord is planning to offer an initial public offering soon (going on the stock market)
so things like keeping devs happy are the lowest priority
its anticipated to happen eventually
people thought it would happen years ago but they pushed it back
probably because they werent making enough money to have people confidently invest
what was the name of that discord clone back then?
probably guilded but im not sure what roblox is doing with it now since they acquired it
ceo of guilded definitely got a lucky escape out of this one, bought by a massive corporation
For some time now, you have to have a Roblox account to use Guilded iirc
yeah i heard its partly to boost their roblox numbers
but its also because keeping authentication in one place is usually a better idea
i would setup a separate identity service though and make roblox and guilded share it
why do all good things have to fall into the usual corporate trap
makes no sense at the moment that you have to log into some lego game to login to your gaming chat client
people dont vote with their wallets anymore as they used to so corporations can get away doing these small changes slowly and know it will be better in the long term money wise
So I am making a desktop application with tauri, and I have an auth system that relies on logging in with steam, which means I have to open a link in their browser when they click "Sign in" on the desktop app. Would the session be saved and useable back inside the desktop application or would it be unuseable as it was saved in the scope of the browser.
better money-wise, worse product-wise
like usual
its terrible but we've gotten to the point where you cant be a normal part of society without accepting some of these stupid terms
can always move everyone to session or something
idk why more people arent using session
signal is good too i heard
some gov did a subpoena on their data and all they gave back is the persons last login date and account creation date lol
yeah lmao

if only companies stored the data they actually needed that would be nice
We are forced to use Threema 
if its something like oauth2 steam would give you a separate token so it wouldnt log you in to your steam client
Its not oauth2
you have to be a partner to use oauth2
I am using their old ass openid 2.0 stuff
Only thing open to the public
My issue is though, will my desktop application have access to this session I save from my backend api, if its opened in the browser
i doubt it since its not good practice to share tokens between 2 services but you can test it by getting a session then logging out in the steam client to see if it invalidates your token
openid also has no "invalidating" because it doesn't give you a token
at least not 2.0
or not steam itself
Steam gives you a steam id back that you then use to query for more information from their web apis
suppose that i am in a file:
file1.js -> can i call a function in ts?
Of course you can stupid
you can convert it
But its not the same scope no?
I am essentially opening a new tab
So the cookie / session would not be accessible between tabs
function createEmbed(title: string, description: string, timestamp: boolean) : EmbedBuilder {
let embed = new EmbedBuilder()
.setTitle(title)
return embed;
}
wait is this not possible to do?
Ain't no way can't i integrate ts in my djs projects anymore...
why would that not be possible?
nvm i used Require instead of import
anything in js is possible in ts
ts doesn't stop you from doing what js does as you can use js in ts without using any of ts features
π
damn i se
but now if i want to call my ts functions i first need to transform it to js right
and then call that js function
thats when you'd use the tsc
it will transpile your ts code into js code
and then you can run it as normal node ./transpiledjsfile.js
i see
so ts is mainly just for... the sake of the development?
after that it's just a plain js code
i see
Its for those who want a type system
yeah that's what i mean with sake of the develop,ent
like it makes everything more typesafe
ts is a dynamically typed superset of js
less prone to bugs etc
tf am i writing ts code for then
your own sake
ts is just a js maker
Its was invented to make development easier
and looks cool
It introduced types to js so that way devs aren't making common mistakes like passing in a number in a function that accepts only a string
π
but if you are making a npm package ts is very powerful, especially if others also use ts with your package
You can bundle types with your package that force those types you made onto them
If you write a method that takes in a number, it will force them to give it a number
you technically dont need to code in ts to do that, but yeah
i love writing them
i see so ts is basically js but then fancier
If you want to think of it that way sure
Its type system can get very powerful though
this looks well..
It allows you to do some wacky things
yea
it's good to use ts, until you need an old module, unmaintained yet still working, is the only module that can do what you want, doesn't support typings
man me n java are bae
no like I can't do import on that module
you can
no
yes
well I forgot that module so can't give it but no
You 100% can
Merhaba
You just have to write your own typings for it so ts can find the typings
Thats the only reason ts wont import it
Hello me Turksh
Δ°nΔilizce no me
lmao
ik the declare module thingy, but π
yeah that's what I did

Thats like the only way to do it
Hey! Does anyone have any ideas how I can solve the border being different sizes? I want the same size border all around
https://play.tailwindcss.com/MFmughejy2
I mean not wrong tho, yeah
unless you put your own .d.ts file inside the node_modules folder of that package
But that gets removed when you run npm update afaik
Only other solution: fork it, and upload it yourself
providing its not protected by a license
~~as long as you didn't get caught ~~
the border is the same size all around
you can open the preview?
β οΈ
yea why cant i
damn
Removing w-full and h-full shows the border all around but it's still not the same size, especially when resizing the screen
Im not sure what you are seeing
it is precisely the same size
It all looks fine to me
It might look differently sized because of the bg colors
but they are the same thickness
What browser are you using
Chrome
is it also possible to use ts when working with api call handling and or using a lot of modules
packages
etc
Right so
i think i will only use ts for serious shit like when creating websites, actual programs etc
Anything you can do in js, you can do in ts
π£οΈ
yes I agree
Tell 'm Aaron
Quite literally anything, so asking "if this is possible" will always be "yes"
I stopped use js and use ts in every project after I found out
is it possible to create graphics using ts?
Sure
can I program something that destroys the world in one line of code
just ask ur mother
heh
No need, ur mother's weight is enough
ok thats mean





