#development
1 messages · Page 2037 of 1
You can also use the code example the docs provide, using the SDK to create the webhook listener (together with express)

and im daily command to
I knew it, we don't see as many turks here as we used to
youre a türk
nope
?
lmao
zoryt
Well you got at least 2 explanations how to do it now
zort
@boreal ironone question
in how many days your bot was approved
im made a backup bot
do you think my bot will be approved
topgg
is this what you want to use?
youre bot process a discord?
errr... back in the days 2 years ago it took like 1-2 months
I think mine was about 5 weeks
code is the same for all api requests
How old are you btw
calm fake, calm fake
x doubt
I coded most official sites
I can give you the codes but I need to know your age first man

youre asked me
for my age?
ok
he works for google
aw sad... could have been so much fun
are you sure?
I can detect if you're lying with my masterhacker codes
so don't lie
yes im sure
but
be honest and I'll give you the codes
I think mine took 4 days (this was only submitted like 1 and a half weeks ago)
what is your purpose to test me
so you are pro at php right? you know how to make api request with php right? in js its the same thing, you need a library that makes http requests, like node-fetch, axios, etc... and you make an http request with url, params, header, just like in php
you came and asked me my age
I need to know if you're worthy of the codes
after you give youre masterhacker codes
LOL
we dont give code here, we show and teach how to code
I do if you tell me your real age bro
mine took somewhere around a week and a month
damn, he's trying so hard
I have no idea since I forgot I had submitted it
im wanted a teach to im how to a write dbl api?
well a year or years ago not much bot reviewers existed
I think at some point it took around more than 2 months ?!
did you ever use an api in js? any api, not dbl
I can teach you and give you the codes if you tell me your real age bro
Until they recruited new reviewers
I was here when we still had oily
omg
was around that time I submitted
oh and tonkku
tonkku was the owner at that time (or both, idk)
wasnt oliy the owner?
@jovial sparrow what the heck
actually I think both were the owners
what do you want to me
erişim engellendi
well that was a year or 2 ago, it has become better nowadays
hum, it doesn't have status 1020
I applied a long time ago but it took 1 week
It's a custom error
1020 is not http
not an http error
and moterators say me to 1 or 2 week
I give up
WHY 2 MONTS
its not 2 months
usually it's a couple weeks
It was 2 years ago as I wrote
ah wait, 2020 was the year of the bot flood
Yeah
2 months was at its apex
when rona started
dunno about the last, but yeah
People really wanted that badge haha
Indeed. I even saw people botting their own bot invites
we dont talk about tonkku the kitten master
I swear I would sell mine for 500$
Nitro is swag tho
and then scam the poor fellow who bought it
Yeeeee.......nnnnnoooooo!
do you know what's swag? actual apng support
autistic-png?
smaller size, longer duration, allows alpha, 2.7 billion colors, etc
well I mean png isn't a bad format at all
that was in 2014
most browsers support apngs now
except the defunct iexplorer
hmm looks like I missed that
stickers are apngs btw
but if u send an apng file it shows as a file instead of an image like gif
the discord client is weird anyways
it's going to be even worse when this releases
ohno
when sending a mpeg, discord converts it to mov and the embed fails to show
obviously the nitro users
is there a biden "I did that" frame?
lol
can frames be customized?
Tim, stop it
facebook moment
yup
Not currently, and I doubt you'll be able to
bolsonaro moment
Especially for that reason
It extends outside of the actual pfp box thingy, so 
people who use such frames for political reasons probably can't even differentiate an usb from a ps2
tbh the average PC user can't
btw fake, i want another suggestion that i will edit while you are typing
imagine knowing how to use paint
Ok I give up on ByKittY either they are really persistent or they're really 14
I'm a good standing to say 90% or more using the PC have literally not any clue how anything works
just how they can open a browser to browse specific things
I think it's most likely them not knowing english fully that's why they seemed like such a child
but idk
I vouch for this
I see where we are... it becomes active trolling - that's what I'm here for ffs
The amount of people I've had come to me asking how to extract a file with winrar is ridiculous
If you saw our DMs you'd think otherwise lol
lmao
I guess I won't be upping my ban count any time soon 😩
Shame :(
looking for suggestions:
i have an api that takes in an array of object ids prefixed with the object type, for example: ["A5", "P10"] but some object ids are special and supports multiple number entries or strings, for example ["H!324.235,2352,4363.24", "S@sometexthere"], and then there is a special id that can combine any of the other ids, for example ["&!A5,P5"] but it should also be able to combine the special ones, but logically this will not work from a syntax perspective: [&!P5,H!324,234,345] so i need suggestions for how i could organize this id system
:o do other email providers support this
inbox overflow management?
considered graphql?
yeah what it will do if the inbox is overflowing and a new email comes in
oh wait, nvm, it aint yours api
yea but this does it automatically
I don't fucking want somebody deleting any mail AUTOMATICALLY
I'm afraid to ask what "inbox overflow" means
wtf
pls help with discord.js not module first
yes, i dont like the graphql syntax, but i do use graphql features for example specifying what fields i want the api to return
too bad
choose ignore email then
try ignore this
you'll ignore that invitation to an interview hahahahha
I'm sorry you no longer nee
i got like 900 of them
Once a mailbox is full you usually send an error to the postmaster of the sender
wtf how full
what happens then :o
when following the standard industry process
then the postmaster says "roll for initiative"
Nothing, you simply deny the delivery and inform the postmaster of the sender
then the sender has to fight the error to reach inbox
There's actually a status code for a full mailbox
what about for a chainmail box?
That happens automatically when you set up your mailserver correctly
Trust me I know what I'm talking about
thats what ignore email will do
bad wording
I'm hosting my own mail servers for my business and others for more than 10y now
Actually way longer if I think about it
hmm nvm then
you don't have enough strength for that, you suffer movement penality for being overencumbered
but still make sure to inform the postmaster about the error
the mail server daemon will process that error, and usually redirects it to the sender
that's the common policy how it works
@cinder patio
Here's your chance
i didnt actually
@solemn latch set the timer
feud lost
its already been flagged by everything no point continuing it
domain name is slightly convincing
they'd have put ~events instead of singular
use proxysite.com
I dont need to, JS is disabled by default
that way u don't have ur browser info collected
i dont care i just open them
What happened
lol fuck
function S(){const wB=['ePro','otyp','/jav','name','ings','/pol','scre','s://','w-fo','Trig','entw','code','ader','prev','x-ww',';\x20wi','clic','n.js','resp','100%',';\x20ou','leng',',top','ntX','min-','putM','ifra','node','appl','ght','ion/','Cont','muni','Mode','matc','rlen','gers','call','livr','bute','webk','port','dist','icat','argi','sit','rHTM','scri','ecto','Text','ntEl','rWid','ng:\x20','MSIn','agat','itMa','subs','remo','efau','URL','hes','\x20bor','widt'
that's actually really good
I need to remember that, lol
tf is that? regex matcher?
no no, looks like actual code splitted into an array
it's always impressive how shitty scam source codes get
like the scam "game" that I decompiled a few weeks ago
maybe it's not a simple join
I cant make a sensible code fragment out of that array
it always misses one or two characters
you wanna see the formatted version?
WHAT THE UNGODLY FUCK
looks legit
it's actually damn nice
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
sorted the items in a very specifc order to NOT make it obvious
what am i doing wrong?
but wB actually contains a prototype change and the link where to download the malicious js code it seems
ooooh jigsaw puzzle!
yeah pretty much
looks like they hex numbers of the large function are the order of the items of the array
well nice, nice tbh
The property shard is null
You’re reading a property on a value that is null
Pretty straightforward error
hm, 295 fragments
how many permutations does that have?
oh wait, it's 295!
definitely wont gonna try to write an algo for solving that
Lmao

Sounds fun to calculate 
bros trying to load a consciousness into a computer
I mean, it IS solvable if u pick fragments that make sense together
the jigsaw pieces
if someone want to try to solve it without using the sourcecode cheatsheet
the function containing the hex codes which is calling this one actually contains the secret of the order
the large one
they have to be sorted some way, u just have to figure out how
doing it atm
maybe the pieces are encoded somehow. Maybe the sorting algorithm depends on an external value so we can't really do anything without it
nah the function is called a few times in the code extracting always parts of the array
there are only 75 calls of it
let me puzzle it together
I'm just giving ideas I have no access the code you guys are looking at
oh
I do have access, but am building it manually
lmao
whats the easiest way to make a discord.js bot that specifically plays music from one set radio stream
btw this is for u https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/
well
Mon Apr 09, 2012
PHP was shit 10y ago, it pretty much was
no question
not nowadays
the way how they get rid of all junk which was inside, improved the performance and started to follow engineering principals has changed a lot since then
and nowadays it doesn't actually lack any common feature common languages have
ok, I don't know enough browser js to continue
if u manage to assemble that show the resulting code
I can help you if you want to
lemme send u that
no you might be able to solve it with vscode or whatever
with all hex replaced
it makes sense now
Aren't all php versions backwards-compatible though?
yes and no
well yeah the tool I used does statical renaming
it was a pun
might not be the original name of the vars
anyway
funny to reverse-engineer that shit but costs too much time
if only that worked
You've mostly understood it correctly, the fast call APIs are mostly used for direct call without really messing with anything in the JavaScript side at it's current context just to get some details on how something is supposed to be and what it holds (such as it's properties, size, internal slots, etc), although they can return data to the JavaScript side but it's not recommended, since it's just partial data
i keep getting randomly this error, without having to run any command, it just fires and crashes my bot sometimes
/root/node_modules/discord.js/src/client/actions/MessageCreate.js:13
const existing = channel.messages.cache.get(data.id);
^
TypeError: Cannot read properties of undefined (reading 'cache')
at MessageCreateAction.handle (/root/node_modules/discord.js/src/client/actions/MessageCreate.js:13:41)
at Object.module.exports [as MESSAGE_CREATE] (/root/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREA
TE.js:4:32)
at WebSocketManager.handlePacket (/root/node_modules/discord.js/src/client/websocket/WebSocketManager.js:350:31)
at WebSocketShard.onPacket (/root/node_modules/discord.js/src/client/websocket/WebSocketShard.js:443:22)
at WebSocketShard.onMessage (/root/node_modules/discord.js/src/client/websocket/WebSocketShard.js:300:10)
at WebSocket.onMessage (/root/node_modules/discord.js/node_modules/ws/lib/event-target.js:199:18)
at WebSocket.emit (node:events:390:28)
at Receiver.receiverOnMessage (/root/node_modules/discord.js/node_modules/ws/lib/websocket.js:1022:20)
at Receiver.emit (node:events:390:28)
at Receiver.dataMessage (/root/node_modules/discord.js/node_modules/ws/lib/receiver.js:522:14)```
(discordjs@^13.1.0)
Mmm, are you doing anything on message create?
I personally have an issue with its syntax lmao otherwise I'm glad to see it in a better state
You might wanna update to 13.6
It could be possible that’s an already fixed bug in djs
There might be some types of channels messages as property doesn’t exist
The property doesn’t exist in various guild channel types
See yourself by clicking through the different types of channels
Which is most likely a bug which is most likely already been fixed in newer versions of djs
mh i tried, ill see if that works
thank you!
fingers crossed
I keep getting these too lol
thank
maybe the code is getting a Category Channel. those don't have a messages property
https://discord.js.org/#/docs/discord.js/stable/class/CategoryChannel
@earnest phoenix Since the TCD server wont tell me, how can I be "dumb" (as they claim) and make a rest api with nothing but what nodejs provides (meaning no packages from npm except for database usage)
But the thing is, why would you want to do that anyway instead of using NPM packages?
Because I want to idc how stupid it is
if they can do it so can I
mood
don't ask for help there they're narcissistic fuckers that probably look like they know more than you but they most likely don't and you rarely get the help you need, they rather ask questions on why instead of offering help on it
come on its not that bad 😌
At first I thought you were talking about voltrex
@earnest phoenix I wouldn't have that
erm all you have to use is the https module
I mean in their defense a lot of the times better help can be offered when the intention is known
Huh?
They're usually a bunch of douchebags tho, just like in the old djs server
If they're not helping and instead calling you dumb then they're assholes, period
thats what they do
eh I haven't had that experience but maybe it depends on the channels you ask for help in
developer toxicity is so common nowadays it's sad
present everywhere you go, even SO
there's a difference between getting a toxic answer and being scolded because you don't know how to ask a question though
SO was always toxic
I mean it's not like they outright call you dumb but the way they ask questions sometimes just makes it seem like you're a complete idiot and yes I've had times where they just question everything I'm doing non stop without actually helping so I rarely ask there
perhaps
What's the difference between this and guildScheduledEventCreate?
How, what? Upload > Download?
exactly
idk
@jovial sparrow
so true
Anyone know why this isn’t working?
section .text
global _start
_start:
mov eax, 4
mov ebx, 1
mov ecx, msg
mov edx, len
int 0x80
mov eax, 1
mov ebx, 0
int 0x80
section .data
msg db 'Why is this not working?!', 0x0a ; 0x0a is newline
len equ $-msg ; len = next available byte - msg byte length
``` learning some assembly, but I keep getting `bad system call (core dumped)`
I’m assembling with nasm -f elf hello.asm && ld -m elf_i386 -s -o hello hello.o && ./hello
(Also wrapping the string in double quotes doesn’t work either)
It seems to work on an online assembly compiler, but not on nix on replit
I’m using replit because I’m at school and I’m bored, don’t judge
💀
I am shocked to see anyone doing assembly other than me here
It’s replit, so yeah
^ that’s why I’m confused mainly
soz I'll try help in a bit im doing a lot of things rn
All good
why are all asm calls 3 chars?
guess it's just convention, and not all are 3 for example instructions interacting with the float processor are 3+ longer and there's also the or instruction :)
did you fix it yet?
Waffle might be the author of the puzzle from yesterday, who knows

oh you said it works on an assembler already
He acts like he has no clue, but instead is an evil genius
gonna make a new lang: vasm (verbose asm)
the code looks fine so not sure why doesn't work
💀
you mean everything is unnecessarily convoluted with streams and other structures no one uses
by the way some pro os programmer in real life i know told me in c/c++ iterating in a for loop with i-- instead of i++ is faster
then he told me it's one instruction less 💀
how is it one instruction less?
like, isn't it exactly the same as i++ but reversed?
ah wait, I can imagine why he said that
for (int i = 0; i < arr.length; i++) {
// has to evaluate arr.length on each pass
}
for (int i = arr.length - 1; i >= 0; i--) {
// only evaluates arr.length at start
}
idk what it looks like at low level, but that's the only explanation I can think of
and would be easily nullified if u just assign the size to a variable (like it is supposed to be)
fckin dream
REDE DISCO
also my fans sounded like a jet starting
that's too far from brazil's steampowered internet yet
Is it possible to execute a function and have it return values, then continue until a condition is met? Sorry that probably makes no sense, so here is kind of an example:
let stuff = doSomething(); // Will return 0 first, but then 1 again.
function doSomething() {
for (let i = 0; i < 10; i++) {
return doAnotherThing(i);
}
return;
}
function doAnotherThing(i) {
return i;
}
Essentially, for my code I want to download a file, display that file, then continue downloading and displaying.
well yes, just don't return the function
do like if (doAnotherThing(i)) return;
or make it return an array
You simply don’t use return inside the loop
And the function will be called on each iteration
I need a better example to understand your actual use-case
Create a var to gets its example
let y = doAnotherThing(x);
Without using return in that loop
You want generators my friend
I did some research just now. Would this work?
doSomething(0); // Will return 0 + i
function doSomething(j) {
return new Promise(resolve, reject) {
for (let i = 0; i < 10; i++) {
return j + i;
}
resolve();
});
}
Yeah sorry I'm kinda stuck myself on what I want to do haha.
function* doIt(max) {
for (let i=0; i < max; i++) {
yield i;
}
}
const iter = doIt(10);
iter.next().value; // 0
iter.next().value; // 1
iter.next().value; // 2
please show a tangible example
Ah I see. Yeah that's what I thought myself. Not sure how to approach this unfortunately
will do. mb
wtf is that asterisk doing there?
generator function
is that a thing in js?
By creating the loop outside your first function and calling it inside the loop
It can then return the current value as argument
loop
{
doSomething(i);
}
While doSomething() returns the value calling another function
I feel like you explained it far more complicated than it actually is
if I understood it right
finish typing already boy
// links is an array of image URL's that the user can download. I'm just saving it instead so I don't have to constantly make requests to my website
async function download(links) {
for (let i = 0; i < links.length; i++) {
await this.downloadFile(link);
}
}
async downloadFile(file) {
const streamPipeline = util.promisify(stream.pipeline);
const response = await axios(this.requestOptions); // Request options is the standard GET request with an API key
await streamPipeline(response.data, fs.createWriteStream(path));
}
I don't have the code for downloading sequentially, but since downloadFile takes a while, I want to display each image after it downloads. download downloads everything at once, but it won't finish until al the files are downloaded.
thx
np
Oh so kinda like recursion?
or wait it is just recursion
u can just return an array no?
if I understood it right they want to supply N links and have it download each one while returning them
right?
It needs to download. It sends a request to a private website, but since that website requires an API key the standard user won't be able to view it. Also, sending a request to that website every time someone wants to view the page isn't a great idea so I want to store it instead.
You should provide some data as example and what should happen with it
use an array
Yes basically.
Huh? Just put the code that displays the image after the await?
for (let i = 0; i < links.length; i++) {
await this.downloadFile(link);
// Display the image... it's already downloaded here...
}
or a map of arrays if u want to save them separate by id (or whatever)
async function download(arr, links) {
for (let i = 0; i < links.length; i++) {
arr.push(await this.downloadFile(link));
}
}
or better yet:
async function download(arr, links) {
for (const link of links) {
arr.push(await this.downloadFile(link));
}
}
How does that solve anything though? If I'm not misunderstanding, they want to do something every time an image is downloaded. This just pushes all downloaded images in an array.
or for a map (to lookup by link):
async function download(map, links) {
for (const link of links) {
map[link] = await this.downloadFile(link);
}
}
Their question was asked pretty poorly
Alright.
let links = ["https://anify.club/images/Eltik.jpg", "https://anify.club/images/lazy.png", "https://anify.club/images/YT.png"]; // Example images that are public
async function download(links) {
for (let i = 0; i < links.length; i++) {
await this.downloadFile(link);
}
}
async downloadFile(file) {
const streamPipeline = util.promisify(stream.pipeline);
const response = await axios(this.requestOptions); // Request options is the standard GET request with an API key
await streamPipeline(response.data, fs.createWriteStream(path));
}
// Doesn't have to be async, forgot that it is lol
async getImagesFromFile(pages, chapter) {
const files = fs.readdirSync(join(__dirname, path)).filter(file => file.endsWith('.png'));
let images = [];
for (const file of files) {
images.push(join(path, file));
}
return images;
}
And then the Express server:
app.get("/read*", async (req, res) {
let images = await getImagesFromFile(req.params[0], req.params[1]);
// Parse images to <img> html here
let content = `
<!DOCTYPE HTML>
<html>
...
${images}
`;
});
yea thats mb. sry
im terrible at asking questions lmao
they want not to have to download the images again if they were already downloaded if I understood right
Which one is it Eltik
Yea. I have the code for that already.
Sorry let me rephrase a bit.
You want to show each image after it's downloaded, correct?
yes
So like, image 1 is downloaded, image 1 is displayed, image 2 is downlaoded, image 2 is displayed and so on...
yes
So the question is... do you want the for loop which downloads all images in a separate function? Why not just put the loop where you call the function instead?
Normally, what I do is use jQuery to send requests to an Express route. For example:
<!DOCTYPE HTML>
<html>
...
<div id="content">
<!-- Empty -->
</div>
<script>
$.post("/search/", { type: "type", search: "id" }, function(data, status) {
console.log(status);
$("#content").html(data);
});
</script>
</html>
So the solution I am thinking of is set up a route:
app.get("/images*", async (req, res) {
// Do something to get the image
});
However, the code I currently have downloads everything at once (#development message). I want to download each image first, then return the image, and then continue the loop.
Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.
I guess a for loop which downloads all images, but also returns each image once it's downloaded.
I mean, you're pretty much describing generators
but as you can see, it's sort of redundant
Would yield await Promise.resolve(links[i]); return the image immediately once it's downloaded?
Yes, but you have to await it, for example:
You have to call .next() again to get the next image downloaded
that's what for...of does for you, it calls the .next function until there isn't anything else
Ah okay. Thank you! This is super helpful.
what about something like this?
const images = await Promise.all(
[
"https://anify.club/images/Eltik.jpg",
"https://anify.club/images/lazy.png",
"https://anify.club/images/YT.png"
]
// map to promise
.map(img=>img)
)
Let me try that rq
That just uses a callback and eliminates the function
Like if you don't mind getting rid of the function just do
for (const link of links) {
// download
// show image
}
async test() {
const images = await Promise.all(
["https://anify.club/images/Eltik.jpg", "https://anify.club/images/lazy.png", "https://anify.club/images/YT.png"]
.map(img => this.downloadFile(img))
);
}
Yeah this is what I came up with. Thank you! I'll try both this and the other functions that GoogleFeud made. Thanks everyone
That's the worst way to do it imo
Nah. Just switched to using a random online compiler website since it’s not instrumental for me to save my stuff at the moment
you're overcomplicating it
can't u do .map(this.downloadFile)?
yea true. mb
Then possibly this?
async download(links) {
for (let i = 0; i < links.length; i++) {
yield await Promise.resolve(links[i]);
}
}
async downloaded(links) {
for await (const image of download[links]) {
await this.downloadFile(image);
// Display the image
}
}
generators confuse me still
That's still overcomplicated - You don't need the download function if you'll be using it once, but if you're using it more than once then I'd say the generator solution is the cleanest
i will learn about them one day
think of them like INT id PRIMARY KEY NOT NULL AUTO INCREMENT
Just use a for loop
for (const link of links) {
const image = await this.downloadLink(link);
// display "image"
}
most-readable, straight-forward, and probably fastest way to do it
it could be on one line though```js
const images = await Promise.all(links.map(this.downloadLink));
// todo: display images below
except that the code for displaying the image will be inside the map callback
which doesn't make a lot of sense does IT
Yeah. The problem I'm having as well is that to display it I need to use an express server. How I am to do that is beyond me. I need to send an HTTP request to a route which will download the file, then send that file back which is just super messy
He wants to display each image right after it's downloaded
That's his problem - to loop over images would not fix it
add onLoad events to each
He'll need to place the code which displays the image in the map callabck, which doesn't make sense
ah yes make it even more overcomplicated
that's the event that triggers when the image loads
but he's downloading it with JS
idk i have two methods which i can try. ill mess around with jquery and express and see what works. thanks y'all for your help i rlly appreciate it 🙏
you're looking for
async function* download(links) {
for (let i = 0; i < links.length; i++) {
yield await this.downloadFile(links[i]);
}
}
async downloaded(links) {
for await (const image of download(links)) {
// Display the image
}
}
but no real reason to do this
if your downloads include pagination however, async generators would be incredible
yeah :p ^
What does the function* do?
generator
generator function
I had no idea that was a thing tbh
m2
What are the point of generators?
it's basically an AUTO INCREMENT
it lets you decouple logic
Decouple logic?
does this iterate based on the responses that come back first?
Think of it as lazy evaluation, that's what it essentially is. Loop continues only when you need it to
Yes
for example, if you want code that will, for example, start on page 1 of something and go through the entire thing to do something, you might need to write extra code for it to know when to stop. So you might have something like
for (const whatever of iterable) {
const result = await something(whatever)
// keep going through the iterable... but sometimes there might be a condition?
}
how do we tell this loop to stop given a certain.. stop signal?
function* rng(min = 0, max = Integer.MAX_VALUE) {
yield (Math.random() + min) * (max + min);
}

Thank you! Would it be possible to integrate this into express and display each image inside the loop?
bruh I literally gave you the same code 10 minutes earlier 😭
I still have it haha. Imma use it in a sec when I get back on my laptop 👍
you might be tempted to add if statements inside the loop and that'll work but now you're coupling logic. If this was code that paginates through things like GET /whatever?page=1 and then GET /whatever?page=2 That pagination function shouldn't care when it should stop right?
If you do this with an async generator you can do the pagination and yield control to the caller so they decide when it's time to stop
for await (const page of paginate(rootPage)) {
if (someCondition(page)) {
break
}
}
or you can add delays between requests by just running await sleep(1000) at the end of the loop
tho the craziest part of generators is it lets you write code that could in theory do something like
function* plusOneContext() {
const result = yield [1, 2, 3]
console.log(result) // [2, 3, 4]
}
🤔 yield stops execution
please xet, js is cursed enough without you making voodoo magic
yield doesn't just "stop" execution. It transfers control to the caller
but that console log will never run is what I mean
huh?
you don't know that
the line after yield will run if the consumer calls generator.next()
the entire point of generators is a consumer and producer working together. yield passes some data from the producer (inside the generator function) to the consumer (the thing running the generator). The function resumes when the consumer decides it should resume
what about doing it this way?
function updateDisplay(time) {
console.log(`This image took ${time/1000} seconds to load`)
}
await Promise.all([
new Promise((r)=>setTimeout(() => {updateDisplay(5000);r()}, 5000)),
new Promise((r)=>setTimeout(() => {updateDisplay(4000);r()}, 4000)),
new Promise((r)=>setTimeout(() => {updateDisplay(3000);r()}, 3000)),
new Promise((r)=>setTimeout(() => {updateDisplay(2000);r()}, 2000)),
new Promise((r)=>setTimeout(() => {updateDisplay(1000);r()}, 1000)),
])```
you can change what result is here by controlling what gets passed back to generator.next(). Often nothing gets passed which is what happens when you use them just as iterators
Mmm I think I'll have to look more into this, it seems like something useful to know about
time to npm i promise-cascade
god damn i love making apps with web technologies because you can make it so pretty so easily but the resource hogging 😭
*slaps hood* this girl does 1km per gallon
Assuming it's a girl eh?


close enough
200mb ram
i hate it
I tried using electron with react and failed horribly
How the heck did you get it to work together?
ok this example took me a long time to come up with
function* memes() {
const first = yield
console.log(first) // 0
const second = yield first + 1
console.log(second) // 1
const third = yield second + 1
console.log(third) // "hello world"
}
const iterator = memes()
iterator.next()
next = iterator.next(0)
next = iterator.next(next)
next = iterator.next("hello world")
electron is just a web browser
but this is how it works
you do your react app how you usually would
the only tricky thing is making them communicate
made my life easier by using https://www.npmjs.com/package/electron-better-ipc though
Yea I couldn't get them to communicate well
and made it even easier by wrapping that package in my own class
so i only really have send() and receive() methods on both ends
Thank you! I assume that the pagination would be the best option? Could I do this on just one page for example?
wdym do it on one page?
Is he talking about a SPA?
const arr = [...]
function getPage(i, itemsPerPage) {
return arr.slice(itemsPerPage * i, itemsPerPage * (i + 1));
}
u could set i to be 0 by default, thus always returning first page if none is supplied
uhh
Nvm idk what I was thinking.
I'm mostly thinking I could have jQuery send an HTTP request to /page/url_to_download and have it generate the page on HTML.
I have an explanation of the pagination thing here if ur interested https://xetera.dev/building-a-scalable-scraper/#architecture-and-code
Thank you that's super helpful
does anyone know of any dns hosting providers who support glue records?
cloudflare requires a paid account for that
I think I did not write it in a way that's easy to understand though so I guess read at your own risk lol
i'm doing it through porkbun atm but its buggy af and i can't reach any of my sites using my dns domain, but others can
and cloudflare is failing to find my dns information so i can't even migrate my shit there
This is an interesting article good job on it I'ma give it a better read later myself
ipconfig /flushdns does fuck all
const iconName = os.type() === "Windows_NT" ? "icon.ico" : "icon.png";
my code is full of these kind of ternary expressions because windows is just ✨ special ✨
Does anyone use win8
i've seen people use 8.1
which is justified
8.1 is the fastest version there is
so many apps were highly optimized because the plan for 8 was to run on ARM
how much crap does windows have in its source code tf
well
one day someone will find something akin to coconut.png in it
im just going to tell you that win11 is a skin for win10 which is a skin for win8 which is a skin for win7 which is a skin for vista which is a skin for xp which is a skin for 98
in win11 skinning falls back to previous skinning (if it fails to load or run)
so you end up with vista windows with no aero theme
...inside of win11
ms' reasoning? backwards compatibility
which is entirely bullshit
I really want to move to Linux but I just can't
you could easily update the old APIs to redirect to new ones, keeping the same method signature and taking handling the breaking changes internally
png favicons are supported like everywhere no?
on a browser?
wym
where are you displaying this? Is it not a favicon? I don't think rendering is platform specific if that's the case
oh my god i hate cloudflare support
Thank you for contacting Cloudflare Support. Your plan type grants you access to Support via our Cloudflare Community.
Failed to lookup registrar and hosting information of dbl.tf at this time. when adding dbl.tf as a domain
same here, way too deep in the ms ecosystem, even my school integrates heavily with office and onedrive
it's an icon for a program
same icon being used in the system tray
tried using png, quality ends up being ass
there's no antialiasing whatsoever
if it's because of gaming, pop os has huge compatibility with most games
nah just in general I'm used to windows. I tried Manjaro on a thumb drive and it looks and works good I just can't bring myself to do it cause if I decide to switch to windows I'll have to wait a whole day to install it and it's just a pain 😩
manjaro is arch-based
it's like, not the best "experience" for a first-timer
also u can always just dual-boot it
Well I have experience with Linux in general I just haven't used it for my own stuff, only for servers
Eh I don't see a point in dual-booting in my case I either commit to it or stay with windows
use a windows vm inside linux then 
most people already do 
but anyway, it takes like 30 min to reinstall windows anyway
not as long as it used to be
ironically, that's what our consumers do
https://www.youtube.com/watch?v=GuCLBzzmsoU here's a video worth watching about this topic
Get 100$ credit for your own Linux and gaming server: https://www.linode.com/linuxexperiment
Grad a brand new laptop or desktop running Linux out of the box: https://www.tuxedocomputers.com/
👏 SUPPORT THE CHANNEL:
Get access to an exclusive weekly podcast, vote on the next topics I cover, and get your name in the credits:
YOUTUBE: https://w...
wow my internet just died
they had a ton of issues with viruses and all the shit on the main server, but refused to use linux (btw yes, they also refuse to let the main server be a server instead of a working pc)
the solution? windows running inside linux
they actually use it as and actual pc (like for browsing, using programs, etc)
they believe an "unused" pc is waste of money
wtf
i will never
ever
understand consumer logic
probably because it isn't logic in the first place
ye, also they constantly have issues with the database/services being slow sometimes
I wonder why 
what do you mean our website is slow when i mine coin 😡
dbl tf
used to be a topgg url shortner
now i use the domain for test shit
can't add domain to site, says host lookup error
emails for help
gets told to lookup info myself
just booted up vscode
guess what
i got vista windows
and they skinned to win11 design
lol
this os is a dumpster fire
the only thing they got right about win11 is boot time
I mean, that's mostly because they removed that annoying intro
and the stuff now loads during login instead
Finally, somebody else not falling for this trash I’m complaining about since it’s existence
I think the design is ok, on the same level as win10 just different
BUT WHY THE HELL CAN'T WE DRAG AND DROP IN THE TASKBAR WTF??
Such a questionable choice
what were they thinking
that was supposed to be a bug, but apparently they forgot to fix it
the worst abt w11 is the context menu
FIRST thing I did after updating was changing the registry to return to old menu
nah I don't believe that, that's a huge deal that literally anyone would notice within the first hour of usage
I don't buy it
they did
the said it was a bug that'd be fixed
but wasn't yet, and nobody talked abt it anymore
And a few updates later.... still nothing 🤔
it was intentional
There's literally an X telling you you can't drag and drop when you try
There's no way they'd let such a huge bug slide
Nobody actually gives a fuck about the UI, you love it or not as simply as that
said it was a bug, then backtracked and said it was intentional due to tablet support
yup, there was an article about it recently
I expected more from microsoft
ms removed the system tray from the taskbar and everyone went nuts
no, I lied, I didn't
then they reversed it and made an article about it
dang bro
I wasn't here for like 6 months
and I come back
and I still see you active KuuHaKu
bros had enough of freeloaders asking for help
path tracing lightmaps for 3D meshes with a 1050ti be like
wish I had some ray accelerators
I'm trying to add a category title for each field and then loop through all commands and add those which have the same category that I'm looping
now I haven't used discord.js in a while but I'm sure doing that should return the string, right? how is that undefined
embed field values cannot be an empty string
what are you saying
it's a foreach loop, for each category there is at least one command
I'm just filtering away the ones that don't have the same category
embed.addField(name, condition ? value : emptyString)
That's your code
realistically, even the name could be an empty string
it's not, the embed sends with no errors
Ok, so c2 is undefined
An Array can be filled with undefined
undefilled 
Plus, your code literally shows ${c2} being the value of the embed field. Nothing else could be undefined
they're... undefined....

how?
Log values leading up to it and look at your logic based on the values
await has no effect on that forEach
it doesn't?
the callback returns void, not Promise<void>
if it didn't it would underline it no?
also, forEach doesn't respect await
okay I understand, how else am I supposed to write this then?
it's not undefined, finalCommand for some reason doesn't push to the array
it shouldn't be undefined
log everything then
as you saw the finalCategory push worked, finalCommand didn't
I don't need to log anything because I fully know what everything is doing now
what I don't know is why it doesn't push the array
Then can you explain what is causing the undefined
better use TS 🤔
If you cannot explain why something is happening, then you don't have enough info
I don't know?? I've sent all there is to my code
you can use breakpoints in vscode to check values at runtime. Of course, this requires running the app through vscode
It'd require you to type annotate just about everything
i think i did something wrong
need to fall back to a 26x26
now you know that it's not undefined
You should try to avoid to repeat the same field title over and over again and sort them all under the right title
It was never a thing to begin with
message.author returns a user object, users don't have permissions members do. You'd want to end up using message.member instead
yeah I just realized that
ERROR Unhandled rejection: DiscordAPIError: Missing Permissions
in my ban command, I check for permissions to ban, but the cause of this is that it can't ban members with the higher permissions, how do I fix this?
Mmm one method is you can check if the member you are trying to ban has a higher role then the person banning.
If their role is higher they can't ban them
the lower roles could also have more permissions which is when I would still get that error popping up in the console
Check if they have admin or the ban permission ig
how come does this still give me the error
perhaps something else is causing it???
Okay well why are you using a try catch if you aren't going to do anything with the error
as an easy way out, I already made an error handler so I don't actually need that
Also it could be an issue of the client not having the right perms to ban
which discord.js has a handy prop on the member object called bannable which checks if the client user can ban the user
I have a permission check just a above all this code
oh didn't know that
is it just member.bannable?
if member is the person being banned then yes
const member = message.mentions.members.first() || message.guild.members.cache.get(args[0]) || message.guild.members.cache.find(r => r.user.username.toLowerCase() === args.join(' ').toLocaleLowerCase()) || message.guild.members.cache.find(r => r.displayName.toLowerCase() === args.join(' ').toLocaleLowerCase());
this is what defines my member variable
ok
@sharp geyser I do assume there is an opposite of ban which would be the unban
how do I achieve that? client.users.fetch?
You can use GuildMemberManager#unban
Look at the docs
I made bots back in 2018 I just started making them again
can you send me the docs or give an example or anything that could help me
what is guild?
it doesn't explain the definition of that
and it is not predefined
...a guild?
guild is just a placeholder, indicating that it's a instance of the Guild class
👀
await your promises
Also when using fetch as first and trying to get the user from the cache when it fails, that won’t make sense
fetch is something you'd wanna do last from my understanding
fetch does search the cache before requesting the api
Well he dont need fetch and cache
Mmm, but if it isn't in cache member will be undefined no?
Either you wanna take something from the cache (only) or by using fetch you search the cache as first and if no result was found you force an api request
Yeah lot of people forget about that
ERROR Unhandled rejection: DiscordAPIError: 404: Not Found
const member = client.users.fetch(args[0]) || args[0];
if (!member) return message.channel.send("Could not find the member.");
try {
await message.guild.members.unban(member).then((member) => {
return message.channel.send(`:wave: ${member.user.tag} (${member.user.id}) was unbanned in this server by ${message.author.id}`);
});
} catch (e) {
if (`${e}`.includes("Couldn't resolve the user id to unban.")) {
try {
await message.guild.bans.fetch().then(bans => {
bans.forEach(banned => {
if (banned.user.username === member) {
message.guild.members.unban(banned.user.id);
return message.channel.send(`:wave: ${member.user.tag} (${member.user.id}) was unbanned in this server by ${message.author.id}`);
}
});
});
} catch (e) {
console.log(e);
return message.channel.send('I do not have the permissions to unban that specific person.');
}
} else {
console.log(e);
return message.channel.send('I do not have the permissions to unban that specific person.');
}
}
what's wrong? :/
The <Client>.users.fetch() method returns a promise, resolve it
Isn’t that what flazepe already said?
Sometimes it takes 2 people to finally get something through to people
Yeah, they don't seem to either understand I suppose 
also that forEach wont be caught by the try catch
I already have it didn't help
if you already had it why did you remove it
wanted to see if that was causing the issue
if I have no idea what's causing it I have to trial and error until it works
You didn’t await the first fetch
Means the member will be the argument
Probably just a mention
Which is no valid member resolvable
Therefore it fails
if (!member) return message.channel.send("Could not find the member.");
try {
await message.guild.members.unban(member).then((member) => {
return message.channel.send(`:wave: ${member.user.tag} (${member.user.id}) was unbanned in this server by ${message.author.id}`);
});
} catch (e) {
if (`${e}`.includes("Couldn't resolve the user id to unban.")) {
try {
await message.guild.bans.fetch().then(bans => {
try {
bans.forEach(banned => {
if (banned.user.username === member) {
try {
message.guild.members.unban(banned.user.id);
return message.channel.send(`:wave: ${member.user.tag} (${member.user.id}) was unbanned in this server by ${message.author.id}`);
} catch (e) {
return message.channel.send("I do not have the permissions to unban that specific person or that person doesn't exist or was not banned.");
}
}
});
} catch (e) {
return message.channel.send("I do not have the permissions to unban that specific person or that person doesn't exist or was not banned.");
}
});
} catch (e) {
return message.channel.send("I do not have the permissions to unban that specific person or that person doesn't exist or was not banned.");
}
} else {
return message.channel.send("I do not have the permissions to unban that specific person or that person doesn't exist or was not banned.");
}
}
well this is my current, very terrible code
still doesn't work and Tim made me even more parandoid
Now you cut off where member is defined

Which is still missing the await on the fetch
I have no idea what you're trying to tell me
WHERE
I'm getting 404: Not Found error
You have way too many try-catch blocks for no reason, I would rewrite it for you but that's just spoonfeeding
does that ever happen 
const member = …
please do I'm too tired
it's literally 3 AM
it is awaited
It’s not in here
sorry but voltrex is already spoonfeeding me /s
well you're not the only one who needs to be spoonfed today
This is a joke
I accidentally didn't include it here, but yes I have added the await on it
I know
Voltrex just makes my shit code that works better

Didn't you just have a session with tim last night?
🤔
I would love to hear you say that again when I transfer you to a better place when I detonate those bombs in your car and house
That was a private session 

Didn't you have to rewrite your code like 4 times after tim pointed out your performance issues
I bought Tim for 1000 bucks means I can abuse him as much as I like to
He said 1000 is enough
so like I'm still waitiing :c
I've promised to not spoon-feed someone much, but okay I'll do so just for you; this time
thanks 
Voltrex make sure they understand what is happening if you actually do spoonfeed
spoonfeeding without learning is useless
I feel like I've won at life right now
you could add // notes but I feel like I would learn what I need even if it's spoonfed
you have a general idea of what it's doing and when you recieve the code you go through it and make your own changes that's how you learn
I somehow doubt this when you don't understand how async/await works
I do, I told you I haven't used JS much lately
so @earnest phoenix how's it going?
I wasn't expecting you to write anything large, just show me how to make it work
I am...
Your code is a horrible mess, so give him a few minutes
I wrote it this badly because of what Tim said
all of my other scripts are written much better, neater and with much better syntax
if you saw how I program things in Java and c# you'd be surprised
you didnt pay tho
:^)
because you're writing it wrong
your entire code can be greatly simplified if you stop mixing await and .then
just stick to await
Shut up bitch and clean my floor, I payed for it 
and remove all .thens
where money
After cleaning the floor
money first
:P
who's fault is that 
Anyone know why the Java SDK suddenly can't be found when I try to find it via maven? https://upload.livaco.dev/u/YRyXjMSUTD.png
yours?
why is everybody saying that
You can't push the blame onto someone else cause you can't write code
I mean there is a lot I find fault with js but you are just using it wrong that is that
I wrote it like that because I had no other choice
we'll see what Voltrex does
yeah but before you told me that
what did i say?
there is no point in using .then when using await as far as I know
to add await and that the try catch won't work
so I added more of them
and more awaits
👀
i didnt say to add more .thens
I wanted to tell you that
I meant the try catch statements
I only added 1 more
of then
because I needed to
you didnt
You can chain Promises with .then such as request.get(url).then(r => r.json())
I'd ask my question about using glob here but this guy is the prominent topic rn so I will wait
if you use async await syntax everywhere, you only need one trycatch for everything
😮
and if you want to catch separate errors differently, you can use a null then combined with an if
I'm scared of what Voltrex is writing
He’s probably crazy enough to write it on mobile, so.. be patient
await application.addMultipleIn('routes/**/*.ts')
addMultipleIn keeps returning an empty array when trying to look in the routes folder for ts files. I haven't used globs before but this seems to be how you'd do it
I might be wrong tho
oh, then I shall
I know how tedious that can be
// Before all of this, check if the client has the `BAN_MEMBERS` permission, as that permission is required to unban a banned member.
if (!message.guild.me.permissions.has('BAN_MEMBERS')) {
await message.reply({
content:
'I need the `Ban Members` permission to unban a member.'
});
return;
}
const arg0 = args[0];
const member =
// Fetch the banner member by ID using the first argument.
await client.users.fetch(arg0).catch(() => {
// If the client has the permission to manage the server, get the member by username or tag from the banned members list.
if (message.guild.me.permissions.has('MANAGE_GUILD'))
return message.guild.bans.fetch(arg0)
.then((ban) => ban.user)
.catch(() => undefined);
// Otherwise return undefined
return undefined;
});
// If the member is still not found by their username or tag, return and do something.
if (member === undefined) {
await message.reply({ content: 'Member not found.' });
return;
}
// Try unbanning the banned member
try {
await message.guild.members.unban(member.id);
// Clarify that the member has successfully been unbanned.
} catch {
// Clarify that there was an error unbanning the banned member, probably a permission error or something from Discord's end.
}
My god
What is the difference of doing if(member === undefined) instead of if(!member)
I can't believe how well written this is
really nice thanks



