#development

1 messages Β· Page 1562 of 1

delicate zephyr
#

its TS

earnest phoenix
#

Why is it even available in JS tho

mellow kelp
#

idk

delicate zephyr
#

VSCode lumps the typings together

mellow kelp
#

maybe they're planning on doing something about enums

cinder patio
#

Probably reserved for the future

mellow kelp
#

and the keyword is just reserved for now

#

yea

cinder patio
#

if they suddenly added enums that would break a lot of legacy code

earnest phoenix
#

Yea, they probably reserved the keyword just for the future changes or something maybe, but it's been reserved since the beginning

delicate zephyr
#

turned off TS validation

#

and got that

#

and even standard yells at me

#

so theres that

cinder patio
opal plank
#

@delicate zephyr ```//@ts-ignore

or

//@ts-nocheck```

#

ignore for single lines, nocheck for whole file

delicate zephyr
#

doesnt matter, I dont use enums anyway

earnest phoenix
#

Imagine if they actually Implemented enums in JS

opal plank
#

lol

delicate zephyr
#

the world: thisisfine

mellow kelp
#
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);
}

KEKW

opal plank
#

wtf

fierce ether
#

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?

cinder patio
#

what's the index for

#

oh nvm

#

that's dumb

#

lmao

mellow kelp
#

just some value to demonstrate

#

like in java you can make enums with properties

timid nebula
#

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?
cinder patio
#

just use objects for enums in js

opal plank
#

i would hit you if i saw you in the street, @quartz kindle also was adding properties on functions

cinder patio
#

along with symbols

mellow kelp
delicate zephyr
regal kiln
summer torrent
#

use color picker

#

it is #fbd9d9 btw

delicate zephyr
#

i think they meant the css

quartz kindle
regal kiln
quartz kindle
#

and my sweph package as well before i reworked it

#
result = [...]
result.flag = ...
result.error = ...
return result;
cobalt spruce
#

hello people

#

how do i make the footer logo animated

#

?

#

message.author.avatarURL()

mellow kelp
#

set dynamic to true in the options

cobalt spruce
#

google suck

#

top gg better

#

bruh

earnest phoenix
#

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

solemn latch
#

probably a combination of webhooks, and checking via the patreon api.

earnest phoenix
#

ye but what if the webhooks been fired but they haven't linked discord?

#

that's what im confused about lmao

solemn latch
#

then they dont get anything

earnest phoenix
#

I've been having to use donatebot

solemn latch
#

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

earnest phoenix
#

it's all confusing for me lmaooo

#

I think imma stick with donatebot for now

modest maple
#

We're working on a solution / replacement for that πŸ˜‰

cobalt spruce
#

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')
summer torrent
cobalt spruce
#

i wonder

#

how much is the size of the banner in top gg website?

delicate zephyr
cobalt spruce
#

i saw alot of people using but How idk

delicate zephyr
#

I use MultiRPC

summer torrent
shy turret
#

I have officially thought of the worst bot idea that might actually work, but everyone will hate me for it. Should I make it?

summer torrent
#

what is it

shy turret
#

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

summer torrent
#

πŸ€”

shy turret
#

i have officially stabbed myself for thinking of that idea

#

please don't make it

velvet bluff
#

Oh my

shy turret
#

anyways should i make it?

summer torrent
#

yes why not

#

i can contribute if you want

delicate zephyr
#

its a fun thing to do

#

its education based which is very much needed rn

#

so why not

summer torrent
#

^

shy turret
#

watch someone be making it right now

#

i would not trust any educational bots

#

because they are 99% made by a student

delicate zephyr
#

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

mellow kelp
#

yea

#

the dank memer guy made the bot to get started with node.js

shy turret
#

Ok

#

ill make it

#

im gonna die

prisma locust
#
$(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?

cobalt spruce
#
DiscordAPIError: Cannot send an empty message at RequestHandler.execute```
#

uhh

#

even the commands are working normaly

#

lol

drifting wedge
#

how can i make like a progress bar like a timer kinda
like a countdown timer bar with html/css/js?

opal plank
#

it must have at least one attachment OR a message OR an embed

drifting wedge
#

how can i make the progress bar thing like move?

cobalt spruce
opal plank
#

max 6000 total

#

2000 usual per field

cobalt spruce
#

error says embed ```js
if (text.length > 1024) return message.channel.send("Oww, that is way too much. The maximum character was 1,024.");

cobalt spruce
#

but not working

#

text is the args

#

let text = args.slice(0).join(" ");

blissful coral
#
module.exports = (data, user) => {
    let string = data.voteMessage;
    string.replace('{invite}', `invite`);
    string.replace('{member}', `${user}`)
    return string;
}

am I using string replace wrong Thonk

#

Because neither of them are being replaced when I do this

#

String: {member} voted for us at {invite}

slender thistle
#

@blissful coral string = string.replace

blissful coral
#

I am dumb

slender thistle
#

πŸ˜›

cobalt spruce
slender thistle
#

Me no speak JS

snow urchin
sturdy dock
#

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

wicked pivot
#
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```
shy turret
#

im making it

velvet bluff
shy turret
#

πŸ™‚

#

ok what do i need to add

#

assignments

velvet bluff
#

No idea honestly

shy turret
#

yes a ton of assignments

velvet bluff
#

Oh no

sterile lantern
#

if you log

#

when a bot is added to a server

#

the name, id, owner, etc

#

and its public

#

does that violate the tos

velvet bluff
#

The user should be informed if the data will become public

solemn latch
#

You should keep what servers your bots in private

velvet bluff
#

It’s for privacy concerns

mellow kelp
#

@solemn latch guess what

solemn latch
#

Did you make it

#

Ay

mellow kelp
#

it's beautiful

solemn latch
#

Lemme put it on a bot

#

Lmao

mellow kelp
#

KEKW alright

solemn latch
#

Blazing fast lmao

mellow kelp
#

blazing fast indeed

shy turret
#

(for teacher dashboard)

mellow kelp
#

very pog

#

"this assignment is meant to kill students"

shy turret
#

i might just call my bot

#

Assignments

summer torrent
#

lol

shy turret
#

im prob gonna make this open source

#

should i make an api

mellow kelp
#

yeah

shy turret
#

brb

mellow kelp
#

i guess an api might make it easier to manage too

summer torrent
urban surge
#

How to upload emoji to my Discord bot?

summer torrent
#

what do you mean

urban surge
summer torrent
#

\:emoji do this in chat

#

discord will turn that to code

urban surge
modest maple
#

Templating so simple happypeepo

shy turret
shy turret
#

im doing a bit of spaghetti programming though

#

sure why not i should organize my code

urban surge
#

add it here, how do i fix it?

livid lichen
#
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.

shy turret
#

hi @jade summit, i am making a discord bot that makes students suffer

#

how is my stream interesting in any way

jade summit
#

What are you doing there? I'm curious.

shy turret
#

i am making google classrooms but its a discord bot

#

dont ask why

blissful coral
#

So I am big dumb rn, how can I remove --noembed from a string if I am storing the string for later use

shy turret
#

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

summer torrent
summer torrent
delicate zephyr
#

yea that works too

summer torrent
blissful coral
summer torrent
#

show code

delicate zephyr
#

does it start as an array?

#

if so

blissful coral
delicate zephyr
#

this is how I do it

blissful coral
#

Is it a regular string

delicate zephyr
#

ok one sec

blissful coral
#

You can see here it is detecting them but not replacing them:

#

the replaced part is just a bunch of other stuff

delicate zephyr
#

'--test'.replace(/--test/g, '')

#

should work

blissful coral
#

so instead of .replace('--noURL', "")

.replace(/--noURL/g, "")

#

Right?

#

@delicate zephyr

delicate zephyr
#

yea

blissful coral
#

thanksss

delicate zephyr
#

no problem

marble juniper
#

how can I execute code only after a calling a .forEach function in js

delicate zephyr
#

use a for loop instead

marble juniper
#

also I wont use a for statement because perfomance wise its worse

delicate zephyr
#

lol

marble juniper
#

lol

delicate zephyr
#

h-how is it

marble juniper
#

for me .forEach is faster

#

mhm

delicate zephyr
#

thats because

#

forEach isnt blocking

#

for is

marble juniper
#

yes

delicate zephyr
#

Well then

#

you wont get what you want

#

the entire reason for loop would work for that reason is because its blocking

shy turret
#

brb

sturdy dock
marble juniper
#

k

delicate zephyr
#

@marble juniper its actually faster btw

#

like iteration wise

#

its faster

marble juniper
#

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

delicate zephyr
#

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

marble juniper
#

oh

#

yeah I didn't think about that

#

cuz im stoopid

delicate zephyr
#

its meh code

#

I'd still do for(let x of y)

shy turret
#

brb

delicate zephyr
#

why are you posting brb lol

crimson panther
#

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

blissful coral
#

@delicate zephyr

crimson panther
hazy shale
#

hello

blissful coral
#

What language

#

What library

hazy shale
#

me?

delicate zephyr
#

@blissful coral mind sending me the full string in dms

#

OH

crimson panther
hazy shale
#

bruuuuuuh

delicate zephyr
#

Wait

#

Extreme

blissful coral
#

Coding language facepalm

delicate zephyr
#

string = string.replace

crimson panther
gilded olive
#

oh my

blissful coral
#

Second time I did this today

gilded olive
#

are you using javascript

#

or

#

python

#

c#

#

ruby

hazy shale
#

._.

#

i coded mine in DBFD

gilded olive
#

what even is that

hazy shale
#

DBScript

blissful coral
#

Oh my

gilded olive
#

what you're doing in your status is against TOS not so

hazy shale
#

me!

#

?

gilded olive
#

but other than that isnt DBScript look like this

send('hi')```
hazy shale
#

nop

gilded olive
hazy shale
#

its easier for commands to be written

gilded olive
#

"Selling/Trading Accounts"

#

is that not against TOS

hazy shale
#

yeye and ppl do /clear in thwir dms

gilded olive
#

cringe

hazy shale
#

yh its selfbot and idk how they clear their dms

#

against tos tho

gilded olive
wispy sail
#

i just made a bot!

crimson panther
#

sorry, but was any of that to to with me??

gilded olive
wispy sail
#

did i ask

blissful coral
#

?

#

Did you need to?

gilded olive
#

I wasn't talking to you

#

unfunny joke

wispy sail
#

not you

gilded olive
#

unfunny/10

crimson panther
hazy shale
#

so is there any way to check in what servers my bot is in?

earnest phoenix
#

do any of you guys now how to hack

wispy sail
hazy shale
#

i need to see the use ppl do it cuz they can mark it as spam

gilded olive
blissful coral
gilded olive
earnest phoenix
#

youre programmers so

#

Ithought maybe

wispy sail
hazy shale
#

he probably means the totally real and dangerous Dank Memers hack

blissful coral
blissful coral
gilded olive
#

what would you want if we could hack

blissful coral
hazy shale
#

._.

earnest phoenix
#

ghoul i want to learn

gilded olive
#

how to hack what

#

if you say games just google

earnest phoenix
#

I want to hack my moms phone

gilded olive
#

bruh

earnest phoenix
#

I think she is cheating on my dad

crimson panther
earnest phoenix
#

I need evidence

hazy shale
#

to buy vbucks?

gilded olive
#

@blissful coral take care of this

blissful coral
#

What?

delicate zephyr
#

Extreme isnt a mod

blissful coral
#

I am not a mod

gilded olive
#

oh

oak cliff
#

We dont assist people with doing illegal things. @earnest phoenix

gilded olive
#

burh

blissful coral
#

Not my position

earnest phoenix
#

Its not really illegal

earnest phoenix
#

I live with her

#

she wouldn't sue me

oak cliff
#

that doesnt make it legal

#

dont ask again.

crimson panther
earnest phoenix
#

ig i'll have to keylog her laptop then

gilded olive
#

reaction roles, you can look into yagpdb, carl bot etc, if you want to do it yourself, pick a programming language then ask again

delicate zephyr
#

sigh

oak cliff
#

-m 806286112690667530

gilded plankBOT
#

🀐 Muted lost cause#8529 (@granite tiger)

gilded olive
#

sigh

hazy shale
#

kool hiw can i make this command? ;-;

gilded olive
#

which command?

hazy shale
#

in DBFD

gilded olive
#

uh

#

no idea mate

hazy shale
#

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? ;-;

oak cliff
#

what was your question

#

sorry

hazy shale
#

if is it possible to see in which servers my bot is in

oak cliff
#

-moreinfo

gilded plankBOT
#

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.

oak cliff
#

yes its possible

hazy shale
#

library? z_kyabhai

oak cliff
#

but we cant help you further without knowing language, library, etc

hazy shale
#

language is BDScript

oak cliff
#

you'll have to wait for someone who knows that then, cause i dont

#

you can try reading their documentation in the meantime

hazy shale
#

its Bot Designer For Discord

#

(BDFD)

oak cliff
#

or if they have a support server, you can try there

blissful coral
#

That doesn't help us

#

We don't know the lang

hazy shale
#

oh

oak cliff
#

if someone doesnt know it, they cant help you

blissful coral
#

Gonna have to read there docs or find someone who knows

hazy shale
#

there is only possible for 10 server names

oak cliff
#

and a lot of people here dont do BDFD, they do stuff like javascript or python

blissful coral
#

Because the people currently present in the channel don't know

oak cliff
#

so you'll have to ask and wait for an answer, and wait a little bit if no one answers and ask again

hazy shale
#

huh ok

oak cliff
#

or you can try to look it up on your own

hazy shale
#

i already did :/

blissful coral
#

In javascript using the djs library, which I think is similar to BDFD, it is client.guilds.cache.map(g => g.name)

hazy shale
#

i literally have no clue misacry

gilded olive
#

it looks like you can use javascript in it

hazy shale
#

BDFD is like $nomention

oak cliff
#

any dev server you ask in probably wont be much help cause a lot of devs dont use BDFD

blissful coral
#

BDFD isn't really a lang just a wrapper

mellow kelp
#

i think pretty much no one uses BDFD

hazy shale
#

$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

mellow kelp
#

that doesn't help either

oak cliff
#

that looks gross

gilded olive
#

it really is

blissful coral
#

Yeah that makes 0 sense and makes my eyes scream

mellow kelp
#

exactly pEnSiVe

lyric mountain
#

what?

delicate zephyr
hazy shale
#

._.

lyric mountain
#

wait, is that a command?

oak cliff
#

yeah thats a kick command

hazy shale
#

ye

lyric mountain
#

that's awful

gilded olive
delicate zephyr
#

I feel like

gilded olive
#

well

hazy shale
#

kicks mentioned user

lyric mountain
#

I'd like to program in php thanks

delicate zephyr
#

you shouldnt be asking here

#

and you should be asking in the BDFD support server

blissful coral
#

Wait

#

That is js

mellow kelp
#

you can use js with that thing apparently

#

but looks like no one does

oak cliff
#

yeah probably what you want is considered 'advanced'

lyric mountain
#

why?

hazy shale
#

js doesn't work at all ...

oak cliff
#

so youll have to use actual javascript

blissful coral
#

so is vars

mellow kelp
#

actually

gilded olive
#

it did say you can use javascript

#

from the looks of it I see no sign of docs or a support server

mellow kelp
#

why in the actual heck does the image show var

lyric mountain
#

bdfd syntax is so awful that assemble feels like a breeze

mellow kelp
#

stuck in es5 KEKW

blissful coral
delicate zephyr
#

assembly is a breeze though

blissful coral
#

it is

#

lmao

delicate zephyr
#

this

#

100%

lyric mountain
#

bdfd is secret raid boss

delicate zephyr
#

no

oak cliff
#

i should chat here more often

#

yall are cool

delicate zephyr
#

BDFD is the alley way in movies you scream at the TV to the character to avoid but they take it anyway

blissful coral
#

kek

oak cliff
delicate zephyr
#

tell me im wrong

#

Im not

#

Same with any bot builders tbh

#

its just

#

Easy way out of actually learning anything

blissful coral
#

bot builders are stupid

#

just learn a language

#

that is a actual language

delicate zephyr
hazy shale
#

js doesn't work at all ...

solemn latch
#

why doesnt js work πŸ€”

delicate zephyr
#

Try asking in the BDFD support server

#

@solemn latch they're using BDFD

solemn latch
#

ah

blissful coral
#

Best way to make it work

lyric mountain
#

actually, if you know how to use js in bdfd would be better to do everything in js anyway

delicate zephyr
#

I should really do a tutorial on how to make a discord bot soon

lyric mountain
delicate zephyr
#

with in-depth explanations and shit

lyric mountain
#

aka Node for dummies 101

delicate zephyr
#

it'd be interesting for me LUL

oak cliff
#

extreme you have any guides on doing classes in js?

delicate zephyr
#

You mean OOP in js

#

well

#

the best attempt at

oak cliff
#

the stuff like this.whatever

#

ive never done that

mellow kelp
#

i mean oop in js is pretty much the same as in other languages

delicate zephyr
#

this is the best example xiuh

#

ur smart

#

you'll get it

mellow kelp
#

but the this keyword is mandatory for accessing props

delicate zephyr
#

ye

oak cliff
#

thanks lukey

mellow kelp
#

because javascript

delicate zephyr
#

Np Xiuh

#

feel free to ask in dms for help

#

considering the entire discord bot I made uses classes from the base

blissful coral
#

Best way

shy turret
lyric mountain
mellow kelp
#

well yea

lyric mountain
#

actually, is there even encapsulation at all in js?

blissful coral
#

uh

mellow kelp
#

wait i was confusing ts with js KEKW

blissful coral
#

lmao

#

ts = advanced js

mellow kelp
#

ts does actually have cool oop

lyric mountain
#

ts = js but done right

delicate zephyr
#

ts = JS Compiled

#

TS is the Java of javascript

blissful coral
#

Ayo luke

#

So

#

I did that whole function right?

mellow kelp
#

ah yes

blissful coral
#

That I showed you

delicate zephyr
#

yea

blissful coral
#

But how can I just do 1 of them and then call the different outputs at once

delicate zephyr
#

wdym

oak cliff
#

have a guide for starting with ts?

#

ive been interested in it for a while

blissful coral
#

just do const function = require(../)(run)
function.foo
function.bar

oak cliff
#

but im a loser and cant dedicate to anything lol

blissful coral
delicate zephyr
#

Oh

#

can you console.log the output of the function

blissful coral
#

yea

delicate zephyr
#

send the output

mellow kelp
#

for the concepts and stuff

oak cliff
#

i know js

mellow kelp
#

o

delicate zephyr
mellow kelp
#

wait how did i learn ts

delicate zephyr
#

I'm learning TS for a side project atm

#

but literally for my CV

#

and thats it

#

i prefer JS

shy turret
mellow kelp
#

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

blissful coral
#

@delicate zephyr

delicate zephyr
#

func.replaced should work

blissful coral
#

do I await it

#

Or no

delicate zephyr
#

no you shouldnt need to

#

unless its async

blissful coral
#

ok thx

#

It isn't

delicate zephyr
#

then nah you dont need to

vale raptor
#

(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?

delicate zephyr
#

like Kurasata

quartz kindle
#

im pretty sure discord.js already fixed that issue

vale raptor
#

what will that do for me, specifically?

quartz kindle
#

or at least it was supposed to fix it

delicate zephyr
#

I mean generally the internal sharder has always been unstable for me

#

Kurasata is an okay fix

quartz kindle
#

a quick fix is to run in worker mode

#

instead of processes

delicate zephyr
#

that too

quartz kindle
#

if the master dies, the workers die too

blissful coral
vale raptor
#

I'll make sure I'm on the latest version, and if so I'll look into kurasata/worker mode

delicate zephyr
#

πŸ‘

vale raptor
#

(looks like I was on latest, so either it's a different issue or it's not actually fixed)

lyric mountain
delicate zephyr
#

lmfao

quartz kindle
#

commit sudoku

delicate zephyr
#

MASTER DOWN, EVERYONE PLAY DEAD

#

gets nuked

vale raptor
#

worker mode seems like the easiest fix for me rn, gonna try that and see how it goes. thanks for the quick help lads

quartz kindle
#

πŸ‘

delicate zephyr
opal plank
#

its master/slave not master/worker

#

boss/worker, master/slave

#

change my mind

delicate zephyr
#

facts

#

I still use master/slave terminology

#

but here we are

#

its 2021

blissful coral
#

Any of yall know mongodb

delicate zephyr
#

I do

blissful coral
#

mongoose node module

delicate zephyr
#

indeed

blissful coral
#

Ok

#

So

#

You already know about the replace function I made

#

It takes a mongoose data result from a findOne() query

delicate zephyr
#

Yes

blissful coral
#

Aka the schema

delicate zephyr
#

yea

blissful coral
#

Getting that retrieved is undefined when I pass it through

delicate zephyr
#

You can await findOne btw

blissful coral
delicate zephyr
#

all of mongos functions are asyncronous

blissful coral
#

sigh

#

I knew that

#

I just-

delicate zephyr
#

but

#

actually

blissful coral
#

I give up sad

delicate zephyr
#

I dont see the issue there

#

oh wait

blissful coral
#

Well that time when I awaited it I did not get a error

#

But

#

I don't think it even tried

delicate zephyr
#

Yea this is an non-blocking thing

#

since you're using a callback

#

the end code is getting run before the callback is finished

blissful coral
#

So how should I do it KEKW

#

Put the second bit in a function?

#

And run the function after I finish the findOne completely

delicate zephyr
#

Can you send me it in dms

pale vessel
#

or use await

opal plank
blissful coral
#

yeah

delicate zephyr
#

and I'll explain shit

fierce ether
#

best way of putting a embed field into a code block?

opal plank
#

huh?

#

dont you mean the opposite?

#

putting a code block into an embed field?

fierce ether
#
 output, {code: "js"})``` i tried this
#

and yes

opal plank
#

you can just append the codeblock to it

fierce ether
#

by using backticks?

opal plank
#

yeah

fierce ether
#

that gets messy

opal plank
#

it dont

fierce ether
#
\`\`\`
#

would have to be like that

opal plank
#

nope

fierce ether
#

i would to use js ${output}

opal plank
#

then "```js\n" + output + "```"

pale vessel
#

This

fierce ether
#

yeh thats even worse

pale vessel
#

I prefer that over template literals

#

How is that worse

fierce ether
#

you would rather use

opal plank
#

well good luck adding 10 backticks then

#

the former

fierce ether
#

just use `

#

ffs

#
\`\```
#

is better

pale vessel
#

bruh

opal plank
#

you came to ask a question

#

i gave you the answer

#

not here to argue your preferences

pale vessel
#

what even is that (the one he sent)

opal plank
#

no idea

fierce ether
#

or codeBlock(output)

#

is easier lol

pale vessel
#

why ask here then

#

if you already have your solution

opal plank
#

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

fierce ether
#

yes, but i can use this but it dosent work in a field js message.channel.send(output, { code: "js" }); wondered how it worked

opal plank
#

not in an embed

mellow kelp
#

how about

[
  '\`\`\`',
  something
  '\`\`\`'
].join('\n')
#

wait KEKW

pale vessel
#

just add the codeblock normally

opal plank
#

literally what i sent above cholo

pale vessel
#

what's so hard about that

delicate zephyr
#
function codeBlock(code, options) {
  return `\`\`\`${options.code || ''}
${code}\`\`\``
}```
#

literally

opal plank
#

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

fierce ether
#

is there a way to use js this.codeBlock = util.promisify(codeblock or whatever); to define it then?

mellow kelp
#
[
  '\`\`\`',
  something,
  '\`\`\`'
].join('\n')
delicate zephyr
#

Erwin, thats literally the function

#

lmfao

#

Either way my guy, Erwins right

#

You're using a function that is easily done

opal plank
#

what this is doing is literally what both me and you said, but it does it in the background

delicate zephyr
#

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

fierce ether
#

yes ik its in the background, but if i wanted to add mutliple objects i would have to go "'''" + objectone + objecttwo + "'''"

opal plank
#

JSON.stringify(object)

#

but yes

delicate zephyr
#

just use ````${value}````

opal plank
fierce ether
#

option 2 is so much better

opal plank
#

you are either stuck with a single + or 3 chars ${} for each

#

first one is a lot cleaner for me

delicate zephyr
#

oh fuck you discord

opal plank
#

though it highly depends on the size

pale vessel
opal plank
#

it would, yes

delicate zephyr
#

unless you do

opal plank
#

we've been through that before

delicate zephyr
#

what Erwin said

#

${JSON.stringify(value)}

#

ez pz

quartz kindle
#

JSON

opal plank
#

^^

delicate zephyr
#

sorry

#

brain fried

fierce ether
#

so first is easier for you?

opal plank
pale vessel
#

,

#

we literally tried to help you and now you're just talking about your preferences kekw

quartz kindle
#

fail

fierce ether
#

lmao

opal plank
#

tim fix axios plis in my shit code

pale vessel
#

discord formatting can be a disaster sometimes

opal plank
#

englithen this humble imbecile with thy wisdom please

pale vessel
#

erwin why axiosssss

#

fetch good

opal plank
#

cuz axios api is god

#

imagine not using Promise API

quartz kindle
#

:^)

pale vessel
#

wdym

opal plank
#

imagine being so old you gotta use .then() and manually parse it

pale vessel
#

you don't need then()

opal plank
#

you do

pale vessel
#

and I like manually parsing it

#

just use await

opal plank
#

at least in 80% of the shit i do on browser i had to use .then() cuz browser and async is a bitch

quartz kindle
#

wut

opal plank
#

every single time i tried using await inside the php environment, it always failed

#

though .then() always worked

pale vessel
#

wtf php

opal plank
#

i was pulling js code, yes

quartz kindle
#

example?

pale vessel
#

ah

opal plank
#

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

quartz kindle
#

why would it fail?

opal plank
#

good question

#

never actually managed to find why

pale vessel
#

did you await the res.json() too

opal plank
#

just turning that code async and awaitng fetch wouldnt work

#

dont recall, probably did

pale vessel
#

don't get why res.json() returns a promise

opal plank
#

UsSE FeTCh

quartz kindle
#

because its a stream

pale vessel
#

fetch is still good erwin

opal plank
#

im probably gonna go with what tim said and try got

#

i never said its bad

#

i said i prefer axios

#

period

quartz kindle
#

fetch returns a stream, so anyway you have to await for the stream to finish streming

pale vessel
#

yea that's fine

mellow kelp
#
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

opal plank
#
let data = axios.get('url')```
done, there ya go
mellow kelp
#

(i still prefer axios dont bully me)

opal plank
#

axios parses the json internally

#

no need to worry about any of that crap

pale vessel
#

const data = await (await fetch("url")).json(); messy

#

await await

quartz kindle
#

const data = await fetch("url").then(x => x.json())

#

no need for double await

pale vessel
#

i used to use those but I prefer double await

opal plank
#

make it triple

mellow kelp
#

rejecting on a bad status code is really handy

#

that's most of why i use axios

opal plank
#

i use axios cuz that makes people think i know what im talking about

quartz kindle
#

i just use https :^)

opal plank
#

got seems quite handy too

#

dunno if its better than axios though, havent actually used it

quartz kindle
#

have you seen bent?

#

its quite interesting as well

delicate zephyr
#

honestly

#

that name

#

idk why

#

bent.request

#

hmmm

pale vessel
#

bent.over

opal plank
#

got bent, im starting to see a pattern here Tim

delicate zephyr
#

yea

#

Mans prolly getting sloshed rn

pale vessel
#

fetch got bent

opal plank
#

next one is over ?

quartz kindle
#

lmao

mellow kelp
#

ran

opal plank
#

got bent over

#

3 amazing https libs

pale vessel
#

lmao

quartz kindle
#

too late

mellow kelp
#

rip

pale vessel
#

it's over

quartz kindle
#

last updated 8 years ago

opal plank
#

lmao

delicate zephyr
#

I want them to do the pingmas tree again this year

#

tbh

#

that was hella fun

opal plank
#

i'll now make an effort to make a bot only with names that would form a stupid sentence as my dependencies

delicate zephyr
#

Erwin

#

why are you the way that you are

opal plank
#

Yes

mellow kelp
#

so i installed postgresql

#

how do i get rid of the stack builder thing

delicate zephyr
#

inb4

opal plank
delicate zephyr
#

somebody once told me

opal plank
#

never gonna give you up

delicate zephyr
#

I wonder if someone managed to make the shrek movie script out of npm deps

opal plank
#

please dont give me more stupid ideas

mellow kelp
#

now this looks like an interesting challenge

opal plank
#

pls dont flood npm with retarded troll libs

mellow kelp
#

maybe we could at least do all-star coolflushed

opal plank
#

thank you ℒ️

mellow kelp
delicate zephyr
#

please

#

like fr

quartz kindle
#

sindre again

delicate zephyr
#

I wanna see it done

quartz kindle
#

lmao

mellow kelp
delicate zephyr
#

lmfao

opal plank
#

now what exactly can i make with those modules?

quartz kindle
#

jack shit

mellow kelp
#

the supreme form of rickroll

delicate zephyr
#

a mess

opal plank
delicate zephyr
#

LMFAO

#

okay then

opal plank
#

hmmmm

pale vessel
#
const somebody = new EventEmitter();
const me = () => console.log("yes");

somebody.once(told => me());```
delicate zephyr
#

it

#

does

opal plank
delicate zephyr
#

NOTHING

pale vessel
#

pog ErwinUI

delicate zephyr
#

WAIT

#

the repo

#

has shit tho

#

wtf

opal plank
#

WTF

#

client is empty

#

client.js has aboslutely nothing

delicate zephyr
#

lmfao

opal plank
#

the fuck are they doing with CORS

delicate zephyr
#

im not laughing

opal plank
#

sounds like a nice way to spam someone/something

delicate zephyr
#

WHY CAN YOU

#

SELECT

#

A SPECIFIC FUCKING SENTENCE

opal plank
#

petition to clear NPM

mellow kelp
#

this package is way ahead of its time

delicate zephyr
#

can we agree

#

that package

#

has way too much effort put into it

opal plank
#

you clearly havent seen is-tenthousand

delicate zephyr
#

You can select a random word

#

from the fucking

#

BEE MOVIE

delicate zephyr
pale vessel
#

that doesn't sound too hard to make if you have the script

mellow kelp
#

this guy is a legend

#

we should all star the repo

opal plank
#

@delicate zephyr check that

opal plank
delicate zephyr
#

like out of all the possible high up powers there could have been you chose to defy every single one

regal saddle
delicate zephyr
#

This is why the aliens dont fucking visit us

regal saddle
#

literally

delicate zephyr
#

That sounded hella agressive

#

lmfao

#

im memeing

feral cargo
#

c!help

delicate zephyr
pale vessel
#

br

delicate zephyr
#

bruh

#

legit just a process.on('end') handler

regal saddle
#

bro?

#

you looking for npm memes

delicate zephyr
#

they're gold

opal plank
#

they are sad to see ngl, thats why npm in general is seen as a meme

#

not only npm, js too

delicate zephyr
#

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 mmulu

opal plank
#

is-undefined is the prime example of it

delicate zephyr
#

is-odd

opal plank
#

it has way too many uses to be considered a meme at this point

quartz kindle
opal plank
#

is-thousand

delicate zephyr
#

is-even

quartz kindle
#

is-is-odd

delicate zephyr
#

is-not-even

#

I wish we could report them for spam

quartz kindle
#

i hve an idea

#

make an open source multipurpose discord bot

#

but replace all basic functionality with npm libs

pale vessel
delicate zephyr
#

oh no

#

we're about to watch

#

a man get murdered

#

in 93 separate ways

mellow kelp
#

oh no

delicate zephyr
#

@opal plank true not to cringe too hard

quartz kindle
#

compare with h

#

omfg

quartz kindle
#

why

#

they are the same

regal saddle
#

bruh

pale vessel
#

Out of 9 of his packages only two or three are useful

#

ourcord is eh though

quartz kindle
#

:^)

shrewd hazel
#

I was working on bump bot :D and Destroy my old bot because Economy is common

opal plank
shrewd hazel
pale vessel
#

How is to string a 1

#

that's 0

opal plank
#

the page at least has some info and shit

quartz kindle
opal plank
#

seems like theres very little commitment, but theres something

pale vessel
#

at least spread the params ffs

quartz kindle
#

should mention in the readme that it only returns the first param

#

xD

opal plank
#

wait, you mean the Matthew here?

pale vessel
#

uh oh, time to make return-all-parameters

#

@Not Erwin#8753 yep

opal plank
#

omg....

#

i wonder about mine though, how shit are my packages?

delicate zephyr
#
module.exports = function(...params) {
  return ...params
}
pale vessel
#

I only have like 2 packages

quartz kindle
#

same

#

but they good

#

:^)

pale vessel
#

and one of them is a fork

#

I'd say it's a useful one