#development

1 messages · Page 2008 of 1

woeful pike
#

also these kinds of things just hit you when you least expect it too

#

just keep up the grind

quartz kindle
#

and yeah its too saturated over there

woeful pike
#

you're much better off making things that you like than working for fiverr fees

quartz kindle
#

ye

#

build a small portfolio, make some basic website and use it as your business card

#

then just be active in discord and/or social media, and people will find you

#

and also, dont listen to what i say, because i myself am not doing it because im a lazy fuck

#

xD

neat ingot
#

lmao

#

I probably should make a business card like portfolio site. Certainly couldnt hurt to have

quartz kindle
#

im planning to make one for myself, but i have so many unfinished projects to do lol

woeful pike
#

portfolios are some of the most boring things ever to build

#

I tried 3 times and gave up

#

hate talking about myself

quartz kindle
#

ye

#

i've always had motivation issues for personal projects

#

i get much more motivated when working for someone else rather than myself

#

because its like i have something to prove

woeful pike
#

oh.. I mean I could see that but I specifically mean tooting my own horn type beat

#

otherwise I enjoy both

lyric mountain
#

when you see yourself everyday it gets boring over time

woeful pike
#

freelancing with enough time to write code you could be proud of is a really great feeling but the sad part is the client doesn't care and the pay sucks

quartz kindle
#

ye

neat ingot
#

I tend to have more motivation for projects that idk if i can do

#

like, the challenge motivates me

#

but once i know i can do it, i get bored 😄

quartz kindle
#

yeah

#

difficult projects are more exciting

woeful pike
#

go make a parser

neat ingot
#

for what? i have

quartz kindle
#

i often find myself spending days thinking about buffers and low level data structures

neat ingot
#

lmao

woeful pike
#

what parser have you written

quartz kindle
#

even if im not actually working on them

neat ingot
woeful pike
quartz kindle
#

or make a binary serializer like me

neat ingot
#

perhaps not quite what you meant, but thats why you gotta specify 😄

quartz kindle
#

xD

neat ingot
#

i've also written a similar markdown style parsing system for my game engine

#

that parses md like files into in game scripts

woeful pike
#

have you tried working with binary files at all?

wheat mesa
#

make a bytecode compiler

woeful pike
#

that's a really fun one

wheat mesa
#

With an interpreter

neat ingot
#

nah, the 1's are ok, but 0's scare me 😨

lyric mountain
quartz kindle
lyric mountain
#

while you're at it, make it bi-directional

quartz kindle
#

most times you're gonna be working with bytes, not bits

#

so 0-255

#

:^)

wheat mesa
#

Make an object oriented SQL compiler/interpreter

#

Like an ORM but with more work

#

That’s an idea I had at one point that I planned on working on, I’m gonna need more compiler experience first though

#

Making sql not suck

neat ingot
#

i've done a little bit of work with byte data (arduino rgb + bluetooth + android app project) ~ that was fun 🙂

lyric mountain
wheat mesa
#

Never heard of it

lyric mountain
#

it's a java ORM that also has a SQL compiler/interpreter (jpql)

#

and makes database transactions very seamless

wheat mesa
#

I meant like as it’s own language

#

SQL++ KEKW

cinder patio
#

I like making stuff other people can use, anything private or just for my portfolio like a mockup website or a clone I'm having a hard time with. I started working on a facebook clone but that's so fucking boring 😩

lyric mountain
#

YASQL

#

yet another sql

rocky hearth
#

What are these two files are called?

yarn.lock
package-lock.json
lyric mountain
#

yarn.lock and package-lock.json

sudden geyser
#

I think they're just known as lock files

#

As for what they do, they pin (hence lock) the versions of dependencies a project relies on

rocky hearth
quartz kindle
#

discord keeps messing up with me

#

now they are sending interactions and buttons in voice channels

sudden geyser
#

wdym

#

example

quartz kindle
# sudden geyser example

the only thing i know about it is this image, but people who are using djsl got errors from receiving texts and interactions in voice channels lmao

spark flint
#

if (!message.channel.id === 955864875928780900) return this just doesn't work lol

quartz kindle
#

the lib tries to add the messages to channel.messages but voice channels dont have .messages lel

sudden geyser
#

Yeah cause id is a string

spark flint
#

oh

sudden geyser
#

Not a number

boreal iron
earnest phoenix
#

And remove that logical NOT operator (!) from there as well as it coerces the value into a boolean, use the string inequality operator (!==)

boreal iron
#

bun somethings being very weird

sudden geyser
spark flint
quartz kindle
#

lel

#

discord.js never though about the possibility of voice channels being able to have messages

neat ingot
#

how do you even do that? when i join voice channels it doesnt change the active text channel page

#

like, how do you send/view the voice channel messages

sudden geyser
#

It opens like a thread

neat ingot
#

never used that feature either lol

quartz kindle
#

pretty sure its not released yet

#

just on a handful of servers

neat ingot
#

seems a bit strange for them to add that feature imo

#

unless they plan to eventually just have 'channels' that are multi purpose

sudden geyser
#

I think it's nice

#

In large servers where voice channels are commonly used it can be useful to share text

#

Or if you just feel like listening along

neat ingot
#

yea i guess that is fair

spark flint
#

is it possible to fully remove buttons from a message after clicking

rocky hearth
#

Can I go back in git commit history, and ammend some changes to specific commit?

neat ingot
earnest phoenix
spark flint
earnest phoenix
#

git rebase -i <commit SHA>^ or HEAD~<number of commits to go back>

#

And change the pick label to edit and save changes to make changes and amend them and run git rebase --continue after every amend

slender thistle
#

JS
Can I use setInterval in the same file as my express route handler where I run the server itself without blocking anything?

To be specific, I would like to make the script send an HTTP request to itself every minute. Is there another preferred approach to this?

sudden geyser
#

yes, setInterval is non-blocking

wheat mesa
#

I’m not so sure about this sort of thing but I think you could also use a worker if you’d like

cloud bough
#

very quick question, ive never really figured out what this does

Bot.application?.commands
#

what does the ?

#

do

slender thistle
#

I don't care that much about it. I just want it to ping itself every minute so that my repl doesn't die

austere surge
slender thistle
cloud bough
#

okay

#

so if it doesn't

#

it just doesn't run?

#
commands?.create({```
austere surge
#

i think itll just do whatever exists

neat ingot
#
const value = commands?.property?.run()``` if either commands or property is undefined, then the overall value will be undefined
austere surge
cloud bough
#

ohh

#

Im also getting this error

#
throw new DiscordAPIError(data, res.status, request);
            ^

DiscordAPIError: Missing Access```
#
        const guildId = '830190061022740560';
    const guild = Bot.guilds.cache.get(guildId);

    if(guild) {
        commands = guild.commands
    } else {
        commands = Bot.application?.commands
    }

    commands?.create({
        name:'ping',
        description:'replies with pong'
    })```
austere surge
#

no application.commands permission probably

neat ingot
#

^ like that

cloud bough
#

is that an intent?

austere surge
neat ingot
#

you need both bot scope, and application.commands scope

cloud bough
#

How do i get the application.commands scope

neat ingot
cloud bough
#

oh

#

oof does that mean I gotta reinvite the bot on all the servers?

#

or is this global

neat ingot
#

yerp ~ congrats 😄

austere surge
neat ingot
#

^ an easy way to check if the guild has slash commands defined

cloud bough
#

oooooof

neat ingot
#

ie, if they have already kicked/reinvited the bot with the application.commands scope and you have commands defined either globally or for that specific guild

cloud bough
#

dang this has really changed

#

its sad that you don't get the permission from just having "ADMINISTRATOR"

austere surge
#

¯_(ツ)_/¯

neat ingot
#

tbh yea, the scope issue is the biggest one i've found witch upgrading

austere surge
#

should definitely be a permission instead

neat ingot
#

there might be some way to avoid the whole kick/reinvite thing, but idk if there is

austere surge
#

cause reinvite is annoying and can mess up some bots configs

neat ingot
#

i've literally just spent like 2 hours fighting with checkbox logic 😐

cloud bough
#

any other scopes that I should add just to future proof

neat ingot
#

not sure future proof is a thing in discord world 😄

#

the applications.commands thing didnt even used to be an option afaik

#

could be wrong 😛

boreal iron
#

It’s a valid scope

#

Your bot needs to be authorized to let users use them

#

or in other words to show them in a guild

neat ingot
#

i remember learning that, if you only select the applications.commands scope for your invite, then your bot can run slash commands in the guild when technically, the bot isnt in the guild (as a member)

boreal iron
#

With the additional bot scope it’s still listed as member (bot)

neat ingot
#

i wonder how long till we are all integration devs 😄

austere surge
#

unpaid discord team

cloud bough
#

wait a second

#

it says "invalid permissions provided"

proven lantern
#

is there a speed penalty for using a variable when doing require()?

cloud bough
neat ingot
boreal iron
boreal iron
#

The bot can’t use slash commands

cloud bough
#

is that the only issue?

#

nvm still invalid

#

weird

boreal iron
#

What are you actually doing?

cloud bough
#

wdym

#

making an invite with the scope

neat ingot
#

and where does it say that the perms are invalid?

cloud bough
#

when clicking the link

#

I dont wanna send it here cuz its advertising

neat ingot
#

lol feel free to dm me a link to test 🙂

boreal iron
#

I can't see any issue

cloud bough
#

I did dekita

neat ingot
#

yea, as soon as i touch the link

boreal iron
#

Bots can't use video, too I guess

cloud bough
#

oh yes

neat ingot
#

why would there be a selectable for it though?

cloud bough
#

that fixed it

neat ingot
#

really? wth!?

#

lmao

cloud bough
#

for the future

boreal iron
cloud bough
#

when it maybe is supported

neat ingot
#

arent there bots that stream video like they do music?

neat ingot
cloud bough
#

nope

austere surge
#

but probably not

cloud bough
#

yeah like a video phone thru guilds

#

lmao

neat ingot
#

i mean, if the bot was able to stream...

cloud bough
#

there was a voice phone at one point

neat ingot
#

wouldnt be too hard to pull that stream from somewhere else

cloud bough
#

but too much internet

boreal iron
#

great... a new way of advertisment

neat ingot
#

lol

boreal iron
cloud bough
#

and they didn't moderate it well

#

so it didn't go well when you joined

#

it was like a cod lobby

neat ingot
#

tbf, it probably wouldnt be hard to use puppeteer to interact with a discord user account, that triggers/handles the actual streaming

#

likely a breach of tos tho

austere surge
#

yeah

heavy marsh
#

Does anyone have a good tut to install @discordjs/opus on windows and on linux

austere surge
#

npm install @discordjs/opus :troll:

spark flint
timber fractal
#

Hey, has anyone got an idea why my CPanel node.js app will give a 503 error when you try to reach the page/subdomain where it should be running and how to fix it?

heavy marsh
heavy marsh
spark flint
heavy marsh
#

its not 30 min

timber fractal
spark flint
#

where the nodejs app is set

#

then

#

stderr.log

#

scroll to bottom of there, thats the error

timber fractal
timber fractal
#

how could that occur

spark flint
#

change node version

#

what version have you selected

timber fractal
#

contacting my hosting if they can do anything

spark flint
#

select 14

#

no select 14

timber fractal
#

oh alright, didnt it need 16

spark flint
#

for what?

timber fractal
#

node:events

#

or

#

wait nvm

spark flint
#

its because you're using nove 10

#

try 14, if not then contact host for 16

timber fractal
#

alright

lyric mountain
#

node 10 is awfully outdated

timber fractal
#

still 503

#

SyntaxError: Unexpected token '??='

#

lemme check that

spark flint
#

code issue now

lyric mountain
#

you'll need to ask for updated node to your host

timber fractal
#

oh yeah... its gotta be v16 cause d.js v13

spark flint
#

yeah

lyric mountain
#

not only that, but optional chaining

timber fractal
#

host is on it

cloud bough
#

is this a reasonable loader for slash commands? ```js
const guildId = '830190061022740560';
const guild = Bot.guilds.cache.get(guildId);

if(guild) {
    commands = guild.commands
} else {
    commands = Bot.application?.commands
}

Bot.commands.forEach((cmd) => {
    if(!cmd.name || !cmd.description) return console.log(cmd)
    commands?.create({
        name:cmd.name,
        description:cmd.description
        options:cmd.options
    })
})```
sudden geyser
#

eh maybe not

#

given you're creating a command N number of times instead of all at once

#

which currently issues more http requests

neat ingot
#

I have a file with that called 'update-commands' that i run whenever i have to update commands

cloud bough
#

oh god rest

neat ingot
#

i also have an update-commands command for my bot 😄

cloud bough
#

I mean whats the problem with the http requests

#

especially when its only on ready

#

should I check if the command already exists? if it doesn't then do it?

rustic nova
#

@civic scroll @nova urchin next one to try out

Given an array of integers, return a new array such that each element at index i of the new array is the product of all the numbers in the original array except the one at i.

For example, if our input was [1, 2, 3, 4, 5], the expected output would be [120, 60, 40, 30, 24]. If our input was [3, 2, 1], the expected output would be [2, 3, 6].

Follow-up: what if you can't use division?

boreal iron
neat ingot
#

no gateway connection (i think?) when i run the update-commands file. it uses the bot token when sending the rest requests only ~ still new to slash commands myself, this is just what I got working easily and never bothered really updating it 😄

neat ingot
#

like, if you wait for the ready event to be fired before you iterate over each guild, then update the commands for that guild ~ thats a lot for doing imo

#

then, why would you want to redefine commands that havent changed the next time you boot?

#

i mean, if you were setting the dev server commands on ready, i could understand that

#

but idk, i guess iterating over all guilds at that time seems unnessicary

cloud bough
#

It's just the dev guild

#

It's going through the command collection

neat ingot
#

ahh ok, then yea thats totally fine for development imo

wheat mesa
#

Does anyone know how to get the content of a page that requires a login? Trying to access a pdf (for personal use only, with my own account) and get the content of it

#

(In an electron app)

prisma imp
#

Why's the site so laggy

#

Can't even load it smh

sudden geyser
#

been like that since the redesign

sudden geyser
#

takes me 10 seconds to search for suggestion bots and I'm still getting irrelevant bots

wheat mesa
#

I need the actual text content of the page preferably

cloud bough
#

Hey dekita, for global commands should I loop thru all commands and see if they exist, and if not then add them?

neat ingot
#

for global commands, I send an array of all commands, idk if you can globally define individual commands

cloud bough
#

I didn't know you can send an array

neat ingot
#

i use the rest thing as well remember, idk if its different when using discord.js internals

cloud bough
#

thats true, rest is annoying

#

but d.js has it in backend

neat ingot
#

can use the .set method to set all commands for optional guild id 🙂

cloud bough
#

oh its kinda like a collection but not

#

weird

neat ingot
sudden geyser
#

big problems require big compromises

#

but yes you can create individual commands with a different endpoint

neat ingot
#

no problem, no comprimise ~ just set all commands at once 😄

sudden geyser
#

and it won't overwrite the other ones

cloud bough
#
let big_problem = require('big-comprimses');```
neat ingot
#

lol

#

const!

cloud bough
#

well big problems may be changed

neat ingot
#

causing more problems 😄

cloud bough
neat ingot
#

random question: how many times on average do you rewrite code before publishing/pushing it?

cloud bough
#

probably about 3-4

#

way more organized that way

#

after 2 I add comments

#

and missing semi-colons

neat ingot
#

eww comments 😛

#

if you comment everything then the documentation takes just as long as the code in my experience 😦

cloud bough
#

meh

#

I usually put a general comment

neat ingot
#

I try to write most of my code so that I can understand the logic easily at a glance, i'll comment complex things

cloud bough
#

//this area of the code processes commands, checks arguments then executes the file

neat ingot
cloud bough
#

Yeah that makes sense

neat ingot
#

^ the one 'fully commented' function in 600 lines 😄

cloud bough
#

the font ;-;

neat ingot
#

theme* 😛

#

synthwave84 ~ incase your interested

cloud bough
#

looks nice but the c

#

looks like a k

neat ingot
#

if you mean in objekt, thats cause it is 😄

cloud bough
#

whyyyyy ;-;

#

just use obj

neat ingot
#

i tend to add unnessicary k, d or Dek in my code

#

at every opportunity!

cloud bough
#

legendary

neat ingot
#

for example 😄

cloud bough
#

lmao

boreal iron
neat ingot
#

dont lie, you know you add 'fake_' before every function you write 😄

boreal iron
#

I hope you’re consistent enough to add them to your vars, too

neat ingot
#

nah ~ inconsistency is key!

boreal iron
#

My gosh, building my frontend for weeks now and yet a lot of backend stuff isn’t even done KEKW

neat ingot
#

hows the frontend coming?

#

I'm debating if I should be happy saving regular json objects, or if I want to port the serializer from my game engine so i can save and reconstruct actual class objects 🤔

boreal iron
#

It’s actually getting damn nice for what I’m capable of

neat ingot
#

pics or lies! 😘

boreal iron
#

Hmm doesn’t make much sense yet tbh

#

There’s just static but very specific content available

neat ingot
#

always with the lies 🙄

#

whats the site for, your bot?

#

I really need to work on my bot frontend more, and the actual bot 😄

#

I keep getting distracted with stupid crap like this RPC app i've been writing

boreal iron
#

Nah not for my bot

neat ingot
#

~ i started one of those, never finished lol

boreal iron
#

But For the specific service my bot also offers

#

And yeah it’s also on he site, stats, invite, command examples etc

neat ingot
#

what is it your bot does?

boreal iron
#

Very specific stuff

neat ingot
#

oooohhh steam stuff, nice

boreal iron
#

For gaming communities

neat ingot
#

i was making a site a while back for steam trading for cash

#

but the actual validation of trades etc was tedious to setup

#

once you have it all functional, you could look into offering similar for other things, like epic games or whatever

boreal iron
#

Aaaand some dark for the fans

#

I kinda like the design

neat ingot
#

dark should be default

boreal iron
#

Very simplified, literally no colors

#

It is

neat ingot
#

❤️

boreal iron
#

But I prefer light for websites

#

Dunno why

neat ingot
#

i preffer light for certain sites, also dunno why

#

seems easier to make a nice dark theme compared to a light one too imo

boreal iron
#

Tbh no, finding lighter accent colors is harder for dark themes

#

While for example red is okay for light mode it’s way too dark for dark mode

neat ingot
#

exact same 'red' (more pink)

boreal iron
#

Hmm I don’t work with color pallets

neat ingot
#

picking the colors took ages tbf

#

some shades are as you say

boreal iron
#

Dunno why you would ever need purple of two stages of blue freerealestate

neat ingot
#

ask bootstrap 😄

#

tbf, they are kind of like, the generic tier colors too
green > blue > purple > red > orange

#

they are also iirc 45 degrees hue shifted from one another

boreal iron
#

Hmm well yeah takes longer for me to do things as I literally do anything my own

neat ingot
#

might be 60

#

yea, those arent the default bootstrap styles, that my custom style that i've slowly written over the past decade 😄

boreal iron
#

Alright gtg leaving highway pepowot

neat ingot
#

^ default 🤮

boreal iron
#

Hmm too bright

neat ingot
#

theres too many flaws that could be picked out with the default colors imo

#

but they obviously chose them for accessibility reasons or whatever

boreal iron
#

Those embeds down are too dark

#

Hard to see

neat ingot
boreal iron
#

Looks better on light mode

neat ingot
#

your bg color does what? a light grey? or a light opaque white on dark and opaque black on light modes?

#

like, the little embed/alert bg color

boreal iron
#

rgba

#

Just black with 0.1

#

Or 0.2

#

Idk

wheat mesa
#

how do I require something in electron? I keep getting an error that require is not defined, but it's something to do with electron

boreal iron
#

And white for dark mode

neat ingot
#

you should preload anything you require

#

then set the webPreferences for your browser window

#

you can enable node integration, its not recommended

wheat mesa
#

Yeah I've got a preload script, just didn't know that you needed to preload stuff like that

neat ingot
#

if you want your preload script to set window.properties, you need to also set contextIsolation to false

wheat mesa
#

I'll try something for a second

#

Okay so I'm still confused, I have a function that I want to call on a form submit, but it's dependent on a couple functions in other files

#

And I can't use require, so how am I meant to do that?

neat ingot
#

create a function in your preload script that performs the action you need, or returns the values from your required files

#

for example, in my app, i need to rread the readme.md file to display in the applications help info page

#

but i cannot use require etc to do that within the running browser windows js, i have to create a preload function

#

that i can then call from within the browser window js

#

for example, lets assume your preload script has this:```js
class AwesomeSauce {
static get working() {
return "success!";
}
}

window.AwesomeSauce = AwesomeSauce;

cloud bough
#

interactions are very weird ```js
let before = Date.now()

    interaction.reply({
        content: `Loading...`,
    }).then((res) => {
        res.editReply(`${Date.now() - before}ms`)
    })
#

I mean yes, editreply does take an object

neat ingot
#

and then your html file loads some script.js file with this: ```js
document.addEventListener('DOMContentLoaded', async event => {
console.log(AwesomeSauce.working)
});

cloud bough
#

but res should be a function with editreply

wheat mesa
#

ah okay I see now

neat ingot
#

you can also ~ in your preload script ~ and your main app script - define handlers for communicating between those two 🙂

wheat mesa
#

agh, now my event isn't being prevented from loading the page, haha

neat ingot
#

😄

wheat mesa
#

got it now

neat ingot
cloud bough
#

like where content is?

neat ingot
#

yea 🙂

#

idk how its passed to the .then handler though

cloud bough
#
interaction.reply({
            content: `Loading...`,
            fetchReply: true
        }).then((res) => {
            res.editReply({
                content:`${Date.now() - before}ms`
            })
        })```
#

says res.editReply isn't a function

wheat mesa
#

for some reason I'm still unable to access my function from inside the script

#

even after setting window.preload = Preload

#

says that I'm trying to access an undefined function

#

(I'm doing window.preload.handleForm() inside the onsubmit attribute of the form)

neat ingot
#

you could also use the await syntax instead of .then

#

but also, i see your just trying to show 'loading' text

#

you should defer the reply

cloud bough
#

Im trying to just get the milliseconds it takes, just like the regular message.channel.send().then(.edit...)

neat ingot
#

defer'd replies have a nice little 'working' type animation 🙂

cloud bough
#

Okay yeah I was looking at that

#

but does it send it to discord and back?

neat ingot
wheat mesa
#

I've got this atm ```js
window.addEventListener('DOMContentLoaded', () => {
console.log(window.preload);
});

class Preload {
static async handleForm(form) {
const pdfParser = new PdfParser();
await pdfParser.getPage(5);
}
}

window.preload = Preload;

neat ingot
#

through the html? not through the javascript the html page loads?

#

like, are you on the actual html tryin to set the handler for a form?

wheat mesa
#
        <form onsubmit="event.preventDefault(); window.preload.handleForm(this)">
            <label for="name">Name:</label>
            <input type="text" class="form-control" id="name">
        </form>
#

yeah

cloud bough
#

like the ping to discord and back

neat ingot
#

hmm

wheat mesa
#

I've never really done html stuff like this before because I never understood the interaction between html files and nodejs quite honestly

neat ingot
#

i've never done it that way, i normally in the js setup some listener

#

the umm

#
window.addEventListener('DOMContentLoaded', () => {
    console.log(window.preload);
});```
#

is that in your preload file?

wheat mesa
#

yup

wheat mesa
neat ingot
#

put it into a js file that the html page loads

#

but keep the rest in preload.js

wheat mesa
#

logs as undefined

neat ingot
neat ingot
cloud bough
#

okay

neat ingot
#
        webPreferences: {
            contextIsolation: false,
            // enableRemoteModule: true,
            // nodeIntegration: false, 
            preload: path.join(__dirname, 'preload.js')
        }```
wheat mesa
#

whoops, I had changed it earlier and forgot to change it back

neat ingot
#

😄

#

working now?

wheat mesa
#

works now 🙂

neat ingot
#

❤️

#

so does the form also work now?

#

im curious if you can set it in the raw html lol

#

I normally add all my elements using js and just have a html template

wheat mesa
#

the form works as intended, tbh I was just using it to test function calls as I wish

neat ingot
#

awesome! 🙂

#

and nothing against definiton of the calls in the html

#

I just like js more than html 😄

wheat mesa
#

me too tbh

#

html is TOO lenient sometimes

neat ingot
#

you ever used ejs templating? electron supports that too 🙂

wheat mesa
#

Yeah I've used ejs a little bit

neat ingot
#

can really help when building large apps with lotsa pages

wheat mesa
#

Didn't think I'd do electron and ejs at the same time though because I'm still pretty new to both lol

neat ingot
#

ahh yea, fair lol

#

I havent bothered with ejs for this rpc app

wheat mesa
#

I've got a new error to work on now, but thankfully it's js related and hopefully not complex lol

neat ingot
#

no need really for a single page app 😄

#

^ ejs from my game engine editor

#

so freaking messy lmao

wheat mesa
#

jeez

neat ingot
#

it loads in multiple other extensions, each with an ejs and js file, where each extension does some explicit task, like, handle projects, playtesting, whatever

wheat mesa
#

now I'm going to struggle to figure out what's wrong with a package that hasn't been updated in 3 years

neat ingot
#

lmao

#

whats the package do?

wheat mesa
#

parses a pdf

neat ingot
#

not sure if thats helpful at all 🙂

wheat mesa
#

yeah I'll give that a try since pdf-parse is giving me issues not related to my code presumably

#

agh, same error

neat ingot
#

😦

wheat mesa
#

Error: No PDFJS.workerSrc specified which unfortunately gives me a completely useless stacktrace

#

because it brings me here

#

which is about where I'm willing to trace it to because _fileContent is the code of more than 20 js files

neat ingot
#

no experience with that issue myself

wheat mesa
#

yeah I'm just gonna give up on this for a little while

#

these libraries all suck

bright hornet
#

https://sourceb.in/93SvwkqESX So the link for message is provided, but it seems it still not fetching up,

[Suggestion Channel](${urls})``` this is how to use to make hyperlinks right?
neat ingot
#

[link name](https://google.com "hover text")

boreal iron
#

Uh what

bright hornet
boreal iron
#

It supports tooltips?

neat ingot
#

yea 🙂

bright hornet
#

did you look at the link?

boreal iron
#

hmm I wasn’t aware

neat ingot
#

you arent fetching the returned message

#

so are you sure that it actually has the url property?

bright hornet
#

yep

neat ingot
#

like, if you console.log(urls) before your message embed gets created, is it the correct url?

bright hornet
#

yap

#

its shows at the top of the terminal before the error

neat ingot
#

perhaps then its the *'s around your link

bright hornet
#

I always do that to bold the hyperlinks

#

even in my vote command works

neat ingot
#

your error - if its the one at the top of the file you linked, is saying that the author icon url isnt valid

bright hornet
#

The problem is the icon url lmao

#

thanks mate

neat ingot
#

no worries 🙂

bright hornet
#

why- js .author.icon_url i didn't read this properly

#

i got attached by this js ('http', 'https') thing

#

lmao

neat ingot
#

lol, seems like a fair oversight 😄

boreal iron
#

Ah I forgot there aren’t any tooltips on mobile lmao

#

Stupid me

rose lance
#

which one looks better?

neat ingot
#

imo use #e4e4e45o

#

for your line border things

rose lance
#

#e4e4e4 probably?

quartz kindle
#

when you screw up string concatenation and array joining

neat ingot
#

#RRGGBBAA

dry imp
neat ingot
#

ive been treating it like a wordsearch

rose lance
#

ah ok

neat ingot
#

5 points!

rose lance
#

I've changed the color now, tho it's more about the rest

neat ingot
#

easy 3 pointer

dry imp
#

find gay in that

bright hornet
rose lance
bright hornet
quartz kindle
lyric mountain
#

Tim might be hiding a secret image there

dry imp
#

it is an amogus image

oak cliff
dry imp
lyric mountain
#

Ohno

wheat mesa
#

least amount of effort I could do for an amongus

#

today I learned ```java
public class Wtf {
private String ok;
public Wtf() {
this("interesting thing I didn't know you could do");
}

public Wtf(String ok) {
this.ok = ok;
}
}

lyric mountain
#

Ah yes, constructor override

#

You really, really need to try groovy after u finish with java

#

It'll feel like when you remove a monster bogey from the nose and breath the best air in your life

#

def obj = ["Rick", 30, "M"]

#

There are like, 3 or 4 ways to call a constructor there

wheat mesa
#

nah I knew constructor override I didn't know you could invoke a ctor with this()

#

unless that's what you meant

lyric mountain
#

Was talking abt groovy

#

It's java with dlc

wheat mesa
#

C# is Java 2

#

I love C# I just never really got into it fully

#

I'm focusing on c++ java and js/ts

lyric mountain
#

I mean, groovy has no refactor need, any java code is 100% compatible out of the oven

wheat mesa
#

I see

lyric mountain
#

That's why I call it a dlc

wheat mesa
#

yeah

#

tbh I love java for the most part

lyric mountain
#

It feels like a cross between java, js and ruby

wheat mesa
#

there's some annoying things but overall pretty good lang

#

I'm starting to learn C by building a bytecode compiler

lyric mountain
#

I remember that KEKW

wheat mesa
#

well earlier I was doing an interpreter in java but now it's time for a bytecode vm

lyric mountain
#

Insane task

wheat mesa
#

I hope to do that stuff professionally in the future

#

really interesting subject

#

I also plan to conquer the dragon book when I have more knowledge and time mmLol

lyric mountain
#

Try making a global language bootstrapper

#

Like allow linking any lang with any lang

#

Kinda like what jvm allows, but bi-directional

wheat mesa
#

like a transpiler, or do you mean make it compile to compatible bytecode?

earnest phoenix
#

Hello

wheat mesa
#

hi

lyric mountain
#

Like, jvm allows running any lang on it and accessing methods and variables from jvm langs

#

It's some blackmagicfuckery behind the scenes

#

But part of the reason why java can run anything on it

wheat mesa
#

it sorta makes sense from what I know, bytecode is just a series of encoded instructions

#

no reason it wouldn't be compatible with other langs as long as there's an interface for it

lyric mountain
#

I KNEW IT

wheat mesa
#

the prophecy is true!

lyric mountain
#

He had to be behind it

wheat mesa
#

it's an incredibly large subject, I love it

#

gonna study that a lot this summer when I've got more time

lyric mountain
#

You're crazy

wheat mesa
#

it's really fun

#

just takes a lot of thought

#

I'll make a new jvm lang for u one day 😉

#

"Java++"

#

just java with the missing features it should've had already

#

tuples, templating instead of generics, string literal templating

lyric mountain
#

Call it Hava

wheat mesa
#

lmao perfection

lyric mountain
#

Must hava

#

And hava good day

wheat mesa
#

it will hava-ll the features java is missing

cloud bough
#

Question, I feel this is hella obvious but its worth mentioning, with nsfw commands, if only the user can see it can it be basically anywhere?

lyric mountain
#

Grey area maybe?

wheat mesa
#

nsfw commands are restricted to nsfw channels

#

as per the discord tos

cloud bough
#

seems like a grey area yeah

#

well thats to prevent other people from seeing nsfw

wheat mesa
#

still specified in their tos though

lyric mountain
#

Idk how to answer, but nsfw channels do have a "I confirm I'm 18yo" screen

cloud bough
#

Oh yeah thats true

lyric mountain
#

So discord is no longer liable for potential minor issues once they click

cloud bough
#

and it doesn't let you in if your under 18

wheat mesa
cloud bough
#

okok

wheat mesa
#

by not being in an nsfw marked channel you're making it available to those under the age of 18 potentially

#

moral of the story: don't risk it

cloud bough
#

I wasn't going too but it was an interesting question to ask with the new api

wheat mesa
lyric mountain
#

Ye

#

You see the screen but can't accept

wheat mesa
#

yeah

#

Made a stupid little swing app in computer science today and my teacher was impressed somehow KEKW

lyric mountain
#

They don't really expect students to research on their own

#

Now u got that teacher's favor

cloud bough
#

For grade 9 I did a neural network science project

#

it was a chatbot LSTM RNN

wheat mesa
#

I was most definitely trying to automate my AP US History notes earlier, but I couldn’t get anything to read a pdf file properly

#

(And no it wouldn’t be cheating, it would be sifting through the textbook determining which areas would be useful to look at)

lyric mountain
#

It's not cheating if u carved it yourself

wheat mesa
#

We’re allowed to have handwritten notes for our reading checks in that class

#

But the chapters are so painfully long

#

So it’s difficult to find the useful information

lyric mountain
#

I hate when people call cheating stuff they could've done themselves but didn't

#

Suffered from that a lot on uni

wheat mesa
#

I was going to write a program that takes the text and looks for certain phrases that indicate importance, rate it on a scale, then choose the most important ones

lyric mountain
#

Like damn, if I can make QoL tools with programming then I'll fckin do it whenever I can

neat ingot
#

qol tools are where the money is

wheat mesa
#

QoL tools make up everything now

dry imp
wheat mesa
#

What good is an IDE without good tools to go with it

lyric mountain
#

I once made an auto Spotify skipper

#

Whenever the window title changed to "Advertisement" it'd trigger multimedia next key

wheat mesa
#

I gave up on my pdf file thing but I’m going to try again sometime this weekend

#

Unfortunately today is the last day I can afford to put schoolwork off before needing to work on it the rest of the week

austere surge
#

hm

spark flint
wide widget
#

bro

#

pls help

spark flint
#

What with?

cold canyon
#

should i use digitalocean or linode

timber fractal
#

well sort of

#

yeah pay for hosting

#

but i have SSH access

spark flint
#

Then only the host can install node16

timber fractal
#

alright

#

so i cant install it like that using SSH access?

spark flint
spark flint
lament rock
#

The question of whether you should use x or y vps provider can be answered by creating your own server PC.

#

📈

lusty quarry
#

Can any one help me to join bot to voice channel

spark flint
#

if the user object doesn't contain account creation date, how can I get it?

#

I want to get user creation dates from users not in my servers

hybrid cargo
#

well you can get it via the rest API

#

pretty sure the user endpoint has the createdAt of the user

boreal iron
quartz kindle
#

or my quick 512Kbit/s upload

neat ingot
#

how to add a slash command to a context menu?

lyric mountain
#

for some reason, the longer I use java, the more I get pushed towards low-level concepts

#

recently I started using GC-sensitive references (like WeakReference) to track whether a reference still exists

neat ingot
#

^ this ~ how?

boreal iron
neat ingot
#

ooohh, so we can define slash command like objects, send them to the api with a different command type id?

boreal iron
#

A slash command is part of interactions, what you mean is a message content menu interaction

#

Not a slash command

#

But yeah you can create and register different types

#

At least those 3 available

lyric crater
#

👋

civic scroll
#

wave

lyric mountain
#

and smile

civic scroll
#

hi

#

kuu

lyric mountain
#

hi sayu

bright hornet
#

Anyone knows how to get rid of this

#

Stuck at loading screen

civic scroll
#

network isue

bright hornet
#

Im using my data

#

Im having an issue almost a week

#

But playing game is smooth as pudding

neat ingot
#

so im setting the command /interaction type for either user or message, but they are still being registered as slash commands instead of context menu interactions am I missing something else?

#

oooooohhh wait i think i got it

bright hornet
#

Yes

simple stump
#

How would I check if a string ends with /c<something_here>? I am parsing URL's and want to remove any URL's that end with /c<num>. For example:
https://mywebsite.com/c2 or https://mywebsite.com/c56.

neat ingot
#

javascript? "somestring".endsWith("string");

#

or you could use regexp: /(.*)string/i.test("somestring")

lyric mountain
#
/  -> begin regex
\/ -> escape "/" character as a literal
c  -> match letter "c"
\d -> match any digit (0-9)
+  -> match 1 or more characters
$  -> match only on the end of the string
/i -> end regex and enable case-insensitivity 
feral aspen
#

How can you push an object to an array in a document in MongoDB?

neat ingot
#

[].push(new model())

feral aspen
#

Sorry? How is that done?

cinder patio
#

$push

neat ingot
#

object = findById(asdjnasjkd)
object.property.push({asjndajksd})

feral aspen
#

Now, via the MongoDB Compass, I use the following to set a new property in all the documents.

db.<document>.updateMany({}, { $set: { abcd: 'efgh' }})
feral aspen
inner sapphire
#

it's not responding at all

near stratus
#

any error?

inner sapphire
#

no

#

let me try putting in a try {}

inner sapphire
neat ingot
#

if you console.log before your db code, does it output?

inner sapphire
#

if i remove .match in data.match

#

it flags everything as a phishing site

neat ingot
#

can you console.log(data)

#

before the match

inner sapphire
#

yeah, sec

#

one sec

neat ingot
#

its likely that property does not exist on your returned data object

inner sapphire
#

hmmm

#

interesting

#

its a known scam link im sending

near stratus
#

the api is just dum

quartz kindle
#

what api is that?

spark flint
#

is that anti-fish

civic scroll
#

i have achieved

#

pain

quartz kindle
inner sapphire
civic scroll
#

also

inner sapphire
neat ingot
spark flint
#

thats what i do now

civic scroll
#

the node's writeFile function

#

doesn't completely overwrites a file

near stratus
civic scroll
#

if the input data has less length than target then we still have leftovers

spark flint
civic scroll
#

which is what happened

spark flint
#

that always works

inner sapphire
#

sec

spark flint
#

if (response.data.match && Number(response.data.matches[0].trust_rating) >= 0.95) { }

#

thats what i do

neat ingot
civic scroll
#

what

inner sapphire
#

ok

inner sapphire
#

so its just a bad domain fdilter

civic scroll
#

there is no option

inner sapphire
#

i thought my code was broken

spark flint
civic scroll
#

except encoding

#

wym

spark flint
#

you just need to check trust rating

inner sapphire
quartz kindle
neat ingot
#

hmm

civic scroll
#

anywho

spark flint
quartz kindle
civic scroll
#

i fixed it

#

by deleting the file

inner sapphire
spark flint
#

it will only proceed if it matches and the trust rating is above 0.95

inner sapphire
spark flint
#
await axios({
            method: 'post',
            url: `https://anti-fish.bitflow.dev/check`,
            data: {
               message: message.content
            },
            headers: { "User-Agent":"Blacklister - https://blacklister.xyz" }
        })
        .then(async response => {
        console.log(response)
            if (response.data.match && Number(response.data.matches[0].trust_rating) >= 0.95) {
                await message.delete()
                // do shit
            }```
inner sapphire
#

aw axios

neat ingot
# civic scroll i fixed it

sorry, i was thinking of the 'createWriteStream' function, which allows you to specifiy if it should overwrite the file, or append, etc

spark flint
#

thats what i do

#

it works similar

inner sapphire
#

ah, cheers bud

#

wait

civic scroll
inner sapphire
#

im dumb

spark flint
#

if (data.match && data.matches[0].trust_rating) >= 0.95) {

#

etc

civic scroll
#

thanks anyway

inner sapphire
#

but im glad my code aint like that

near stratus
spark flint
#

and i believe they check new domains too

#

they won't add every variation of steamcommunity ever

near stratus
spark flint
#

yeah i know

#

but its impossible to flag every version ever

#

thats why they check newly registered domains with certain key words in

#

like @atomic kindles api

quartz kindle
#

most of these databases need people to update them

#

and not only admins, the community needs to help

near stratus
#

Imma stick with Google's safebrowsing

spark flint
#

i report links all the time

quartz kindle
#

databases like these are worthless if people dont keep updating them

spark flint
#

they are good at what they do tbf

quartz kindle
spark flint
#

and another

quartz kindle
#

which is publicly updated by github users

spark flint
#

theyre only 0.5 from there

quartz kindle
#

so add your reported urls there

spark flint
#

if its an actual known scam link the trust rating is 1

inner sapphire
#

uh

#

may i have help again?

#

its now stopped working

spark flint
#

what about it isn't working

#

any errors?

inner sapphire
#

nvm im dumb

#

i kjeep forgetting i enabled the permission checking

#

@spark flint how would i log the json data into an embed?

spark flint
#

literally data

inner sapphire
#

dont work

spark flint
#

as that seems to be returning the json

inner sapphire
#

[ object object ]

#

💀

spark flint
#

JSON.stringify(data)

inner sapphire
#

ah

#

ty

#

ok

#

uh

#

that broke it off

spark flint
#

oh

inner sapphire
#
  matches: [
    {
      followed: false,
      domain: 'dlscord.gg',
      url: 'https://domain.gg/',
      source: 'Phish.Surf',
      type: 'PHISHING',
      trust_rating: 1
    }
  ]
}
#

i want it to look like this

#

it came out nonsense in the embed

spark flint
#

data.matches

inner sapphire
#

rty

atomic kindle
inner sapphire
#

[object Object]

#

yummy

quartz kindle
spark flint
#

do something like .addField("Matches", JSON.stringify(data.matches))

atomic kindle
#

By checking newly registered domains, and a periodic check. 🎉

inner sapphire
#

big broken

quartz kindle
spark flint
#

send in code block

atomic kindle
#

Been pretty accurate up until now.

inner sapphire
spark flint
#

try adding a field for each match

inner sapphire
#

yeah i might

quartz kindle
#

JSON.stringify(data.matches, null, "\t")

inner sapphire
#

thankie tim

near stratus
quartz kindle
#

lmao

spark flint
#

data.matches.forEach(function(match) {
  embed.addField("Match",`Domain: ${match.domain}\nType: ${match.type}\nTrust rating: ${match.trust_rating}`)
})```
#

maybe that

#

or something

quartz kindle
#

so phishing links about it are trying to steal info from people in russia

#

for example:

Fraudsters hacked a woman's LC, issued 939 SIM cards for her and withdrew 1.5 million rubles

neat ingot
#

any update on the node ipc situation? 😄

spark flint
#

nope

quartz kindle
near stratus
neat ingot
#

lmao

#

must be a really good lib to have 0 issues. maybe i should install it 😛

quartz kindle
inner sapphire
#

appreciate the help

spark flint
#

no problemo

inner sapphire
#

looks neato now

#

:D

quartz kindle
#

i wonder if my ipc lib got more downloads because of the node-ipc situation

#

nah not really

neat ingot
#

sadly a lot of people are likely totally unaware of the issues

inner sapphire
#

much more cleaner Pog

spark flint
#

gg!

inner sapphire
#

that's just developer logging 😂

#

i like everything to look nioce mmlol

neat ingot
#

how does your ping command look?

#

i would change the word 'powered' to 'protected' in your embed footer

split hazel
#

long shot but my office installation is stuck at 3% i tried many times to start the installer again but to no avail any ideas?

neat ingot
#

use open office instead? 😛

split hazel
#

nah i prefer ms office

#

maybe a way to install office programs separately

neat ingot
#

cant u use the web app versions?

split hazel
#

just stuck at this 💀

split hazel
quartz kindle
#

did you restart the pc?

split hazel
#

yeah

quartz kindle
#

how long did you wait?

split hazel
#

very long

#

every time i restart the installer its either at 0% or 3%

#

forever

#

no cpu or network usage in task manager either

neat ingot
#

must be hitting inso some issue and failing to report

quartz kindle
#

running installer as admin?

split hazel
#

it asks for admin automatically but i tried explicitly running it as admin too

#

i'll try compatibility

quartz kindle
#

what version is this?

split hazel
#

im on 11 so might be fucked

#

365

quartz kindle
#

is it official or warez?

split hazel
#

official (what is warez)

quartz kindle
#

Warez is a common computing and broader cultural term referring to pirated software (i.e. illegally copied, often after deactivation of anti-piracy measures) that is distributed via the Internet. Warez is used most commonly as a noun, a plural form of ware (short for computer software), and is intended to be pronounced like the word wares /ˈwɛərz/.

split hazel
#

ah

#

when i was 12 yeah

#

but my school offers office for free

neat ingot
#

lmao

#

never heard that term before

#

i've been using 'privateering' lately cause of linus tech tips (utuber) 😄

quartz kindle
#

from ms answers (which rarely ever help):

Are you trying to install Office for Business?

If so, Please make sure that there is no old copy of Office remain in your computer(check in Control Panel), then go to Portal and click install office button.

#

another answer from ms answers:

Go back to the issue, you can try use ODT tool to install Office by following steps.

Download the Office Deployment Tool and install it.
Export a configuration file using Office Customization Tool.
Run Command Prompt as administrator then navigate to the location of the configuration file.
Use download mode and configure mode to finish installation process. You can click HERE for details.

inner sapphire
split hazel
#

can try again

#

oh thats cool with it you can install specific office programs

#

how do you create config file tho

#

ah i see its in the folder

spark flint
#

can't send here or Zerotwo kicks me lol

inner sapphire
#

who did that

spark flint
#

no clue

inner sapphire
#

aweet

quartz kindle
#

maybe someone from here

#

watching the convo in silence

#

lmao

inner sapphire
fleet lion
simple stump
#

If I have an array of objects:

[text, url]

Ex.
["Hello!", "https://hello.com/"]

And I have a select menu:

const selectMenu = new Discord.ActionRowBuilder()
  .addComponents(
    new Discord.SelectMenuBuilder()
      .setCustomId("website")
      .setPlaceholder('Select')
      .addOptions(
        {
          label: 'I want the label to be array[i][0]',
          description: 'A detailed description/',
          value: 'I want the value to be array[i][1]',
        },
      ),
    );

How would I loop through an array and set the label/value of the select menu be in that loop?

I've amounted to this much:

let options = [];
for (let i = 0; i < res.length; i++) {
  options.push({ label: res[i].text, value: res[i].url });
}
const selectMenu = new Discord.ActionRowBuilder()
  .addComponents(
    new Discord.SelectMenuBuilder()
      .setCustomId("manga-" + interaction.member.id)
      .setPlaceholder('Select')
      .addOptions(options),
);

But I get the error "Invalid form of body." I assume that the options variable can't be passed as an array, rather JSON, but I'm not sure how to approach this.

wicked pivot
#

Could someone help me with puppeteer?, someone experienced enough

solemn latch
#

I have never used it but its pretty straight forward isnt it?

proven lantern
simple stump
# wicked pivot use for of ```js let options = [} for (const {text, url} of res){ options.pu...

Thank you! I tried that, but unfortunately that doesn't seem to work. I logged the array and it returns the correct value I expected:

[
  {
    label: "Hello!",
    value: "https://hello.com/"
  },
  ...
  {
    label: "Another website!",
    value: "https://asdf.com/"
  }
]

I get the same error.

let options = [];
for (const {text, url} of res){
  options.push({label: text, value: url})
}

console.log(options);
simple stump
wicked pivot
proven lantern
#

none of the values can be undefined or empty string

#

discord will 400 that

simple stump
wicked pivot
simple stump
simple stump
proven lantern
#

do you have more than 25 options?