#development
1 messages · Page 1533 of 1
Well Superbrain8 is gonna write my bot for me soon so I'm good for now
x doubt
i have to write a bot?
Yes
where did i agreed to it?
i just said i want to know what you have in mind?

right here
Even if you did you can still say "no" 😂
since there is still no answer i havent agreed in any way
you don't have to explain yourself, just block them and move on
I want you to write an AI bot for me
will be quite expensive for you
charge extra for being annoying
Oh yeah the "Karen charge"
lol
I want you to write a Voice AI Bot that you can talk to in a voice channel
150$/hour or nothing
and it will feel like you're talking to a human
jarvis bot
It's been a dream project for me
For you
Yes
This isn't a channel for asking people to write you a bot. Go to fiverr or something
I'll give you $5 to shut up
grabs Dialogflow API and throws into a bot, then collect money
Stonks
$5 to shut up? deal
[insert ads for a bot making company]
You just gave me a great idea Lumap
It'd be good to put ads in the bot
so I can make money off of it
Ads
lol how to get your bot removed within a day 101
if you throw ads into a bot People will kick the bot relatively fast
yeah ok
ive named you a price
40-80 Hours
Are you even a Certified Developer? like @quartz kindle ?
Until minecraft 2 releases
did i have the role?
you agree to the price?
if yes i have to contact my lawyer to make a work contract
One message removed from a suspended account.
lol
wtf
still thinking its a joke
One message removed from a suspended account.
Why do i smell scam here
How can I edit a webhook using the discord.js WebHookClient? (Can't seem to find the docs on it)
One message removed from a suspended account.
This guy isn't being serious right?
this is why i call my lawyer for the contract, if he doesnt pay i can legally get him
Just a troll, ignore him.
bro you're literally in a racing game 
That's 5head
yes I was playing earlier
5 head indeed
let me know if u wanna play
One message removed from a suspended account.
Seems like some random dude looking for attention 
we can work out the details
I'd prefer if we went to DMs to avoid all these people
This guy is speedrunning to get fully spoon-fed by other devs, telling others to make a "Voice Chat AI bot"
I'm waiting for the 5 bucks btw
told you a price and you agreed, if you want to negotiate more i will refuse
You're not getting $5 because you've failed to shutup @cinder patio
It's apparently his dream project to have someone else create an AI bot for him
can ya'll like not
One message removed from a suspended account.
I'm not negotiating, buddy
cant do everything on ur own
maybe 1 day u will realize that
You expecting it for free
?
no
Take it to DMs
im gonna pay the guy
after we work a contract with his lawyer
as he wishes
🗿 Inb4 mute
^^^
yes sir
async function getWiki(query){
var link = await google((query + ' wikipedia'), ['wikipedia.org/wiki']);
if(!link.length) link = await duckduckgo((query + ' wikipedia'), ['wikipedia.org/wiki']);;
if(!link.length) return null;
var url = link[0];
const html = await axios.get(url);
const $ = cheerio.load(html.data.replace(/b>/g, 'b>**').replace(/<i.*?>|<\/i>/g, (elem) => elem + '*'));
var text = $('.mw-parser-output p:not(.mw-empty-elt)').first().text();
if(text.includes('Coordinates')) text = $('.mw-parser-output p:not(.mw-empty-elt)').eq(1).text();
text = text.replace(/( \(\*listen\)|\[([a-z]|[0-9])*?\])/g, '').trim();
var thumb = $('.infobox img').first().attr('src');
var title = $('.firstHeading').text();
var footer = $('#footer-info-lastmod').text().trim().slice(14);
if(thumb) thumb = 'https:' + thumb;
if(!thumb) thumb = null;
return {url, title, thumb, text, footer};
}
did i do it to much?
it takes 5 sec to get the article
Yes I think you did it too much
if I'm being honest
You don't even know what that is 
oof
What do you mean?
here's the result
hmmm
So are you trying to return the wiki of a single query?
yes thats weird
how can i make it faster
hmm should i do that for all the thing
I'd say just for the getWIki method?
It should be pretty obvious which line is taking so long
You could also do it like a real man and print to console every line LOL
Either way will work I'm sure
your webscraper is what is so slow
Does Wikipedia not have an api
You have a few issues, mainly that you're parsing the entire page instead of just using the Wikipedia API. It would be much faster for you to get data using the API https://www.mediawiki.org/wiki/API:Main_page
I can't believe you tricked me like this
Using cheerios is inherently slow
Then why'd you stop?
hmmmm
should give you better results
I prefer corn flakes and fruit loops. 
Good one
or at least a better flavour
Very funny guys
:^)
corn flakes with rice milk <3
Can anyone tell how can we make economy bot
By using a database
with a database and some math
You need to learn how to make a basic bot first, Mr. SneakyCat
Which I highly doubt you know how to do
From where
do you have any coding experience? ever tried making a bot before?
Anyone got any opinions on okta?
You probably need to learn how to program first
Which I highly doubt you know how to do
I've come to the realization that a lot of the people who ask for help here
They don't know how to code and want to make something way beyond their capabilities
Yeah especially those that demand other people make the bot for them, those are the worst types of noobs 
Exactly
welp ur right
Which documentation I am new
Learn a programming language first
I wonder who she is pointing at
do you have any coding experience? ever tried making a bot before?
JavaScript is a programming language that adds interactivity to your website. This happens in games, in the behavior of responses when buttons are pressed or with data entry on forms; with dynamic styling; with animation, etc. This article helps you get started with JavaScript and furthers your understanding of what is possible.
If you don't know any programming I'd recommend javascript. <#development message> for links to useful guides and tutorials.
Ok Ty all
The noobs who don't know how to code
Read the convo before talking
Ok
"Those that demand other people make the bot for them" you?

It's not demanding if I pay them
Can we keep non dev help conversations out of this channel 🤔
It's conversation about help developing my bot
Can you explain how you came to the wild conclusion that that's not dev help related
This channel is not for hiring developers
I'm not hiring anyone
They will help me with my bot
and I, completely unrelated to the bot help, will give them money
There is another error with sqlite3 npm installation
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
This might be crazy but maybe
I already did
say it
That it could not find any Visual Studio insallation to use
One message removed from a suspended account.
i havent really done subdomains before, is this how id do it?
One message removed from a suspended account.
One message removed from a suspended account.
Can you show me the IPs so that I can make sure it's right?
I installed even these
no
ok
i dont think its a good idea to show the ips
One message removed from a suspended account.
its the ip for my vps
yes
you're right that was just a test
One message removed from a suspended account.
what is it exactly
One message removed from a suspended account.
One message removed from a suspended account.
U passed the test so can u show me now?
How can I do it?
-_-
@earnest phoenix I'm going to remind you once again to please keep the channel on topic and to be nice to people
My deepest apologies Mr. Pasta it won't happen again
Is <Set>.has() is faster than <Array>.includes()?
yes
Most likely
Oooh! How much?
Probably depends on the size
Think of it like this, to find an element in an array you have to loop through the entire array where as sets include addresses to each element in memory.
Such as 99k times
Considering both have same amount of elements.
not sure about the specific implementation of Set, but im pretty sure Set .has() is o(1)
array.includes is o(n)
Worst case scenario for an array is that you have to loop every single element to find the one you're looking for
Good evening someone would already use the pkg module could help me?
So, what if I store number literals in sets. How it will compare the memory locations. As checking for a number in a set creates a new number literal
anyone help please?
Whats the o(whatever) actually called.
I understand what it just means operations = whatever to do a task, but never have properly learned about it.
BIG O NOTATION
I'm not too sure, there's probably somewhere you can read on it. Keep in mind that Sets can not have duplicate values though.
@rocky hearth 99k calls comparison
1- Array.prototype.includes()
2- Set.prototype.has()
<Set>.has() is just a little faster
🤔 that's not too much though.
Thanks
and since it's o(1), that speed will not change iirc
there is a huge difference between array and set
the position of the item in the index matters
Wait, am i tripping or <Array>.includes() is actually faster
Array - 25 chars
Set - 26 chars
Arrays are faster to loop through because of the way they're placed in memory
items in sets are hashed and indexed. every item has a uniform access time
arrays are stored in indexes, and any operation besides direct index access requires a full scan
I think it's a bit faster to add elements onto a set than an array too right?
to add new elements to an array u need to create a new array and copy its contents
^^
no
no?
You don't
array is faster to add items
but
only if adding at the end
not at the beginning
or at an arbitrary position
uh yes
i actually benchmarked this when making my FTSet lib
like where there's a gap in the array?
Push is O(1) yeah?
yes push is o(1)
yeah
unshift is not
Ah, I see
unshift is something like o(log n) or something
math™️
Bro, quik mafs
adding items to sets is like adding items to an object, there is no concept of index position, they are stored as hash keys under the hood
with arrays the position matters
O(1) = operation takes 1 amount of time
O(n) = operation takes N amount of time depending on N number of items
const timeTaken = 0, a = Array(100000).concat("##########")
for (const i of a) {
a.includes("##########")
}
console.log(`Time taken: ${timeTaken}ms`) // Time taken: 0ms
``` easy faster js now
Lol
performance.now() is obviously the reason why it's showing high numbers
O(log n) isn't bad is it? Obviously not o(1) good but not the worst.
as close as you can get pretty much
then i meant the wrong thing
lul
i meant exp
or n²
not sure which
array.unshift() gets STUPID slow
as the amount of items increases
unshift is O(n) isn't it
Why not
coming from tim
lmaoo
the way it ramps up is just stupid
wdym
but I use for...of with everything 😅
Wtf
Do you have these numbers posted somewhere tim
idk either
for (const i of 10) {
console.log(i) // 0,1,2,3,...
}
``` 
Pog
LOL
LOL not like that
i've actually extended the number prototype just so i can do that LOL
it's so fun
how to do that?

implement the iterator protocol on the number prototype
for (const i of Infinity); is the new while (true)
omg
is it ok to do like that?
yeah 100% cpu is fine

leave me alone i want to be different
in fact, for(;;) is the recommended way to do infinite loops, according to ESLint
ESLint is ballin
doesn't while(true) just halt the process basically?
yes
poggers
until you break it from inside the loop
xD
while(true){ if(Math.random() > .99) break;}
what about negatives?
i've also went out of my way to support negatives too
just about to say that lmao
lmao nice
i never actually iterate through negatives but it's just nice to have little details like that
my versions probably not as efficient as it could be but who cares 
lmao
one sec
how the fuck did you iterate a number
Imagine
while (true) /* If bogo sort succeeds to sort an array with 69420 elements */ break;```
The real challenge
xD
bogo sort is o(no)
O(?) best O
bogo sort is the fastest, and the slowest sorting algorithm at the same fucking time
and I like it
Object.defineProperty(Number.prototype, Symbol.iterator, {
value: function* () {
if (isNaN(this)) throw new TypeError(`${this} is not iterable`)
const f = i => this > 0 ? i < this : i > this
for (let i = 0; f(i); this > 0 ? i++ : i--) yield i;
},
writable: true,
configurable: true
})
"In average, it runs in O(n*n!)"
In computer science, bogosort[1][2] (also known as permutation sort, stupid sort,[3] slowsort,[4] shotgun sort, random sort, monkey sort, bobosort, lawn_gnoome sort or shuffle sort or derp sort) is a highly inefficient sorting algorithm based on the generate and test paradigm
i like the nicknames
if I ever get an interview I will be doing a bogo sort
I should use bogo sort for my uni project
set timeout sort is the best sorting algo
async sort
if some sorting algorithms are so much better than others, then why does array.sort() not use it?
Speaking of bogo sort, bogo sort more like big o notation of yandere simulator's code
lol
array.sort uses many of them
because not everything is javascript 
they dont learn them to use in js
cringe not using js
That code could be slightly optimized
generator functions is just sync async
it's like 8 months old at this point lmao
yeah it can
just looked it it xd
i've never actually used generator functions
they do look nice
a pitty they are a bit slow
generator functions?
like, slow in general or just slow if you actually yield
slower compared to the non generator alternative
by aobut 15-20% i think
last time i tested
function sort(arr) {
let sorted = false;
while (!sorted) {
arr.sort(e => Math.random() - .5);
for (let i = 0; i < arr.length - 1; i++) {
if ((arr[i] ?? -Infinity) > (arr[i + 1] ?? Infinity)) {
sorted = false;
break;
} else sorted = true
}
}
return arr;
}```
there we go
i tested generator functions on FTSet and the performance was about 15% worse when iterating
Tim rate my code
ur code sucks
lmao
omg
thats basically a bogosort implementation
ye
cringe not using c++
idk c++
idk js
pog
||(in reality i know both)||
Lol no
y not
client.shard.broadcastEval(`if (this.shard.ids.includes("0")) (process.memoryUsage().heapUsed / 1024 / 1024)`).then(console.log);
```Why does it gives [null]?
for generators, it is necessary to return?

you didn't return
cross-posted question and alr answered
client.shard.broadcastEval(`if (this.shard.ids.includes("0")) return (process.memoryUsage().heapUsed / 1024 / 1024); else return false`).then(console.log);```
o it was?
yes
lol xD
no excuses now
you return the last item
if its not the last item yet, you yield instead
how2yield in js?
which one?
in c# it is just yield return item;
bogosort? xD
no
2**51 better
yeah, but is it mandatory to return when we have finished working with that generator?
2**64 - 1
not sure, test it
it will probably return undefined as the last item or something, unless its smart enough to detect it
Error [SyntaxError]: Illegal return statement
will I have to go to jail xD
yes
smh
ur shaking ur head too much
[] do u mean those?
no
@grizzled raven
How about this?
Object.defineProperty(Number.prototype, Symbol.iterator, {
value: function* () {
if (isNaN(this)) throw new TypeError(`${this} is not iterable`)
const sign = Math.sign(this), upto = Math.abs(this);
for (let i = 0; i < upto; i++) yield i * sign;
},
writable: true,
configurable: true
})
operator[] :)
{}?
if(a) { bla } else { ble }
boring
function*
pointer in JS???
its the syntax for a generator function
nah jk that's nice
another dissappointment for me :(
tim go benchmark the two and see which is faster 
xD
what do pointers to
not js stuff? 😅
point to an address in memory
^
which by default, js has for every object. Right?
not really, js manages memory differently
client.shard.broadcastEval(`if (this.shard.ids.includes("0")){return (process.memoryUsage().heapUsed / 1024 / 1024)}`).then(console.log);
``` same error
pointers are a low level language thing
with manual memory management
js has automatic memory management, it has no pointers
oh lol
should I exclude return?
well it's fine ig, but i still prefer manual mem management, since it's fun
I could use tenary operator
in C++ you shouldn't even use raw pointers - there's shared_ptr and unique_ptr
with manual memory management you can tune it a bit finer than just having some stuff doing it automaticly
they're still called pointers though
client.shard.broadcastEval(`this.shard.ids.includes("0") ? (process.memoryUsage().heapUsed / 1024 / 1024) : null`)
``` this does not work too , even when I await it
@rocky hearth your version takes avg 8ms to complete 99999
@grizzled raven yours takes avg 25ms to complete 99999

Wooohooo!
what about 2**64 - 1?
no
pls test it on even 1 thread on ur cpu
lmao
no
i'm guessing that max int
yeah it is
lmaoo
well 2**128 - 1 on compiled langs usually
@quartz kindle How about this
Object.defineProperty(Number.prototype, Symbol.iterator, {
value: function* () {
if (isNaN(this)) throw new TypeError(`${this} is not iterable`);
if (this > 0) {
for (let i = 0; i < this; i++) yield i;
} else {
for (let i = 0; i > this; i--) yield i;
}
},
writable: true,
configurable: true
});```
Faster than i expected
15ms
how can a number be not a number?
lmao
y 15ms, it should be even more faster. Isnt it?
Yes
yeah sure
Inb4 0ms
ruining all my fun 
i like these, coding challenges. We might do this more often. Tim can be our mentor. LOL
lmao
i should probably change mine to the faster one but that's admitting defeat
@quartz kindle would converting this to primitive in advance be faster?
Why do this when tim always gonna come out with a faster one 
Tim might be coding in binary.
would use rust or C to get the fastest code
just code in assembly
another factor is how you wrote it
not bad i guess
I still remember generating an array between 0 and N then reducing the whole thing to multiply
that was slow on large numbers
isnt that just factorial?
yes
show the code tim?
Object.defineProperty(Number.prototype, Symbol.iterator, {
value: function* () {
const n = this.valueOf()
if (n !== n) throw new TypeError(`${this} is not iterable`)
const sign = Math.sign(n), upto = Math.abs(n);
for (let i = 0; i < upto; i++) yield i * sign
},
writable: true,
configurable: true
})
``` this is all i got 
n !== n probably isn't even necessary lol
yield i * sign
but y u did, this.valueOf() stuff
i tried optimizing it more, but most things are pretty irrelevant now
try without the if statement
so a simplified version is this
because looping NaN would just loop nothing
Number.prototype[Symbol.iterator] = function() {
if (isNaN(this)) throw new TypeError(`${this} is not iterable`);
let o = this.valueOf();
let inc = o >= 0 ? 1 : -1;
let i = 0;
const next = () => {
return { done: i === o, value: i += inc };
};
return { next };
}
which is better?
o >= 0 ? 1 : -1;
or
o < 0 ? -1 : 1;
or
Math.sign(o)
hm
third one ternary is slow
"third one" - so he might be refering Math.sign(), to be slow
Ternary being slow is probably not an issue.
But Math.sign is preferable it's basically what you want already done for you
I thought he meant this
guys
I did mean that
what
does it contain an invite link?
const Discord = require('discord.js');
const got = require('got');
const client = new Discord.Client
exports.run = async (message, args) => {
try {
client.guilds.cache.forEach((guild) => {
guild.channels.cache.filter(chx => chx.type === "text").find(x => x.position === 0).createInvite().then(invite => {
let embed = new Discord.MessageEmbed()
.setTitle(guild.name)
.addField('ID:', guild.id, true)
.addField('Verifiziert:', guild.verified, true)
.addField('Region:', guild.region, true)
.addField('Owner:', guild.owner.user.tag, true)
.addField('User:', guild.memberCount, true)
.addField('Invite:', 'Invite link' + invite.code, true)
.setColor(0x00FFFF)
.setThumbnail(guild.iconURL())
message.channel.send(embed)
})
})
}
catch(error){
console.log(error);
return message.channel.send(message.client.errormessage)
}
};
The code isnt working but there is no error
what's the expected X actual result?
idk this is a code that i wanted to try but it isnt working
i expected that he sends an embed, but nothings happens, literally nothing
try putting console.log("Hello world") in the beginning of that command to see if it's being reached
when u use broadcasteval to get ram, will the ram be outputted on a specific sort
or it will be sort on the first one?
bytes iirc
same xD ram mb * 1024* 1024
btw, just as a note, that'll get u banned from top.gg if you can create invites at will
but, some bots on top.gg have backdoors xD
interesting, tell us more
sure, and we cant detect hidden stuff, but if found out, the bot will be removed.
im sure there are tons of bots which break discord tos and discord cant really do anything to find them either 🤷♂️
okay i will delete the command
doesnt make it okay.
yes, thats the thing xD, but when u just have the command, but you do not use it, is this allowed?
pretty sure making stuff that is against discord tos is still a violation of tos, even if never used.
youd have to ask discord about it
I have something like that (Request support), but the user must consent for the invite to be created
oh, were are this stuff wirtten? I want to read more, give my bot a full check
else the command simply says "That server didn't request support"
@cinder patio @rocky hearth @lyric mountain @sudden geyser i did 1 billion iterations comparing ternary with Math.sign and the results are inconclusive
you should disclose the invite being created before allowing them to run the command.
if anything ternary was like 1% faster
and the authorization is for a single-use, 10 minute invite which is only created once
I'd still use it
this is the primary dev tos https://discord.com/developers/docs/legal
https://discord.com/developers/docs/policy
any idea, tried all your suggestions
a billion...
theres also the user tos and user guidelines as well, which devs must follow.
I just think comparing things like how fast ternary is vs. a function call for math is trivial
I think ternary is faster because it's hardcoded within the language itself
like, it's optimized to the root
I cannot install sqlite3 as npm package. I have latest version of VS Code and Visual Studio, Also I have python installed and it's in path
the error still says you dont have visual studio
but I still say I have
guys I am trying to collect all the reactions and then printing after the collector has ended. How can I get from the collection?
if(reason == 'time') {
msg.channel.send('Didn\'n respond in time');
return;
} else {
this.reIntializeTopClans(collected);
return;
}```
There it is
it's like comparing a car to a carpet
okey?
lol, everyone muted/blocked me xD
no
it says missing any windows sdk
I know okey sorry
that's vs
and?
btw, why do you need vs to install sqlite3?
idk
open admin powershell again, and run npm i -g windows-build-tools
and show what happens
I tried this before but I will try this again
okay, I will try asking here tomorrow 😁
also try restarting ur pc
what does it output?
okay
What if we compare ternary operator to if-else (with a single expression)
if-else is slower
the -ary operations are simpler than other operations, so they tend to be faster
last time i checked, there was no significant difference between then
pretty sure they get compiled to the same instructions
yeah, there's that too
hmmmm interesting
it doesn't work
that takes long xD
why might this throw missing ) after argument list
<% patterns.recent.slice(0, 2).forEach(pattern => { %>
<div class="col-6">
<div class="container card p-0">
<div class="content">
<h2 class="content-title">
<% pattern.name %>
</h2>
<p class="text-muted">
<% pattern.description %>
</p>
<div class="text-right">
<a href="#" class="btn">Download</a>
</div>
</div>
</div>
</div>
% }); %>
oops nvm
just realised why
Silly
smh cutie 
i told you to show us what happens
show a screen shot of the window
when you run that command
never
wats the answer?
discord.js
Im using this to count total people using my bot```js
message.client.guilds.cache.reduce((acc, guild) => acc + guild.memberCount, 0)
The other day it was at 14k but now its returning NaN. Anyone know whats wrong with it?
one of your guilds has no memberCount
that can happen if a guild is unavailable when you start the bot
memberCount will be null
you can use guild.memberCount || 0 to avoid this
Thank you!
when I am doing it on const pfp

okay, i have some ejs that iterates through an array and then renders out some html
<% JSON.parse(patterns.recent).slice(0, 2).forEach(pattern => { %>
<div class="col-6">
<div class="container card p-0">
<div class="content">
<h2 class="content-title">
<% console.log(pattern.name) %>
</h2>
<p class="text-muted">
<% console.log(pattern.description) %>
</p>
<div class="text-right">
<a href="#" class="btn">Download</a>
</div>
</div>
</div>
</div>
<% }); %>```
this is what it outputs
@pure lion what do i do with 7 million of you
help all 7 million until one remains
im the first of many
i did something very bad 
on a scale of 1 to 10 how bad is it
so yeah any idea why it doesnt render out the text?
i can trade you for about 7 doge coins
7million Dice's to squish
squish noises
which is worth 6 cents of usd
no, give me Dice
how dare it not be 7
xD
how can i give an <a> a dynamic href with this
what is your domain?
fluidd.club
you dont need the a record for this
then the subdomain would be fluidd.club.fluidd.club
a pretty cool subdomain
then how do i make a subdomain?
yeah
Hi
same for node and panel
so are my records all good?
A records with name subdomain and content is where the subdomain points to
no you dont need the A Record for fluidd.club
thats my root domain
also not sure if you need all the CNames
think of it as an @
yea but its handled on another level by cloudflare
every A record you make is a Sub Domain
cloudflare does it kinda weirdly 🤔
lol
they just label root as the domain itself for some reason 🤷♂️
yeah
yeah its right 
would still use a CName for it, looks better imo
mk
but isnt it supposed to be an a record?
yes
did you point them all to the same IP?
yes
nginx can do it.
you can use vhosts to point the domains to one of them
Yep
i have no idea how to do that 😆
how can I put a bot instead of online dnd?
I use discord.py
I used server_name
I just literally let nginx do all the work, my DNS setup is very minimal.
nice domain 
¯_(ツ)_/¯
+_+
wish i knew how
I just showed you
nginx is worth spending the time to learn
its a bit hard if you dont know how exactly
point domain.ext, *.domain.ext , www.domain.ext to your VPS's IP address
and that's pretty much it
really? thanks!
he wants to know how to configure nginx i guess
what is going on?
guys, please help me:
how can I put a bot instead of online dnd?
I use discord.py
i didn't say that and the "bot"
I Have A Problem
he probably uses a webhook to immitate you
remove the 3rd one
or rather
the content
though that UI is different than my interface
but it's like... if that's supposed to be subdomains, the last one doesn't make sense
how can i structure a mongo query to search multiple fields and get all documents that the search queries for are returned? e.g query field tags and field names for the string "hard", if either field matches then the document is returned regardless of whether the other fields dont match (hope that makes sense)
also how can i query if one of the fields is an array
nginx is a pain in the ass to learn, but man, you'll have one sweet ass after that
^this, nginx has made my life so much easier
setting it up is a pain in the ass
but once its up and you know what you're doing, you are speed
idk why my stuffs not working
nginx is pog
also it's nice that all you have to do to save ur settings is backup a couple files
@blissful axle i think we’re going to have to restart
You can always go for Caddy instead if you don't need nginx's more advanced features
i wish i could pay someone to set it up
Configuring it is easier, and it gets certs automatically
okay so i have const found = await Upload.find({name:query, tags: query});
its meant to query the db with those conditions
but it doesnt get it on an either-or basis; its a narrow search
i want it to search the collection and if at least one of the fields match its included in the returned document array
hey how do i get the object length?
and select a certain object?
like !show 3 would get the "name" key in object 3
objects have no length
select a certain object
that entire thing is a single object
you're probably thinking of properties
The Object.values() method
returns an array of a given object's own enumerable property values, in the same order
as that provided by a for...in loop. (The only
difference is that a for...in loop enumerates properties in the prototype
chain as well.)
ahh yes finnaly ive got a Nginx server as a proxy for my API running, not as hard as it sounds if you know how
yeah probably @earnest phoenix thanks!
anyways, i got something else...
import Pokemon from 'pokemon-images';
^^^^^^
SyntaxError: Cannot use import statement outside a module
wht are you using an es6 import over a bunch of es5 ones
@frigid galleon
a
would this be right?
Bro
Question : How Would One Make an Image Link Scraper for discord channels that then puts the links it's Scraped into a Json format in a .txt file example( "", "", "", "", ) ??
ok, let's split that question:
How to make an image link scrapper
you need to use a regex to match specific url patterns (note that discord CDN images are volatile)
Put them into a json format
you just need to store them in a json array, which is basically a normal js array with.toString()
In a .txt file
if you're gonna store a json, use .json (windows can fck everything, especially text files)
I'm on mac, I'm just trying to Pull All images from a Discord Channel with a Certain command and then have the bot put them into a json format of "", so I don't have to copy all the links and do it manually😂 I'm taking the Lazy-ish Route
Why does it don't want to go out of the loop ? after the loop, it does like if the command never happened...
Does anyone can help me ?
https://mystb.in/SuspensionElectroFifteen.python
PS : when I replace all infos I have in my line n°38 by "blah blah" it works
regex is the way
this is the way
do you now the wae?
perhaps
There's a Wayyyyyyy Easier way to getting Guild info than what you have written btw...
tell me how pls
btw, is that an owner-only command?
yeah, only me can use this command
Is it Displaying Bot info?, Or is it a specific guild info?
it is displaying all guilds infos. Their member count, number of channels and the owner
ahhhh i thought it was a Specific Guild info,
no... but anyone is able to help me ?
does the print methods send anything in ur console?
nope... not the one at the 40th line
no error?
it never go out from the loop. It stop here and do like if it never happened
no, not any error
put a print(f"Entry {x}") inside that loop
see if it prints forever
or prints nothing at all
hm
comment that line out
put one that adds only normal text to the description
like, without {}
see if it finishes
I'm guessing you're getting nullpointer somewhere there
it works if I do that, I tried with just "blah blah" and it printed that in 59 differents lines
@lyric mountain
ok, you'll need to check whether the guild is null or not
uh
what is this doing?
you know list comprehension is a thing
put it inside the loop, if the guild is not null append to the description
Pain
else either don't put anything or put "Guild XX is null" or something
Let me make that easier gimmie a sec
it looks like you want each guilds name
right?
guilds = [g.name for g in bot.guilds]
print(', '.join(guilds))```
and i don't know why you're storing this in a file....
I want the guild name, the member count of each guild, the owner of the guild and the number of text channel of each guild
bc it is more than 2000 char when I am in 59 guilds xD
for every server?
yeah
if I do every server, message per message, it will send too many messages
So I keep it in a file and send it bc it's better for the ratelimit
for g in bot.guilds:
name = g.name
members = len(g.members)
channels = len(g.text_channels)
return name, members, channels```
pretty sloppy but try that and see what it returns
it might be ideal not to have discord be your logging/storage method at this point then, and rather storing this stuff locally, or creating a dashboard for this info.
secure dashboard*
seems to return a tuple after test bot trying
you can do
for g in bot.guilds:
name = f"Server Name {g.name}"
members = f"Members {len(g.members)}"
channels = f"Text Channels {len(g.text_channels)}"
return name, members, channels```
probably a better way to do this but eh
multi return, python is indeed weird
useful sometimes
I made it look a bit better with some string methods but if you did it alr thats fine @leaden lake
it loop only 25 times... Idk why it's annoying

is it maybe bc I am on linux ?
that shouldn't be an issue no
try this and tell me what it returns
guilds = [g for g in bot.guilds]
return len(guilds)```
ah im doing return cuz im using jishaku
but you can use print or whatever
If it works it should send something like https://i.imgur.com/YqvhImU.png
yeah nothing
nope, no issue
print(dict(bot.intents))```
{'guilds': True, 'members': True, 'bans': False, 'emojis': False, 'integrations': False, 'webhooks': False, 'invites': False, 'voice_states': True, 'presences': True, 'guild_messages': True, 'dm_messages': True, 'guild_reactions': True, 'dm_reactions': True, 'guild_typing': False, 'dm_typing': False}
??
see you tomorrow but It's so strange whatever you try returns nothing
is there any rate limit for fetch ?
for g in bot.guilds:
name = f"Server Name `{g.name}`:"
members = f"Members `{len(g.members)}`"
channels = f"Text Channels `{len(g.text_channels)}`"
yield '\n'.join([name, members, channels])``` try this 
what do you need help with?


