#development
1 messages Β· Page 1562 of 1
Why is it even available in JS tho
idk
VSCode lumps the typings together
maybe they're planning on doing something about enums
Probably reserved for the future
if they suddenly added enums that would break a lot of legacy code
Yea, they probably reserved the keyword just for the future changes or something maybe, but it's been reserved since the beginning
turned off TS validation
and got that
and even standard yells at me
so theres that
@delicate zephyr ```//@ts-ignore
or
//@ts-nocheck```
ignore for single lines, nocheck for whole file
lol
the world: 
class MyEnum {
constructor(index) {
this.index = index;
}
static VALUE_ONE = new MyEnum(0);
static VALUE_TWO = new MyEnum(1);
static VALUE_THREE = new MyEnum(2);
static VALUE_FOUR = new MyEnum(3);
}

wtf
im trying to be able to do .setDescription(t("fun/general:TEST")) i tried using js MessageEmbed.prototype.t = function(key, args, options = {}) { let string = this.translate(key, args); if (options.edit) { return this.edit(string) } else { return this.setDescription(string) } }; but t is not defined?
this code doesnt actually stop the command from carrying on?
.catch((error) => {
if (
error.code ===
Discord.Constants.APIErrors.MISSING_PERMISSIONS
) {
return channel.send(
"I am missing permissions to run that command"
);
}```
it litterally caries on executing the code
anyone know why?
just use objects for enums in js
i would hit you if i saw you in the street, @quartz kindle also was adding properties on functions
along with symbols
yeahh thats better
this.this.this.this.a.this

What is the color code?
yes, my fast-zlib package used to do this ```js
function zlib() {
...
}
zlib.constants = {
...
}
module.exports = zlib;
Yes thanks xD
and my sweph package as well before i reworked it
result = [...]
result.flag = ...
result.error = ...
return result;
hello people
how do i make the footer logo animated
?
message.author.avatarURL()
set dynamic to true in the options
Does anyone know how people use patreon api to give users premium keys?
I'm unsure of how they actually do it, do they detect a role being given on their support server,
or do they use webhooks from the patreon api. I'm unsure as which one is the one most people use.
Since if someone donates to your patreon, and they haven't linked their discord to patreon, the webhook is still fired.
But I think detecting a role isn't really good enough
probably a combination of webhooks, and checking via the patreon api.
ye but what if the webhooks been fired but they haven't linked discord?
that's what im confused about lmao
then they dont get anything
I've been having to use donatebot
obviously they need to link their id.
if they didnt, then you need to check via the api after they have.
probably via a specific command
We're working on a solution / replacement for that π
hello how i can make the bot check if the args are base64 encode and returns a message when is not
var text = args.slice(0).join(" ");
this is decode var ===> var b = new Buffer.from(text, 'base64')
this is encode var ===> var b = new Buffer.from(text);
var s = b.toString('base64')
thanjk u
i wonder
how much is the size of the banner in top gg website?
How do u do that custom Status
i saw alot of people using but How idk
I use MultiRPC
I have officially thought of the worst bot idea that might actually work, but everyone will hate me for it. Should I make it?
what is it
The Discord Bot For Teachers or Discord Classrooms
even if you tell me make it
i wont
there's an original bot idea for you
π€
Oh my
anyways should i make it?
make it open source
its a fun thing to do
its education based which is very much needed rn
so why not
^
watch someone be making it right now
i would not trust any educational bots
because they are 99% made by a student
why does that matter
some of the biggest bots started from the bottom where they were just starting out
you cant just distrust someone because someone used it to learn, you learn from mistakes and feedback
use it as a learning experience and such
$(document).ready(function(){
var cnt = 2;
$(".addCF").click(function(){
$("#westarz").append('<input type="text" name="kod'+cnt+'"> <a href="javascript:void(0);" class="remCF">delete input</a>');
cnt++;
});
$("#westarz").on('click','.remCF',function(){
if (confirm("delete?"))
{
$(this).parent().parent().remove();
}
});
});
</script>
<input type="text" name="kod">
<a href="javascript:void(0);" class="addCF">add</a>
**
**
Hi, I created a code to create a new input when I click on the add button here, but it didn't work, do you know how to help?
DiscordAPIError: Cannot send an empty message at RequestHandler.execute```
uhh
even the commands are working normaly
lol
how can i make like a progress bar like a timer kinda
like a countdown timer bar with html/css/js?
you are trying to send a message without any content
it must have at least one attachment OR a message OR an embed
what is the max lenght of embed
error says embed ```js
if (text.length > 1024) return message.channel.send("Oww, that is way too much. The maximum character was 1,024.");
i used this
but not working
text is the args
let text = args.slice(0).join(" ");
module.exports = (data, user) => {
let string = data.voteMessage;
string.replace('{invite}', `invite`);
string.replace('{member}', `${user}`)
return string;
}
am I using string replace wrong 
Because neither of them are being replaced when I do this
String: {member} voted for us at {invite}
@blissful coral string = string.replace
I am dumb
π
can u help me up?
Me no speak JS

I get this error every time i try to start my bot is there any way around it?
Or do i have to delete the topgg package temporarily
if (message.member.presence.activities.find(a => a.type === "CUSTOM_STATUS")) {
if (array.some(link => message.member.presence.activities.find(a => a.type === "CUSTOM_STATUS").state.includes("discord.gg/" + link))) {
}
}```
``` TypeError: Cannot read property 'includes' of null```
Bruh
No idea honestly
yes a ton of assignments
Oh no
if you log
when a bot is added to a server
the name, id, owner, etc
and its public
does that violate the tos
The user should be informed if the data will become public
You should keep what servers your bots in private
Itβs for privacy concerns
it's beautiful
alright
Blazing fast lmao
blazing fast indeed
lol
yeah
brb
i guess an api might make it easier to manage too
if you need a contributor, let me know π
How to upload emoji to my Discord bot?
what do you mean
I want the bot to send the emojis I uploaded on discord
thanks it worked
ig ill do that
after i get the core concept of the web, ok
im doing a bit of spaghetti programming though
sure why not i should organize my code
Error: Cannot find module '../lib/utils/unsupported.js'
Require stack:
- C:\Users\USER\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:925:15)
at Function.Module._load (node:internal/modules/cjs/loader:769:27)
at Module.require (node:internal/modules/cjs/loader:997:19)
at require (node:internal/modules/cjs/helpers:92:18)
at C:\Users\USER\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js:19:21
at Object.<anonymous> (C:\Users\USER\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js:155:3)
at Module._compile (node:internal/modules/cjs/loader:1108:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
at Module.load (node:internal/modules/cjs/loader:973:32)
at Function.Module._load (node:internal/modules/cjs/loader:813:14) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\USER\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js'
]
}
The terminal process "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -Command npm run download" terminated with exit code: 1.
What the.
hi @jade summit, i am making a discord bot that makes students suffer
how is my stream interesting in any way
What are you doing there? I'm curious.
So I am big dumb rn, how can I remove --noembed from a string if I am storing the string for later use
im bored and i want to kill myself for making this
brb bathroom
api is working
temp changing screenshare to something else, touching sensetive info
.replace('--noembed', '')
it doesn't work on codeblock
you can use https://github.com/1Computer1/lexure for parse such inputs
yea that works too
Weird, I did that but it didn't work
show code
this is how I do it
Is it a regular string
ok one sec
You can see here it is detecting them but not replacing them:
the replaced part is just a bunch of other stuff
so instead of .replace('--noURL', "")
.replace(/--noURL/g, "")
Right?
@delicate zephyr
yea
thanksss
no problem
how can I execute code only after a calling a .forEach function in js
use a for loop instead
also I wont use a for statement because perfomance wise its worse
lol
lol
h-how is it
yes
Well then
you wont get what you want
the entire reason for loop would work for that reason is because its blocking
brb
anyone know why this doesnt consistently work? using mysql2 and discord.js
k
nah not really im trying to make a dataset here from reddit images
lol
and it saves each image
you know
so its better for me if its non blocking
then uh
Hold on
lemme write an example
const a = [1,2,3,4,5,6]
let iter = 0
a.forEach(t => {
// do shit
iter++
if(iter === a.length) {
// Do shit
}
})
@marble juniper
brb
Can someone help me please.
how do i make it so certain channels will unlock if the click on the emoji that corresponds with the selected channel
lang or lib?
??
hello
me?
english
bruuuuuuh
Coding language 
string = string.replace
dunno what you mean by libary
oh my
Don't bonk plz
Second time I did this today
what even is that
DBScript
Oh my
what you're doing in your status is against TOS not so
but other than that isnt DBScript look like this
send('hi')```
nop
yes you
its easier for commands to be written
cringe

i just made a bot!
sorry, but was any of that to to with me??
no, this was
did i ask
not you
unfunny/10
o i have no idea.
so is there any way to check in what servers my bot is in?
do any of you guys now how to hack
i wanna know this
i need to see the use ppl do it cuz they can mark it as spam
so...you made a bot but you don't know how you coded it?
can we see when out bot is being tested?
he probably means the totally real and dangerous Dank Memers hack
Read pins in #support
Bot devs not hackers, 2 different things
what would you want if we could hack
He would've said that
._.
ghoul i want to learn
I want to hack my moms phone
bruh
I think she is cheating on my dad
no i havent made a bot. i was wondering if there was a way to get people in a server to click on an emoji and it unlock a channel but only people who click on that emoji can see the channel
I need evidence
to buy vbucks?
@blissful coral take care of this
What?
Extreme isnt a mod
I am not a mod
oh
We dont assist people with doing illegal things. @earnest phoenix
burh
Not my position
Its not really illegal
yes it is possible
how do i do it?
ig i'll have to keylog her laptop then
reaction roles, you can look into yagpdb, carl bot etc, if you want to do it yourself, pick a programming language then ask again
sigh
-m 806286112690667530
π€ Muted lost cause#8529 (@granite tiger)
sigh
kool hiw can i make this command? ;-;
which command?
its not that ez for mute
anyways is there an answer for my question or do i have to w8 for another staff to answer? ;-;
if is it possible to see in which servers my bot is in
-moreinfo
If you want people to be able to assist you, please provide more information, such as what library and language you're using, the code in question and what you are trying to do and/or what is causing the error.
yes its possible
library? 
but we cant help you further without knowing language, library, etc
language is BDScript
you'll have to wait for someone who knows that then, cause i dont
you can try reading their documentation in the meantime
or if they have a support server, you can try there
oh
if someone doesnt know it, they cant help you
Gonna have to read there docs or find someone who knows
there is only possible for 10 server names
and a lot of people here dont do BDFD, they do stuff like javascript or python
Because the people currently present in the channel don't know
so you'll have to ask and wait for an answer, and wait a little bit if no one answers and ask again
huh ok
or you can try to look it up on your own
i already did :/
In javascript using the djs library, which I think is similar to BDFD, it is client.guilds.cache.map(g => g.name)
i literally have no clue 
it looks like you can use javascript in it
BDFD is like $nomention
any dev server you ask in probably wont be much help cause a lot of devs dont use BDFD
i think pretty much no one uses BDFD
$deletecommand
$argsCheck[>1;ERROR! mention someone to kick, example: /kick @user.]
$nomention $kickMention
$onlyPerms[kick;ERROR! you need kick members permission]
$title[Member kicked]
$color[#FF0000]
$footer[moderator ID: $authorID]
$description[
Kicked: <@$mentioned[<]>
Kicked by: <@$authorID>
Reason: $noMentionMessage
]
thats a kick command in embed
that doesn't help either
that looks gross
it really is
Yeah that makes 0 sense and makes my eyes scream
exactly 
what?
BDFD for you
._.
wait, is that a command?
yeah thats a kick command
ye
that's awful
I feel like
well
kicks mentioned user
I'd like to program in php thanks
yeah probably what you want is considered 'advanced'
why?
js doesn't work at all ...
so youll have to use actual javascript
message.replace() is javascript
so is vars
actually
it did say you can use javascript
from the looks of it I see no sign of docs or a support server
why in the actual heck does the image show var
bdfd syntax is so awful that assemble feels like a breeze
stuck in es5 
Makes SQL capitalization look level 1
assembly is a breeze though
bdfd is secret raid boss
no
BDFD is the alley way in movies you scream at the TV to the character to avoid but they take it anyway
kek

tell me im wrong
Im not
Same with any bot builders tbh
its just
Easy way out of actually learning anything
the "don't look back" alley
the "You wont be able to look back anyway" alley
js doesn't work at all ...
why doesnt js work π€
ah
actually, if you know how to use js in bdfd would be better to do everything in js anyway
yea
Learning JavaScript and node.js
https://www.codecademy.com/catalog
https://eloquentjavascript.net
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Introduction
https://github.com/getify/You-Dont-Know-JS
https://nodeschool.io
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference
JavaScript Resources
https://developer.mozilla.org/en-US/docs/Web/JavaScript
https://javascript.info
https://nodejs.org/en/docs/
https://github.com/nodesource/distributions
https://www.30secondsofcode.org/js/p/1
Just remove those embeds real quickkkk
I should really do a tutorial on how to make a discord bot soon
with in-depth explanations and shit
aka Node for dummies 101
it'd be interesting for me 
extreme you have any guides on doing classes in js?
i mean oop in js is pretty much the same as in other languages
Classes are a template for creating objects. They encapsulate data with code to work on that data. Classes in JS are built on prototypes but also have some syntax and semantics that are not shared with ES5 classalike semantics.
this is the best example xiuh
ur smart
you'll get it
but the this keyword is mandatory for accessing props
ye
thanks lukey
because javascript
Np Xiuh
feel free to ask in dms for help
considering the entire discord bot I made uses classes from the base
i was streaming in vc before
js's encapsulation and polymorphism are very raw
well yea
actually, is there even encapsulation at all in js?
uh
wait i was confusing ts with js 
ts does actually have cool oop
ts = js but done right
ah yes
That I showed you
yea
But how can I just do 1 of them and then call the different outputs at once
wdym
just do const function = require(../)(run)
function.foo
function.bar
but im a loser and cant dedicate to anything lol
yea
send the output
probably start with js first
for the concepts and stuff
i know js
o

wait how did i learn ts
I'm learning TS for a side project atm
but literally for my CV
and thats it
i prefer JS
there i put my current progress on my github https://github.com/real2two/custom-classrooms
oh i think i just kinda
watched random youtube videos about typescript
and the rest was just messing around with the language and reading the docs
func.replaced should work
then nah you dont need to
(discord.js) anyone got tips on how to tackle a sharded bot that sometimes spawns duplicate instances? I think it happens when the master process crashes, and the child process(es) continue to run, causing more child processes to be spawned on auto-restart of the master process. is there some standard way to kill shards on master process death that I'm missing?
us a custom lib
like Kurasata
im pretty sure discord.js already fixed that issue
what will that do for me, specifically?
or at least it was supposed to fix it
I mean generally the internal sharder has always been unstable for me
Kurasata is an okay fix
that too
if the master dies, the workers die too
Master has it fixed
I'll make sure I'm on the latest version, and if so I'll look into kurasata/worker mode
π
(looks like I was on latest, so either it's a different issue or it's not actually fixed)
ah, yes, samurai style
lmfao
commit sudoku
worker mode seems like the easiest fix for me rn, gonna try that and see how it goes. thanks for the quick help lads
π

Any of yall know mongodb
I do
mongoose node module
indeed
Ok
So
You already know about the replace function I made
It takes a mongoose data result from a findOne() query
Yes
Aka the schema
yea
You can await findOne btw

all of mongos functions are asyncronous
I give up 
Well that time when I awaited it I did not get a error
But
I don't think it even tried
Yea this is an non-blocking thing
since you're using a callback
the end code is getting run before the callback is finished
So how should I do it 
Put the second bit in a function?
And run the function after I finish the findOne completely
Can you send me it in dms
or use await
same
yeah
and I'll explain shit
best way of putting a embed field into a code block?
you can just append the codeblock to it
by using backticks?
that gets messy
it dont
i would to use js ${output}
then "```js\n" + output + "```"
This
yeh thats even worse
you would rather use
bruh
you came to ask a question
i gave you the answer
not here to argue your preferences
what even is that (the one he sent)
no idea
you DO realise its doing what i sent, but in the background right?
{code: 'js'} would simply add the stuff i sent above wrapping around your content
yes, but i can use this but it dosent work in a field js message.channel.send(output, { code: "js" }); wondered how it worked
not in an embed
just add the codeblock normally
literally what i sent above cholo
what's so hard about that
function codeBlock(code, options) {
return `\`\`\`${options.code || ''}
${code}\`\`\``
}```
literally
or that, but like i said, it doesnt magically send discord API telling it to parse it for you
it just does what i sent above in the background
is there a way to use js this.codeBlock = util.promisify(codeblock or whatever); to define it then?
[
'\`\`\`',
something,
'\`\`\`'
].join('\n')
Erwin, thats literally the function
lmfao
Either way my guy, Erwins right
You're using a function that is easily done
meant with this #development message
what this is doing is literally what both me and you said, but it does it in the background
oh right
yea
its just adding backticks, some value and a new line
and thats it
god I wish d.js explained shit better sometimes
yes ik its in the background, but if i wanted to add mutliple objects i would have to go "'''" + objectone + objecttwo + "'''"
just use ````${value}````
option 2 is so much better
you are either stuck with a single + or 3 chars ${} for each
first one is a lot cleaner for me
oh fuck you discord
though it highly depends on the size
won't that use toString() which becomes object object?
it would, yes
unless you do
we've been through that before
JSON
^^
,
,
we literally tried to help you and now you're just talking about your preferences kekw
fail
lmao
tim fix axios plis in my shit code
discord formatting can be a disaster sometimes
englithen this humble imbecile with thy wisdom please
wdym
imagine being so old you gotta use .then() and manually parse it
you don't need then()
you do
at least in 80% of the shit i do on browser i had to use .then() cuz browser and async is a bitch
wut
every single time i tried using await inside the php environment, it always failed
though .then() always worked
wtf php
i was pulling js code, yes
example?
ah
dont have one
actually
lies
i do
but its a hassle to dig it, specially since i edited
ugh.... fine
1 sec
<script>
window.onload = () => {
const fragment = new URLSearchParams(window.location.hash.slice(1));
if (fragment.has("access_token")) {
const accessToken = fragment.get("access_token");
const tokenType = fragment.get("token_type");
fetch('https://discordapp.com/api/users/@me', {
headers: {
authorization: `${tokenType} ${accessToken}`
}
})
.then(res => res.json())
.then(response => {
window.alert(response);
const { username, discriminator } = response;
document.getElementById('info').innerText += ` ${username}#${discriminator}`;
})
.catch(console.error);
}
else {
window.alert('No acess token');
document.getElementById('login').style.display = 'block';
}
}
</script>
you cant turn that async and await that fetch
it would always fail
it has to be syncronous code
though what i said before is complete bs, you get the point with me hating fetch() on browsers
why would it fail?
did you await the res.json() too
just turning that code async and awaitng fetch wouldnt work
dont recall, probably did
don't get why res.json() returns a promise
UsSE FeTCh
because its a stream
fetch is still good erwin
im probably gonna go with what tim said and try got
i never said its bad
i said i prefer axios
period
fetch returns a stream, so anyway you have to await for the stream to finish streming
yea that's fine
fetch('url')
.then(async res => ({ ...res, data: await res.json() }))
.then(res => {
console.log('Status:', res.status);
console.log('Data:', res.data);
})
there ya go
let data = axios.get('url')```
done, there ya go
(i still prefer axios dont bully me)
i used to use those but I prefer double await
make it triple
i use axios cuz that makes people think i know what im talking about
i just use https :^)
got seems quite handy too
dunno if its better than axios though, havent actually used it
bent.over
got bent, im starting to see a pattern here Tim
fetch got bent
next one is over ?
lmao
ran
lmao
rip
it's over
last updated 8 years ago
lmao
i'll now make an effort to make a bot only with names that would form a stupid sentence as my dependencies
Yes
inb4

somebody once told me
never gonna give you up
I wonder if someone managed to make the shrek movie script out of npm deps
please dont give me more stupid ideas
now this looks like an interesting challenge
pls dont flood npm with retarded troll libs
maybe we could at least do all-star 
thank you β’οΈ
sindre again
I wanna see it done
lmao
lmfao
now what exactly can i make with those modules?
jack shit
the supreme form of rickroll
a mess

const somebody = new EventEmitter();
const me = () => console.log("yes");
somebody.once(told => me());```
https://www.npmjs.com/package/@erwinv/envvar this doesnt look that bad tbh
NOTHING
pog ErwinUI
WTF
client is empty
client.js has aboslutely nothing
lmfao
the fuck are they doing with CORS
sounds like a nice way to spam someone/something
petition to clear NPM
this package is way ahead of its time
this
can we agree
that package
has way too much effort put into it
you clearly havent seen is-tenthousand
that shit has nothing on the fucking bee movie
that doesn't sound too hard to make if you have the script
@delicate zephyr check that
why
just
why
seriously
,
like out of all the possible high up powers there could have been you chose to defy every single one
Bruh
This is why the aliens dont fucking visit us
literally
c!help
br
they're gold
they are sad to see ngl, thats why npm in general is seen as a meme
not only npm, js too
yea true
but like
People who use it
and actually learn
know its not a meme
people who refuse to use to learn
or people that just dont use it because they think its a meme
are bad 
is-undefined is the prime example of it
is-odd
it has way too many uses to be considered a meme at this point
lmao
is-thousand
is-even
is-is-odd
i hve an idea
make an open source multipurpose discord bot
but replace all basic functionality with npm libs
@opal plank Look at Matthew's packages https://www.npmjs.com/~steadmatthew
oh no
@opal plank true not to cringe too hard
absolute meme value
bruh
I was working on bump bot :D and Destroy my old bot because Economy is common
there, i rated them all

the page at least has some info and shit
seems like theres very little commitment, but theres something
at least spread the params ffs
wait, you mean the Matthew here?
I only have like 2 packages



