Almost Static
@almostStatic
Passionate computer science student and good friends with @RossJames
0
omgthisprogrammeisactuallysolongOur legendary computer science teacher gave us a task to shorten code. Originally, somebody got it from 71 or so lines down to 20, then somebody else to 15, and so on till somebody got 4 lines. I went home and spent about 30 minutes on it and got it in 2 lines. Boom. Also got one with only one line but I don't know if I want to count that since it was in another file.
I doubt anyone will get anything lower than 2 lines - primarily because of the for .. in function requiring a newline; you must use a for .. in loop in order to loop through every element, as Python does not come with any built-in functions that allow this.
In JavaScript, I can easily rewrite this in one line due to it being a better language (and that you can use semicolons to manage and terminate statements that therefore allow you to write your entire programme on one line, albeit not advised)
2
0
0
This is something I made out of my spare time, I was going to use it for one of my Discord bots and felt that sharing this might help others, too.
He
Node.js
Testing to see if a str is a valid hex colour code
There are many ways this can be applied, for instance, in my discord bot I have a >setcolor comma
Node.js
Trim a string
The below function will return a string that isn't longer than the specified maxLength. If a string is longer than maxLength then the l
Node.js
Using the Discord.JS Docs API (v1)
You need to send a GET request to the following URL:
https://djsdocs.sorta.moe/v1/main/stable/embed?q={query}
re
Node.js
Welcome
I've seen this issue pop up everywhere, even in the Official Discord.js Server
I'm sure many of you have received the error cannot read prop
Discord Permissions List (In Array Form)
Ever making a command in your discord.js bot and realise that you suddenly need an array containing all of t
Hello People
> This template and its use has been deprecated.
>
> If you are looking for a guide on making a Discord bot using discord.js, I recommen
Node.js
7Hubs /home/runner/Removed/node_modules/discord.js/src/rest/RESTManager.js:32
const token = this.client.token ?? this.client.accessToken;
^
SyntaxError: Unexpected token '?'
Could someone please help?1 year ago
Editing Messages | Discord.js
If you do not have a solid understanding of JavaScript or how it works and wish to learn how to do this; I suggest that
JUMBA is it possible to make it so the bot sends the message after a command, like you showed, but instead of it instantley editing it, it does so after another command?
for example i say a, the bot responds b, then i say c, and he edits the "b" to be a "d". Kinda confusing, but i hope you understand.2 years ago
RhyleyPlant do you know if there is a way to edit a message after a user has sent a message?3 years ago
Hey there! Today I will be teaching you how to 'wait for messages' in discord.js. Also known as awaitMessages. This tutorial is written in Nodejs and
Node.js
DavidBerg4 @almostStatic I'm trying to create multiple inputs, and I'm struggling with it. Is it possible to message me?2 years ago