#development
1 messages Β· Page 1511 of 1
concat would be worse than that one
im not sure if js has a handy method to recursively do it
i could shorten it with forEach, but i dont think that'd be wise
for
guys i want code for a intervall message
frEach is suprisingly slow
then go make it
we dont spoonfeed people code here
i want a reason to not quit my Job today
xD

xDDD
with the downside to fricking die

I just wrote a code that took me 2h
what does it do?
and i released that i made wrong exercise number
i wrote a web scraper for 2 hours and than realized they have an API
xD
thanks for reminding me, i need to fix my scraper
those fucks updated their website
and broke my shit
does Google search have an API ?
google API
not google api Google Offers an API
there is an API backend for Google Search
It google API have a google search thing
google search api sucks ass
scrape duckduckgo instead
bcs the entire Google API sucks
ye the way to connect api
they have restrictive limits like on everything else ^
The newest messages may not be, but if one of those 99 messages is over 14 days old discord will say the entire thing is not allowed
are you sure all of them are not?
Dyno doesn't use bulk delete to delete messages older than 14 days
So can I use anything else than bulk delete?
And to filter the messages that are older than it, use filterOld option in <TextChannel>#bulkDelete()
Yeah was about to say that lol
The normal <Message>#delete() can however delete messages older than 14 days
Use filters to make sure that it only tries to delete valid ones
Wow I didn't know that
the use case for mixing them is if you want to return a value on catch
wdym?
let a = await bla().catch(e => {
console.log(e);
return 10;
});
console.log(a) // 10 if error
yeah, but equally that wouldnt make sense
it does
let thing;
try {
thing = await something
} catch(e) {console.log(e); thing = 10};
///////
let thing = await something.catch(e => {console.log(e); return 10});
theres absolutely no difference
there is no difference, but its a much simpler syntax
I think the second one is cleaner
most people are telling me the opposite
@earnest phoenix so I just replace it with that?
that the first is cleaner
No, that would only delete a single message
imagine this then
i know mostly its preference, but idk if theres an actual reason NOT to mix await/chains apart from readability
Iβm confused @earnest phoenix you said that message delete is better but can only delete a single message?
If you want to delete messages older than 14 days you have to fetch messages and iterate through them while calling <Message>#delete() on them but that's API abuse
But then dyno...
This ruins the purge command kinda
let guild;
try {
guild = await client.guilds.fetch(id)
} catch {
guild = null;
}
let channel;
try {
channel = await client.channels.fetch(id)
} catch {
channel = null;
}
let user;
try {
user = await client.users.fetch(id)
} catch {
user = null;
}
``` does this look clean?
thats what i said tim, APART from redability, is there a reason NOT to mix async/chains ?
not afaik
the reason its not recommended is because people can get confused about what the code is actually doing
cuz most places recommend not mixing them, but it infers that you shouldnt, rather than a cleaning recommendation
ie if they dont understand promises very well
Hm
okay that makes sense
The only time I mix them is when I have to use the fetch api
const body = await fetch(...).then(res => res.json());
thats fair, i use that commonly too
people often dont understand that await returns the final value of the entire chain, and that you can return something from inside a .then that way
so they end up doing confusing shit and not know why
i only use .then in that context to be fair
i hate it when people mix async and sync in literally any other situation
i think its very useful as a circuit breaker for invalid/error-prone functions
then again, breakpoints and try-catch
for example ```js
await database.get(something).catch(() => null) // if database throws an error if item is invalid or not found
with discord its very popular to use it for fetching
user = await client.users.fetch(id).catch(() => null)
if(!user) return message.channel.send("user not found")
that makes sense, ty @quartz kindle
is nekos.fun allowed for top.gg? (https://www.nekos.fun/)
i had some trouble with nekos.life thats why i'm asking
no, i entered correctly token
π€
i don't understand
you didn't if it's complaining about an invalid one
hmm
and when i dont use the lewd endpoint, i can use the rest? @opaque fern
I had trouble with nekos.life just because i was using it and not using the endpoint so idk if i can use this instead
hadn't any of these in my bot
nsfw**
not from neko
gotta code my own api
problem is that i'm developing everything for the bot alone. its a lot tho
yea
when i do it, i'll code an entire api
i have a friend that is developing his own, may we can create a api that we can use for both
thank you xD
Hello how to setup roles per voting?
@quartz kindle can u answer this
And how to do it because I don t know Can you help me?
thats valid yes
but "freezed" is not valid english
xD
if ur talking about server voting, pretty sure you can edit it on the website
But when I call moves().
It says this is undefined
show code
But i want more than 1 role per voting
I have server
?
a lot of server have it
It's fairly a large code, but I tried doing like -
const move = (currentSquare.isFreezed ? this.freezedMove : this.vectorMove).bind(this);
move() // No Error!
And then it worked fine!
Is there any more clean way, or It is already fine?
if you need to send the move function to use elsewhere, its fine like that yeah
Can anyone else tell me how to create roles per voting??
I don t know programming man so asking for how to create it without i msut creating the code for it
yes i see it
And what to do with it?
when i create webhook the bot created what is it?
and some name and channel i don t understand
this happens
i created it on discord server
i believe @pliant gorge has that integrated
without coding
just add @pliant gorge to your server and setup the roles via it, ask in #support for more info
so I only asing can i make it easy?
no coding
I have it in server and more in message i don t understand
once again, @pliant gorge has it
And i have bot in my server and what to do now?
i've heard about it somewhere
in support they say me to write here
please someone finally help me because I don t know nothing about coding
i've read somewhere about rewarding roles with Votes via DSL
Wot
U need vps
And Api
And code
Duh we need
O then it's changed
O
Then my bsd
Bad
Someone say I need VPS someone say I don t need nopthing - what I actually need?
isnt this exactly what they want?
,
oh, then yeah, you need coding for that
or find a bot that does that already
Do you know about some bot?
i personally dont
theres quite a few bots that deal with voting for stuff like that
but if you were to ask for a name, i woulnt be able to tell you one. There are hundreads of thousands of bots out there, i dont know every single one of them to be able to give you a definitive answer
K
coding is possibly your best alternative
be it hiring someone or learning yourself for free
Do you know any trusted and secure websites that offer free bot hosting?
the word "free" already implies bad
secure and trusted? sure
glitch and heroku
good? none
both of them have limitations
your best bet is AWS or f1 micro
f1 being free forever
Oooo
AWS being free only for the first couple months
I have one
O
you can use even an old phone to host ur bot
any 2010 ish piece of hardware and higher should have no problems hosting a bot
most of them you would install linux and run it

Do you know what the ping is roughly when you host with a raspberry pi on a 100 megabit internet?
i personally hate linux for personal use
@opal plank I agree
it takes up so much time to setup stuff that windows makes so basic
ok, ty π
i think my bot got 40+ servers today
wdym pro?
I have 78 commands
more commands usually = bad
bad for the user to remember most of them, and it usually indicated a multi purpose bot
which is dying nowadays
it does
more usuaully affects negatively your bot
OwO
how though?
the avarge user wont be using that many commands nor remembering most of them
its plain annoying to remember all commands
users want a bot that does whats its meant to be doing, and be good at what it does
tons of commands usually tens to tip over the multi purpose bot
unless most of your commands are targetted to the area you set it to fill
thats where what i said falls in place
usually
there are use cases
but the trend of multipurpose bots has ended quite a while ago
hoping into discovery with a multipurpose bot is shooting yourself in the foot
wanna see an example?
here
unless your bot is original or pure quality it's doomed to fail and go into the garbage can
read around here
If Iβm not wrong people are splitting their bits
people want MORE bots, not an ALL IN ONE bot
they want a bot that does it job, and does a good job at nat, not garbage that is meh on all areas it tries to be in
Plus itβs an advantage for the devs as well
abstract class Piece {
abstract readonly pieceType: PieceType;
constructor() {
/* Abstract property 'pieceType' in class 'Piece' cannot be accessed in the constructor. */
const a = this.pieceType; // not working
}
}
Is there any workaround for this?
when making a messaging platform, is it faster to send strings or send buffers?
buffers
oki ty
@cinder patio yo
ye
how is your day also there is a program that can translate the duration on files bytes
nice
How to get user account created date in js
What library?
discord.js
you have any discordjs.guide link?
i know
guides can be found on the front page
Whatcha mean discordjs.guide link
Why do you need a guide for a property.
?
what's the problem?
I just realized the djs guide doesn't explain properties. They expect you to understand them before using the lib.
Didn't know that
Yeah, it's "guide", not "documentation"
Yeah, it just seems to go over basics pretty decently. Honestly always figured it would be in there somewhere.
https://prnt.sc/wjs11d please help!!! my music bot dont hear!!
how are you a bot developer
The role means nothing other than they have an approved bot
Ik
?
It is showing green line around bot logo
we can't understand reason it from screenshot
@atomic vault @summer torrent They prob are using js and got rate limited for ytdl so its sending nothing but it is still playing something on discord just to clear things up.
hearing and streaming are two different things
"hearing" is just bots receiving audio data from other members
thats just an educated guess
streaming is sending audio data to discord
Im pretty sure if you just do #play it will just show the green line
hey guys
(message.guild.members.get(message.author.id))
how do i get the user
from id?
guide member
guild.guildmembers.get?
uh
Why not just use the member property
message.guild.members.cache.get(message.author.id)
Pepega
that returns guild member
<Guild>#members#cache#get()
volt
it says members.get is not a func
Error: secretOrPrivateKey must have a value anyone know what this means?
Looks like your private key wasn't given a value.
That's a user
i keep forgetting cache
Its a way of saying class rather than variable name afaik.
is there a standard for hash notation? i've never seen that anywhere
Oh pog
I have no idea, i've seen them use it all the time but i don't think it's a standard way of writing notation
I don't recall every seeing that notation anyone else either.
So no, it's not really standard.
Standards would be.. y'know... known, and common π
considering they have a bunch of shit they came up with already...

djs is a "special" thing
dont even look at their channel.startTyping implementation
i've seen it quite often in OOP language queries
java, c# etc
Man
So C# implements the Class#method notation? lol
badum-tss
i mean
C#, more like Class# notation
caching
and a lot of discord-related queries are done with your bearer token
but it doesn't really do caching, the point is for example the picture of my server gets updated instantly after I change it
no, when I change the picture of my server
it's still... caching
the DSL bot receives GUILD_UPDATE dispatch event
it gets updated instantly after changing my picture
yea server list
so, see what cry said
What does the picture have to do with that anyway, it's an image, grabbing images from the CDN isn't rate limited.
It is because it is dealing with guild id
But dsl just gets the event
why are you ignoring what i said lmfao
No for the image it's because it gets the GUILD_UPDATE event like cry said.
I'm taking credit cry
cry me a river
i need a colored name π
As I understood Guild_update is when you enable your intents, but dsl doesn't have intents on because discord didn't accept it
no
guild_update doesn't require privileged intents
^
TypeError: fetch(...).json is not a function how is it not a function?
still, it is intents and if discord doesn't accept your application (which it didn't for me) you cannot use GUILDS intents (afaik maybe i'm wrong)
you can't directly chain a promise without .then()
It's not a PRIVILEDGED intent.
you have a misconception
everyone can use normal intents
my bot is verified so no worries about it
The 2 priviledge intents are GUILD_MEMBER and PRESENCE . Every other intents is perfectly open to literally every bot out there.
Yes, really.
thanks man you are a life saver
const data = await fetch(`${_config_json__WEBPACK_IMPORTED_MODULE_3__["dashboard"].dashboardUrl}/api/guilds`, {
headers: {
Auth: cookies === null || cookies === void 0 ? void 0 : cookies.token
}
}).json()``` so how can i turn it into json @umbral zealot
how can you disable it that users cannot react with own emotes to a certain message of a bot?
call it on the result of the resolved promise
right now you're calling it directly on the promise
await fetch(url, headers).then(r => r.json());
oh thanks
deny their add reaction perms
Though why the hell are you directly working on the webpack output? 
how would you do that?
π
you cant disable reactions on a specific message i believe, only in a specific channel, or in the entire server
oh they meant per message
so i actually have to delete em everytime if sb adds something
or just ignore them?
there's also another kind of dumb way
fill up the reaction limit on the message with unique emojis
@umbral zealot did you even make the reload command in your git?
uhhhh yes?
lmaooo xDD
dafuq
really
how are you supposed to do this when all the commands are in folders
(`./${commandName}.js`)
you cant
well then you cant
so I say you didnt make it
if (!args || args.size < 1) {
return message.reply("Must provide a command name to reload.");
}
const command = args[0].split('/');
if (!bot.commands.has(command[1].split('.')[0])) {
return message.reply("That command does not exist");
}
Reflect.deleteProperty(require.cache, require.resolve(`../${command[0]}/${command[1]}`));
bot.commands.delete(command[1].split('.')[0]);
const props = require(`../${command[0]}/${command[1]}`);
bot.commands.set(command[1].split('.')[0], props);
message.reply(`The command ${command.join('/')} has been reloaded`);
now this would work
Does it though
it didnt work
So... what's your point
you put code meant for a command handler without sub folders on a git with a command handler with them
Do you have any idea what ```js
Reflect.deleteProperty(require.cache, require.resolve(./${commandName}.js));
*actually* does?
nope
lol
so you have no fucking clue what your talking about on why it doesn't work you ungrateful litlte shit π
didnt know errors compiled to js @fierce ether
You'll need node 14 or higher to use optional chaining π
wait do i?
yeah I had that problem too
have fun updating
babel
I thought we all agreed optional chaining is too slow
I might not have been part of this global decision making π
where do i even download v14
idc about slowness I use it a lot
I was part of the meeting when we said "If you're worried about performance in JavaScript you're using the wrong language, fool"
True
thats pretty self explanatory
I thought it was like painfully slow.
Which operating system are you on? Windows? Linux? Mac?
ive downloaded v14 15.4

i love this chat
Optional chaining in pure javascript is probably very optimised
That's 14.15.4
so you downloaded v14.15.4
yh
not v14 15.4
Yeah so you're good
version 15 doesnt work some times
oh yeh i meant that
is there anything that dosent work with v14?
There's nothing that break irrevocably in 14, you're safe using it
Node updates major versions when they break anything and that could be something you've never even heard of in your life - that's usually the case for me.
i do recall some libs breaking with node 15 and some targetting specific 14 or lower, so i guess not all libs updated, but i havent ever encountered an issue with node 15 personally
@opal plank canvas
Good to know tbh, I didn't do my own research, I just remember being told it's awfully slow.
In the 2 seconds I looked it up, its not slow at all.
life
"oh we've flipped a bit in the Buffer() option.xyx MUST RELEASE NEW VERSION" lol
chalk
actually, not even canvas i dont think
also, like i mentioned, LIB issue isnt node issue
canvas does break
You're confusing "nodejs broke" with "some modules have not yet updated to node-gyp working with that version"
dont fault node for the lib
this
NodeJS itself, and javascript code you wrote yourself, usually doesn't break on major updates.
im pretty sure every lib I have ever used isnt up to v15
wait chalk breaks?
I'm pretty sure it's not every lib
I have used
No you're just being overly dramatic.
im using node 15 rn with canvas
how
I did
You also need to re-build every node-gyp install
by deleting node_modules and running npm i again
I did
that took forever
Yes, it does take forever.
you guys must have tons of modules mine takes like 15 secs
the it uses to generate the images and shit
@umbral zealot no it was funny and didnt let me delete it
the problem with node 15 is npm 7 which is buggy af
i could be horridly worng about it though
I had to reset the security on some of the modules to delete it
canvas, sqlite, and a whole lot of other things are written in native C++ and require python and the C++ build tools to make it run on node, and that's exactly why it requires a rebuild every time you switch node version
Hey, so I got into another problem here, how does DSL handle member count?
guild.memberCount
literally a property on guilds that Discord provides
first tell me how many stab wounds
This time it needs whitelisting ...
No, it does not
^^
lmao
member_count is given by the API
for ALL members you do
and if you had GUILD_MEMBERS denied, you can occasionally guild.fetch() and use approximate_member_count
for member COUNT, you dont
It really feels like you're trying to get an "AHA! GOTCHA!" moment here where you tell us something about DSL we don't already comprehend fully π
all it takes is a few seconds of β¨ research β¨
there's no cheat going on.
he is partially right tho
guild.memberCount relies on GUILD_MEMBERS to keep itself updated
no it doesn't, actually
it does
π
I'm like 99% certain it uses the approximate_member_count
well I just need approximation I don't want accurate number
at least it does in discord.js
when you recieve guild object you always recieve it, im fairly certain you dont need to fetch it, sounds like more of a no-caching issue
My point is, there is an approximate member count provided by the API and that's what DSL uses
I was using memberCount as an example
which is what i said lul
member_count is received only on GUILD_CREATE so it relies on the intent to keep itself updated
if you have members denied, just occasionally fetch the approximate one
That's a library problem
as in they haven't figured out that basic thing about approximate member count π
how is that a library problem lol
there isnt any gateway event that gives you approximate member count
you get that by fetching
no lib is gonna do automated fetching behind the scenes
this is always sent though, any message or interaction that comes shipped with guild should have this updated on their end
No, you're right, libs don't fetch behind the scene
that's why they use the member_count provided by the API directly, if they're smart
Β―_(γ)_/Β―
Some pretty pog conversations in dev today, actually things I dont know about.
I'm just saying whatever the reasoning, it's actually a thing that the API can provide without privileged intents.
The details are not that important
yes but i am talking about the details lmao
lmao
the difference is that one is received over the gateway and isn't updated without the privileged intent
the other one is REST only
which gets sent on every message basically
π
you COULD fetch it if you dont have ANY events coming though
thx
if a person codes an app that uses guild.memberCount, and they dont have the members intent, if they leave the app running for 1 month without restarts/disconnects, their member count value will be wrong
usually whenever you recieve some events via REST i'd be smart to cache stuff like that
imagin having 300 requests per second no way you can fetch that amount
i mean without fetching, coming from a MESSAGE or some other event like presence
correct
though you get the approx
like you mentioned, the count only gets sent on CREATE
but you could constantly update aprox based on the messages/presences you receieve
Getting it through updates on messages and such is plenty sufficient for most people anyway
can a jwtSecret be anything?
and I'm sure it's sufficient for DSL
You shouldn't be using JWTs to store session cookies.
So member count is updated on every message?
it isn't
what should i use?

Cookies.
literally cookies
they've been around for decades and they're still the safest way to store a session ID on the user side
i just rechecked the create message payload
you don't get a guild object at all
you get the guild id
wait what?

the docs mention on guild_Create you get the full guild
i really cant be arsed to switch now
rather just use jwt rn
You should. JWTs are not as safe as you think they are. https://gist.github.com/samsch/0d1f3d3b4745d778f78b230cf6061452
yes
so you should be recieving a full guild object
You're opening yourself up to injection attacks, on top of making your system slower and take more memory for absolutely no benefit.
not only an id
oh really?
presences should come through, but that requires intents as well
which is what we trying to avoid
hmmm, yeah, you only recieve member
i guess it makes sense, it'd be horribly slow to be sending guild every message
though i was under the impression guild came shipped with it too
So is guild sent with events with the guild intent? Right?
so self bots require intents
^^
the way they receive guilds is completely different
theres quite a few things that user can access that could be used to aid a bot
i can give quite a few good examples
maybe on a different chat app
no, not at all
no I mean talking about it
you would have to build a library from scratch, pretty much no other lib supports user tokens anymore and the gateway flow for user tokens became different from bots
Imagine if bots had search 
they were supposed to
search is the shittiest of my ideas
What would bots use search for though
same thing users use it for
fetching user linked accounts gets rid of literally 90% of auth methods people do. You need to connect to your twitch? simply scan the user accs. Youtube? github integrations? all that.
I was thinking of forcefully adding a user everytime the bot would join a server to be able to fetch stuff like that, never again bother with AUTH
lol
search is the least useful stuff i can think of that bots would access
I know some people want bots to be able to see how many messages users have sent to determine punishments
none of that requires search
woo I would use it to find messages sent from a user on a date
What if your server is old
I wouldnt want to store
better yet, just channel/count/user
no need to store context
just how many messages were sent
stuff like that is child's play
scanning auth accounts seems far more useful
Lmao
I dont see how you get message count on an preexisting server
related to this, the reason why that data is accessible only through oauth is because otherwise you could easily get that data, then go ahead and go to the sites of the linked accounts and scrape more personal information from there
this way they're like "well it's your fault you're retarded and authorized an untrusted app"
fetch() looped
Api aboose
how come?
respecting ratelimts and only once since you'd be dumping that into the db, its not automation, its a one time thing
'ive seen quite a few bots that download the whole history without most of the useless shit, just timestamp, userid, guildid, and channel id
storing content is bad, both regarding disk space and privacy
For each user? Every time your bot joins a guild
Imagine fetching all messages from each user and the bot is in 2k guilds
And some guilds having millions of messages
Ya
who said for each user?
channel.messages.fetch()
just fetch with 100 limit and the last message id you got
i had a crawler that did that once
I mean, like, if I was able to do guild.search("from:136583532972605440").then(r => r.count) just to get the number of messages sent by a user, I don't need to fetch them to know how many they had.
Β―_(γ)_/Β―
that can take days to finish
Per guild
Hey Erwin you've sent 46,070 message on this guild.
lol
didn't need to fetch them all π
if i were to tell you i personally know someone who scanned ALL Dapi history, would you believe me?
took 2 days
That wouldn't surprise me that at least one bot did that
well that's at least one π
and 1 that escaped sandbox and deleted all channels 
I'm honestly surprised these bots don't get temp banned for api abuse.
there 2 others that i know of too
you can make them do it so slowly it looks normal
too bad discord limits per key, not connection
otherwise you could create multiple ws connections or possibly ip rotation
did you ever see tag oops?
LMFAO

the fact that discord didn't even properly implement CSRF tokens until late 2018
that's when the bots attacked discord a lot
they weren't even bots, well, they were, but stolen accounts
because you could scrape off the token
i remember hearing about shit like that
Evie name change @umbral zealot ?
charen
Cannot read property 'cache' of undefined what does this mean?
its only just started happening?
<% cli.guilds.cache.forEach((guild) => { %> cli is client?
res.render('servers', { user: req.session.user, guilds: req.session.guilds, cli: client })
req.session.guilds is null
i wouldn't send the client
well ob it is
what did it log
size: 0,
timeout: 0,
url: 'https://discordapp.com/api/users/@me/guilds',
status: 200,
ok: true,
redirected: false,
statusText: 'OK',
headers: {},
body: {```
and so on
that looks like a raw http request
wdym
what you logged
yes
.cache is a thing in that
do i remove cache
why do you want to remove cache
well why isit undefined?
show the full log
TypeError: C:\views\servers.ejs:11
9| <div class="servers">
10| <h1 class="title">Servers you can manage: </h1>
>> 11| <% djsclient.guilds.cache.forEach((guild) => { %>
12| <% if (!guild.member(user.id)) return %>
13| <% const member = guild.members.cache.find(p => p.id === user.id) %>
14| <% if (!member.hasPermission('ADMINISTRATOR')) return %>
Cannot read property 'cache' of undefined```
wdym confirm
...to confirm that it's your actual discord client
oh wait yeh its not
console.log it
an empty object
but why?
π€·ββοΈ
module.exports = client;
hastebin your entire bot.js
bing bonk
i'm trying to do a dashboard for my bot using ejs, but i acually never used ejs
ejs is really easy
@pure lion learn me everything k thx
and also how to make it interact w/ my client
and shit
yes
rendering text => <%- %>
rendering code stuff => <%= %>
the array has empty values
also
why are you making it a map inside of a map
couldn't you just make it a map
once
wqait
he maps it which he then maps it again
and the first map wont have a string
lol
so empty values
the categories are most probably strings
how to make ejs interact with bot client
Make a rest api
Ejs itself doesnt make the thing interactive or anything
Its just like
@marble juniper what should I do
To render stuff from the server
Who can teach me html
@remote cedar ok
you replace the first .map with a .forEach
also you need a value to store the map in
I cant write long descriptionxd
just use markdown
You can use markdown
xd
lol
Whats that
dsicord uses markdown
h o w
this
is
markdown
markdown
A markup language to simplify html
this shows a title
bold text
this shows another title
thats markdown
means h1, ## means h2 etc
link
- list
- of
- stuff
Markdown ||is|| very cool
alternatively
Markdown is a lightweight markup language for creating formatted text using a plain-text editor. John Gruber and Aaron Swartz created Markdown in 2004 as a markup language that is appealing to the human users in its source form. Markdown is widely used in blogging, instant messaging, online forums, collaboration software, documentation pages, an...
uh no
forEach π€’
pretty sure forEach only returns a singular value
forEach doesnt return anything
foreach is an iterator
lol
You probably want .map()
lo
h.
Or reduce
he has a map function inside of a map function
seems like a case for flatMap
Uh
cant you ...
thats why I said foreacj
it's stable
@pure lion can u do liveshare to show me how it works bc im dumb
flatMap is supported in node as of v11
@tight plinth no u
uh
The flatMap() method returns a new array formed by applying a given callback function to each element of the array, and then flattening the result by one level. It is identical to a map() followed by a flat() of depth 1, but slightly more efficient than calling those two methods separately.
lol
What did you want to do again?
Yeah but what about it
so
bot.categories.flatMap()
module.exports.run = async (bot, message, args, embedconf, { prefix } ) => {
const helpMessage = bot.categories.map((commands) => {
commands.map(command => `${prefix}${command}`).join(", ")
});
return message.channel.send(`\`\`${helpMessage.join(", ")}\`\``);
};
there u have it
what's the ... operator for anyway
u living in es5
is bot.categories a map?
yes
ree
You cant map a Map afaik
it worked before
const input = { x: 1, y: 2, a: 3, b: 4 }
const { x, y, ...z } = input
x // 1
y // 2
z // { a: 3, b: 4 }
example of using ...
ohhhhh
What's the invite link for that bot? Dm pls
uh
why?
when destructing an object ... allows you to collect the remaining properties of an object to a new object
basically
That bot is useful i see
Just dm me with the invite link pls
barnie
its not public
all you seen is an eval
Eval is literally a thign you can have in your bot and should ONLY be for owners.
even if you had that bot you wouldn't be able to use the eval
@umbral zealot safe eval sandbox can be
i have a code command but for some reason it wont register map (notevil)
A safe eval sandbox is pointless.
no not
i was bored
docker containers
because it wouldn't have access to all the things we use them for as bot owners.
its for users
docker containers
not owners
Why would I give someone else eval anyways. it's pointless.
if you want an eval sandbox just CTRL+SHIFT+I and type away, mate.
thats what the command is for
but its not an eval
mine has rust too
rusty dusty
b
c
@solemn leaf understand?
d
ok
why showing the status offline when bot is online
isnt there api to send when your bot is online
Did you just start the bot? It might take a while for it to update
Top.gg doesn't track bot presences anymore since bots have been kicked from the server.
how to make this on .js?
hey guys whats the best cheap vps hosting?




